/* ==========================================================================
   Malwa Fresh — Design tokens
   Kheti Green / Sarson Yellow / Mitti Rust / warm paper base
   ========================================================================== */

:root {
  /* Brand palette */
  --color-green: #2c4227;
  --color-green-dark: #1b2917;
  --color-green-deep: #16210f;
  --color-yellow: #c99a2e;
  --color-yellow-light: #e0b752;
  --color-rust: #a63d2c;
  --color-rust-dark: #832f21;
  --color-paper: #f2e9d6;
  --color-paper-deep: #e7dabd;
  --color-cream: #faf5e8;
  --color-ink: #211d16;
  --color-ink-soft: #4a4436;

  /* Semantic */
  --bg-body: var(--color-paper);
  --bg-card: var(--color-cream);
  --text-body: var(--color-ink);
  --text-muted: var(--color-ink-soft);
  --border-strong: var(--color-ink);

  /* Type */
  --font-display: "Fjalla One", "Arial Narrow", sans-serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  /* Layout */
  --max-width: 1200px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --shadow-card: 0 6px 20px rgba(33, 29, 22, 0.12);
  --shadow-stamp: 3px 3px 0 var(--color-rust);
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-body);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.08;
  text-transform: uppercase;
}

p {
  margin: 0;
}

button {
  font-family: inherit;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Accessibility utilities
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  z-index: 1000;
  background: var(--color-green);
  color: var(--color-paper);
  padding: 0.9em 1.4em;
  font-family: var(--font-mono);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

.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;
}

:focus-visible {
  outline: 3px solid var(--color-rust);
  outline-offset: 3px;
}

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 0.9em 1.6em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--color-yellow);
  color: var(--color-ink);
  border-color: var(--color-ink);
  box-shadow: 3px 3px 0 var(--color-ink);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--color-ink);
}

.btn-primary:active {
  transform: translate(0, 0);
  box-shadow: 1px 1px 0 var(--color-ink);
}

.btn-outline {
  background: transparent;
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-outline:hover {
  background: var(--color-paper);
  color: var(--color-green-dark);
}

.btn-secondary {
  background: var(--color-green);
  color: var(--color-paper);
  border-color: var(--color-green);
}

.btn-secondary:hover {
  background: var(--color-green-dark);
  border-color: var(--color-green-dark);
}

/* ==========================================================================
   Crate-tag / mandi price-tag motif — the signature element
   ========================================================================== */

.crate-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-ink);
  background: var(--color-paper);
  border: 2px solid var(--color-ink);
  padding: 0.4em 1em;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-stamp);
  position: relative;
}

.crate-tag::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(33, 17, 17, 0.35);
  pointer-events: none;
}

.crate-tag--alt {
  transform: rotate(2deg);
  background: var(--color-green);
  color: var(--color-paper);
  border-color: var(--color-paper);
  box-shadow: 3px 3px 0 var(--color-yellow);
}

.crate-tag--alt::before {
  border-color: rgba(242, 233, 214, 0.35);
}

.section-eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--color-rust);
  display: inline-block;
  margin-bottom: var(--space-2);
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--color-paper);
  border-bottom: 3px solid var(--color-ink);
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 18px rgba(33, 29, 22, 0.18);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.7rem;
  gap: var(--space-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-ink);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  border: 2px solid var(--color-ink);
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  line-height: 1;
}

.brand-word span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--color-rust);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-links a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  padding-block: 0.3rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  border-color: var(--color-rust);
  color: var(--color-rust);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-md);
  background: var(--color-cream);
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-ink);
  margin-inline: auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.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);
}

@media (max-width: 880px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-paper);
    border-bottom: 3px solid var(--color-ink);
    padding-inline: var(--space-3);
    padding-block: 0;
    gap: var(--space-2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding-block 0.25s ease;
  }

  .nav-links.is-open {
    max-height: 400px;
    padding-block: var(--space-3);
    border-bottom-width: 3px;
  }
}

