/* Brooks Family Recipes — warm kitchen, mobile-first */
:root {
  --bg: #f7f2eb;
  --bg-card: #fffdf9;
  --ink: #2c241c;
  --ink-muted: #6b5e52;
  --line: #e8ddd0;
  --accent: #c45c3e;
  --accent-dark: #a34830;
  --accent-soft: #f3e0d8;
  --sage: #6b8f71;
  --sage-soft: #e4efe6;
  --him: #4a6fa5;
  --him-soft: #e4ebf5;
  --her: #9b6b8a;
  --her-soft: #f3e8ef;
  --both: var(--accent);
  --both-soft: var(--accent-soft);
  --shadow: 0 2px 12px rgba(44, 36, 28, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
  position: relative;
}

/* Subtle fixed photo wash behind all pages */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  /* cover = fill the whole screen; photo is portrait-oriented */
  background:
    url("../images/bg-pumpkins.jpg") center / cover no-repeat;
  filter: saturate(0.9) brightness(1.04);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* cream wash — high opacity = subtle photo */
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  pointer-events: none;
}

@supports not (background: color-mix(in srgb, white 50%, transparent)) {
  body::after {
    background: rgba(247, 242, 235, 0.55);
  }
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Sticky header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background: rgba(247, 242, 235, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.header-back:hover, .header-back:focus-visible {
  background: var(--line);
  outline: none;
}

.fav-toggle {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.fav-toggle[aria-pressed="true"] { color: var(--accent); }
.fav-toggle:hover, .fav-toggle:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

/* Layout */
.wrap {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 0;
}

.page-intro {
  margin: 0.25rem 0 1.25rem;
}

.page-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.page-intro p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.example-banner {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--sage-soft);
  border: 1px solid #c5d9c8;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #3d5a42;
}

.example-banner strong { font-weight: 600; }

/* Search & filters */
.controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.search-wrap {
  position: relative;
}

.search-wrap label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border: 1.5px solid rgba(232, 221, 208, 0.9);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  box-shadow: var(--shadow);
  -webkit-appearance: none;
}
.search-input::placeholder { color: #9a8c7e; }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
  font-size: 1.1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  width: 100%;
  margin: 0.15rem 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid rgba(232, 221, 208, 0.9);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: #cbbba8; }
.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip-him[aria-pressed="true"] { background: var(--him); border-color: var(--him); }
.chip-her[aria-pressed="true"] { background: var(--her); border-color: var(--her); }
.chip-fav[aria-pressed="true"] { background: var(--accent); }

.chip-count {
  font-size: 0.7rem;
  opacity: 0.85;
  font-weight: 600;
}

/* Recipe grid */
.recipe-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.recipe-card {
  background: rgba(255, 253, 249, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(232, 221, 208, 0.85);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.recipe-card:active { transform: scale(0.99); }

.recipe-card a.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.card-media {
  height: 120px;
  background: linear-gradient(135deg, rgba(243, 224, 216, 0.55) 0%, rgba(245, 235, 224, 0.45) 50%, rgba(228, 239, 230, 0.55) 100%);
  display: grid;
  place-items: center;
  font-size: 2.75rem;
  position: relative;
}

.card-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: var(--ink-muted);
}

.card-body {
  padding: 0.9rem 1rem 1.1rem;
  position: relative;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.25;
  padding-right: 2.5rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.65rem;
}

.card-meta .dot::before {
  content: "·";
  margin-right: 0.75rem;
  color: #c4b5a5;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f0e8de;
  color: var(--ink-muted);
}

.liked-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.liked-him { background: var(--him-soft); color: var(--him); }
.liked-her { background: var(--her-soft); color: var(--her); }
.liked-both { background: var(--both-soft); color: var(--accent-dark); }

.card-fav {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.25rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card-fav[aria-pressed="true"] { color: var(--accent); }
.card-fav:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: var(--bg-card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-muted);
}
.empty-state .emoji { font-size: 2.5rem; margin-bottom: 0.5rem; }
.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  margin: 0 0 0.35rem;
}
.empty-state p { margin: 0 0 1rem; font-size: 0.95rem; }
.empty-state button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.empty-state button:hover { background: var(--accent-dark); }

.results-count {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
}

/* Recipe detail */
.detail-hero {
  margin: -0.25rem -1rem 1.25rem;
  height: 160px;
  background: linear-gradient(145deg, var(--accent-soft), #f8efe6 55%, var(--sage-soft));
  display: grid;
  place-items: center;
  font-size: 4rem;
  position: relative;
}

.detail-hero .example-flag {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: var(--ink-muted);
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail-desc {
  color: var(--ink-muted);
  margin: 0 0 1rem;
  font-size: 1rem;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
}
.stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.section {
  margin-bottom: 1.75rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-soft);
}

.ingredient-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingredient-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.ingredient-list li:last-child { border-bottom: none; }

.ingredient-list input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.ingredient-list label {
  flex: 1;
  cursor: pointer;
  line-height: 1.4;
}
.ingredient-list label .amount {
  font-weight: 600;
  color: var(--accent-dark);
  margin-right: 0.35rem;
}
.ingredient-list input:checked + label {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 2.75rem;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}
.steps li::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 1.85rem;
  bottom: 0;
  width: 2px;
  background: var(--accent-soft);
}
.steps li:last-child::after { display: none; }

.notes-box {
  background: #fff8e8;
  border: 1px solid #edd9a8;
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.95rem;
}

.coming-soon {
  text-align: center;
  padding: 1.75rem 1.25rem;
  background: var(--bg-card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-muted);
}
.coming-soon .emoji { font-size: 2rem; margin-bottom: 0.4rem; }
.coming-soon h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
  margin: 0 0 0.35rem;
}
.coming-soon p { margin: 0; font-size: 0.9rem; }

.not-found {
  text-align: center;
  padding: 3rem 1rem;
}
.not-found a.btn {
  display: inline-flex;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover { background: var(--accent-dark); }

.site-footer {
  margin-top: 2.5rem;
  padding: 1.25rem 1rem calc(1rem + var(--safe-bottom));
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
}

.noscript {
  margin: 1rem;
  padding: 1rem;
  background: #fff3cd;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

/* Tablet+ */
@media (min-width: 600px) {
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-media { height: 140px; }
  .detail-hero { height: 200px; margin-left: 0; margin-right: 0; border-radius: var(--radius); }
  .wrap { padding-top: 1.25rem; }
  .filter-label { width: auto; margin-right: 0.25rem; }
}

@media (min-width: 900px) {
  .wrap { width: min(900px, 100%); }
  .recipe-grid { grid-template-columns: repeat(3, 1fr); gap: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
