/* Z8Z Eggs — static farm stand
   Brand: patriotic red #B22234, blue #3C3B6E
   Edit prices in index.html only.
   MOBILE REPAIR 2026-08: phone-first (320–480), then tablet, zero horizontal scroll.
*/

:root {
  --red: #b22234;
  --red-dark: #8f1b29;
  --blue: #3c3b6e;
  --blue-dark: #2a294f;
  --cream: #faf7f2;
  --cream-dark: #f0ebe3;
  --text: #1a1a1a;
  /* CHANGE: slightly darker muted for phone readability */
  --muted: #4a4a4a;
  --white: #ffffff;
  --shadow: 0 8px 24px rgba(60, 59, 110, 0.12);
  --radius: 12px;
  --max: 1080px;
  /* CHANGE: slightly shorter sticky bar on phones; desktop overrides below */
  --header-h: 64px;
  /* CHANGE: shared min touch size */
  --tap: 48px;
  /* CHANGE: tighter side gutter on small phones */
  --gutter: 0.875rem;
}

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

html {
  scroll-behavior: smooth;
  /* CHANGE: keep anchors clear of sticky header */
  scroll-padding-top: calc(var(--header-h) + 16px);
  /* CHANGE: kill accidental horizontal scroll on phones */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* CHANGE: fluid body type — never huge/tiny on 320–480 */
  font-size: clamp(0.95rem, 0.9rem + 0.35vw, 1.05rem);
  line-height: 1.55;
  color: var(--text);
  background: var(--cream);
  overflow-x: clip;
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* CHANGE: default contain — section images override with cover where intentional */
  object-fit: contain;
}

a {
  color: var(--blue);
}

a:hover {
  color: var(--red);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.container {
  /* CHANGE: fluid gutters; min 100% - gutters so 320px never overflows */
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin-inline: auto;
  max-width: 100%;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--red) 0%, var(--blue) 100%);
  color: var(--white);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  /* CHANGE: prevent brand/hamburger collision */
  gap: 0.5rem 0.75rem;
  min-height: var(--header-h);
  /* CHANGE: tighter vertical padding on phones */
  padding-block: 0.45rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  /* CHANGE: brand yields space to hamburger; never collides */
  flex: 1 1 auto;
  max-width: calc(100% - var(--tap) - 0.75rem);
}

.brand:hover {
  color: inherit;
  opacity: 0.95;
}

.brand-logo {
  /* CHANGE: slightly smaller logo on phones for breathing room */
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--white);
  flex-shrink: 0;
  /* CHANGE: fixed box so logo never crops oddly */
  aspect-ratio: 1 / 1;
}

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