/* ==========================================================================
   Hero — scroll-scrub animation
   ========================================================================== */

.hero-scrub {
  position: relative;
  height: 400vh;
  padding-block: 0;
  background: var(--color-green-deep);
}

.hero-scrub__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: min(92vh, 780px);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background-image: url("hero-banner.jpeg");
  background-size: cover;
  background-position: center;
}

.hero-scrub__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(22, 33, 15, 0.92) 0%, rgba(22, 33, 15, 0.55) 42%, rgba(22, 33, 15, 0.15) 68%, rgba(22, 33, 15, 0.35) 100%);
}

.hero-scrub__content {
  position: relative;
  z-index: 2;
  color: var(--color-paper);
  padding-block: var(--space-5) var(--space-5);
  width: 100%;
}

.hero-scrub__content .crate-tag {
  margin-bottom: var(--space-3);
}

/* Respect prefers-reduced-motion: collapse to a single static frame, no scrub */
@media (prefers-reduced-motion: reduce) {
  .hero-scrub {
    height: min(92vh, 780px);
  }

  .hero-scrub__sticky {
    position: relative;
    top: auto;
    height: 100%;
    background-image: url("hero-frames/hero-109.jpg");
  }

  .hero-scrub__canvas {
    display: none;
  }
}

.hero-title {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  color: var(--color-paper);
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.35);
}

.hero-title em {
  font-style: normal;
  color: var(--color-yellow-light);
}

.hero-tagline {
  margin-top: var(--space-2);
  max-width: 46ch;
  font-size: 1.15rem;
  color: var(--color-paper);
}

.hero-actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ==========================================================================
   Sections
   ========================================================================== */

section {
  padding-block: var(--space-6);
}

.section-header {
  max-width: 62ch;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.section-lede {
  margin-top: var(--space-2);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* ---- About / Our Story ---- */

.about {
  background: var(--color-cream);
  border-top: 3px solid var(--color-ink);
  border-bottom: 3px solid var(--color-ink);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: start;
}

.about-copy p {
  margin-bottom: var(--space-3);
  font-size: 1.05rem;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-media {
  position: sticky;
  top: 100px;
}

.about-media figure {
  margin: 0;
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.about-media img {
  width: 100%;
  height: 380px;
  object-fit: cover;
}

.about-media figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--color-green);
  color: var(--color-paper);
  padding: 0.7em 1em;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-media {
    position: static;
    order: -1;
  }
}

/* ---- Markets ---- */

.markets {
  background: var(--color-green);
  color: var(--color-paper);
  border-bottom: 3px solid var(--color-ink);
}

.markets .section-lede {
  color: rgba(242, 233, 214, 0.82);
}

.next-market {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  background: var(--color-green-dark);
  border: 2px dashed var(--color-yellow);
  color: var(--color-paper);
  padding: 0.9em 1.3em;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  display: inline-block;
  max-width: 100%;
}

.next-market strong {
  color: var(--color-yellow-light);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 860px) {
  .market-grid {
    grid-template-columns: 1fr;
  }
}

.market-card {
  background: var(--color-cream);
  color: var(--color-ink);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
}

.market-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.market-card-head .crate-tag {
  transform: rotate(-3deg);
}

.market-venue {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}

.market-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.market-detail {
  flex: 1 1 200px;
  display: flex;
  gap: 0.7em;
  align-items: flex-start;
  background: var(--color-paper);
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-md);
  padding: 0.8em 1em;
}

.market-detail .icon {
  flex-shrink: 0;
  margin-top: 0.15em;
  color: var(--color-rust);
}

.market-detail address {
  font-style: normal;
  font-size: 0.98rem;
  line-height: 1.4;
}

.market-detail .time-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.market-detail .detail-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.2em;
}

.map-frame {
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  line-height: 0;
}

.map-frame iframe {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}

/* ---- Produce preview / gallery grid ---- */

.produce-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

@media (max-width: 980px) {
  .produce-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .produce-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.produce-card {
  position: relative;
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-cream);
  box-shadow: var(--shadow-card);
}

