/* ══════════════════════════════════════════
   RESET + VARIABLES
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:      #FAF6EF;
  --warm-white: #FDF9F4;
  --ink:        #1A1410;
  --brown:      #6B4C35;
  --rust:       #C05A2C;
  --gold:       #D4A847;
  --sage:       #7A8C6E;
  --muted:      #9C8B7A;
  --border:     #E8DDD0;
  --card:       #FFFFFF;
  --nav-h:      56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ══════════════════════════════════════════
   NAV
══════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 300;
  height: var(--nav-h);
  background: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid rgba(212,168,71,0.2);
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 400;
  color: var(--warm-white);
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.nav-brand em { font-style: italic; color: var(--gold); }

.nav-links {
  display: flex; gap: 0; list-style: none; margin-left: auto;
}

.nav-link {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(250,246,239,0.5);
  text-decoration: none;
  padding: 8px 15px;
  position: relative; transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute; bottom: -1px; left: 15px; right: 15px;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transition: transform 0.2s;
}
.nav-link:hover { color: var(--warm-white); }
.nav-link.is-active { color: var(--gold); }
.nav-link.is-active::after { transform: scaleX(1); }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--warm-white); font-size: 20px; padding: 4px 8px;
}

/* ══════════════════════════════════════════
   PAGE HEROES
══════════════════════════════════════════ */
.site-hero {
  background: var(--ink);
  padding: 64px 40px 56px;
  position: relative; overflow: hidden;
}
.site-hero::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,71,0.12) 0%, transparent 70%);
}
.site-hero::after {
  content: '';
  position: absolute; bottom: -60px; left: 20%;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(192,90,44,0.08) 0%, transparent 70%);
}
.hero-rule {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--rust), var(--gold), var(--sage));
}
.hero-eyebrow {
  font-size: 10px; font-weight: 500; letter-spacing: 4px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 16px; position: relative; z-index: 1;
}
.site-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 6vw, 72px); font-weight: 400;
  color: var(--warm-white); line-height: 1.05;
  position: relative; z-index: 1; max-width: 700px;
}
.site-hero h1 em { font-style: italic; color: var(--gold); }
.hero-sub {
  margin-top: 16px; font-size: 14px; font-weight: 300;
  color: rgba(250,246,239,0.5);
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.hero-sub strong { color: var(--cream); font-weight: 400; }
.hero-divider { width: 1px; height: 14px; background: rgba(255,255,255,0.15); }

.subpage-hero {
  background: var(--ink);
  padding: 40px 40px 36px;
  position: relative; overflow: hidden;
}
.subpage-hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--rust), var(--gold), var(--sage));
}
.subpage-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4vw, 48px); font-weight: 400;
  color: var(--warm-white); line-height: 1.1;
}
.subpage-hero h1 em { font-style: italic; color: var(--gold); }
.subpage-meta {
  margin-top: 12px; display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.subpage-meta span { font-size: 13px; color: rgba(250,246,239,0.5); }
.subpage-meta .chip {
  background: rgba(255,255,255,0.08);
  color: rgba(250,246,239,0.7);
  border-radius: 20px; padding: 3px 10px; font-size: 11px;
}

/* ══════════════════════════════════════════
   BACK BUTTON
══════════════════════════════════════════ */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(250,246,239,0.45);
  text-decoration: none; background: none; border: none;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 18px; display: block; transition: color 0.15s; cursor: pointer;
}
.back-btn:hover { color: var(--gold); }

/* ══════════════════════════════════════════
   RECIPE CARDS  (used on all listing pages)
══════════════════════════════════════════ */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 18px;
}

.r-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 22px 22px;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.r-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--rust), var(--gold));
  opacity: 0; transition: opacity 0.2s;
}
.r-card:hover { border-color: var(--rust); box-shadow: 0 4px 22px rgba(192,90,44,0.1); transform: translateY(-2px); }
.r-card:hover::before { opacity: 1; }

