/* /smile-gallery/ / SYSTEM v3 LIGHT LUXURY (gallery.css?v=3) */

/* ==========================================================
   1. FEATURED BEFORE/AFTER / the jewel, restyled light
   ========================================================== */

/* asymmetric stage: slider left, case sheet right */
.ba-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.8fr;
  gap: clamp(2.25rem, 4.5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 980px) {
  .ba-grid { grid-template-columns: 1fr; }
}

/* warm museum mat: panel surface + brass hairline + corner ticks */
.ba-shell {
  position: relative;
  padding: clamp(0.7rem, 1.6vw, 1.1rem);
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--brass) 42%, transparent);
  border-radius: 2px;
  box-shadow: var(--shadow-deep);
}
.ba-shell::before {
  content: ""; position: absolute; top: -2px; left: -2px; width: 22px; height: 22px;
  border-top: 2px solid var(--brass); border-left: 2px solid var(--brass); pointer-events: none;
}
.ba-shell::after {
  content: ""; position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px;
  border-bottom: 2px solid var(--brass); border-right: 2px solid var(--brass); pointer-events: none;
}

.ba {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 2px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* critical for mobile drag */
  cursor: ew-resize;
}
.ba:focus-visible { outline: 2px solid var(--brass-deep); outline-offset: 4px; }

.ba__before,
.ba__after { display: block; width: 100%; height: auto; }

.ba__before { position: relative; z-index: 1; }

/* after image stacked above, clipped by JS-set clip-path */
.ba__after-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}
.ba__after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* handle: 56px invisible hit halo, visible 2px brass line down the center */
.ba__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  left: 50%; /* JS updates this */
  transform: translateX(-50%);
  width: 56px;
  background-image: linear-gradient(
    color-mix(in oklab, var(--brass) 0%, transparent),
    var(--brass) 12%,
    var(--brass) 88%,
    color-mix(in oklab, var(--brass) 0%, transparent)
  );
  background-repeat: no-repeat;
  background-size: 2px 100%;
  background-position: center top;
  pointer-events: auto; /* events bubble to the stage handlers */
  touch-action: none;
  cursor: ew-resize;
}

/* warm brass medallion grip */
.ba__handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  border: 1.5px solid var(--brass);
  box-shadow: var(--shadow-deep);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.ba__handle::after {
  content: "\2194";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--brass-deep);
  font-size: 1.25rem;
  font-weight: 700;
  pointer-events: none;
  line-height: 1;
}

/* BEFORE / AFTER plaques */
.ba__label {
  position: absolute;
  bottom: 1rem;
  padding: 0.42rem 0.75rem 0.38rem 0.95rem;
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  border: 1px solid color-mix(in oklab, var(--brass) 45%, transparent);
  border-radius: 2px;
  color: var(--ink);
  font-family: var(--font-b);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ba__label--before { left: 1rem; z-index: 1; }
.ba__label--after { right: 1rem; z-index: 4; color: var(--brass-deep); }

/* case sheet: hairline spec rows beside the slider */
.case-sheet h2 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.4rem); }
.case-sheet .lead { font-size: 1.05rem; }
.case-sheet dl {
  border-top: 1px solid var(--line);
  margin-bottom: 1.75rem;
}
.case-sheet .case-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.25rem;
  padding: 0.95rem 0.1rem;
  border-bottom: 1px solid var(--line);
}
.case-sheet dt {
  font-family: var(--font-d);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brass-deep);
  padding-top: 0.1rem;
}
.case-sheet dd { color: var(--ink-soft); font-size: 0.97rem; }
.case-hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 1.1rem;
}

/* featured before/after is now a dark beat: case sheet reads on cinema */
.cinema .case-sheet dl { border-top-color: oklch(73% 0.077 83 / 0.22); }
.cinema .case-sheet .case-row { border-bottom-color: oklch(73% 0.077 83 / 0.22); }
.cinema .case-sheet dt { color: var(--brass-light); }
.cinema .case-sheet dd { color: var(--milk-soft); }
.cinema .case-sheet .case-hint { color: var(--milk-soft); }
/* the museum mat brightens its brass border on dark */
.cinema .ba-shell { border-color: oklch(73% 0.077 83 / 0.55); }

/* ==========================================================
   2. RESULTS WALL / cinematic feature band + museum column grid
   ========================================================== */

