/* ============================================================
   Shop Showcase Section — Floating Books Edition
   Enqueued on the homepage only (see functions.php).

   Light theme: warm orange-pale (#fff3e8) wash over a faint photo.

   SPECIFICITY NOTE — read before editing:
   front-page.php ships an inline reset `.jw-breakthrough-page * {
   margin:0; padding:0 }` (specificity 0,1,0) that loads AFTER this
   file. Any rule here at 0,1,0 or lower loses its margin/padding to
   that reset. EVERY selector below is therefore scoped under
   `.jw-shop-section` (the section element itself under
   `.jw-breakthrough-page .jw-shop-section`) to reach 0,2,0+ and win.
   Keep new rules scoped the same way or their spacing will vanish.
   ============================================================ */

.jw-breakthrough-page .jw-shop-section {
  position: relative;
  overflow: hidden;
  padding: 64px 40px 56px;
  /* Layered background, painted front-to-back:
     1. soft white highlight (top-right) for depth
     2. orange-pale (#fff3e8) wash — a gradient that varies in hue and
        opacity (93% → 76% → 95%) so the photo and a warmer cream band
        bloom through mid-section, giving the flat colour some texture
     3. the product photo, faint, sized to cover the whole section */
  background-color: #fff3e8;
  background-image:
    radial-gradient(ellipse 80% 60% at 75% 0%, rgba(255,255,255,0.65) 0%, transparent 60%),
    linear-gradient(165deg, rgba(255,243,232,0.93) 0%, rgba(255,231,209,0.76) 48%, rgba(255,243,232,0.95) 100%),
    url('../../Images/Product-image2.jpg');
  background-position: center, center, center;
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
}

/* Brand tokens — defined on the section itself so every var() below resolves
   no matter which page embeds it. The homepage's :root and the /resources/
   page wrapper define different token names; without this, undefined vars
   make `color` invalid and the card text falls back to the inherited link
   colour (orange). */
.jw-shop-section {
  --navy:        #0d2240;
  --orange:      #e87722;
  --orange-deep: #c4611a;
  --text-mid:    #3a4a5c;
  --text-hint:   #9aabbf;
  --border:      #e0d9d0;
}

/* Dot pattern overlay — 32px tile, faint navy dots, full-bleed, behind content */
.jw-shop-section .jw-shop-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.10;
  background-image: radial-gradient(#0d2240 1.2px, transparent 1.2px);
  background-size: 32px 32px;
}

.jw-shop-section .jw-shop-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
}

/* ---- Header ----
   Self-sufficient copies of the site-standard .section-eyebrow / -title /
   -sub styles, scoped to .jw-shop-section so this section renders correctly
   wherever it is embedded — the homepage AND the /resources/ hub — without
   depending on front-page.php's inline styles. Values match front-page.php;
   the 0,2,0 scope keeps them winning over any margin-zeroing page reset. */
.jw-shop-section .section-eyebrow {
  font-size: 12px; /* nudged up from the standard 10px */
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #e87722;
  text-align: center;
  margin-bottom: 10px;
}
.jw-shop-section .section-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: #0d2240;
  text-align: center;
  line-height: 1.25;
  margin-bottom: 12px;
}
.jw-shop-section .section-sub {
  font-size: 14px;
  font-weight: 400;
  color: #6b7d90;
  text-align: center;
  max-width: 480px;
  margin: 0 auto 44px;
  line-height: 1.75;
}

/* ---- Featured 3-up ---- */
.jw-shop-section .jw-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
.jw-shop-section .jw-feature {
  position: relative;
  isolation: isolate;
  display: block;
  padding: 24px 16px 8px;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.4s ease;
}
.jw-shop-section .jw-feature:hover { transform: translateY(-8px); }

/* Soft white spotlight behind the book(s) */
.jw-shop-section .jw-feature::before {
  content: '';
  position: absolute;
  inset: 20px 10% auto 10%;
  height: 240px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center 60%, rgba(255,255,255,0.7) 0%, transparent 65%);
  transition: opacity 0.4s ease;
}

/* The book image(s) */
.jw-shop-section .jw-feature-books {
  position: relative;
  z-index: 1;
}
.jw-shop-section .jw-feature-books--pair {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.jw-shop-section .jw-feature-book {
  display: block;
  margin: 0 auto;
  max-height: 220px;
  width: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 32px rgba(0,0,0,0.20));
}
.jw-shop-section .jw-feature-books--pair .jw-feature-book {
  margin: 0;
  max-height: 195px;
}
/* second volume overlaps the first slightly, sitting on top */
.jw-shop-section .jw-feature-books--pair .jw-feature-book + .jw-feature-book {
  margin-left: -40px;
  z-index: 2;
}

/* Ground shadow under the book */
.jw-shop-section .jw-book-shadow {
  position: relative;
  z-index: 1;
  width: 70%;
  height: 16px;
  margin: -8px auto 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(13,34,64,0.16) 0%, transparent 70%);
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.jw-shop-section .jw-feature:hover .jw-book-shadow {
  transform: scaleX(0.85);
  opacity: 0.5;
}

/* Badge pill — light card with dark text */
.jw-shop-section .jw-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: rgba(255,255,255,0.75);
  border: 0.5px solid var(--border);
}
.jw-shop-section .jw-badge--bundle {
  color: var(--orange-deep);
  background: rgba(232,119,34,0.12);
  border-color: rgba(232,119,34,0.40);
}

