/* ============================================================
   The Harvest Bake Co. — theharvestsourdough.com
   Warm, artisanal single-page site
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --cream:        #f7f0e2;
  --cream-2:      #efe4cf;
  --paper:        #fdfaf3;
  --ink:          #2d2116;
  --ink-soft:     #5b4c3b;
  --crust:        #7c4a24;
  --crust-deep:   #5e3517;
  --chocolate:    #3d2b1f;
  --wheat:        #c9962f;
  --wheat-2:      #d9b25a;
  --leaf:         #6f7b52;
  --line:         rgba(61, 43, 31, 0.14);

  --shadow-sm: 0 2px 10px rgba(61, 43, 31, 0.08);
  --shadow-md: 0 12px 34px rgba(61, 43, 31, 0.14);
  --shadow-lg: 0 26px 60px rgba(61, 43, 31, 0.22);

  --radius: 16px;
  --radius-lg: 26px;
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--crust); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; color: var(--chocolate); margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--wheat); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--maxw), 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 128px) 0; }
.kicker {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .74rem;
  font-weight: 800;
  color: var(--crust);
  margin: 0 0 1rem;
}
.eyebrow-leaf::before { content: "🌾"; margin-right: .5em; }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-body); font-weight: 800;
  font-size: 1rem; line-height: 1;
  padding: .95em 1.6em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--crust); color: #fff8ec; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--crust-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--chocolate); border-color: rgba(61,43,31,.28); }
.btn-ghost:hover { background: rgba(61,43,31,.06); transform: translateY(-2px); }
.btn-light { background: #fff8ec; color: var(--chocolate); box-shadow: var(--shadow-sm); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247, 240, 226, .82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.nav.scrolled { box-shadow: var(--shadow-sm); border-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-logo { height: 46px; width: auto; display: block; }
@media (max-width: 480px) { .brand-logo { height: 38px; } }

.nav-links { display: flex; align-items: center; gap: 1.7rem; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { color: var(--ink-soft); font-weight: 700; font-size: .96rem; position: relative; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--wheat); transition: width .2s ease;
}
.nav-links a:not(.btn):hover { color: var(--chocolate); }
.nav-links a:not(.btn):hover::after { width: 100%; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 26px; height: 2.6px; background: var(--chocolate); border-radius: 3px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle span + span { margin-top: 6px; }
.nav.open .nav-toggle span:nth-child(1) { transform: translateY(8.6px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-8.6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex; align-items: center;
  color: #fff6e8;
  background: #2a1c11;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("../images/full/IMG_6266.jpg");
  background-size: cover; background-position: 50% 42%;
  transform: scale(1.05);
  z-index: 0;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(105deg, rgba(30,19,10,.82) 0%, rgba(30,19,10,.55) 42%, rgba(30,19,10,.18) 100%),
    linear-gradient(0deg, rgba(30,19,10,.55), rgba(30,19,10,0) 45%);
}
.hero-inner { position: relative; z-index: 2; max-width: 680px; padding: 8vh 0; }
.hero-logo { width: min(430px, 82%); height: auto; margin-bottom: 1.6rem; filter: drop-shadow(0 4px 18px rgba(0,0,0,.35)); }
.hero .kicker { color: var(--wheat-2); }
.hero h1 { color: #fff8ee; font-size: clamp(2.6rem, 6.4vw, 4.6rem); text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.hero p.lead { font-size: clamp(1.08rem, 2.1vw, 1.32rem); color: #f4e7d3; max-width: 32em; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero-chip {
  display: inline-flex; align-items: center; gap: .5em;
  margin-top: 2.2rem; padding: .5em 1em;
  background: rgba(255,248,236,.14); border: 1px solid rgba(255,248,236,.28);
  border-radius: 999px; font-size: .9rem; font-weight: 700; color: #fdf3e3;
  backdrop-filter: blur(4px);
}

/* ---------- Craft strip ---------- */
.craft { background: var(--paper); }
.craft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.craft-card { text-align: center; padding: 1rem; }
.craft-ico {
  width: 66px; height: 66px; margin: 0 auto 1rem;
  display: grid; place-items: center;
  background: var(--cream-2); border-radius: 50%;
  font-size: 1.9rem;
}
.craft-card h3 { font-size: 1.3rem; margin-bottom: .3em; }
.craft-card p { color: var(--ink-soft); margin: 0; font-size: .98rem; }

/* ---------- About ---------- */
.about { background: var(--cream); }
.about-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 68px); align-items: center; }
.about-photo { position: relative; }
.about-photo img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); object-fit: cover; aspect-ratio: 5 / 4; }
.about-photo .tag {
  position: absolute; bottom: -18px; left: 24px;
  background: var(--chocolate); color: var(--wheat-2);
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  padding: .7em 1.2em; border-radius: 12px; box-shadow: var(--shadow-md);
}
.about-body h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
.about-body p { color: var(--ink-soft); font-size: 1.06rem; }
.signature { font-family: var(--font-display); font-style: italic; font-size: 1.5rem; color: var(--crust); margin-top: .4em; }