/* full-width cinematic feature band opening the wall */
.wall-feature { margin: 0 0 clamp(2.4rem, 4.5vw, 3.6rem); }
.wall-feature .frame { box-shadow: var(--shadow-lift); }
.wall-feature .frame img { object-position: center 30%; }
/* deepen the band into a true mid-page dark accent */
.wall-feature .frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, oklch(18.5% 0.005 85 / 0.55) 0%, oklch(18.5% 0.005 85 / 0.12) 42%, transparent 72%);
}
.wall-feature__cap { z-index: 2; }
.wall-feature__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(1.3rem, 3vw, 2.4rem);
  background: linear-gradient(
    to top,
    oklch(18.5% 0.005 85 / 0.86),
    oklch(18.5% 0.005 85 / 0.28) 52%,
    transparent
  );
  color: var(--paper);
}
.wall-feature__cap strong {
  display: block;
  font-family: var(--font-d);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-light);
  margin-bottom: 0.35rem;
}
.wall-feature__cap span {
  display: block;
  font-family: var(--font-d);
  font-weight: 300;
  line-height: 1.08;
  font-size: clamp(1.15rem, 0.95rem + 0.8vw, 1.6rem);
}

/* the wall: equal-width museum columns, natural image heights */
.wall {
  columns: 3;
  column-gap: clamp(1rem, 1.6vw, 1.6rem);
}
@media (max-width: 980px) { .wall { columns: 2; } }
@media (max-width: 560px) { .wall { columns: 1; } }

/* on small screens give the feature band a taller crop so the face reads */
@media (max-width: 640px) {
  .wall-feature .frame { aspect-ratio: 4 / 5; }
  .wall-feature .frame img { object-position: center 25%; }
}

.wall__item {
  break-inside: avoid;
  margin: 0 0 clamp(1.1rem, 1.8vw, 1.7rem);
}
.wall__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in oklab, var(--brass) 28%, transparent);
  box-shadow: var(--shadow-lift);
  background: var(--paper);
}
.wall__frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(1.02) sepia(0.04);
  transition: transform 0.8s var(--ease);
}
.wall__item:hover .wall__frame img { transform: scale(1.045); }

.wall__item figcaption {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.wall__item figcaption strong {
  display: block;
  font-family: var(--font-d);
  font-weight: 500;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--brass-deep);
  margin-bottom: 0.15rem;
}

/* honesty note, centered beneath the wall */
.wall__note {
  max-width: 58ch;
  margin: clamp(2rem, 3.5vw, 3rem) auto 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.wall__note::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--brass);
  margin: 0 auto 1.1rem;
}

/* ==========================================================
   3. DESIGN PHILOSOPHY BENTO + LEARN-MORE LEDGER TUNING
   ========================================================== */
.phil-head { margin-bottom: clamp(2rem, 4vw, 3.25rem); max-width: 64ch; }
.phil-head .lead { margin-top: 1rem; }

/* learn-more ledger: tighter rows than the treatments ledger */
.next-ledger .ledger__name { font-size: clamp(1.1rem, 1rem + 0.7vw, 1.45rem); }
.next-ledger .ledger__row { grid-template-columns: 3rem 1.15fr 1.45fr auto; padding-block: clamp(1.2rem, 2.2vw, 1.7rem); }
@media (max-width: 980px) {
  .next-ledger .ledger__row { grid-template-columns: 2.5rem 1fr; }
}

/* PERL cinema split */
.perl-cine .split { align-items: center; }
.perl-cine .ctarow { margin-top: 2rem; }
.perl-cine p { color: var(--milk-soft); }

/* ==========================================================
   THEME-DARK OVERRIDES (dark rollout 2026-07-10)
   ========================================================== */
/* caption color was var(--paper) (light-theme trick); pin it light on dark */
body.theme-dark .wall-feature__cap { color: oklch(94% 0.002 90); }

/* side-by-side pair replaces the drag slider (teeth never align at a drag seam) */
.ba2up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.5rem, 1vw, 0.75rem);
}
.ba2up__half {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 4 / 5;
}
.ba2up__half img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}
.ba2up .ba__label { bottom: 0.85rem; }
.ba2up .ba__label--before { left: 0.85rem; }
.ba2up .ba__label--after { right: 0.85rem; }

/* lightbox (no captions on wall photos; click any photo to enlarge) */
.wall__frame img, .ba2up__half img { cursor: zoom-in; }
.lbx {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: oklch(8% 0 0 / 0.94);
}
.lbx[hidden] { display: none; }
.lbx__img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 40px 90px -30px oklch(0% 0 0 / 0.8);
  cursor: default;
}
.lbx__close {
  position: absolute;
  top: clamp(0.8rem, 2.5vw, 1.6rem);
  right: clamp(0.8rem, 2.5vw, 1.6rem);
  width: 46px;
  height: 46px;
  border: 1px solid oklch(40% 0.004 85);
  border-radius: 50%;
  background: oklch(16% 0.002 85 / 0.7);
  color: oklch(94% 0.002 90);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.3s var(--ease);
}
.lbx__close:hover, .lbx__close:focus-visible { border-color: var(--brass); }