.r-fav-btn {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  padding: 3px 5px; border: 0; background: transparent;
  cursor: pointer; font-size: 17px; line-height: 1;
  color: #bbb; transition: all 0.2s;
}
.r-fav-btn:hover { transform: scale(1.1); }
.r-fav-btn.is-on { color: #c43b2f; }

.r-cat {
  font-size: 9px; font-weight: 500; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--sage); margin-bottom: 6px;
}
.r-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700;
  line-height: 1.2; margin-bottom: 8px; color: var(--ink);
}
.r-meta {
  display: flex; gap: 10px; font-size: 11px;
  color: var(--muted); margin-bottom: 10px; flex-wrap: wrap;
}
.r-summary { font-size: 13px; line-height: 1.6; color: #5d554d; }

/* ══════════════════════════════════════════
   SECTION HEADERS
══════════════════════════════════════════ */
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px; font-weight: 400; color: var(--ink);
}
.section-title em { font-style: italic; color: var(--rust); }
.section-link {
  font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color 0.15s;
}
.section-link:hover { color: var(--rust); }

/* Recipe section groups (on author/category detail pages) */
.recipe-sec { margin-bottom: 36px; }
.recipe-sec-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.recipe-sec-title {
  font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 400;
}
.recipe-sec-count { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════════
   CAROUSELS
══════════════════════════════════════════ */
.carousel-wrap { position: relative; }
.carousel-outer { overflow: hidden; margin: 0 -6px; padding: 0 6px; }
.carousel-track {
  display: flex; gap: 16px;
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
  box-shadow: 0 2px 10px rgba(26,20,16,0.1);
  transition: all 0.2s; color: var(--brown); font-size: 16px;
}
.carousel-arrow:hover { background: var(--ink); color: var(--warm-white); border-color: var(--ink); }
.carousel-arrow.prev { left: -19px; }
.carousel-arrow.next { right: -19px; }
.carousel-arrow:disabled { opacity: 0.25; pointer-events: none; }

/* Author tiles */
.author-tile {
  flex: 0 0 210px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit;
  display: block; transition: all 0.22s;
}
.author-tile:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(26,20,16,0.1); border-color: transparent; }
.author-tile-img {
  height: 130px; display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 400;
  position: relative; overflow: hidden;
}
.author-tile-img::before {
  content: ''; position: absolute; inset: 0; opacity: 0.07;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 11px);
}
.author-tile-img span { position: relative; z-index: 1; }
.author-tile-body { padding: 14px 16px 16px; }
.author-tile-name {
  font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700;
  color: var(--ink); margin-bottom: 2px; line-height: 1.2;
}
.author-tile-book { font-size: 11px; font-style: italic; color: var(--muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.author-tile-count { font-size: 11px; color: var(--rust); font-weight: 500; }

/* Category tiles */
.cat-tile {
  flex: 0 0 170px; border-radius: 14px; overflow: hidden;
  text-decoration: none; display: block;
  height: 190px; position: relative; transition: all 0.22s;
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(26,20,16,0.15); }
.cat-tile-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: 48px;
  background-size: cover; background-position: center;
}
.cat-tile-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(26,20,16,0.72) 100%);
}
/* Hide emoji when a real image is loaded */
.cat-tile-bg.has-img { font-size: 0; }
.cat-tile-content { position: absolute; bottom: 0; left: 0; right: 0; z-index: 1; padding: 14px; }
.cat-tile-name { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 400; color: white; line-height: 1.2; margin-bottom: 2px; }
.cat-tile-count { font-size: 11px; color: rgba(255,255,255,0.65); }

/* ══════════════════════════════════════════
   FEATURED RECIPE CARDS (home page picks)
══════════════════════════════════════════ */
.featured-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.featured-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  text-decoration: none; color: inherit; display: block;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.featured-card-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 14px 14px 0 0; opacity: 0.5; transition: opacity 0.2s;
}
.featured-card:hover { border-color: var(--rust); box-shadow: 0 4px 22px rgba(192,90,44,0.1); transform: translateY(-2px); }
.featured-card:hover .featured-card-bar { opacity: 1; }
.featured-cat { font-size: 9px; font-weight: 500; letter-spacing: 2.5px; text-transform: uppercase; color: var(--sage); margin-bottom: 6px; }
.featured-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.25; margin-bottom: 6px; }
.featured-author { font-size: 11px; color: var(--muted); font-style: italic; }
.featured-time { margin-top: 12px; font-size: 11px; color: var(--rust); }