/* ---------- Menu ---------- */
.menu { background: var(--paper); }
.menu-group + .menu-group { margin-top: clamp(40px, 6vw, 72px); }
.menu-group-title { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.menu-group-title h3 { font-size: 1.7rem; margin: 0; white-space: nowrap; }
.menu-group-title::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.6vw, 32px); }
.menu-card {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.menu-card .ph { aspect-ratio: 4 / 3; overflow: hidden; }
.menu-card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.menu-card:hover .ph img { transform: scale(1.06); }
.menu-card .body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.menu-card .row { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; }
.menu-card h4 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin: 0; color: var(--chocolate); }
.menu-card .price { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--crust); white-space: nowrap; }
.menu-card .desc { color: var(--ink-soft); font-size: .95rem; margin: .4rem 0 0; }
.menu-note {
  margin-top: clamp(36px, 5vw, 56px); text-align: center;
  background: var(--cream-2); border-radius: var(--radius);
  padding: 1.5rem; color: var(--ink-soft); font-size: 1.02rem;
}
.menu-note strong { color: var(--chocolate); }

/* ---------- Gallery ---------- */
.gallery { background: var(--cream); }
.gallery-grid { columns: 4 220px; column-gap: 16px; }
.gallery-grid button {
  border: 0; padding: 0; margin: 0 0 16px; width: 100%;
  background: none; cursor: pointer; display: block;
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm);
  break-inside: avoid; line-height: 0;
  transition: box-shadow .2s ease;
}
/* Deliberately NO transform on the button. It's a child of a CSS multi-column
   container, and Safari mis-repaints transformed column children — tiles blank
   out on hover. Zoom the image inside the fixed frame instead, which is the same
   effect the menu cards use and keeps the column boxes untransformed. */
