/* Crumb public recipe site */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --text: #22201c;
  --muted: #6b655b;
  --line: #e6dfd3;
  --accent: #00796b;
  --accent-strong: #005c52;
  --accent-text: #ffffff;
  --accent-soft: #dff1ee;
  --star: #e0a100;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 20px rgba(40, 30, 10, .06);
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141615;
    --surface: #1c201e;
    --surface-2: #232826;
    --text: #ece8e1;
    --muted: #a59f95;
    --line: #313835;
    --accent: #4db6ac;
    --accent-strong: #80cbc4;
    --accent-text: #00201c;
    --accent-soft: #1d3330;
    --star: #f2c14e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--serif); font-size: 24px; font-weight: 700; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.header-search { flex: 1; max-width: 420px; display: flex; }
.header-search input, .search-big input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  border-radius: 999px 0 0 999px; padding: 9px 16px; font: inherit;
}
.header-search button, .search-big button {
  border: 0; background: var(--accent); color: var(--accent-text); border-radius: 0 999px 999px 0; padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a.btn-login { background: var(--accent); color: var(--accent-text); padding: 8px 16px; border-radius: 999px; margin-left: 6px; }
.site-nav a.btn-login:hover { background: var(--accent-strong); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; }
@media (max-width: 860px) {
  .header-row { flex-wrap: wrap; padding: 8px 16px; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
  .nav-toggle { display: block; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; order: 4; padding-bottom: 8px; }
  .site-nav.open { display: flex; }
  .site-nav a.btn-login { margin: 6px 0 0; text-align: center; }
}

/* Hero */
.hero { position: relative; color: #fff; background: #2a2a26 url('../img/hero.jpg') center/cover; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10, 20, 18, .82), rgba(10, 20, 18, .35)); }
.hero .wrap { position: relative; padding: 64px 16px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); max-width: 14em; }
.hero p { font-size: 18px; max-width: 34em; opacity: .92; margin: 12px 0 24px; }
.search-big { display: flex; max-width: 560px; }
.search-big input { padding: 14px 20px; font-size: 17px; background: #fff; color: #222; border-color: transparent; }
.search-big button { padding: 0 24px; font-size: 16px; }
.hero-links { margin-top: 14px; font-size: 14px; }
.hero-links a { color: #fff; margin-right: 14px; }

/* Sections */
.section { padding: 44px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.see-all { white-space: nowrap; font-weight: 600; text-decoration: none; }
.empty { color: var(--muted); grid-column: 1 / -1; padding: 12px 0; }

/* Recipe cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-link { text-decoration: none; color: inherit; flex: 1; }
.card-img { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 12px 14px 4px; }
.card-meta { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.card-title { font-size: 19px; }
.card-desc { color: var(--muted); font-size: 15px; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-cook { display: flex; align-items: center; gap: 8px; padding: 10px 14px 14px; font-size: 14px; color: var(--muted); text-decoration: none; }
.card-cook:hover span { text-decoration: underline; }
.card-skeleton .card-img { animation: pulse 1.4s infinite; }
.card-skeleton .card-body span { display: block; height: 12px; margin: 6px 0; background: var(--surface-2); border-radius: 6px; animation: pulse 1.4s infinite; }
.card-skeleton .card-body span + span { width: 60%; }
@keyframes pulse { 50% { opacity: .5; } }

/* Featured: one large card and a column of others */
.featured { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.featured .side { display: grid; gap: 20px; align-content: start; }
.featured .side .card { flex-direction: row; }
.featured .side .card-link { display: flex; }
.featured .side .card-img { aspect-ratio: 1; width: 42%; flex: none; align-self: flex-start; }
.featured .side .card-cook { display: none; }
.card-large .card-img { aspect-ratio: 16 / 10; }
.card-large .card-title { font-size: 28px; }
@media (max-width: 800px) { .featured { grid-template-columns: 1fr; } }

.stars { color: var(--star); letter-spacing: 1px; font-size: 14px; display: inline-block; margin-top: 6px; }
.stars-off { color: var(--line); }
.stars-count { color: var(--muted); letter-spacing: 0; font-size: 13px; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cat { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff; box-shadow: var(--shadow); }
.cat img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.cat:hover img { transform: scale(1.05); }
.cat span { position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-family: var(--serif); font-size: 19px; font-weight: 600; }
.cat small { display: block; font-family: var(--sans); font-size: 12px; font-weight: 500; opacity: .85; }

/* Cookbook collection: one "cookbook" per cook */
.cookbooks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.cookbook { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 14px 18px; border-radius: 6px 14px 14px 6px; background: var(--surface); box-shadow: var(--shadow); border-left: 10px solid var(--accent); text-decoration: none; color: var(--text); }
.cookbook:hover { transform: translateY(-2px); transition: transform .15s; }
.cookbook strong { font-family: var(--serif); font-size: 18px; }
.cookbook small { color: var(--muted); }

/* Healthy eating collections */
.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.collection { padding: 18px; border-radius: var(--radius); background: var(--accent-soft); text-decoration: none; color: var(--text); }
.collection strong { display: block; font-family: var(--serif); font-size: 19px; color: var(--accent-strong); }
.collection span { color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* Newsletter */
.newsletter { margin: 48px 0 0; padding: 36px 28px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.newsletter h2 { font-size: 30px; }
.newsletter p { color: var(--muted); }
.newsletter form { display: grid; gap: 10px; }
.newsletter input { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 12px 14px; font: inherit; }
.btn { display: inline-block; border: 0; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--accent-strong); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.form-status { min-height: 1.4em; font-size: 14px; color: var(--muted); margin: 0; }
@media (max-width: 760px) { .newsletter { grid-template-columns: 1fr; padding: 26px 18px; } }

/* Listing page */
.page-head { padding: 34px 0 6px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.more { text-align: center; margin: 28px 0; }

/* Recipe page */
.recipe-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; padding: 32px 0 8px; align-items: start; }
.recipe-hero img.main { width: 100%; border-radius: 18px; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: var(--shadow); }
.recipe-hero h1 { font-size: clamp(30px, 4vw, 44px); }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.byline { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); }
.byline a { color: var(--text); font-weight: 600; text-decoration: none; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; padding: 0; list-style: none; }
.facts li { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.facts b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.recipe-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; padding: 28px 0; }
.recipe-body h2 { font-size: 24px; margin-bottom: 12px; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.steps { padding-left: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 48px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.recipe-notes { background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px; white-space: pre-line; margin-top: 8px; }
@media (max-width: 820px) { .recipe-hero, .recipe-body { grid-template-columns: 1fr; } }
@media print {
  .site-header, .site-footer, .actions, .newsletter, .related { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Cook page */
.cook-head { display: flex; align-items: center; gap: 18px; padding: 34px 0 10px; }
.cook-head h1 { font-size: clamp(28px, 4vw, 40px); }
.cook-head p { margin: 4px 0 0; color: var(--muted); }

/* Legal pages */
.legal { max-width: 780px; padding: 34px 16px 20px; }
.legal h1 { font-size: 38px; }
.legal h2 { font-size: 23px; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--text); }
.legal .updated { color: var(--muted); }
.legal .callout { background: var(--accent-soft); border-radius: 12px; padding: 14px 18px; }

/* Footer */
.site-footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); padding: 30px 0; font-size: 14px; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); }

/* Newsletter author */
.dietitian { display: flex; align-items: center; gap: 14px; margin: 12px 0 4px; }
.dietitian img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.dietitian p { margin: 0; color: var(--muted); }
.dietitian strong { color: var(--text); }