/* ══════════════════════════════════════════
   DIRECTORY GRIDS
══════════════════════════════════════════ */
.authors-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px;
}
.author-dir-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: all 0.22s;
}
.author-dir-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(26,20,16,0.1); border-color: transparent; }
.author-dir-img {
  height: 100px; display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 30px; position: relative; overflow: hidden;
}
.author-dir-img::before {
  content: ''; position: absolute; inset: 0; opacity: 0.07;
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 10px);
}
.author-dir-img span { position: relative; z-index: 1; }
.author-dir-body { padding: 18px 20px 20px; flex: 1; }
.author-dir-name { font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.author-dir-book { font-size: 12px; font-style: italic; color: var(--muted); margin-bottom: 14px; }
.author-dir-stats { display: flex; gap: 18px; }
.stat strong { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; color: var(--rust); display: block; line-height: 1.1; }
.stat { font-size: 11px; color: var(--brown); }
.author-dir-footer {
  padding: 10px 20px 14px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 5px;
}
.cat-chip {
  font-size: 10px; padding: 2px 8px;
  background: var(--cream); border: 1px solid var(--border);
  border-radius: 10px; color: var(--brown);
}

.cats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px;
}
.cat-dir-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: all 0.22s;
}
.cat-dir-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(26,20,16,0.1); border-color: transparent; }
.cat-dir-img {
  height: 120px; display: flex; align-items: center; justify-content: center; font-size: 38px;
  position: relative; overflow: hidden; background-size: cover; background-position: center;
}
.cat-dir-img::before {
  content: ''; position: absolute; inset: 0; opacity: 0.07;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 10px);
}
/* Shown only when no image */
.cat-dir-img.has-img { font-size: 0; }
.cat-dir-img.has-img::before { display: none; }
/* Subtle darkening gradient over photo for readability */
.cat-dir-img.has-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,20,16,0.08) 0%, rgba(26,20,16,0.22) 100%);
}
.cat-dir-icon { position: relative; z-index: 1; }
.cat-dir-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.cat-dir-name { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 400; color: var(--ink); line-height: 1.2; margin-bottom: auto; }
.cat-dir-count { font-size: 11px; color: var(--rust); font-weight: 500; margin-top: 10px; }

/* ══════════════════════════════════════════
   JUMP NAV (filter chips on detail pages)
══════════════════════════════════════════ */
.jump-nav {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 20px 40px 0;
}
.jump-label {
  font-size: 10px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-right: 4px;
}
.jump-chip {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px; font-size: 12px; color: var(--brown);
  text-decoration: none; font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: all 0.15s; display: inline-block;
}
.jump-chip:hover { border-color: var(--rust); color: var(--rust); }
.jump-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--warm-white); }
button.jump-chip { font-family: 'DM Sans', sans-serif; }

