/* ============================================
   AVANT-APRÈS — Page styles
   Page : /avant-apres
   ============================================ */


/* ── HERO ──────────────────────────────────── */

.gallery-hero {
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.gallery-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.gallery-hero-content {
  padding: var(--space-16) var(--space-6) var(--space-16);
  max-width: 600px;
  margin: 0 auto;
}

.gallery-hero-image {
  display: none;
}

@media (min-width: 1024px) {
  .gallery-hero-grid {
    grid-template-columns: 1fr 1fr;
    max-width: var(--container-xl);
    margin: 0 auto;
  }

  .gallery-hero-content {
    padding: var(--space-20) var(--space-16) var(--space-20) var(--space-16);
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .gallery-hero-image {
    display: block;
    position: relative;
    min-height: 480px;
  }

  .gallery-hero-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
}

.gallery-hero-title {
  font-size: var(--text-4xl);
  font-family: var(--font-display);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  font-variation-settings: 'opsz' 36, 'WONK' 0;
  margin-bottom: var(--space-5);
}

.gallery-hero-title em {
  font-style: italic;
  font-weight: var(--font-weight-light);
}

@media (min-width: 768px) {
  .gallery-hero-title {
    font-size: var(--text-5xl);
    font-variation-settings: 'opsz' 48, 'WONK' 0;
  }
}

.gallery-hero-sub {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  max-width: 52ch;
  margin-bottom: var(--space-8);
}


/* ── CASE SECTION ──────────────────────────── */

.case-section {
  padding: var(--space-20) 0;
}

.case-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 1024px) {
  .case-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }

  /* Alternate layout — slider left, text right */
  .case-layout--reverse > .case-slider-wrap { order: -1; }
  .case-layout--reverse > .case-content     { order:  1; }
}


/* ── CASE CONTENT ──────────────────────────── */

.case-title {
  font-size: var(--text-3xl);
  font-family: var(--font-display);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  font-variation-settings: 'opsz' 30, 'WONK' 0;
  margin-bottom: var(--space-5);
}

@media (min-width: 768px) {
  .case-title {
    font-size: var(--text-4xl);
    font-variation-settings: 'opsz' 36, 'WONK' 0;
  }
}

.case-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  max-width: 55ch;
  margin-bottom: var(--space-8);
}


/* ── CASE META TABLE ───────────────────────── */

.case-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
}

/* When inside an alt-bg section, invert to white */
.section-alt .case-meta {
  background: var(--color-bg);
}

.case-meta-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  font-size: var(--text-sm);
}

.case-meta-label {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  min-width: 88px;
  flex-shrink: 0;
}

.case-meta-value {
  color: var(--color-text-muted);
}


/* ── CASE LINK ─────────────────────────────── */

.case-link {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast) var(--ease-out);
}

.case-link:hover {
  color: var(--color-accent-hover);
}


/* ── BEFORE / AFTER SLIDER ─────────────────── */

.case-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ba-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-md);
}

.ba-slider.ba-dragging {
  cursor: grabbing;
}

/* After — sits behind, full width */
.ba-after {
  position: absolute;
  inset: 0;
}

.ba-after img,
.ba-before img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Before — full size, clipped by clip-path (set by JS). Image never resizes. */
.ba-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0); /* default 50/50 — JS updates this */
}

/* "Avant" / "Après" pills */
.ba-label {
  position: absolute;
  bottom: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.ba-label--after {
  right: var(--space-4);
  background: var(--color-text);
  color: var(--color-text-on-dark);
}

.ba-label--before {
  left: var(--space-4);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* Handle */
.ba-handle {
  position: absolute;
  top: 0;
  left: 50%; /* updated by JS */
  height: 100%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  z-index: 10;
  touch-action: none;
}

.ba-handle:focus {
  outline: none;
}

.ba-handle:focus-visible .ba-handle-circle {
  box-shadow: 0 0 0 3px var(--color-accent), var(--shadow-md);
}

.ba-handle-track {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ba-handle-circle {
  width: 44px;
  height: 44px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  transition:
    transform var(--transition-fast) var(--ease-out),
    box-shadow var(--transition-fast) var(--ease-out);
  flex-shrink: 0;
}

.ba-slider:hover .ba-handle-circle,
.ba-slider.ba-dragging .ba-handle-circle {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.case-slider-hint {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-align: center;
  letter-spacing: var(--tracking-wide);
}


/* ── DISCLAIMER ────────────────────────────── */

.disclaimer-band {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-border);
}

.disclaimer-text {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  max-width: 72ch;
  margin: 0 auto;
  text-align: center;
  line-height: var(--line-height-relaxed);
}