.brand-text strong {
  /* CHANGE: clamp brand name so it stays readable, never overflows */
  font-size: clamp(1.05rem, 0.95rem + 1.2vw, 1.25rem);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  /* CHANGE: fluid subtitle */
  font-size: clamp(0.7rem, 0.65rem + 0.4vw, 0.8rem);
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.header-phone {
  display: none;
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  /* CHANGE: touch-friendly when shown */
  min-height: var(--tap);
  align-items: center;
  padding: 0 0.25rem;
}

.header-phone:hover {
  color: var(--white);
  text-decoration: underline;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  /* CHANGE: 48px thumb target */
  width: var(--tap);
  height: var(--tap);
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  /* CHANGE: remove default button look */
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  color: inherit;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 1px;
  /* CHANGE: animate open/close bars */
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* CHANGE: X icon when menu open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
  width: 100%;
  order: 10;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  margin-bottom: 0.35rem;
  /* CHANGE: full-bleed feel under header actions */
  flex-basis: 100%;
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.site-nav a {
  display: flex;
  align-items: center;
  /* CHANGE: big full-width tap targets */
  min-height: var(--tap);
  padding: 0.85rem 1rem;
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  -webkit-tap-highlight-color: transparent;
}

.site-nav a:hover,
.site-nav a:active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

/* Tablet+ header */
@media (min-width: 480px) {
  :root {
    --gutter: 1rem;
    --header-h: 68px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand {
    gap: 0.65rem;
  }
}

@media (min-width: 768px) {
  :root {
    --header-h: 72px;
    --gutter: 1rem;
  }

  .header-bar {
    flex-wrap: nowrap;
    padding-block: 0.6rem;
  }

  .brand {
    flex: 0 1 auto;
    max-width: none;
    gap: 0.75rem;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .header-phone {
    display: inline-flex;
  }

  .nav-toggle {
    display: none;
  }

  .header-actions {
    margin-left: 0;
    order: 3;
  }

  .brand {
    order: 1;
  }

  .site-nav {
    display: block;
    width: auto;
    order: 2;
    flex: 1;
    flex-basis: auto;
    margin: 0 0.5rem;
    background: transparent;
  }

  .site-nav ul {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.15rem;
    padding: 0;
  }

  .site-nav a {
    display: block;
    min-height: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
  }

  /* CHANGE: reset hamburger X transforms if resize mid-open */
  .nav-toggle[aria-expanded="true"] span {
    transform: none;
    opacity: 1;
  }
}

/* —— Hero —— */
.hero {
  position: relative;
  color: var(--white);
  background: var(--blue);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(178, 34, 52, 0.82) 0%, rgba(60, 59, 110, 0.88) 55%, rgba(42, 41, 79, 0.92) 100%),
    url("../images/farm-scene.jpg") center / cover no-repeat;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
  /* CHANGE: reduced mobile hero padding (was 3.5/3.75) */
  padding: 1.75rem 0 2rem;
}

.hero h1 {
  margin: 0 0 0.55rem;
  /* CHANGE: aggressive clamp so h1 fits 320px without overflow */
  font-size: clamp(1.45rem, 1.15rem + 3.2vw, 2.75rem);
  line-height: 1.18;
  max-width: 18ch;
  /* CHANGE: prevent long words from forcing scroll */
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero-lead {
  margin: 0 0 0.4rem;
  /* CHANGE: fluid lead */
  font-size: clamp(1rem, 0.95rem + 0.5vw, 1.15rem);
  line-height: 1.4;
  max-width: 36ch;
  opacity: 0.96;
}

.hero-sub {
  margin: 0 0 1.25rem;
  max-width: 40ch;
  opacity: 0.92;
  /* CHANGE: fluid sub + tighter line-height */
  font-size: clamp(0.9rem, 0.86rem + 0.35vw, 0.98rem);
  line-height: 1.45;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  /* CHANGE: stack cleanly on narrow screens */
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.hero-ctas .btn {
  /* CHANGE: full-width stacked CTAs with 48px min height */
  width: 100%;
  min-height: var(--tap);
  justify-content: center;
  text-align: center;
}

/* CHANGE: hero spacing roomier on larger phones / tablet */
@media (min-width: 480px) {
  .hero .container {
    padding: 2.5rem 0 2.75rem;
  }

  .hero-ctas {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .hero-ctas .btn {
    width: auto;
    min-width: min(100%, 12rem);
  }
}

@media (min-width: 768px) {
  .hero .container {
    padding: 3.5rem 0 3.75rem;
  }

  .hero h1 {
    max-width: 16ch;
    line-height: 1.15;
  }

  .hero-sub {
    margin-bottom: 1.75rem;
  }

  .hero-ctas {
    gap: 0.75rem;
  }
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  /* CHANGE: padding + min-height for thumb targets */
  padding: 0.75rem 1.15rem;
  min-height: var(--tap);
  border-radius: 10px;
  font-weight: 700;
  /* CHANGE: fluid button type */
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1rem);
  line-height: 1.25;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  /* CHANGE: avoid wrap mid-word on long CTA labels */
  white-space: normal;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--white);
  color: var(--blue);
}

.btn-primary:hover {
  background: var(--cream);
  color: var(--blue-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.75);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.btn-red {
  background: var(--red);
  color: var(--white);
}

.btn-red:hover {
  background: var(--red-dark);
  color: var(--white);
}

.btn-blue {
  background: var(--blue);
  color: var(--white);
}

.btn-blue:hover {
  background: var(--blue-dark);
  color: var(--white);
}

.btn-outline {
  background: var(--white);
  color: var(--blue);
  border-color: var(--blue);
}

.btn-outline:hover {
  background: var(--cream);
  color: var(--blue-dark);
}

/* —— Sections —— */
.section {
  /* CHANGE: fluid section padding — tight on phones, roomy on desktop */
  padding: clamp(1.75rem, 4vw, 3rem) 0;
}

.section-alt {
  background: var(--white);
}

.section-head {
  text-align: center;
  /* CHANGE: tighter head margin on mobile */
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.section-head h2 {
  margin: 0 0 0.5rem;
  /* CHANGE: clamp section titles for phones */
  font-size: clamp(1.4rem, 1.2rem + 1.5vw, 2rem);
  line-height: 1.2;
  color: var(--blue);
}

.section-head p {
  margin: 0 auto;
  max-width: 42ch;
  color: var(--muted);
  /* CHANGE: readable muted body on small screens */
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  line-height: 1.5;
  padding-inline: 0.25rem;
}

.badge {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(178, 34, 52, 0.1);
  color: var(--red);
  font-weight: 700;
  /* CHANGE: fluid badge text */
  font-size: clamp(0.82rem, 0.78rem + 0.3vw, 0.9rem);
  line-height: 1.3;
  max-width: 100%;
}

/* —— Pricing cards —— */
.price-grid {
  display: grid;
  /* CHANGE: consistent single-column gap on phones */
  gap: 1rem;
  grid-template-columns: 1fr;
  /* CHANGE: avoid awkward stretch whitespace */
  align-items: stretch;
}

/* CHANGE: 2-col only on comfortable tablets; 3-col at larger */
@media (min-width: 640px) {
  .price-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.price-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* CHANGE: balanced card padding on phones */
  padding: 1.25rem 1.1rem;
  text-align: center;
  border: 1px solid rgba(60, 59, 110, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  /* CHANGE: no min-height that creates empty space */
  min-width: 0;
}

.section-alt .price-card {
  background: var(--cream);
}

.price-card h3 {
  margin: 0;
  /* CHANGE: clamp card titles so long names wrap cleanly */
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.1rem);
  line-height: 1.3;
  color: var(--blue);
  max-width: 100%;
}

.price-card .price {
  margin: 0.2rem 0;
  /* CHANGE: fluid price figure */
  font-size: clamp(1.75rem, 1.5rem + 1.5vw, 2rem);
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.price-card .unit {
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 0.95rem);
  color: var(--muted);
  font-weight: 600;
}

.price-note {
  margin: 1.5rem auto 0;
  max-width: 48ch;
  text-align: center;
  color: var(--muted);
  font-size: clamp(0.92rem, 0.88rem + 0.3vw, 0.98rem);
  line-height: 1.55;
  /* CHANGE: slight side pad so text doesn't hug edges on 320px */
  padding-inline: 0.15rem;
}

.eggs-photo {
  margin: 0 auto 1.5rem;
  max-width: 420px;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.eggs-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  /* CHANGE: avoid layout shift / stretch */
  object-position: center;
}

/* —— How to buy —— */
.buy-layout {
  display: grid;
  /* CHANGE: consistent stack gap under 768 */
  gap: 1.15rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .buy-layout {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
    gap: 1.5rem;
  }
}

.buy-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* CHANGE: slightly tighter padding on phones */
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.1rem, 3vw, 1.5rem);
  border: 1px solid rgba(60, 59, 110, 0.08);
  min-width: 0;
}

.buy-card h3 {
  margin: 0 0 0.75rem;
  color: var(--blue);
  font-size: clamp(1.1rem, 1.05rem + 0.4vw, 1.2rem);
  line-height: 1.25;
}

/* CHANGE: class for second buy step heading (was inline style) */
.buy-card h3.buy-step-2 {
  margin-top: 1.5rem;
}

.buy-card p {
  /* CHANGE: readable body in buy card */
  color: var(--text);
  line-height: 1.55;
  margin: 0 0 0.5rem;
  overflow-wrap: break-word;
}

.venmo-handle {
  /* CHANGE: flex + min-height for thumb-friendly Venmo handle */
  display: flex;
  align-items: center;
  margin: 0.5rem 0 1rem;
  /* CHANGE: clamp handle so @Z8ZEggs never overflows 320px */
  font-size: clamp(1.5rem, 1.2rem + 2.5vw, 2.4rem);
  font-weight: 800;
  color: var(--red);
  text-decoration: none;
  letter-spacing: 0.02em;
  word-break: break-word;
  line-height: 1.15;
  min-height: var(--tap);
}

.venmo-handle:hover {
  color: var(--red-dark);
  text-decoration: underline;
}

.buy-steps {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.5;
}

.buy-steps li {
  margin-bottom: 0.55rem;
  padding-left: 0.15rem;
}

.buy-steps li:last-child {
  margin-bottom: 0;
}

.qr-card {
  text-align: center;
  background: var(--cream);
  border-radius: var(--radius);
  padding: clamp(1.15rem, 3vw, 1.5rem);
  border: 1px solid rgba(60, 59, 110, 0.08);
  min-width: 0;
}

.qr-card img {
  /* CHANGE: fluid QR with fixed aspect; never stretches */
  width: min(200px, 70vw);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin: 0 auto 1rem;
  background: var(--white);
  border-radius: 8px;
  padding: 8px;
}

.qr-card p {
  margin: 0;
  font-size: clamp(0.85rem, 0.82rem + 0.2vw, 0.9rem);
  color: var(--muted);
  line-height: 1.45;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.contact-row .btn {
  width: 100%;
}

/* CHANGE: side-by-side contact buttons when there's room */
@media (min-width: 400px) {
  .contact-row {
    flex-direction: row;
  }

  .contact-row .btn {
    width: auto;
    flex: 1 1 auto;
    min-width: min(100%, 9.5rem);
  }
}

/* —— Location —— */
.location-grid {
  display: grid;
  /* CHANGE: single column + consistent gaps below 640 */
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .location-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 1.5rem);
  border: 1px solid rgba(60, 59, 110, 0.08);
  min-width: 0;
}

.info-card h3 {
  margin: 0 0 0.75rem;
  color: var(--blue);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.15rem);
  line-height: 1.25;
}

.info-card p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  line-height: 1.5;
  /* CHANGE: improve muted readability */
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
}

.info-card p:last-child {
  margin-bottom: 0;
}

.info-card a {
  font-weight: 600;
  /* CHANGE: phone link easy to tap */
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
}

/* CHANGE: class for hours phone spacing (was inline style) */
.info-card .hours-phone {
  margin-top: 1rem;
}

.map-link {
  display: inline-flex;
  margin-top: 0.75rem;
  /* CHANGE: full-width maps CTA on very small screens */
  max-width: 100%;
}

@media (max-width: 399px) {
  .map-link {
    width: 100%;
    justify-content: center;
  }
}

/* —— Footer —— */
.site-footer {
  background: var(--blue);
  color: var(--white);
  padding: clamp(1.5rem, 3vw, 2rem) 0;
  text-align: center;
}

.site-footer a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  /* CHANGE: footer links as touch targets */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.25rem 0.5rem;
}

.site-footer a:hover {
  text-decoration: underline;
  color: var(--white);
}

.footer-brand {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.15rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /* CHANGE: tighter wrap gaps on phones */
  gap: 0.15rem 0.5rem;
  margin: 0.35rem 0;
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 0.95rem);
}

.footer-copy {
  margin: 0.75rem 0 0;
  font-size: clamp(0.8rem, 0.78rem + 0.15vw, 0.85rem);
  opacity: 0.85;
  line-height: 1.4;
  padding-inline: 0.5rem;
}

/* —— Utility —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— CHANGE: extra-small phone polish (320–360) —— */
@media (max-width: 360px) {
  :root {
    --gutter: 0.75rem;
    --header-h: 60px;
  }

  .hero .container {
    padding: 1.4rem 0 1.65rem;
  }

  .hero h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.55rem);
    line-height: 1.2;
    max-width: none;
  }

  .price-card {
    padding: 1.1rem 0.95rem;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }
}

/* —— CHANGE: tablet mid-band (641–767) — cards 3-col already; buy still stacks —— */
@media (min-width: 641px) and (max-width: 767px) {
  .hero .container {
    padding: 2.75rem 0 3rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}

/* —— CHANGE: reduce motion for accessibility —— */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .nav-toggle span {
    transition: none;
  }
}
)
