/* ===========================================================
   City Farmers Market — custom styles
   Tailwind covers most of the layout; this file holds the
   things Tailwind can't express cleanly (patterns, slideshow,
   event card, lightbox, decorative hero tiles).
   =========================================================== */

:root {
  --brand-orange: #F26522;
  --brand-orange-dark: #D85412;
  --brand-orange-soft: #FFE7D6;
  --brand-green: #2E9E47;
  --brand-green-dark: #258139;
  --brand-green-soft: #DCF1E0;
  --brand-cream: #FFF8F0;
  --brand-ink: #1F2937;
  --brand-ink-soft: #6B7280;
}

html { scroll-behavior: smooth; }
body { -webkit-tap-highlight-color: transparent; }

/* Header shadow when scrolled */
#site-header.is-scrolled {
  box-shadow: 0 10px 30px -18px rgba(31, 41, 55, 0.18);
}

/* ---------- Hero decorative pattern ---------- */
.hero-pattern {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(46, 158, 71, 0.10) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 28%, rgba(242, 101, 34, 0.10) 0 2px, transparent 3px),
    radial-gradient(circle at 25% 78%, rgba(242, 101, 34, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 88%, rgba(46, 158, 71, 0.08) 0 2px, transparent 3px);
}

/* ---------- Hero produce tiles ---------- */
.produce-tile {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 14px 30px -14px rgba(31, 41, 55, 0.25);
  display: grid;
  place-items: center;
  font-size: 40px;
  line-height: 1;
  transition: transform .35s ease;
}
.produce-tile:hover { transform: translateY(-4px) rotate(0deg) !important; }
.produce-tile--sm { width: 60px; height: 60px; border-radius: 18px; font-size: 30px; }

@media (min-width: 768px) {
  .produce-tile { width: 96px; height: 96px; border-radius: 26px; font-size: 50px; }
  .produce-tile--sm { width: 72px; height: 72px; font-size: 36px; }
}

/* ===========================================================
   WEEKLY SALE SLIDESHOW
   =========================================================== */

.weekly-viewer__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 80vh;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.025) 0 14px, transparent 14px 28px),
    var(--brand-cream);
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: pan-y; /* allow vertical page scroll, capture horizontal */
}
@media (min-width: 768px) {
  .weekly-viewer__frame { aspect-ratio: 16 / 10; }
}
.weekly-viewer__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: opacity .25s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.weekly-viewer__frame img.is-swapping { opacity: 0; }

