/* ============================================================
   Ingredients library — front surface
   Uses the journal (blog-v1) tokens: earthen surfaces, serif
   display, calm borders. No new colour language introduced.
   ============================================================ */

.ing-hero { padding: 56px 40px 34px; max-width: 1360px; margin: 0 auto; }
.ing-hero .eyebrow { display:inline-block; margin-bottom:14px; }
.ing-hero h1 { font-family: var(--font-serif); font-size: clamp(2.1rem, 4.4vw, 3.3rem); line-height:1.08; letter-spacing:-0.02em; margin:0 0 14px; max-width: 20ch; }
.ing-hero h1 em { font-style: italic; color: hsl(var(--accent)); }
.ing-hero-lead { max-width: 62ch; color: hsl(var(--foreground) / 0.66); font-size: 1rem; line-height:1.7; margin:0 0 26px; }

.ing-searchbar { display:flex; align-items:center; gap:10px; border:1px solid hsl(var(--border)); background:hsl(var(--background)); border-radius:999px; padding:8px 8px 8px 18px; max-width:720px; }
.ing-searchbar svg { width:18px; height:18px; opacity:.5; flex:none; }
.ing-searchbar input { flex:1; border:0; background:transparent; font:inherit; font-size:.95rem; padding:8px 0; outline:none; color:inherit; }
.ing-searchbar button { border:0; border-radius:999px; padding:10px 20px; font:inherit; font-size:.85rem; font-weight:600; cursor:pointer; background:linear-gradient(180deg,#3a7a5c 0%,#2f6249 100%); color:#fff; }

.ing-suggest { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:14px; font-size:.8rem; color:hsl(var(--foreground) / 0.5); }
.ing-suggest button { border:1px solid hsl(var(--border-soft)); background:transparent; border-radius:999px; padding:5px 12px; font:inherit; font-size:.78rem; cursor:pointer; color:hsl(var(--foreground) / 0.7); transition:all .18s ease; }
.ing-suggest button:hover { border-color:hsl(var(--accent) / .5); color:hsl(var(--accent)); }

/* Tier strip */
.ing-tierbar { border-top:1px solid hsl(var(--border-soft)); border-bottom:1px solid hsl(var(--border-soft)); background:hsl(var(--surface-soft) / 0.55); }
.ing-tierbar-inner { max-width:1360px; margin:0 auto; padding:14px 40px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.ing-tierbar .tier-label { font-size:.76rem; text-transform:uppercase; letter-spacing:.09em; color:hsl(var(--foreground) / .5); font-weight:600; }
.tier-switch { display:inline-flex; border:1px solid hsl(var(--border)); border-radius:999px; padding:3px; background:hsl(var(--background)); }
.tier-switch button { border:0; background:transparent; border-radius:999px; padding:7px 15px; font:inherit; font-size:.8rem; font-weight:600; cursor:pointer; color:hsl(var(--foreground) / .55); transition:all .18s ease; }
.tier-switch button.is-active { background:hsl(153 22% 28%); color:hsl(var(--background)); }
.ing-tierbar .tier-note { font-size:.8rem; color:hsl(var(--foreground) / .55); margin-left:auto; }
.ing-tierbar .tier-note a { color:hsl(var(--accent)); text-decoration:none; font-weight:600; }

/* Layout: rail + results */
.ing-wrap { max-width:1360px; margin:0 auto; padding:30px 40px 70px; display:grid; grid-template-columns:262px 1fr; gap:34px; align-items:start; }
.ing-rail { position:sticky; top:88px; border:1px solid hsl(var(--border-soft)); border-radius:14px; background:hsl(var(--background)); padding:6px 0; }
.ing-facet { border-bottom:1px solid hsl(var(--border-soft)); }
.ing-facet:last-child { border-bottom:0; }
.ing-facet > summary { list-style:none; cursor:pointer; padding:13px 18px; font-size:.83rem; font-weight:600; display:flex; align-items:center; justify-content:space-between; }
.ing-facet > summary::-webkit-details-marker { display:none; }
.ing-facet > summary::after { content:""; width:7px; height:7px; border-right:1.6px solid currentColor; border-bottom:1.6px solid currentColor; transform:rotate(45deg); opacity:.45; transition:transform .2s ease; }
.ing-facet[open] > summary::after { transform:rotate(-135deg); }
.ing-facet-body { padding:2px 18px 16px; display:flex; flex-wrap:wrap; gap:7px; }
.ing-facet-body label { display:inline-flex; align-items:center; gap:6px; font-size:.78rem; border:1px solid hsl(var(--border-soft)); border-radius:999px; padding:5px 11px; cursor:pointer; color:hsl(var(--foreground) / .72); transition:all .16s ease; }
.ing-facet-body label:hover { border-color:hsl(var(--accent) / .45); }
.ing-facet-body input { accent-color:hsl(153 22% 28%); width:13px; height:13px; }
.ing-facet-body label.is-on { background:hsl(153 22% 28% / .1); border-color:hsl(153 22% 28% / .45); color:hsl(var(--foreground)); }
.ing-rail-foot { padding:12px 18px 16px; }
.ing-rail-foot button { width:100%; border:1px solid hsl(var(--border)); background:transparent; border-radius:8px; padding:9px; font:inherit; font-size:.8rem; cursor:pointer; color:hsl(var(--foreground) / .7); }
.ing-facet-body--soon { display:block; }
.ing-facet-soon { font-size:.75rem; color:hsl(var(--foreground) / .45); }

/* Toolbar */
.ing-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:18px; }
.ing-toolbar .results-count { font-size:.82rem; color:hsl(var(--foreground) / .55); }
.ing-toolbar .spacer { margin-left:auto; }
.ing-sort { border:1px solid hsl(var(--border)); border-radius:999px; padding:8px 14px; font:inherit; font-size:.8rem; background:hsl(var(--background)); color:inherit; }
.ing-chipsrow { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.ing-activechip { display:inline-flex; align-items:center; gap:7px; font-size:.76rem; border:1px solid hsl(var(--accent) / .4); background:hsl(var(--accent) / .08); color:hsl(var(--foreground)); border-radius:999px; padding:5px 8px 5px 12px; }
.ing-activechip button { border:0; background:transparent; cursor:pointer; font:inherit; line-height:1; opacity:.6; }

/* Cards — grid */
.ing-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:1.5rem; }
.ing-grid.is-list { grid-template-columns:1fr; gap:1rem; }
.ing-card { display:flex; flex-direction:column; border:1px solid hsl(var(--border-soft)); border-radius:14px; overflow:hidden; background:hsl(var(--background)); cursor:pointer; transition:transform .22s var(--ease-organic), box-shadow .22s ease, border-color .22s ease; text-align:left; padding:0; font:inherit; color:inherit; width:100%; }
.ing-card:hover { transform:translateY(-2px); border-color:hsl(var(--accent) / .35); box-shadow:0 14px 34px hsl(153 30% 20% / .10); }
.ing-media { position:relative; aspect-ratio:16/10; background:hsl(var(--surface-soft)); overflow:hidden; }
.ing-media img { width:100%; height:100%; object-fit:cover; display:block; }
.ing-src { position:absolute; top:10px; left:10px; font-size:.66rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:4px 9px; border-radius:999px; background:hsl(var(--background) / .92); border:1px solid hsl(var(--border-soft)); backdrop-filter:blur(6px); }
.ing-veg { position:absolute; top:10px; right:10px; width:18px; height:18px; border-radius:3px; background:hsl(var(--background) / .95); border:1.5px solid #2f7a3f; display:grid; place-items:center; }
.ing-veg i { width:8px; height:8px; border-radius:999px; background:#2f7a3f; display:block; }
.ing-veg.is-nonveg { border-color:#9b3324; }
.ing-veg.is-nonveg i { background:#9b3324; }
.ing-body { padding:1.05rem 1.15rem 1.2rem; display:flex; flex-direction:column; gap:.55rem; flex:1; }
.ing-cat { font-size:.68rem; text-transform:uppercase; letter-spacing:.1em; font-weight:700; color:hsl(var(--accent)); }
.ing-name { font-family:var(--font-serif); font-size:1.22rem; line-height:1.2; margin:0; }
.ing-name span { font-family:var(--font-sans); font-size:.78rem; color:hsl(var(--foreground) / .45); margin-left:7px; }
.ing-blurb { font-size:.84rem; line-height:1.6; color:hsl(var(--foreground) / .62); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin:0; }
.ing-stats { display:flex; gap:14px; flex-wrap:wrap; margin-top:auto; padding-top:.6rem; border-top:1px dashed hsl(var(--border-soft)); }
.ing-stat { display:flex; flex-direction:column; }
.ing-stat b { font-size:.95rem; font-variant-numeric:tabular-nums; font-weight:600; }
.ing-stat small { font-size:.66rem; text-transform:uppercase; letter-spacing:.07em; color:hsl(var(--foreground) / .45); }
.ing-stat.is-locked b { filter:blur(4px); user-select:none; opacity:.7; }
.ing-tags { display:flex; flex-wrap:wrap; gap:6px; }
.ing-tag { font-size:.7rem; border:1px solid hsl(var(--border-soft)); border-radius:999px; padding:3px 9px; color:hsl(var(--foreground) / .62); }
.ing-tag.is-warn { border-color:hsl(28 60% 45% / .45); color:hsl(28 60% 34%); background:hsl(28 60% 45% / .08); }
.ing-lock { display:inline-flex; align-items:center; gap:5px; font-size:.68rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:hsl(28 55% 38%); }
.ing-lock svg { width:11px; height:11px; }

/* List view */
.ing-grid.is-list .ing-card { flex-direction:row; }
.ing-grid.is-list .ing-media { flex:0 0 210px; aspect-ratio:auto; min-height:150px; }
.ing-grid.is-list .ing-body { padding:1.1rem 1.4rem; }
.ing-grid.is-list .ing-blurb { -webkit-line-clamp:2; }
.ing-grid.is-list .ing-stats { border-top:0; padding-top:0; gap:22px; }

@media (max-width:1080px){ .ing-wrap{grid-template-columns:1fr;} .ing-rail{position:static;} .ing-grid{grid-template-columns:repeat(2,1fr);} }
@media (max-width:680px){
  .ing-hero{padding:38px 20px 26px;} .ing-wrap{padding:22px 20px 56px;} .ing-tierbar-inner{padding:12px 20px;}
  .ing-grid{grid-template-columns:1fr;}
  .ing-grid.is-list .ing-card{flex-direction:column;} .ing-grid.is-list .ing-media{flex:none; aspect-ratio:16/10; min-height:0;}
  .ing-tierbar .tier-note{margin-left:0;}
}

/* Detail drawer */
.ing-drawer-scrim { position:fixed; inset:0; background:hsl(30 12% 12% / .45); backdrop-filter:blur(2px); z-index:80; opacity:0; pointer-events:none; transition:opacity .22s ease; }
.ing-drawer-scrim.is-open { opacity:1; pointer-events:auto; }
.ing-drawer { position:fixed; top:0; right:0; height:100%; width:min(560px,100%); background:hsl(var(--background)); border-left:1px solid hsl(var(--border)); z-index:81; transform:translateX(100%); transition:transform .28s var(--ease-organic); display:flex; flex-direction:column; }
.ing-drawer.is-open { transform:none; }
.ing-drawer-head { display:flex; align-items:flex-start; gap:12px; padding:20px 22px 14px; border-bottom:1px solid hsl(var(--border-soft)); }
.ing-drawer-head h2 { font-family:var(--font-serif); font-size:1.6rem; margin:0 0 4px; line-height:1.15; }
.ing-drawer-head p { margin:0; font-size:.8rem; color:hsl(var(--foreground) / .55); }
.ing-drawer-close { margin-left:auto; border:1px solid hsl(var(--border)); background:transparent; border-radius:999px; width:34px; height:34px; display:grid; place-items:center; cursor:pointer; color:inherit; flex:none; }
.ing-drawer-tabs { display:flex; gap:4px; padding:10px 22px 0; border-bottom:1px solid hsl(var(--border-soft)); overflow-x:auto; }
.ing-drawer-tabs button { border:0; background:transparent; font:inherit; font-size:.8rem; font-weight:600; padding:9px 12px; cursor:pointer; color:hsl(var(--foreground) / .55); border-bottom:2px solid transparent; white-space:nowrap; }
.ing-drawer-tabs button.is-active { color:hsl(var(--foreground)); border-bottom-color:hsl(153 22% 28%); }
.ing-drawer-body { padding:20px 22px 44px; overflow-y:auto; flex:1; }
.ing-kv { display:grid; grid-template-columns:1fr auto; gap:9px 14px; font-size:.85rem; }
.ing-kv dt { color:hsl(var(--foreground) / .58); }
.ing-kv dd { margin:0; font-variant-numeric:tabular-nums; font-weight:600; text-align:right; }
.ing-sub { font-size:.7rem; text-transform:uppercase; letter-spacing:.1em; font-weight:700; color:hsl(var(--foreground) / .45); margin:22px 0 10px; }
.ing-sub:first-child { margin-top:0; }
.ing-gate { border:1px dashed hsl(28 55% 45% / .5); background:hsl(28 55% 45% / .07); border-radius:12px; padding:16px 18px; font-size:.85rem; line-height:1.6; color:hsl(var(--foreground) / .75); }
.ing-gate strong { display:block; margin-bottom:5px; font-size:.9rem; color:hsl(var(--foreground)); }
.ing-gate a { display:inline-block; margin-top:10px; font-weight:700; font-size:.8rem; color:hsl(var(--accent)); text-decoration:none; }
.ing-cond { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px dashed hsl(var(--border-soft)); font-size:.85rem; }
.ing-cond span.pill { font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; padding:3px 9px; border-radius:999px; }
.pill-good { background:hsl(153 35% 30% / .12); color:hsl(153 35% 26%); }
.pill-caution { background:hsl(35 70% 45% / .14); color:hsl(30 60% 34%); }
.pill-avoid { background:hsl(8 60% 45% / .12); color:hsl(8 55% 38%); }

.ing-empty { text-align:center; padding:60px 20px; color:hsl(var(--foreground) / .55); }
.ing-empty h3 { font-family:var(--font-serif); font-size:1.4rem; margin:0 0 8px; color:hsl(var(--foreground)); }

/* Public hub extras (infinite scroll + sticky under site header) */
.page-ingredients .ing-rail { top: 96px; }
.ing-sentinel { height: 1px; width: 100%; }
.ing-loading, .ing-end {
  text-align: center;
  padding: 22px 12px 8px;
  font-size: .82rem;
  color: hsl(var(--foreground) / .5);
}
.ing-card { text-decoration: none; color: inherit; }
.ing-media--empty {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, hsl(var(--surface-soft)), hsl(var(--background)));
  color: hsl(var(--foreground) / .35);
  font-family: var(--font-serif);
  font-size: 1.6rem;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.layout-toggle { display:inline-flex; gap:4px; border:1px solid hsl(var(--border)); border-radius:999px; padding:3px; background:hsl(var(--background)); }
.layout-toggle button { border:0; background:transparent; border-radius:999px; width:34px; height:34px; display:grid; place-items:center; cursor:pointer; color:hsl(var(--foreground) / .5); }
.layout-toggle button svg { width:16px; height:16px; }
.layout-toggle button.is-active { background:hsl(153 22% 28%); color:hsl(var(--background)); }
