/* Fruity Fresh — Product Showcase Page Stylesheet */
/* Pairs with base.css (chrome + tokens) and product-showcase.js (lightbox). */

/* ══════════════════════════════════════════════
   SECTION BANDS
══════════════════════════════════════════════ */
.ps-section {
  padding: 90px clamp(20px,5vw,64px);
  position: relative;
  overflow: hidden;
}
.ps-band-light { background: linear-gradient(160deg,#fff8fb 0%,#f8ffff 100%); }
.ps-band-white { background: #fff; }
.ps-band-dark  { background: linear-gradient(135deg,#140820 0%,#2d0a4e 100%); }

/* Atmospheric ambient layers — very subtle, opacity-light radial orbs. */
.ps-band-light::before,
.ps-band-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.ps-band-light::before {
  background:
    radial-gradient(ellipse 720px 460px at 12% 25%, rgba(255,107,157,.07), transparent 65%),
    radial-gradient(ellipse 660px 420px at 88% 78%, rgba(78,205,196,.055), transparent 65%);
}
.ps-band-dark::before {
  background:
    radial-gradient(ellipse 700px 480px at 18% 22%, rgba(255,107,157,.11), transparent 65%),
    radial-gradient(ellipse 620px 420px at 82% 78%, rgba(78,205,196,.08), transparent 65%);
}

.ps-wrap {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════
   SECTION HEAD (kicker + title)
══════════════════════════════════════════════ */
.ps-head { text-align: center; margin-bottom: 48px; }
.ps-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.ps-kicker-on-dark { color: var(--accent); }
.ps-title {
  font-family: var(--FD); font-weight: 700;
  font-size: clamp(28px, 3.6vw, 44px);
  color: #140820; line-height: 1.2;
}
.ps-title-on-dark { color: #fff; }

/* ══════════════════════════════════════════════
   GRID SYSTEM (strict aspect-ratio, no masonry)
══════════════════════════════════════════════ */
.ps-grid {
  display: grid;
  gap: 32px;
}
.ps-grid-single { grid-template-columns: minmax(0, 560px); justify-content: center; }
/* Hero feature — solo centered artwork, slightly larger than .ps-grid-single */
.ps-grid-feature { grid-template-columns: minmax(0, 620px); justify-content: center; }
.ps-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Editorial asymmetric pair — hero + secondary */
.ps-grid-asym {
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: center;
}
/* Collectible nutrition cards — readability over density */
.ps-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1400px) {
  .ps-grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ══════════════════════════════════════════════
   TILE
══════════════════════════════════════════════ */
.ps-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3/4;
  background: #fff;
  border: 0; padding: 0; margin: 0;
  border-radius: 22px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 10px 32px rgba(45,27,51,.10);
  transition: transform .3s ease, box-shadow .3s ease;
}
.ps-band-dark .ps-tile {
  box-shadow: 0 12px 36px rgba(0,0,0,.45);
}
.ps-tile:hover {
  transform: translateY(-6px) scale(1.008);
  box-shadow: 0 22px 56px rgba(45,27,51,.18);
}
.ps-band-dark .ps-tile:hover {
  box-shadow: 0 22px 56px rgba(0,0,0,.55), 0 0 36px rgba(255,107,157,.14);
}
.ps-tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.ps-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity .35s ease;
}
.ps-tile img.is-loaded { opacity: 1; }

/* ══════════════════════════════════════════════
   FEATURE CAPTION (under solo cover artwork)
══════════════════════════════════════════════ */
.ps-feature-caption {
  max-width: 560px;
  margin: 28px auto 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: #6B4D7A;
  font-style: italic;
}

/* ══════════════════════════════════════════════
   COLLECTIONS STAGGER (desktop magazine rhythm)
   Visual offset only — does not affect layout.
══════════════════════════════════════════════ */
@media (min-width: 901px) {
  .ps-band-white .ps-tile:nth-child(even) {
    transform: translateY(22px);
  }
  .ps-band-white .ps-tile:nth-child(even):hover {
    transform: translateY(16px) scale(1.008);
  }
}

/* ══════════════════════════════════════════════
   TILE WRAP + PER-TILE DOWNLOAD ICON (nutrition)
══════════════════════════════════════════════ */
.ps-tile-wrap { position: relative; }
.ps-download {
  position: absolute;
  top: 12px; right: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--dark);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(45,27,51,.20);
  border: 1px solid rgba(255,255,255,.6);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .22s ease, transform .22s ease, background .2s, color .2s;
  z-index: 3;
  text-decoration: none;
}
.ps-tile-wrap:hover .ps-download,
.ps-download:focus-visible {
  opacity: 1;
  transform: translateY(0);
}
.ps-download:hover {
  background: var(--accent);
  color: #fff;
}
.ps-download:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Touch devices: keep icon visible but subtle (no hover surface to reveal on) */
@media (hover: none) {
  .ps-download { opacity: .92; transform: none; }
}

/* ══════════════════════════════════════════════
   CLOSING CTA
══════════════════════════════════════════════ */
.ps-cta {
  padding: 100px clamp(20px,5vw,64px);
  background: linear-gradient(135deg,#140820 0%,#2d0a4e 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ps-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 50% 0%, rgba(255,107,157,.13), transparent 65%),
    radial-gradient(ellipse 520px 400px at 50% 100%, rgba(78,205,196,.08), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.ps-cta-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.ps-cta-title {
  font-family: var(--FD); font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  color: #fff; line-height: 1.2;
  margin: 8px 0 16px;
}
.ps-cta-sub {
  font-size: 16px; line-height: 1.75;
  color: rgba(255,255,255,.7);
  margin-bottom: 32px;
}
.ps-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dk));
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 14px 32px; border-radius: 999px;
  box-shadow: 0 12px 32px rgba(255,107,157,.42);
  transition: transform .22s, box-shadow .22s;
}
.ps-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(255,107,157,.55);
}

/* ══════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════ */
.ps-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14,5,22,.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.ps-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease, visibility 0s linear 0s;
}
.ps-lb-stage {
  max-width: 95vw;
  max-height: 92vh;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; /* let custom pinch/pan handlers own gestures */
}
.ps-lb-img {
  max-width: 95vw;
  max-height: 92vh;
  width: auto; height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform .22s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.ps-lb-img.is-zoomed { cursor: grab; transition: none; }
.ps-lb-img.is-panning { cursor: grabbing; transition: none; }

.ps-lb-close, .ps-lb-prev, .ps-lb-next, .ps-lb-download {
  position: fixed;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .2s, transform .2s, border-color .2s;
  z-index: 2;
}
.ps-lb-close {
  top: 18px; right: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ps-lb-download {
  top: 18px; left: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.ps-lb-download[hidden] { display: none !important; }
.ps-lb-prev, .ps-lb-next {
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.ps-lb-prev { left: 18px; }
.ps-lb-next { right: 18px; }
.ps-lb-close:hover, .ps-lb-prev:hover, .ps-lb-next:hover, .ps-lb-download:hover {
  background: rgba(255,107,157,.28);
  border-color: rgba(255,107,157,.55);
}
.ps-lb-prev:hover, .ps-lb-next:hover { transform: translateY(-50%) scale(1.05); }
.ps-lb-close:focus-visible, .ps-lb-prev:focus-visible, .ps-lb-next:focus-visible, .ps-lb-download:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ps-lb-hint {
  position: fixed;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255,255,255,.45);
  pointer-events: none;
  z-index: 2;
}
@media (hover: none) { .ps-lb-hint { display: none; } }

/* ══════════════════════════════════════════════
   REVEAL (re-asserted in case base.css load order matters)
══════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s ease, transform .65s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 800px) {
  .ps-section { padding: 60px 20px; }
  .ps-head { margin-bottom: 36px; }
  .ps-grid { gap: 22px; }
  .ps-grid-asym { grid-template-columns: 1fr; gap: 22px; align-items: stretch; }
  .ps-grid-cards { gap: 22px; }
  .ps-tile { border-radius: 18px; }
  .ps-cta { padding: 70px 20px; }
  .page-hero { padding: 100px 20px 60px; }
  .ps-feature-caption { margin-top: 22px; font-size: 13.5px; }
  .ps-lb-close { top: 12px; right: 12px; width: 40px; height: 40px; }
  .ps-lb-download { top: 12px; left: 12px; width: 40px; height: 40px; }
  .ps-lb-prev, .ps-lb-next { width: 42px; height: 42px; }
  .ps-lb-prev { left: 10px; }
  .ps-lb-next { right: 10px; }
  .ps-lb-stage, .ps-lb-img { max-width: 96vw; max-height: 84vh; }
}
@media (max-width: 680px) {
  .ps-grid-2 { grid-template-columns: 1fr; }
  .ps-grid-cards { grid-template-columns: 1fr; }
  .ps-grid-single, .ps-grid-feature { grid-template-columns: minmax(0, 1fr); }
}

/* ══════════════════════════════════════════════
   REDUCED MOTION
══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ps-tile, .ps-tile img, .ps-cta-btn, .ps-lightbox,
  .ps-lb-close, .ps-lb-prev, .ps-lb-next, .ps-lb-download,
  .ps-lb-img, .ps-download, .reveal {
    transition: none !important;
    animation: none !important;
  }
  .ps-tile img { opacity: 1; }
  .reveal { opacity: 1; transform: none; }
}
