/* Section 11 — Before & After gallery
   Route: #/before-after (view="before-after")
   Keeps dark masculine theme tokens; no real photos (CSS-generated placeholders). */

/* ---------- Section container ---------- */
.section--before-after {
  /* Rely on `main > .section` base bg-primary; no override so theme-switch works. */
}

.s-ba {
  /* Extra breathing room so the heading doesn't hug the sticky navbar. */
  padding-top: 0.5rem;
}

/* ---------- Heading block ---------- */
.s-ba__head {
  text-align: center;
  margin: 0 auto 2.25rem;
  max-width: 720px;
}
.s-ba__title {
  margin: 0.4rem 0 0.6rem;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.s-ba__sub {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--text-secondary);
}
.s-ba__disclaimer {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Gallery grid ---------- */
.s-ba__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .s-ba__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}
@media (min-width: 1024px) {
  .s-ba__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
}

/* ---------- Pair card ---------- */
.s-ba-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.s-ba-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ---------- Side-by-side before/after pair ---------- */
.s-ba-card__pair {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;              /* thin separator line between the two shots */
  background-color: var(--border);
}

/* Animated divider line — a thin accent bar that slides in from the middle on hover. */
.s-ba-card__pair::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 0;
  background: linear-gradient(180deg, transparent, var(--accent) 40%, var(--accent) 60%, transparent);
  transform: translate(-50%, -50%);
  transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 2;
}
.s-ba-card:hover .s-ba-card__pair::after { height: 85%; }

/* Each individual shot (placeholder image canvas) */
.s-ba-shot {
  position: relative;
  aspect-ratio: 3 / 4;
  margin: 0;
  overflow: hidden;
  display: block;
  transition: filter 0.35s ease;
}
/* Soft floor shadow at the bottom of each shot — grounds the silhouette so it
   feels like a real studio photograph rather than a bare gradient. */
.s-ba-shot::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 4%;
  height: 18px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.55), transparent 70%);
  filter: blur(4px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.s-ba-shot::before {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* BEFORE visual: muted, desaturated radial gradient — suggests a dull "pre" state.
   On card hover it dims slightly and the silhouette pulls back, drawing the eye to AFTER. */
.s-ba-shot--before {
  background:
    radial-gradient(ellipse at 50% 35%, #2a2c33 0%, #16181e 55%, #0a0b0f 100%),
    linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0));
  filter: grayscale(0.35) brightness(0.85) contrast(0.95);
}
.s-ba-card:hover .s-ba-shot--before {
  filter: grayscale(0.5) brightness(0.75) contrast(0.95);
}
.s-ba-card:hover .s-ba-shot--before::before {
  transform: scale(0.92);
  opacity: 0.7;
}
.s-ba-shot--before::before {
  /* Abstract silhouette hint (torso-ish glow). */
  content: '';
  position: absolute;
  inset: 20% 28% 18% 28%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.04), transparent 70%);
  border-radius: 50%;
}

/* AFTER visual: warmer, brighter, red-orange accent glow — suggests "improved" state.
   On card hover, saturation and brightness bump a touch + silhouette scales up
   subtly — a very quiet "reveal" effect (no jarring movement). */
.s-ba-shot--after {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(229, 57, 53, 0.28) 0%, rgba(31, 34, 41, 0.6) 55%, #0a0b0f 100%),
    linear-gradient(180deg, rgba(255, 120, 90, 0.06), rgba(0,0,0,0));
  filter: saturate(1.15) brightness(1.05);
}
.s-ba-card:hover .s-ba-shot--after {
  filter: saturate(1.3) brightness(1.12);
}
.s-ba-shot--after::before {
  content: '';
  position: absolute;
  inset: 18% 26% 16% 26%;
  background: radial-gradient(ellipse, rgba(255, 180, 150, 0.16), transparent 70%);
  border-radius: 50%;
}
.s-ba-card:hover .s-ba-shot--after::before {
  transform: scale(1.06);
  opacity: 1;
}

/* ---------- Overlay badges (BEFORE / AFTER text) ---------- */
.s-ba-shot__overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  background-color: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}
.s-ba-shot__overlay--accent {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.25), var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}
/* Subtle glow pulse on AFTER badge when the card is hovered — reinforces
   that AFTER is the "winning" side. Kept very gentle so it never distracts. */
@keyframes ba-after-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.25), var(--shadow-sm); }
  50%      { box-shadow: 0 0 0 6px rgba(229, 57, 53, 0.18), 0 6px 18px rgba(229, 57, 53, 0.4); }
}
.s-ba-card:hover .s-ba-shot__overlay--accent {
  animation: ba-after-pulse 1.6s ease-in-out infinite;
}

/* Respect reduced-motion — disable all hover animation flourishes. */
@media (prefers-reduced-motion: reduce) {
  .s-ba-card,
  .s-ba-shot,
  .s-ba-shot::before,
  .s-ba-card__pair::after,
  .s-ba-shot__overlay--accent {
    transition: none;
  }
  .s-ba-card:hover .s-ba-shot__overlay--accent { animation: none; }
  .s-ba-card:hover { transform: none; }
}

/* ---------- Caption ---------- */
.s-ba-card__caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  background-color: var(--bg-elevated);
}
.s-ba-card__caption strong {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* Bullet separator between Week / Period and Customer note: "Week 2 • Real Customer".
   Sits before the customer-note <span>; the parent flex `gap` provides the spacing. */
.s-ba-card__caption span::before {
  content: '\2022';           /* • bullet */
  margin-right: 0.5rem;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
}
/* Collapse rendering when either half of the caption is missing — avoids a
   stranded bullet when only the Week field is filled (or vice versa). */
.s-ba-card__caption strong:empty,
.s-ba-card__caption span:empty { display: none; }

/* ---------- CTA block ---------- */
.s-ba__cta {
  margin-top: 2.5rem;
  text-align: center;
}
.s-ba__cta-btn {
  padding: 1rem 2.4rem;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(229, 57, 53, 0.32);
}
.s-ba__cta-btn:hover {
  box-shadow: 0 14px 34px rgba(229, 57, 53, 0.45);
  transform: translateY(-1px);
}
.s-ba__cta-note {
  margin: 0.8rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- View switching — per-route visibility ----------
   Rules here mirror the pattern established in 07b-products-listing.css. */

/* Hide the before-after section on every non-before-after view */
body[data-view="home"] #sec-11,
body[data-view="products"] #sec-11,
body[data-view="product-detail"] #sec-11 { display: none; }

/* On the before-after view, hide everything else in <main> */
body[data-view="before-after"] #sec-02,
body[data-view="before-after"] #sec-03,
body[data-view="before-after"] #sec-04,
body[data-view="before-after"] #sec-05,
body[data-view="before-after"] #sec-06,
body[data-view="before-after"] #sec-07,
body[data-view="before-after"] #sec-07b,
body[data-view="before-after"] #sec-08,
body[data-view="before-after"] #sec-09 { display: none; }