.gallery-grid button:hover { box-shadow: var(--shadow-md); }
.gallery-grid img {
  width: 100%; height: auto; display: block;
  transition: transform .45s ease;
}
.gallery-grid button:hover img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
  .gallery-grid img { transition: none; }
  .gallery-grid button:hover img { transform: none; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(24, 15, 8, .9);
  display: none; align-items: center; justify-content: center;
  padding: 4vw;
  backdrop-filter: blur(4px);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lb-btn {
  position: absolute; background: rgba(255,248,236,.14); border: 1px solid rgba(255,248,236,.3);
  color: #fff; width: 52px; height: 52px; border-radius: 50%; font-size: 1.5rem;
  cursor: pointer; display: grid; place-items: center; transition: background .15s ease;
}
.lb-btn:hover { background: rgba(255,248,236,.3); }
.lb-close { top: 4vw; right: 4vw; }
.lb-prev { left: 3vw; top: 50%; transform: translateY(-50%); }
.lb-next { right: 3vw; top: 50%; transform: translateY(-50%); }

/* ---------- Order / Find us ---------- */
.order { background: var(--chocolate); color: #f6ead4; }
.order h2, .order h3 { color: #fff6e6; }
.order .kicker { color: var(--wheat-2); }
.order-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.order-info p { color: #e6d6bd; }
.find-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.1rem; }
.find-list li { display: flex; gap: .9rem; align-items: flex-start; }
.find-list .ico { font-size: 1.35rem; line-height: 1.4; }
.find-list b { color: #fff6e6; display: block; }
.find-list span { color: #d9c6a9; font-size: .96rem; }
.socials { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }

.order-card {
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-lg);
}
.order-card h3 { color: var(--chocolate); margin-bottom: .2em; }
.order-card > p { color: var(--ink-soft); font-size: .96rem; margin-bottom: 1.4rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 800; font-size: .86rem; margin-bottom: .4rem; color: var(--chocolate); }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--font-body); font-size: 1rem;
  padding: .8em .95em; border: 1.6px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--wheat); box-shadow: 0 0 0 3px rgba(201,150,47,.18);
}
.field textarea { resize: vertical; min-height: 100px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.order-card .btn-primary { width: 100%; justify-content: center; margin-top: .3rem; }
.form-hint { font-size: .82rem; color: var(--ink-soft); margin-top: .9rem; text-align: center; }

/* ---------- Order item picker ---------- */
.order-items { display: flex; flex-direction: column; }
.order-loading { color: var(--ink-soft); font-size: .95rem; margin: 0; padding: .3rem 0; }
.order-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem .1rem; border-bottom: 1px solid var(--line);
}
.order-item:last-child { border-bottom: 0; }
.oi-info { display: flex; flex-direction: column; line-height: 1.25; }
.oi-name { font-weight: 700; color: var(--chocolate); font-size: .98rem; }
.oi-price { font-size: .82rem; color: var(--ink-soft); }
.oi-stepper { display: flex; align-items: center; gap: 2px; background: var(--cream-2); border-radius: 999px; padding: 3px; transition: background .15s ease; }
.oi-stepper.has-qty { background: var(--wheat-2); }
.oi-btn {
  width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent;
  color: var(--crust); font-size: 1.25rem; font-weight: 700; cursor: pointer;
  line-height: 1; display: grid; place-items: center; transition: background .15s ease;
}
.oi-btn:hover { background: rgba(124, 74, 36, .16); }
.oi-qty { min-width: 1.7rem; text-align: center; font-weight: 800; color: var(--chocolate); font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.footer { background: #2a1c11; color: #cbb59a; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 3rem 0; }
.footer .brand-logo { height: 58px; }
.footer-verse { width: 100%; font-family: var(--font-display); font-style: italic; color: #b89a72; font-size: .98rem; margin: 1.4rem 0 0; }
.footer-area { width: 100%; color: #9c8266; font-size: .86rem; margin: 1rem 0 0; }
.footer a { color: var(--wheat-2); font-weight: 700; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-legal { width: 100%; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.4rem; font-size: .84rem; color: #9c8266; }

/* ---------- Weekly announcement bar ---------- */
.weekly-banner { background: linear-gradient(90deg, var(--wheat) 0%, var(--wheat-2) 100%); color: var(--chocolate); }
.weekly-inner { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .7rem var(--gutter); text-align: center; }
.weekly-inner p { margin: 0; font-weight: 800; font-size: .98rem; letter-spacing: .01em; }
.weekly-dot { font-size: 1.1rem; line-height: 1; }

/* ---------- Sold-out state on menu cards ---------- */
.menu-card .ph { position: relative; }
.menu-card.sold-out { opacity: .72; }
.menu-card.sold-out .ph img { filter: grayscale(.45); }
.menu-card.sold-out .price { color: var(--ink-soft); }
.sold-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--chocolate); color: #fff6e6;
  font-family: var(--font-body); font-weight: 800; font-size: .72rem;
  letter-spacing: .05em; text-transform: uppercase;
  padding: .38em .75em; border-radius: 999px; box-shadow: var(--shadow-sm);
}

/* ---------- Reviews ---------- */
.reviews { background: var(--paper); }
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.5vw, 28px); }
.review-card {
  margin: 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .7rem;
}
.review-card blockquote { margin: 0; font-size: 1.05rem; line-height: 1.6; color: var(--ink); }
.review-card blockquote::before { content: "\201C"; }
.review-card blockquote::after { content: "\201D"; }
.review-card figcaption { font-family: var(--font-display); font-weight: 600; color: var(--crust); font-size: .98rem; }
.stars { color: var(--wheat); letter-spacing: 2px; font-size: 1.05rem; line-height: 1; }
.stars-empty { color: rgba(61,43,31,.22); }
.reviews-empty { grid-column: 1 / -1; text-align: center; color: var(--ink-soft); font-size: 1.05rem; padding: .5rem 0 0; }

.review-form-card {
  max-width: 640px; margin: clamp(32px, 5vw, 52px) auto 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-md);
}
.review-form-card h3 { color: var(--chocolate); margin-bottom: .2em; }
.review-form-card > p { color: var(--ink-soft); font-size: .96rem; margin-bottom: 1.3rem; }
.review-form-card .btn-primary { width: 100%; justify-content: center; margin-top: .3rem; }

/* "Also post it on Google" — appears after a review sends, only if
   GOOGLE_REVIEW_URL is set in js/config.js. */
.review-google {
  margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px dashed var(--line);
}
.review-google h4 { color: var(--chocolate); font-size: 1.08rem; margin-bottom: .35em; }
.review-google > p { color: var(--ink-soft); font-size: .94rem; margin-bottom: 1rem; }
.review-google-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.review-google-actions .btn { flex: 1 1 12rem; justify-content: center; margin-top: 0; }
/* The shared rule above stretches any .btn-primary in this card to full width;
   inside the two-button row it needs to share space instead. */
.review-form-card .review-google-actions .btn-primary { width: auto; }
.review-google .form-hint { margin-top: .7rem; }

/* QR to finish the review on a phone. Only worth showing on a real screen —
   on a phone you'd be scanning the device you're already holding. */
.review-qr {
  display: none;
  margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line);
  align-items: center; gap: 1rem;
}
.review-qr img { width: 104px; height: 104px; flex: none; }
.review-qr p { color: var(--ink-soft); font-size: .88rem; margin: 0; }
@media (min-width: 640px) {
  .review-qr { display: flex; }
}

/* ---------- Instagram section ---------- */
.insta { background: var(--cream); }
.insta-feed { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.insta-social { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.insta-frame {
  width: 100%; max-width: 960px; min-height: 320px;
  border: 0; overflow: hidden; border-radius: 16px;
  box-shadow: var(--shadow-sm); background: var(--paper);
}

/* ---------- Reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero::before { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .craft-grid { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 520px; }
  .order-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav.open .nav-links { max-height: 480px; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 1rem var(--gutter); }
  .nav-links a.btn { margin: 1rem var(--gutter); text-align: center; justify-content: center; }
  .nav-links a:not(.btn)::after { display: none; }
}
@media (max-width: 560px) {
  .menu-grid { grid-template-columns: 1fr; max-width: 400px; margin-inline: auto; }
  .reviews-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .field-row { grid-template-columns: 1fr; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; justify-content: center; }
}
