/* ============================================================
   TasteWoven — main stylesheet
   Warm food theme, mobile-first, Pinterest-style cards.
   Colors: primary #E85D04, secondary #FFBA08, bg #FFF8F0,
           text #2B2B2B, accent #6A994E
   ============================================================ */

:root {
  --primary: #E85D04;
  --primary-dark: #C74E02;
  --secondary: #FFBA08;
  --bg: #FFF8F0;
  --surface: #FFFFFF;
  --text: #2B2B2B;
  --text-muted: #6F6B66;
  --accent: #6A994E;
  --border: #F0E4D7;
  --shadow: 0 2px 12px rgba(43, 43, 43, 0.07);
  --shadow-lg: 0 8px 28px rgba(43, 43, 43, 0.12);
  --radius: 14px;
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1.3rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; border: 2px solid transparent; cursor: pointer; transition: all .18s ease;
  font-family: var(--font-body); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: var(--bg); }
.btn-danger { background: #C0392B; color: #fff; }
.btn-danger:hover { background: #96281B; color: #fff; }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn-save.is-saved { background: var(--accent); }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; }
.brand { font-family: var(--font-head); font-weight: 800; font-size: 1.45rem; color: var(--text); display: flex; align-items: center; gap: .35rem; }
.brand-accent { color: var(--primary); }
.brand:hover { color: var(--text); }
.main-nav { display: none; gap: 1.1rem; align-items: center; }
.main-nav a { color: var(--text); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--primary); }
.header-search { display: none; margin-left: auto; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: .15rem .3rem .15rem .9rem; align-items: center; }
.header-search input { border: 0; background: transparent; outline: none; font-family: var(--font-body); width: 170px; }
.header-search button { border: 0; background: transparent; cursor: pointer; font-size: 1rem; padding: .3rem .5rem; }
.header-actions { display: none; align-items: center; gap: .8rem; }
.nav-link { color: var(--text); font-weight: 500; font-size: .93rem; }
.nav-toggle { margin-left: auto; background: transparent; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--text); }
.nav-auth-mobile { display: flex; gap: .8rem; align-items: center; }

@media (min-width: 900px) {
  .main-nav { display: flex; }
  .header-search { display: flex; }
  .header-actions { display: flex; }
  .nav-toggle, .nav-auth-mobile { display: none; }
}
@media (max-width: 899px) {
  .main-nav.open { display: flex; flex-direction: column; align-items: flex-start; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--surface); padding: 1rem 1.2rem; gap: .9rem;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
}

