/* Individual results and video ------------------------------------------------
   A result case is either a before/after pair of photos or a single finished
   look (photo or video). Every plate is 3:4, so pairs and singles keep one
   rhythm: a single plate has a pair plate's width, its caption sits beside it.
   On phones the plates of a pair become a swipe row with a hairline marker.

   Two kinds of video: quiet loops (muted, play while visible, always
   pausable) and the lesson film (sound, starts only when asked). */

.vr-case { margin: 0; }
.vr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(14px, 2.4vw, 40px);
}
.vr-plates { display: contents; }
.vr-plate { margin: 0; min-width: 0; }
.vr-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgb(69 71 63 / 5%);
}
.vr-media > img,
.vr-media > video { width: 100%; height: 100%; object-fit: cover; }
.vr-media > .photo-placeholder { height: 100%; aspect-ratio: auto; }
.vr-plate figcaption {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgb(69 71 63 / 62%);
}
.vr-plate figcaption span::before { content: " · "; }

.vr-caption {
  grid-column: 1 / -1;
  margin-top: clamp(28px, 3vw, 44px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.vr-caption h3 {
  font: 400 clamp(22px, 2vw, 30px)/1.2 var(--font-display);
  letter-spacing: -.025em;
}
.vr-caption p {
  max-width: 44ch;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
  color: rgb(69 71 63 / 80%);
}
.vr-case[data-align="center"] .vr-caption { text-align: center; }
.vr-case[data-align="center"] .vr-caption p { margin-inline: auto; }

/* Single finished look: caption beside the plate, resting on its baseline. */
.vr-case[data-kind="single"] .vr-caption {
  grid-column: 2;
  align-self: end;
  margin: 0 0 33px;
  text-align: left;
}
.vr-case[data-kind="single"] .vr-caption p { margin-inline: 0; }

.vr-progress { display: none; }

/* Pause/play for quiet loops: small, bottom left, never over the face. */
.vr-toggle {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  background: rgb(239 238 233 / 82%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font: 400 11px/1 var(--font-sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}
.vr-toggle[hidden] { display: none; }
.vr-toggle i { width: 8px; height: 10px; }
.vr-toggle[data-state="playing"] i { border-inline: 2.5px solid currentColor; }
.vr-toggle[data-state="paused"] i {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}
.vr-toggle:focus-visible, .vr-film-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The lesson film: poster first, sound and controls once started. */
.vr-film { margin: 0; }
.vr-film-frame { position: relative; overflow: hidden; background: rgb(69 71 63 / 8%); }
.vr-film-frame > video { display: block; width: 100%; height: auto; }
.vr-film-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 16px;
  padding: clamp(18px, 2.4vw, 32px);
  border: 0;
  background: linear-gradient(to top, rgb(30 31 27 / 38%), transparent 46%);
  color: var(--paper);
  font: 400 13px/1.3 var(--font-sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.vr-film-play[hidden] { display: none; }
.vr-film-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgb(239 238 233 / 80%);
  border-radius: 50%;
  transition: background-color 180ms ease;
}
.vr-film-icon::before {
  content: "";
  margin-left: 4px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent currentColor;
}
.vr-film-play:hover .vr-film-icon { background: rgb(239 238 233 / 18%); }
.vr-film figcaption {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgb(69 71 63 / 62%);
}

@media (max-width: 640px) {
  .vr-grid { display: block; }
  .vr-plates {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
  .vr-plates::-webkit-scrollbar { display: none; }
  .vr-plate { flex: 0 0 84%; scroll-snap-align: start; }
  .vr-plate:only-child { flex-basis: 100%; }
  .vr-progress { display: flex; gap: 6px; margin-top: 18px; }
  .vr-progress i { flex: 1; height: 1px; background: var(--rule); transition: background-color 200ms ease; }
  .vr-progress i[data-active] { background: var(--ink); }
  .vr-case[data-align="center"] .vr-caption,
  .vr-case[data-kind="single"] .vr-caption { text-align: left; margin: 26px 0 0; }
  .vr-case[data-align="center"] .vr-caption p { margin-inline: 0; }
  .vr-film-icon { width: 50px; height: 50px; }
}

@media (max-width: 640px) {
  .results-feature .vr-case, .treatment-result .vr-case { margin-top: 38px; }
}

/* Lesson page: the cover holds a quiet loop instead of a portrait. */
.lesson-cover { overflow: hidden; background: rgb(69 71 63 / 5%); }
.lesson-cover > video { width: 100%; height: 100%; object-fit: cover; }
.lesson-film .vr-film { max-width: 520px; }
.lesson-film .vr-film figcaption span::before { content: " · "; }
@media (max-width: 640px) {
  .lesson-film .vr-film { margin-top: 38px; }
}