/* ══════════════════════════════════════════
   PROFILE BAR
══════════════════════════════════════════ */
.profile-bar {
  background: var(--warm-white); border-bottom: 1px solid var(--border);
  padding: 24px 40px; display: flex; gap: 18px; align-items: flex-start;
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 20px;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.profile-avatar::before {
  content: ''; position: absolute; inset: 0; opacity: 0.1;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 8px);
}
.profile-avatar span { position: relative; z-index: 1; }
.profile-name { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.profile-book { font-size: 12px; font-style: italic; color: var(--muted); }
.profile-desc { font-size: 13px; color: var(--muted); line-height: 1.65; margin-top: 7px; max-width: 560px; }

/* ══════════════════════════════════════════
   SIDEBAR LAYOUT  (browse, author, category)
══════════════════════════════════════════ */
.browse-layout { display: grid; grid-template-columns: 265px 1fr; min-height: 600px; align-items: start; }
.sidebar {
  background: var(--warm-white); border-right: 1px solid var(--border); padding: 24px 18px;
  /* Sticky + independent scroll so ingredient list is always reachable */
  position: sticky;
  top: var(--nav-h);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Favourites toggle tile ──────────────── */
.fav-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.fav-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 12px;
  background: var(--cream); border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px;
  font-weight: 500; color: var(--brown); transition: all 0.18s; text-align: left;
}
.fav-toggle:hover { border-color: #c43b2f; color: #c43b2f; background: rgba(196,59,47,0.04); }
.fav-toggle.is-active { background: rgba(196,59,47,0.07); border-color: #c43b2f; color: #c43b2f; }
.fav-toggle.is-active .fav-count { background: rgba(196,59,47,0.15); color: #c43b2f; }
.fav-toggle-left { display: flex; align-items: center; gap: 8px; }
.fav-count {
  font-size: 10px; background: var(--border); color: var(--muted);
  border-radius: 10px; padding: 2px 7px; font-weight: 500;
}

/* ── Ingredient search box ───────────────── */
.ing-search-wrap { position: relative; margin-bottom: 10px; }
.ing-search-wrap input {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--cream); font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--ink); outline: none; transition: border-color 0.2s;
}
.ing-search-wrap input:focus { border-color: var(--rust); }
.ing-search-wrap svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  opacity: 0.35; pointer-events: none;
}

/* ── Active filter pills (shown in main toolbar) ── */
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--ink); color: var(--warm-white);
  border-radius: 20px; padding: 3px 10px 3px 12px; font-size: 11px;
}
.pill-remove {
  background: none; border: none; color: rgba(250,246,239,0.5);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
  font-family: 'DM Sans', sans-serif; transition: color 0.15s;
}
.pill-remove:hover { color: var(--gold); }
.sidebar-title {
  font-size: 10px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.author-filter {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 7px 10px; background: transparent; border: 1px solid var(--border);
  border-radius: 7px; text-align: left; cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--brown); margin-bottom: 5px; transition: all 0.15s;
}
.author-filter:last-child { margin-bottom: 0; }
.author-filter:hover { border-color: var(--sage); color: var(--ink); background: var(--cream); }
.author-filter.is-active { background: var(--ink); color: var(--warm-white); border-color: var(--ink); }
.author-filter.is-active .badge { background: rgba(255,255,255,0.15); color: var(--gold); }
.author-filter-name { font-weight: 500; }
.author-filter-book { font-size: 10px; opacity: 0.65; display: block; margin-top: 1px; font-style: italic; }
.badge {
  font-size: 10px; background: var(--border); color: var(--muted);
  border-radius: 10px; padding: 2px 7px; font-weight: 500;
}
.search-box { position: relative; margin-bottom: 14px; }
.search-box input {
  width: 100%; padding: 9px 12px 9px 33px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--cream); font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--ink); outline: none; transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--rust); }
.search-box svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); opacity: 0.4; }
.ing-group { margin-bottom: 5px; }
.ing-letter { font-size: 10px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); padding: 5px 8px 3px; }
.ing-btn {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 5px 9px; background: transparent; border: none; border-radius: 5px;
  text-align: left; cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--brown); transition: all 0.15s;
}
.ing-btn:hover { background: var(--cream); color: var(--rust); }
.ing-btn.is-active { background: var(--rust); color: white; }
.ing-btn.is-active .badge { background: rgba(255,255,255,0.25); color: white; }

.browser-main { padding: 28px 36px; }
.browser-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.browser-heading { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 400; flex: 1; }
.browser-heading em { font-style: italic; color: var(--rust); }
.browser-count { font-size: 12px; color: var(--muted); }

.fav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--brown); font-family: 'DM Sans', sans-serif;
  font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.fav-btn:hover { border-color: var(--rust); color: var(--rust); }
.fav-btn.is-active { background: rgba(192,90,44,0.08); border-color: var(--rust); color: var(--rust); }
.clear-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 12px; font-family: 'DM Sans', sans-serif; font-size: 12px;
  color: var(--brown); cursor: pointer; transition: all 0.15s;
}
.clear-btn:hover { border-color: var(--rust); color: var(--rust); }

.browser-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.btab {
  background: none; border: none; padding: 8px 14px 11px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--muted);
  cursor: pointer; position: relative; transition: color 0.2s; margin-bottom: -1px;
}
.btab.is-active { color: var(--rust); font-weight: 500; }
.btab.is-active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--rust); }