/* ---------- Flash ---------- */
.flash { margin: .8rem 0; padding: .8rem 1.1rem; border-radius: var(--radius); font-weight: 500; }
.flash-success { background: #EAF3E4; color: #3E6B2A; border: 1px solid #CBE3BB; }
.flash-error { background: #FBE9E7; color: #A03325; border: 1px solid #F3C8C1; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, #FFF3E4 0%, var(--bg) 55%, #FDF0DC 100%); padding: 3.2rem 0 2.6rem; text-align: center; }
.hero-eyebrow { font-weight: 600; color: var(--accent); margin-bottom: .6rem; }
.hero-title { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; }
.hero-title em { color: var(--primary); font-style: normal; }
.hero-subtitle { max-width: 620px; margin: 1rem auto 1.6rem; color: var(--text-muted); font-size: 1.05rem; }
.hero-search { display: flex; max-width: 620px; margin: 0 auto 1.2rem; background: var(--surface);
  border-radius: 999px; padding: .35rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.hero-search input { flex: 1; border: 0; outline: none; padding: .5rem 1rem; font-size: 1rem; background: transparent; font-family: var(--font-body); min-width: 0; }
.hero-ctas { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.4rem; }
.hero-chips { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.hero-chips a, .chip { background: var(--surface); border: 1px solid var(--border); padding: .35rem .9rem;
  border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--text); }
.hero-chips a:hover, .chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Sections ---------- */
.home-section { padding: 2.2rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-subtitle { color: var(--text-muted); font-size: .95rem; }
.section-more { font-weight: 600; white-space: nowrap; }

/* ---------- Recipe cards ---------- */
.recipe-grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.recipe-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease; display: flex; flex-direction: column; }
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-image-wrap { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.card-image { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.recipe-card:hover .card-image { transform: scale(1.04); }
.card-badge { position: absolute; top: .7rem; left: .7rem; background: var(--primary); color: #fff;
  font-size: .75rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px; }
.card-time { position: absolute; bottom: .7rem; right: .7rem; background: rgba(43,43,43,.75); color: #fff;
  font-size: .75rem; font-weight: 500; padding: .22rem .6rem; border-radius: 999px; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card-category { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.card-title { font-size: 1.12rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }
.card-desc { font-size: .88rem; color: var(--text-muted); flex: 1; }
.card-meta { display: flex; gap: .9rem; font-size: .82rem; color: var(--text-muted); }
.card-rating { color: var(--secondary); font-weight: 700; }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); background: var(--surface);
  border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- Category grid ---------- */
.category-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.category-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem .9rem; text-align: center; display: flex; flex-direction: column; gap: .25rem;
  transition: all .18s ease; color: var(--text); }
.category-tile:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.category-icon { font-size: 1.9rem; }
.category-name { font-weight: 600; }
.category-count { font-size: .8rem; color: var(--text-muted); }

/* ---------- Cuisine cards ---------- */
.cuisine-grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cuisine-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: transform .18s ease; }
.cuisine-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--text); }
.cuisine-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.cuisine-card-body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .3rem; }
.cuisine-card-body p { font-size: .88rem; color: var(--text-muted); }

/* ---------- Newsletter ---------- */
.newsletter-band { background: linear-gradient(120deg, var(--primary), #F07C2E); color: #fff; padding: 2.6rem 0; margin-top: 2rem; }
.newsletter-inner { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between; }
.newsletter-band h2, .newsletter-band p { color: #fff; }
.newsletter-band p { opacity: .92; }
.newsletter-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.newsletter-form input { border: 0; border-radius: 999px; padding: .65rem 1.1rem; font-size: .95rem; min-width: 240px; font-family: var(--font-body); }

/* ---------- Page head / breadcrumbs ---------- */
.page-head { padding: 2.2rem 0 1.2rem; }
.page-head p { color: var(--text-muted); margin-top: .3rem; }
.page-head.center { text-align: center; padding: 4rem 0; }
.breadcrumbs { font-size: .85rem; color: var(--text-muted); margin-bottom: .7rem; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.collection-intro { max-width: 720px; }

/* ---------- Filter bar / pagination ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.6rem; align-items: center; }
.filter-bar select { padding: .5rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-family: var(--font-body); }
.pagination { display: flex; gap: .4rem; justify-content: center; margin: 2rem 0; }
.page-link { padding: .45rem .85rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Search ---------- */
.search-page-form { margin-top: 1rem; }
.search-suggestions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: 1rem 0 3rem; }
.search-suggestions p { color: var(--text-muted); margin-right: .4rem; }
.results-count { color: var(--text-muted); margin-bottom: 1.2rem; }

/* ---------- Recipe page ---------- */
.recipe-page { padding-bottom: 2rem; }
.recipe-header { display: grid; gap: 1.6rem; margin: 1rem 0 1.6rem; }
@media (min-width: 820px) { .recipe-header { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.recipe-lede { color: var(--text-muted); margin: .8rem 0 1rem; font-size: 1.05rem; }
.recipe-badges { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.recipe-badges span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; font-weight: 600; }
.recipe-badges .badge-hot { background: #FFF0E0; border-color: #F8CFA5; color: var(--primary); }
.recipe-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.recipe-hero-image img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; box-shadow: var(--shadow-lg); }
.recipe-meta-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; }
.recipe-meta-bar > div { background: var(--surface); padding: .8rem .6rem; text-align: center; display: grid; }
.recipe-meta-bar span { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.recipe-meta-bar strong { font-size: 1.02rem; }
.recipe-columns { display: grid; gap: 1.6rem; }
@media (min-width: 900px) { .recipe-columns { grid-template-columns: 340px 1fr; align-items: start; } }
.recipe-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.4rem; }
.recipe-panel h2 { margin-bottom: 1rem; font-size: 1.35rem; }
.panel-note { font-family: var(--font-body); font-size: .82rem; color: var(--text-muted); font-weight: 400; }

.ingredient-list { list-style: none; display: grid; gap: .55rem; }
.ingredient-list label { display: flex; gap: .6rem; align-items: baseline; cursor: pointer; }
.ingredient-list input[type="checkbox"] { accent-color: var(--primary); transform: translateY(2px); }
.ingredient-list input:checked ~ .ing-name { text-decoration: line-through; color: var(--text-muted); }
.ing-qty { font-weight: 700; color: var(--primary); white-space: nowrap; }

.instruction-steps { list-style: none; display: grid; gap: 1.1rem; counter-reset: step; }
.instruction-steps li { display: flex; gap: .9rem; align-items: flex-start; }
.step-number { background: var(--primary); color: #fff; font-weight: 700; border-radius: 50%;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: .1rem; }

.tips-panel { background: #FFFBEB; border-color: #F5E3AE; }
.tips-list { padding-left: 1.2rem; display: grid; gap: .5rem; }
.subs-list { list-style: none; display: grid; gap: .5rem; }
.nutrition-table { width: 100%; border-collapse: collapse; }
.nutrition-table tr { border-bottom: 1px solid var(--border); }
.nutrition-table tr:last-child { border-bottom: 0; }
.nutrition-table th { text-align: left; padding: .5rem 0; font-weight: 500; color: var(--text-muted); }
.nutrition-table td { text-align: right; font-weight: 700; }

.faq-accordion details { border-bottom: 1px solid var(--border); padding: .7rem 0; }
.faq-accordion details:last-child { border-bottom: 0; }
.faq-accordion summary { font-weight: 600; cursor: pointer; }
.faq-accordion p { margin-top: .5rem; color: var(--text-muted); }
.related-section { padding: 1rem 0 2.5rem; }

/* ---------- Forms / auth ---------- */
.form-narrow { max-width: 480px; padding-bottom: 3rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; margin-top: 2.5rem; margin-bottom: 3rem; box-shadow: var(--shadow); }
.auth-sub { color: var(--text-muted); margin: .4rem 0 1.4rem; }
.auth-alt { margin-top: 1.2rem; font-size: .92rem; color: var(--text-muted); }
.stack-form { display: grid; gap: 1rem; }
.stack-form label { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; min-width: 0; }
.stack-form input, .stack-form textarea, .stack-form select { width: 100%; min-width: 0; padding: .65rem .9rem;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-family: var(--font-body); font-size: .95rem; }
.stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus { outline: 2px solid var(--secondary); border-color: var(--secondary); }
.stack-form input:disabled { background: var(--bg); color: var(--text-muted); }

/* ---------- Dashboard / admin ---------- */
.stat-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; display: grid; gap: .2rem; text-align: center; color: var(--text); transition: all .18s ease; }
a.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card strong { font-size: 1.6rem; color: var(--primary); }
.stat-card span { font-size: .85rem; color: var(--text-muted); }
.admin-actions-row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin: 1rem 0 1.5rem; }
.admin-search { display: flex; gap: .5rem; margin-left: auto; }
.admin-search input { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border); font-family: var(--font-body); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 3rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 720px; }
.admin-table th { text-align: left; padding: .8rem 1rem; background: var(--bg); border-bottom: 1px solid var(--border); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.admin-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cell-muted { color: var(--text-muted); font-size: .85rem; }
.cell-actions { display: flex; gap: .5rem; align-items: center; }
.cell-actions form { display: inline; }
.status-pill { padding: .18rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.status-published { background: #EAF3E4; color: #3E6B2A; }
.status-draft { background: #FDF2D9; color: #8A6D1A; }
.admin-form { max-width: 860px; padding-bottom: 3rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.form-grid-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.cat-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.cat-fieldset legend { font-weight: 700; padding: 0 .5rem; }
.checkbox-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.checkbox-item { display: flex !important; flex-direction: row !important; gap: .45rem !important; align-items: center; font-weight: 500 !important; }
.checkbox-item input { accent-color: var(--primary); }

/* ---------- Prose (about / legal) ---------- */
.prose { max-width: 720px; padding-bottom: 3rem; display: grid; gap: 1rem; }
.prose h2 { margin-top: .8rem; }
.prose ul { padding-left: 1.3rem; display: grid; gap: .4rem; }

/* ---------- Footer ---------- */
.site-footer { background: #241E18; color: #D8CFC5; margin-top: 3rem; padding: 2.6rem 0 1rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding-bottom: 1.6rem; }
.footer-brand p { font-size: .9rem; margin: .6rem 0 1rem; opacity: .8; }
.site-footer .brand { color: #fff; }
.site-footer h4 { color: #fff; margin-bottom: .7rem; font-family: var(--font-body); font-size: .95rem; }
.site-footer a { display: block; color: #D8CFC5; font-size: .9rem; padding: .18rem 0; }
.site-footer a:hover { color: var(--secondary); }
.site-footer .brand:hover { color: #fff; }
.footer-newsletter { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-newsletter input { border: 0; border-radius: 999px; padding: .5rem 1rem; font-size: .88rem; font-family: var(--font-body); }
.footer-bottom { border-top: 1px solid #3A322A; padding-top: 1rem; font-size: .82rem; opacity: .7; }
.footer-bottom p { display: inline; }

/* ---------- Ads ---------- */
.ad-box { margin: 1.4rem auto; text-align: center; max-width: 100%; overflow: hidden; }
.ad-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted, #9A8F82); margin-bottom: .3rem; }

/* ---------- Subscription ---------- */
.subscribe-wrap { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); max-width: 860px; margin: 0 auto; padding-bottom: 3rem; }
.plan-card, .checkout-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.plan-card { border-top: 4px solid var(--primary); }
.plan-price { font-family: var(--font-heading); font-size: 2.6rem; color: var(--primary); margin: .4rem 0 1rem; }
.plan-price span { font-size: 1rem; color: #9A8F82; font-family: var(--font-body); }
.plan-features { list-style: none; display: grid; gap: .55rem; padding: 0; margin-bottom: 1.2rem; }
.plan-status { background: #EAF3E4; color: #3E6B2A; border-radius: var(--radius); padding: .7rem 1rem; font-size: .92rem; margin-bottom: 1rem; }
.paywall { margin: 1.5rem 0; border: 2px dashed var(--primary); border-radius: var(--radius); background: linear-gradient(180deg, #FFF4E8, #FFF8F0); }
.paywall-inner { max-width: 560px; margin: 0 auto; text-align: center; padding: 2.6rem 1.4rem; display: grid; gap: .8rem; justify-items: center; }
.paywall-lock { font-size: 2.4rem; }
.paywall .btn { margin: 0 .3rem; }

/* ---------- Cookie consent ---------- */
.consent-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .9rem 1.2rem; background: #241E18; color: #D8CFC5; box-shadow: 0 -4px 16px rgba(0,0,0,.25); }
.consent-banner p { font-size: .86rem; margin: 0; max-width: 640px; }
.consent-banner a { color: var(--secondary); text-decoration: underline; }
.consent-banner[hidden] { display: none; }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .recipe-actions, .related-section, .breadcrumbs, .newsletter-band, .flash { display: none !important; }
  body { background: #fff; }
  .recipe-columns { grid-template-columns: 1fr; }
  .recipe-panel { border: 1px solid #ddd; break-inside: avoid; }
  .recipe-hero-image img { max-height: 300px; }
}
