/* Advanced recipe filter. Uses the same card, spacing and archive components as the rest of the site. */
.filter-page{
  padding:1rem 0 3rem;
}

.filter-page-head{
  max-width:900px;
  margin:0 0 1.4rem;
}

.filter-page-head .eyebrow{
  margin:0 0 .3rem;
  color:var(--muted);
  font-size:.9rem;
  font-weight:700;
}

.filter-page-head h1{
  margin:0;
  color:var(--text);
  font-size:2rem;
  line-height:1.15;
}

.filter-page-head>p:last-child{
  max-width:850px;
  margin:.5rem 0 0;
  color:var(--muted);
  font-size:1rem;
  line-height:1.5;
}

.advanced-filter.card{
  padding:1.35rem;
  overflow:visible;
}

.filter-section{
  padding:0 0 1.35rem;
  margin:0 0 1.35rem;
  border-bottom:1px solid var(--border);
}

.filter-section-heading{
  margin:0 0 .85rem;
}

.filter-section-heading h2{
  margin:0;
  color:var(--text);
  font-size:1.2rem;
  line-height:1.3;
}

.filter-section-heading p{
  margin:.35rem 0 0;
  color:var(--muted);
  font-size:.94rem;
  line-height:1.5;
}

.filter-section-heading-inline{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:1rem;
}

.filter-mode-guide{
  max-width:950px;
}

.ingredient-combobox{
  position:relative;
}

.ingredient-chips{
  display:flex;
  min-height:52px;
  flex-wrap:wrap;
  align-items:center;
  gap:.45rem;
  padding:.4rem .55rem;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  transition:border-color .15s ease,box-shadow .15s ease;
}

.ingredient-chips:focus-within{
  border-color:var(--accent);
  box-shadow:0 0 0 4px var(--accent-3);
}

.ingredient-chips>input{
  min-width:240px;
  height:38px;
  flex:1;
  padding:0 .3rem;
  border:0;
  outline:0;
  box-shadow:none;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-size:1rem;
  line-height:1.2;
}

.ingredient-chips>input::placeholder{
  color:#8a8f99;
}

.ingredient-chip{
  display:inline-flex;
  height:36px;
  align-items:center;
  gap:.4rem;
  padding:0 .7rem;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--pill-bg);
  color:var(--text);
  font-size:.9rem;
  font-weight:600;
}

.ingredient-chip button{
  padding:0;
  border:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font:inherit;
  line-height:1;
}

.ingredient-suggestions{
  position:absolute;
  z-index:30;
  top:calc(100% + 6px);
  right:0;
  left:0;
  display:grid;
  max-height:280px;
  overflow:auto;
  padding:.4rem;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  box-shadow:0 18px 45px rgba(0,0,0,.10);
}

.ingredient-suggestions[hidden]{
  display:none!important;
}

.ingredient-suggestions button{
  min-height:42px;
  padding:.6rem .75rem;
  border:0;
  border-radius:8px;
  background:#fff;
  color:var(--text);
  font-size:.95rem;
  text-align:left;
  cursor:pointer;
}

.ingredient-suggestions button:hover{
  background:var(--accent-2);
}

.staple-options{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
}

.check-pill{
  position:relative;
  cursor:pointer;
}

.check-pill input{
  position:absolute;
  opacity:0;
}

.check-pill span{
  display:flex;
  height:40px;
  align-items:center;
  padding:0 .8rem;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  color:var(--text);
  font-size:.92rem;
  font-weight:600;
}

.check-pill input:checked+span{
  border-color:var(--accent);
  background:var(--accent-2);
  color:var(--secondary);
}

.check-pill input:focus-visible+span{
  box-shadow:0 0 0 4px var(--accent-3);
}

.filter-section-options{
  padding-bottom:1.35rem;
}

.filter-fields{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1rem;
  align-items:end;
}

.filter-fields label{
  display:grid;
  min-width:0;
  grid-template-rows:minmax(2.5rem,auto) 48px;
  gap:.45rem;
  color:var(--text);
  font-size:.9rem;
  font-weight:700;
}

.filter-fields label>span{
  display:flex;
  align-items:flex-end;
  line-height:1.3;
}

.filter-fields select,
.filter-fields input{
  display:block;
  width:100%;
  height:48px;
  min-height:48px;
  margin:0;
  padding:0 .85rem;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-size:1rem;
  line-height:1.2;
}

.filter-actions{
  display:flex;
  justify-content:flex-end;
  gap:.7rem;
}

.primary-button,
.secondary-button{
  display:inline-flex;
  height:48px;
  min-height:48px;
  align-items:center;
  justify-content:center;
  padding:0 1.15rem;
  border:1px solid var(--accent);
  border-radius:10px;
  font-size:.96rem;
  font-weight:800;
  line-height:1;
  cursor:pointer;
  text-decoration:none;
}

.primary-button{
  background:var(--accent);
  color:#fff;
}

.secondary-button{
  background:#fff;
  color:var(--accent-strong);
}

.primary-button:hover{
  background:var(--accent-strong);
  border-color:var(--accent-strong);
  color:#fff;
  text-decoration:none;
}

.secondary-button:hover{
  background:var(--accent-2);
  color:var(--accent-strong);
  text-decoration:none;
}

.primary-button:focus-visible,
.secondary-button:focus-visible{
  outline:0;
  box-shadow:0 0 0 4px var(--accent-3);
}

.filter-results{
  margin-top:2rem;
}

.filter-results .section-heading h2{
  margin:0 0 1rem;
  font-size:1.3rem;
}

/* Result cards reuse archive-grid, archive-item, cardlink, thumb, title and muted. */
.filter-result-body{
  padding-bottom:.2rem;
}

.filter-result-body .title{
  padding-bottom:.35rem;
}

.recipe-match{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:.35rem .6rem;
  padding:0 20px;
  color:var(--muted);
  font-size:.82rem;
}

.recipe-match strong{
  color:var(--accent-strong);
}

.filter-result-description{
  display:-webkit-box!important;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
}

.filter-error,
.empty-state{
  padding:1rem 1.1rem;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}

@media(max-width:900px){
  .filter-fields{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:600px){
  .filter-page-head h1{
    font-size:1.65rem;
  }

  .advanced-filter.card{
    padding:1rem;
  }

  .filter-section-heading-inline{
    align-items:flex-start;
    flex-direction:column;
    gap:.2rem;
  }

  .filter-fields{
    grid-template-columns:1fr;
  }

  .filter-fields label{
    grid-template-rows:auto 48px;
  }

  .ingredient-chips>input{
    min-width:180px;
    font-size:1rem;
  }

  .filter-actions{
    align-items:stretch;
    flex-direction:column;
  }

  .primary-button,
  .secondary-button{
    width:100%;
  }
}