.group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
  margin-top: 24px;
}
.group-header:first-child { margin-top: 0; }
.group-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; }
.group-toggle { background: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-family: 'DM Sans', sans-serif; font-size: 11px; color: var(--brown); cursor: pointer; }
.group-toggle:hover { border-color: var(--rust); color: var(--rust); }

/* Full index */
.full-index { columns: 3; column-gap: 28px; }
.fi-group { break-inside: avoid; margin-bottom: 20px; }
.fi-letter { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 400; color: var(--border); line-height: 1; margin-bottom: 5px; }
.fi-ing {
  width: 100%; text-align: left; background: transparent; border: none;
  padding: 3px 0; color: var(--brown); border-bottom: 1px dashed var(--border);
  display: flex; justify-content: space-between; cursor: pointer;
  font-size: 12px; font-family: 'DM Sans', sans-serif;
}
.fi-ing:hover { color: var(--rust); }
.fi-count { font-size: 10px; color: var(--muted); font-style: italic; }

/* Mobile sheet */
.mob-trigger { display: none; }
.mob-backdrop { display: none; position: fixed; inset: 0; background: rgba(26,20,16,0.5); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.mob-backdrop.is-show { opacity: 1; pointer-events: auto; }

/* ══════════════════════════════════════════
   EMPTY + UTILITY
══════════════════════════════════════════ */
.empty { text-align: center; padding: 80px 40px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { font-size: 14px; }

.page-body { padding: 40px 40px 64px; }
.divider { height: 1px; background: var(--border); margin: 44px 40px 0; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  background: var(--ink); padding: 36px 40px; position: relative; overflow: hidden; margin-top: auto;
}
footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--rust), var(--gold), var(--sage)); }
footer::after { content: ''; position: absolute; bottom: -60px; left: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(212,168,71,0.1) 0%, transparent 70%); }
.footer-inner { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.footer-eyebrow { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; font-weight: 500; }
.footer-title { font-family: 'Playfair Display', serif; font-size: clamp(20px, 3vw, 30px); color: var(--warm-white); font-weight: 400; line-height: 1.15; }
.footer-title em { font-style: italic; color: var(--gold); }
.footer-note { max-width: 380px; font-size: 13px; line-height: 1.6; color: rgba(250,246,239,0.45); text-align: right; }
.footer-submit-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--rust); color: var(--warm-white); border-radius: 8px; padding: 10px 20px; font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; transition: background 0.18s; white-space: nowrap; }
.footer-submit-btn:hover { background: var(--gold); color: var(--ink); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .featured-grid { grid-template-columns: repeat(2,1fr); }
  .full-index { columns: 2; }
}

@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--ink); padding: 8px 16px 24px; border-bottom: 1px solid rgba(212,168,71,0.2); z-index: 299; }
  .nav-links.is-open { display: flex; }
  .nav-link { padding: 14px 0; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-toggle { display: block; }
  .site-hero { padding: 40px 20px 36px; }
  .subpage-hero { padding: 28px 20px 24px; }
  .page-body { padding: 24px 20px 48px; }
  .divider { margin: 28px 20px 0; }
  .jump-nav { padding: 14px 20px 0; }
  .profile-bar { padding: 20px; flex-direction: column; }
  .browse-layout { grid-template-columns: 1fr; }
  .browser-main { padding: 20px 20px 96px; }
  .full-index { columns: 1; }
  .featured-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-note { text-align: left; }
  footer { padding: 28px 20px; }
  .recipe-content { grid-template-columns: 1fr !important; }
  .recipe-sections { padding: 20px 20px 0; }

  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    height: min(78vh, 600px); z-index: 210;
    border-right: none; border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 36px rgba(26,20,16,0.2);
    transform: translateY(105%); transition: transform 0.26s ease;
    overflow-y: auto;
  }
  .sidebar.is-open { transform: translateY(0); }
  .mob-backdrop { display: block; }
  .mob-trigger {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; left: 16px; right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 120;
    border: 1px solid var(--border); border-radius: 999px;
    padding: 10px 16px; background: var(--ink); color: var(--warm-white);
    font-family: 'DM Sans', sans-serif; font-size: 13px; cursor: pointer;
    box-shadow: 0 8px 24px rgba(26,20,16,0.24);
  }
  .mob-summary { color: rgba(250,246,239,0.6); font-size: 11px; margin-left: 6px; }
  .mob-sheet-head {
    display: flex; align-items: center;
    padding: 14px 18px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
  }
  .mob-sheet-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 500; }
}