/* Slideshow arrows (overlay left/right edges) */
.slideshow__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 9999px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .92);
  color: var(--brand-ink);
  box-shadow: 0 12px 28px -14px rgba(31, 41, 55, .45);
  backdrop-filter: blur(6px);
  z-index: 2;
  transition: background .15s ease, color .15s ease, opacity .15s ease, transform .15s ease;
}
.slideshow__arrow svg { width: 20px; height: 20px; }
.slideshow__arrow:hover { background: var(--brand-orange); color: #fff; }
.slideshow__arrow:disabled { opacity: .35; cursor: not-allowed; }
.slideshow__arrow--prev { left: 12px; }
.slideshow__arrow--next { right: 12px; }

@media (min-width: 768px) {
  .slideshow__arrow { width: 52px; height: 52px; }
  .slideshow__arrow svg { width: 24px; height: 24px; }
  .slideshow__arrow--prev { left: 18px; }
  .slideshow__arrow--next { right: 18px; }
}

/* Slide counter pill (bottom-left) */
.slideshow__counter {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: .35rem .75rem;
  border-radius: 9999px;
  background: rgba(31, 41, 55, .85);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* Zoom button (bottom-right) */
.weekly-zoom {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  border-radius: 9999px;
  background: rgba(31, 41, 55, .85);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.weekly-zoom:hover { background: var(--brand-ink); }

/* Hide "View full size" label on small screens (icon-only) */
@media (max-width: 480px) {
  .weekly-zoom { padding: .55rem; }
  .weekly-zoom > :last-child:not(svg) { display: none; }
}

/* Placeholder rendered when no images are available */
.weekly-missing {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  padding: 2rem;
  text-align: center;
  color: var(--brand-ink-soft);
}
.weekly-missing svg { width: 56px; height: 56px; opacity: .55; margin-bottom: .75rem; }
.weekly-missing h4 { font-weight: 700; color: var(--brand-ink); margin-bottom: .25rem; }
.weekly-missing code {
  display: inline-block; margin: 0 .15rem;
  padding: .15rem .45rem; border-radius: .4rem;
  background: #fff; border: 1px solid rgba(0,0,0,.08);
  font-size: .8rem;
}

/* ===========================================================
   PROMOTIONS & EVENTS — event card
   =========================================================== */

.event-card {
  display: grid;
  grid-template-columns: 1fr;
  background: #fff;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 30px 60px -32px rgba(31, 41, 55, .25);
}
@media (min-width: 768px) {
  /* Desktop: image column sized by image's natural aspect, body column flexes.
     align-items: start keeps both columns anchored to the same top edge so the
     poster top and the date badge top sit on the same baseline. */
  .event-card {
    grid-template-columns: minmax(280px, 38%) 1fr;
    align-items: start;
  }
}

.event-card__media {
  position: relative;
  display: block;
  background: #1a0a08;
  overflow: hidden;
  line-height: 0; /* kill the inline-image gap so the cell hugs the image */
}
.event-card__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  object-position: top center;
  transition: transform .4s ease;
}
.event-card__media:hover img { transform: scale(1.02); }

.event-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
@media (min-width: 768px) {
  .event-card__body { padding: 2rem 2.25rem; }
}

/* Calendar-style date block */
.event-card__date {
  display: inline-grid;
  align-self: flex-start;
  width: max-content;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  text-align: center;
  line-height: 1.05;
  background: #fff;
}
.event-card__date .event-card__month {
  background: var(--brand-orange);
  color: #fff;
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .12em;
  padding: .4rem 1.25rem;
  text-transform: uppercase;
}
.event-card__date .event-card__day {
  font-weight: 800;
  font-size: 1.6rem;
  padding: .35rem 1rem .15rem;
  color: var(--brand-ink);
}
.event-card__date .event-card__year {
  font-size: .75rem;
  color: var(--brand-ink-soft);
  padding: 0 1rem .4rem;
  font-weight: 600;
}

.event-card__pill {
  align-self: flex-start;
  padding: .25rem .65rem;
  border-radius: 9999px;
  background: var(--brand-green-soft);
  color: var(--brand-green-dark);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.event-card__title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--brand-ink);
  line-height: 1.15;
}
.event-card__title span {
  color: var(--brand-ink-soft);
  font-weight: 600;
  font-size: .9em;
}
@media (min-width: 768px) {
  .event-card__title { font-size: 2rem; }
}

.event-card__subtitle {
  color: var(--brand-ink-soft);
  font-size: 1rem;
}

.event-card__meta {
  display: grid;
  gap: .5rem;
  margin-top: .25rem;
}
.event-card__meta li {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  color: var(--brand-ink);
  font-size: .95rem;
}
.event-card__meta svg {
  width: 18px; height: 18px;
  color: var(--brand-orange);
  margin-top: .1rem;
  flex: 0 0 auto;
}
.event-card__meta small {
  color: var(--brand-ink-soft);
  font-size: .85rem;
}

.event-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .25rem;
}
.event-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.2rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: .95rem;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.event-card__cta--primary {
  background: var(--brand-orange);
  color: #fff;
}
.event-card__cta--primary:hover { background: var(--brand-orange-dark); }
.event-card__cta--ghost {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, .12);
  color: var(--brand-ink);
}
.event-card__cta--ghost:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

/* ---------- Value cards ---------- */
.value-card {
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
}
.value-card h3 { font-weight: 800; font-size: 1.05rem; margin-top: 1rem; }
.value-card p { color: var(--brand-ink-soft); margin-top: .35rem; font-size: .95rem; }
.value-card__icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
}

/* ---------- Social buttons ---------- */
.social-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 9999px;
  background: var(--brand-cream);
  color: var(--brand-ink);
  transition: background .2s ease, color .2s ease;
}
.social-btn svg { width: 18px; height: 18px; }
.social-btn:hover { background: var(--brand-orange); color: #fff; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15, 23, 32, .92);
  z-index: 60;
  display: grid; place-items: center;
  padding: 1rem;
  animation: fadeIn .18s ease-out;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: .75rem;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
}
.lightbox__close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 9999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  backdrop-filter: blur(8px);
}
.lightbox__close:hover { background: rgba(255,255,255,.22); }

/* Lightbox prev/next + counter */
.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 9999px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  backdrop-filter: blur(8px);
  transition: background .15s ease, opacity .15s ease;
  z-index: 1;
}
.lightbox__arrow svg { width: 22px; height: 22px; }
.lightbox__arrow:hover { background: rgba(255, 255, 255, .26); }
.lightbox__arrow:disabled { opacity: .25; cursor: not-allowed; }
.lightbox__arrow--prev { left: 1rem; }
.lightbox__arrow--next { right: 1rem; }
@media (min-width: 768px) {
  .lightbox__arrow { width: 56px; height: 56px; }
  .lightbox__arrow svg { width: 26px; height: 26px; }
  .lightbox__arrow--prev { left: 1.5rem; }
  .lightbox__arrow--next { right: 1.5rem; }
}
.lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .4rem .9rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .03em;
  backdrop-filter: blur(8px);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