/* Featured typography */
.jw-shop-section .jw-feature-title {
  margin: 0 0 6px;
  font-family: 'Merriweather', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--navy);
}
.jw-shop-section .jw-feature-desc {
  margin: 0 auto 14px;
  max-width: 240px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-mid);
}
.jw-shop-section .jw-feature-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}
.jw-shop-section .jw-feature-price {
  color: var(--navy);
  font-weight: 700;
}
.jw-shop-section .jw-feature-price-old {
  margin-left: 6px;
  font-weight: 500;
  color: var(--text-hint);
  text-decoration: line-through;
}
.jw-shop-section .jw-feature-dot { color: var(--text-hint); }
.jw-shop-section .jw-feature-details {
  color: var(--text-mid);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

/* ---- Marquee — full-bleed to the section edges ---- */
.jw-shop-section .jw-marquee-wrap { position: relative; }
.jw-shop-section .jw-marquee-eyebrow {
  margin: 0 0 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--orange);
  text-align: center;
}
.jw-shop-section .jw-marquee {
  position: relative;
  overflow: hidden;
  /* break out of the section's 40px side padding → edge to edge */
  margin-left: -40px;
  margin-right: -40px;
}
.jw-shop-section .jw-marquee-track {
  display: flex;
  width: max-content;
  animation: jw-marquee 40s linear infinite;
}
.jw-shop-section .jw-marquee:hover .jw-marquee-track { animation-play-state: paused; }
@keyframes jw-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* each book is a link; margin-right (not flex gap) keeps the loop seamless */
.jw-shop-section .jw-marquee-item {
  flex-shrink: 0;
  display: block;
  margin-right: 24px;
  text-decoration: none !important;
  transition: transform 0.3s ease;
}
.jw-shop-section .jw-marquee-item:hover { transform: translateY(-8px); }
.jw-shop-section .jw-marquee-book {
  display: block;
  max-height: 175px;
  width: auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
}

/* Edge fades — orange-pale to transparent */
.jw-shop-section .jw-marquee-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.jw-shop-section .jw-marquee-fade--left {
  left: 0;
  background: linear-gradient(to right, #fff3e8, transparent);
}
.jw-shop-section .jw-marquee-fade--right {
  right: 0;
  background: linear-gradient(to left, #fff3e8, transparent);
}

/* ---- Closing CTA ---- */
.jw-shop-section .jw-shop-cta {
  margin-top: 44px;
  text-align: center;
}
.jw-shop-section .jw-shop-browse {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff !important;
  text-decoration: none !important;
  background: var(--orange);
  border: none;
  box-shadow: 0 6px 20px rgba(232,119,34,0.28);
  transition: background 0.2s ease, transform 0.2s ease;
}
.jw-shop-section .jw-shop-browse:hover,
.jw-shop-section .jw-shop-browse:focus {
  background: var(--orange-deep);
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* ---- Responsive ---- */
/* Desktop-only vertical dividers between the 3 featured products.
   The ::after sits on the 2nd & 3rd columns, centred in the grid gutter. */
@media (min-width: 1024px) {
  .jw-shop-section .jw-feature + .jw-feature::after {
    content: '';
    position: absolute;
    top: 12%;
    bottom: 12%;
    left: -12px;            /* half the 24px grid gap → centred in the gutter */
    width: 1px;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      var(--border) 22%,
      var(--border) 78%,
      transparent 100%);
    pointer-events: none;
  }
}

@media (max-width: 1023px) {
  .jw-breakthrough-page .jw-shop-section { padding: 48px 40px; }
  .jw-shop-section .jw-feature-book { max-height: 180px; }
  .jw-shop-section .jw-feature-books--pair .jw-feature-book { max-height: 160px; }
  .jw-shop-section .jw-marquee-book { max-height: 150px; }
}
@media (max-width: 767px) {
  .jw-breakthrough-page .jw-shop-section { padding: 48px 32px; }
  .jw-shop-section .jw-feature-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .jw-shop-section .jw-feature-book { max-height: 200px; }
  .jw-shop-section .jw-feature-books--pair .jw-feature-book { max-height: 180px; }
  .jw-shop-section .jw-feature-books--pair .jw-feature-book + .jw-feature-book { margin-left: -34px; }
  .jw-shop-section .jw-marquee {
    /* mobile section padding drops to 32px */
    margin-left: -32px;
    margin-right: -32px;
  }
  .jw-shop-section .jw-marquee-book { max-height: 140px; }
  .jw-shop-section .jw-marquee-fade { width: 48px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .jw-shop-section .jw-marquee-track { animation: none; }
  .jw-shop-section .jw-feature,
  .jw-shop-section .jw-book-shadow,
  .jw-shop-section .jw-marquee-item,
  .jw-shop-section .jw-shop-browse { transition: none; }
  .jw-shop-section .jw-feature:hover { transform: none; }
  .jw-shop-section .jw-feature:hover .jw-book-shadow { transform: none; opacity: 1; }
  .jw-shop-section .jw-marquee-item:hover { transform: none; }
  .jw-shop-section .jw-shop-browse:hover { transform: none; }
}