/* ══════════════════════════════════════════
   AUTH — NAV ACCOUNT BUTTON
══════════════════════════════════════════ */
.nav-search-li {
  display: flex;
  align-items: center;
}
.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(250,246,239,0.5);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-search-btn:hover {
  color: var(--warm-white);
  background: rgba(255,255,255,0.07);
}

.nav-account-li {
  display: flex;
  align-items: center;
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.nav-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(212,168,71,0.25);
  border-radius: 999px;
  color: rgba(250,246,239,0.6);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 32px;
}
.nav-account-btn:hover {
  background: rgba(212,168,71,0.12);
  border-color: rgba(212,168,71,0.5);
  color: var(--gold);
}
.nav-account-btn.is-signed-in {
  background: rgba(212,168,71,0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 10px;
}

@media (max-width: 768px) {
  .nav-search-li {
    border-top: 1px solid rgba(255,255,255,0.06);
    width: 100%;
  }
  .nav-search-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    gap: 10px;
    color: rgba(250,246,239,0.5);
    background: none;
    border-radius: 0;
  }
  .nav-search-btn::after {
    content: 'Search';
  }
  .nav-account-li {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-left: 0;
    margin-left: 0;
    width: 100%;
  }
  .nav-account-btn {
    width: 100%;
    justify-content: flex-start;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 14px 0;
    font-size: 12px;
    letter-spacing: 2px;
    color: rgba(250,246,239,0.5);
  }
  .nav-account-btn:hover,
  .nav-account-btn.is-signed-in {
    background: transparent;
    border: none;
    color: var(--gold);
  }
}

/* ══════════════════════════════════════════
   GLOBAL SEARCH OVERLAY
══════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,20,16,0.65);
  z-index: 600;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.search-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.search-overlay-inner {
  width: min(640px, calc(100vw - 32px));
  background: var(--warm-white);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(26,20,16,0.3);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform 0.2s;
}
.search-overlay.is-open .search-overlay-inner {
  transform: translateY(0);
}
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 16px 4px 20px;
  border-bottom: 1px solid var(--border);
}
.search-bar-icon {
  color: var(--muted);
  flex-shrink: 0;
  margin-right: 12px;
}
.search-bar-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  padding: 18px 0;
}
.search-bar-input::placeholder { color: var(--muted); }
.search-bar-close {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  line-height: 1;
}
.search-bar-close:hover { background: var(--ink); color: var(--warm-white); border-color: var(--ink); }

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.search-results::-webkit-scrollbar { width: 4px; }
.search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.search-group { padding: 0 0 8px; }
.search-group-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 20px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(232,221,208,0.4);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--cream); }
.search-result-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.search-result-title mark {
  background: rgba(212,168,71,0.3);
  color: var(--ink);
  border-radius: 2px;
  padding: 0 1px;
}
.search-result-meta {
  font-size: 11px;
  color: var(--muted);
}
.search-no-results {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.search-no-results em { color: var(--ink); font-style: normal; font-weight: 500; }

/* ══════════════════════════════════════════
   AUTH — MODAL BACKDROP
══════════════════════════════════════════ */
.auth-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(26,20,16,0.72);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.22s;
}
.auth-backdrop.is-open {
  display: block;
  opacity: 1;
}

/* ══════════════════════════════════════════
   AUTH — MODAL CARD
══════════════════════════════════════════ */
.auth-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -54%) scale(0.97);
  z-index: 510;
  width: min(440px, calc(100vw - 32px));
  background: var(--warm-white);
  border-radius: 18px;
  padding: 36px 36px 32px;
  box-shadow: 0 24px 80px rgba(26,20,16,0.28);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s, opacity 0.22s;
}
.auth-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.auth-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--muted);
  padding: 4px 6px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.auth-close:hover { color: var(--ink); background: var(--border); }

