/* Recipe — food-themed, mobile-first stylesheet */
:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --ink: #2a1f17;
  --muted: #6f6158;
  --line: #ebe2d6;
  --brand: #d9480f;
  --brand-dark: #b23a0a;
  --saffron: #f4a300;
  --leaf: #2f9e44;
  --chili: #c92a2a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 31, 23, .06), 0 8px 24px rgba(42, 31, 23, .08);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font-body); }
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.container { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 999px; padding: .7rem 1.25rem; font: 600 .95rem var(--font-body); cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; transition: background .15s, transform .15s; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f4ede4; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 247, 241, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--saffron), var(--brand)); color: #fff; font: 700 1.2rem var(--font-display); }
.logo-text { font: 700 1.35rem var(--font-display); }
.site-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .5rem .8rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: #f4e6d8; color: var(--brand-dark); }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; }
  .nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Search */
.search { position: relative; display: flex; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 1rem 1.25rem 1rem 3rem; font: 1.05rem var(--font-body); color: var(--ink); border-radius: 999px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--saffron); outline-offset: 2px; }
.search::before { content: ''; position: absolute; left: 1.15rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6158' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.search .btn { margin: .35rem; }
.search-lg input { padding-block: 1.2rem; font-size: 1.1rem; }
.suggestions { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40; list-style: none; margin: 0; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-align: left; max-height: 70vh; overflow-y: auto; }
.suggestions [role="option"] { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem; border-radius: 10px; cursor: pointer; color: var(--ink); }
.suggestions [role="option"] img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.suggestions [role="option"] span { display: flex; flex-direction: column; line-height: 1.3; }
.suggestions small { color: var(--muted); }
.suggestions [aria-selected="true"], .suggestions [role="option"]:hover { background: #f8eee3; }
.suggestion-all { justify-content: center; font-weight: 600; color: var(--brand-dark) !important; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px !important; margin-top: .25rem; }
.suggestion-empty { padding: .8rem; color: var(--muted); }

/* Hero */
.hero { position: relative; min-height: min(78vh, 640px); display: grid; place-items: center; text-align: center; color: #fff; overflow: visible; }
.hero-media { position: absolute; inset: 0; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 18, 10, .35), rgba(30, 18, 10, .65)); }
.hero-content { position: relative; z-index: 2; padding: 4rem 0; width: min(760px, 100% - 2.5rem); }
.hero h1 { color: #fff; text-shadow: 0 2px 20px rgba(0, 0, 0, .3); }
.hero p { font-size: clamp(1rem, 2vw, 1.2rem); opacity: .95; }
.hero .search { margin-top: 1.5rem; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.25rem; }
.hero-chips a { color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); padding: .3rem .85rem; border-radius: 999px; text-decoration: none; font-size: .9rem; backdrop-filter: blur(4px); }
.hero-chips a:hover { background: rgba(255, 255, 255, .3); }

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: .25rem 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--brand); margin-bottom: .35rem; }
.alt { background: #f5ede3; }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .85rem; list-style: none; margin: 0; padding: 0; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.1rem .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #f0c9a8; }
.cat-icon { font-size: 2rem; line-height: 1; }
.cat-name { font-weight: 600; font-size: .95rem; }
.cat-count { font-size: .8rem; color: var(--muted); }

/* Recipe of the day */
.rotd { display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); border-radius: calc(var(--radius) + 6px); overflow: hidden; box-shadow: var(--shadow); }
.rotd-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.rotd-body { padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.rotd-body h2 a { color: inherit; text-decoration: none; }
.stat-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1.5rem; padding: 0; list-style: none; }
.stat-row li { background: #f8eee3; border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; }
@media (max-width: 760px) { .rotd { grid-template-columns: 1fr; } }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .18s, box-shadow .18s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #efe4d6; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 700; margin-bottom: .3rem; }
.card-title { font-size: 1.2rem; margin-bottom: .35rem; }
.card-desc { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; list-style: none; margin: auto 0 0; padding: .75rem 0 0; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); }
.badge { position: absolute; top: .75rem; left: .75rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; background: var(--leaf); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.badge::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #fff; margin-right: .35rem; vertical-align: middle; }
.badge-non-veg { background: var(--chili); }
.badge-vegan { background: #5c940d; }

/* Empty state */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-icon { font-size: 3rem; }

/* Listing */
.page-head { padding: 2.25rem 0 1.25rem; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .25rem; }
.page-head .search { max-width: 640px; margin-top: 1rem; }
.listing { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; padding-bottom: 4rem; }
.filters { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.filters h2 { font-size: 1.15rem; display: flex; justify-content: space-between; align-items: center; }
.filter-group { border: 0; padding: 0; margin: 0 0 1.1rem; }
.filter-group legend, .filter-group label.lbl { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .4rem; display: block; }
.filters select { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; color: var(--ink); }
.chip-set { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-set label { cursor: pointer; }
.chip-set input { position: absolute; opacity: 0; pointer-events: none; }
.chip-set span { display: inline-block; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: .88rem; }
.chip-set input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-set input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; }
.link-btn { background: none; border: 0; color: var(--brand-dark); font: 600 .85rem var(--font-body); cursor: pointer; padding: 0; text-decoration: underline; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.toolbar select { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; }
.toolbar label { font-size: .9rem; color: var(--muted); margin-right: .4rem; }
.active-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.active-filters button { border: 1px solid #f0c9a8; background: #fdf0e6; color: var(--brand-dark); border-radius: 999px; padding: .25rem .7rem; font: 500 .85rem var(--font-body); cursor: pointer; }
.filters-toggle { display: none; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; }
.pagination button { min-width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: 600 .95rem var(--font-body); cursor: pointer; color: var(--ink); padding: 0 .8rem; }
.pagination button[aria-current="page"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 900px) {
  .listing { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
}

/* Recipe detail */
.breadcrumb { font-size: .9rem; padding: 1.25rem 0 .75rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: '›'; margin-right: .4rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.detail-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; }
.detail-hero .media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow); }
.detail-hero .lead { font-size: 1.1rem; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0 0 1.25rem; padding: 0; }
.tag-list a { display: inline-block; font-size: .82rem; padding: .25rem .7rem; border-radius: 999px; background: #f4e6d8; color: var(--brand-dark); text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; margin: 2rem 0; padding: 0; list-style: none; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; }
.facts span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.facts strong { font-size: 1.1rem; }
.detail-body { display: grid; grid-template-columns: 340px 1fr; gap: 2.5rem; align-items: start; padding-bottom: 2rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.ingredients { position: sticky; top: 84px; }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li { border-bottom: 1px dashed var(--line); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients label { display: flex; gap: .7rem; padding: .6rem 0; cursor: pointer; align-items: baseline; }
.ingredients input { accent-color: var(--brand); transform: translateY(2px); flex: none; }
.ingredients input:checked ~ span { text-decoration: line-through; color: var(--muted); }
.qty { font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.steps { list-style: none; counter-reset: step; margin: 0 0 2rem; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.4rem 3.4rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font: 700 1rem var(--font-display); }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 1.12rem; top: 2.6rem; bottom: .3rem; width: 2px; background: var(--line); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.note { border-radius: var(--radius); padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--line); }
.note h3 { display: flex; gap: .5rem; align-items: center; }
.note ul { margin: 0; padding-left: 1.1rem; }
.note li { margin-bottom: .4rem; }
.note-tips { background: #fff8e6; border-color: #f6dfa0; }
.note-serve { background: #eef8ef; border-color: #cbe8cf; }
.note-store { background: #eef4fb; border-color: #cfe0f2; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-size: .9rem; z-index: 60; }
@media (max-width: 900px) {
  .detail-hero, .detail-body { grid-template-columns: 1fr; }
  .ingredients { position: static; }
}

/* Footer */
.site-footer { background: #2a1f17; color: #e9dfd3; padding: 3rem 0 1.5rem; margin-top: 2rem; }
.site-footer .logo { color: #fff; margin-bottom: .75rem; }
.site-footer .muted { color: #b8a99b; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-title { font: 700 .85rem var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; columns: 2; }
.footer-links a { color: #e9dfd3; text-decoration: none; font-size: .92rem; line-height: 2; }
.footer-links a:hover { color: var(--saffron); }
.footer-bottom { border-top: 1px solid #45382d; margin-top: 2rem; padding-top: 1.25rem; font-size: .88rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, #efe6da 0, #f7f0e7 50%, #efe6da 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 320px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Print */
@media print {
  .site-header, .site-footer, .actions, .breadcrumb, .related, .skip-link, .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .detail-hero, .detail-body { grid-template-columns: 1fr; gap: 1rem; }
  .detail-hero .media img { max-height: 3in; width: auto; box-shadow: none; }
  .panel, .note, .facts li { border: 1px solid #ccc; break-inside: avoid; }
  .ingredients { position: static; }
  .steps li { break-inside: avoid; }
  .steps li::before { background: #fff; color: #000; border: 1px solid #000; }
  a { color: #000; text-decoration: none; }
}