.produce-card figure {
  margin: 0;
}

.produce-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.produce-card button {
  all: unset;
  display: block;
  cursor: pointer;
  width: 100%;
}

.produce-card button:hover img,
.produce-card button:focus-visible img {
  transform: scale(1.06);
}

.produce-card figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.7em 0.9em;
  border-top: 2px solid var(--color-ink);
  background: var(--color-cream);
}

.produce-preview-cta {
  margin-top: var(--space-4);
  text-align: center;
}

/* ---- Why Malwa Fresh ---- */

.why {
  background: var(--color-paper-deep);
  border-bottom: 3px solid var(--color-ink);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

@media (max-width: 980px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

.why-card {
  background: var(--color-cream);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.why-card .crate-tag {
  margin-bottom: var(--space-2);
  font-size: 0.7rem;
}

.why-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  text-transform: none;
}

.why-card p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ---- Follow us ---- */

.social {
  background: var(--color-ink);
  color: var(--color-paper);
}

.social-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.social-copy h2 {
  color: var(--color-paper);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}

.social-copy p {
  margin-top: var(--space-2);
  color: rgba(242, 233, 214, 0.8);
  max-width: 50ch;
}

.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.follower-count {
  font-family: var(--font-mono);
  color: var(--color-yellow-light);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin-top: var(--space-1);
  display: inline-block;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--color-green-deep);
  color: var(--color-paper);
  padding-block: var(--space-5) var(--space-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(242, 233, 214, 0.2);
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

.footer-brand .brand-word {
  color: var(--color-paper);
}

.footer-brand p {
  margin-top: var(--space-2);
  color: rgba(242, 233, 214, 0.75);
  max-width: 34ch;
}

.footer-heading {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--color-yellow-light);
  margin-bottom: var(--space-2);
}

.footer-market {
  margin-bottom: var(--space-2);
  font-size: 0.95rem;
  line-height: 1.5;
}

.footer-market strong {
  display: block;
  color: var(--color-paper);
}

.footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  margin-bottom: 0.6em;
  color: var(--color-paper);
  border-bottom: 1px solid transparent;
}

.footer-contact a:hover {
  border-color: var(--color-yellow-light);
}

.footer-bottom {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(242, 233, 214, 0.6);
}

/* ==========================================================================
   Produce.html specific
   ========================================================================== */

.page-banner {
  background: var(--color-green);
  color: var(--color-paper);
  border-bottom: 3px solid var(--color-ink);
  padding-block: var(--space-5);
}

.page-banner .section-title {
  color: var(--color-paper);
}

.page-banner p {
  margin-top: var(--space-2);
  max-width: 62ch;
  color: rgba(242, 233, 214, 0.85);
  font-size: 1.05rem;
}

.produce-category {
  margin-bottom: var(--space-5);
}

.produce-category:last-child {
  margin-bottom: 0;
}

.produce-category-title {
  font-size: 1.6rem;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.produce-category-title::after {
  content: "";
  flex: 1;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--color-ink) 0 10px, transparent 10px 18px);
}

.gallery-closing {
  background: var(--color-cream);
  border-top: 3px solid var(--color-ink);
  text-align: center;
}

.gallery-closing .section-header {
  margin-inline: auto;
  text-align: center;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(22, 17, 10, 0.92);
  padding: var(--space-3);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: min(90vw, 1000px);
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-inner img {
  max-height: 76vh;
  width: auto;
  max-width: 100%;
  border: 3px solid var(--color-paper);
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--color-ink);
}

.lightbox-caption {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  color: var(--color-paper);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

.lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-yellow);
  border: 2px solid var(--color-ink);
  color: var(--color-ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 600px) {
  .lightbox-close {
    top: -50px;
    right: 0;
  }
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--color-paper);
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-paper);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: var(--color-rust);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

@media (max-width: 900px) {
  .lightbox-prev {
    left: 4px;
  }

  .lightbox-next {
    right: 4px;
  }
}