/* ══════════════════════════════════════════
   AUTH — SIGNED-OUT CONTENT
══════════════════════════════════════════ */
.auth-eyebrow {
  font-size: 10px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--rust); font-weight: 500; margin-bottom: 8px;
}
.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px; font-weight: 400; color: var(--ink);
  line-height: 1.15; margin-bottom: 8px;
}
.auth-title em { font-style: italic; color: var(--rust); }
.auth-sub {
  font-size: 13px; color: var(--muted); line-height: 1.55;
  margin-bottom: 24px;
}

.auth-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1; padding: 9px 0;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted);
  position: relative; transition: color 0.18s;
}
.auth-tab::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0; height: 2px;
  background: var(--rust); transform: scaleX(0); transition: transform 0.18s;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active { color: var(--rust); }
.auth-tab.is-active::after { transform: scaleX(1); }

.auth-panel { display: none; }
.auth-panel.is-active { display: block; }

/* Google button */
.auth-google-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 11px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; color: var(--ink);
  cursor: pointer; transition: border-color 0.18s, box-shadow 0.18s;
}
.auth-google-btn:hover:not(:disabled) {
  border-color: #4285F4;
  box-shadow: 0 2px 10px rgba(66,133,244,0.15);
}
.auth-google-btn:disabled { opacity: 0.6; cursor: default; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--muted); font-size: 11px; letter-spacing: 0.5px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Form fields */
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block; font-size: 11px; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--brown); margin-bottom: 6px;
}
.auth-field-optional {
  font-size: 10px; font-weight: 400; letter-spacing: 0.5px;
  text-transform: none; color: var(--muted); margin-left: 4px;
}
.auth-field input {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--ink);
  background: var(--cream);
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
}
.auth-field input:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(192,90,44,0.1);
}

.auth-msg {
  font-size: 13px; min-height: 18px; margin-bottom: 10px;
  line-height: 1.4; border-radius: 7px; padding: 0;
}
.auth-msg.error { color: #c0392b; }
.auth-msg.success { color: var(--sage); }

.auth-submit {
  width: 100%; padding: 12px;
  background: var(--rust); color: var(--warm-white);
  border: none; border-radius: 10px; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; letter-spacing: 0.5px;
  transition: background 0.18s, transform 0.1s;
}
.auth-submit:hover:not(:disabled) { background: #a84d24; transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.auth-note {
  margin-top: 12px; font-size: 12px; color: var(--muted);
  line-height: 1.5; text-align: center;
}

/* ══════════════════════════════════════════
   AUTH — SIGNED-IN CONTENT
══════════════════════════════════════════ */
.auth-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(192,90,44,0.12);
  color: var(--rust);
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  margin: 8px auto 16px;
}
.auth-user-name {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 400; color: var(--ink);
  margin-bottom: 2px;
}
.auth-user-email {
  text-align: center; font-size: 13px; font-weight: 400; color: var(--muted);
  margin-bottom: 18px;
}
.auth-fav-summary {
  text-align: center;
  background: rgba(192,90,44,0.07);
  border: 1px solid rgba(192,90,44,0.15);
  border-radius: 10px; padding: 13px 16px;
  font-size: 14px; color: var(--brown);
  margin-bottom: 22px;
  transition: background 0.18s, border-color 0.18s;
}
.auth-fav-summary:hover {
  background: rgba(192,90,44,0.12);
  border-color: rgba(192,90,44,0.3);
}
.auth-fav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.auth-fav-arrow {
  font-size: 14px;
  color: var(--rust);
  margin-left: 4px;
}
.auth-fav-heart { margin-right: 4px; }
.auth-signout {
  display: block; width: 100%;
  padding: 11px; border-radius: 10px;
  background: transparent;
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500; letter-spacing: 0.5px;
  color: var(--muted); cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.auth-signout:hover { border-color: var(--rust); color: var(--rust); }

@media (max-width: 480px) {
  .auth-modal { padding: 28px 22px 24px; }
  .auth-title { font-size: 22px; }
}
