/* Experience Replay owns the player composition; the selected site theme
   supplies its palette and typography, just as it does for every layout. */
@import url('./dive-deck.css');

body[data-rvns-layout="experience-replay"] {
  --replay-accent: var(--t-accent, #168f91);
  --replay-highlight: var(--t-accent, #168f91);
  --replay-panel: var(--t-bg-elevated, #f4f4f4);
  --replay-background: var(--t-bg, #fff);
  --replay-muted: var(--t-text-muted, #66747a);
  --replay-font: var(--t-font-body, system-ui, sans-serif);
  --replay-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --replay-viewer-height: clamp(320px, 56svh, 640px);
  background: var(--replay-background);
  color: var(--t-text);
  font-family: var(--replay-font);
}
body[data-rvns-layout="experience-replay"] :is(.rvns-dive-deck, .rvns-replay, .rvns-replay-composition, .rvns-replay-location) { width: min(1240px, 100%); margin: 0 auto; }
body[data-rvns-layout="experience-replay"] .rvns-layout-hero { min-height: 340px; padding: 32px; }
body[data-rvns-layout="experience-replay"] .rvns-layout-hero h1 { font: 800 clamp(30px, 3.6vw, 44px)/1.12 var(--replay-font); letter-spacing: -.035em; max-width: 900px; }
body[data-rvns-layout="experience-replay"] .rvns-layout-eyebrow { color: var(--t-on-media, #fffdf7); font: 700 11px/1.5 var(--replay-mono); letter-spacing: .2em; }
body[data-rvns-layout="experience-replay"] .rvns-layout-hero-description { font: 400 16px/1.5 var(--replay-font); max-width: 640px; }
.rvns-replay-opening { display: grid; }
.rvns-replay-opening .rvns-layout-hero { grid-area: 1 / 1; align-items: start; padding: 32px 32px 130px !important; }
.rvns-replay-opening .rvns-dive-summary { grid-area: 1 / 1; align-self: end; position: relative; z-index: 1; padding: 0 32px 28px; border: 0; }
.rvns-replay-opening .rvns-dive-module-head,
.rvns-replay.has-profile .rvns-replay-heading,
.rvns-replay.has-profile .rvns-replay-range:not(:focus-within),
[data-replay-status] { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.rvns-replay-opening .rvns-dive-summary-grid { display: flex; flex-wrap: wrap; background: transparent; border: 0; gap: 20px 38px; }
.rvns-replay-opening .rvns-dive-stat { min-height: 0; padding: 0; border: 0; gap: 6px; flex-direction: column-reverse; }
.rvns-replay-opening .rvns-dive-stat dd { margin: 0; color: var(--t-on-media, #fffdf7); font: 700 28px/1.2 var(--replay-mono); }
.rvns-replay-opening .rvns-dive-stat dd span { font-size: 12px; color: var(--t-on-media, #fffdf7); }
.rvns-replay-opening .rvns-dive-stat dt { color: var(--t-on-media, #fffdf7); font: 700 9px/1.5 var(--replay-mono); letter-spacing: .14em; }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile { padding: 20px 32px 0; border: 0; background: var(--replay-background); }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile .rvns-dive-module-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
body[data-rvns-layout="experience-replay"] .rvns-dive-module-head > p { display: none; }
body[data-rvns-layout="experience-replay"] :is(.rvns-dive-module h2, .rvns-replay-heading h2) { color: var(--replay-accent); margin: 0; font: 700 11px/1.5 var(--replay-mono); letter-spacing: .18em; text-transform: uppercase; }
.rvns-replay-profile-actions { display: flex; align-items: center; gap: 18px; }
.rvns-replay-profile-actions > span { font-size: 12px; color: var(--replay-muted); }
body[data-rvns-layout="experience-replay"] [data-replay-play] { border: 0; border-radius: 6px; padding: 12px 18px; background: var(--t-text); color: var(--replay-background); font: 700 11px/1.3 var(--replay-mono); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
[data-replay-play]::before { content: '▶ '; }
[data-replay-play][aria-pressed="true"]::before { content: 'Ⅱ '; }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-chart { position: relative; box-shadow: none; border: 0; padding: 28px 0 0; background: transparent; }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-svg { height: clamp(72px, 10svh, 130px); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), var(--dd-line) 25%); }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-line { stroke: var(--replay-accent); stroke-width: 3; }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-area { fill: color-mix(in srgb, var(--replay-accent) 9%, transparent); }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-axis { stroke: none; }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-cursor { stroke-dasharray: 3 3; }
.rvns-replay-profile-tooltip { position: absolute; top: 0; left: clamp(66px, var(--replay-cursor, 0%), calc(100% - 66px)); transform: translateX(-50%); width: 132px; box-sizing: border-box; white-space: nowrap; padding: 6px 9px; border-radius: 6px; background: var(--t-text); color: var(--replay-background); text-align: center; pointer-events: none; font: 700 10px/1.5 var(--replay-mono); }
.rvns-replay-profile-tooltip strong { display: block; font-size: 14px; }
[data-replay-unmatched] .rvns-replay-profile-tooltip { display: none; }
.rvns-replay-profile-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--replay-muted); font: 10px/1.5 var(--replay-mono); }
.rvns-replay-profile-details { margin-top: 8px; color: var(--replay-muted); font-size: 11px; }
.rvns-replay-profile-details summary { cursor: pointer; width: fit-content; }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-meta { margin: 10px 0 0; font-size: 11px; }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-readout { font: 12px/1.5 var(--replay-mono); color: var(--t-text); }
body[data-rvns-layout="experience-replay"] .rvns-dive-profile-source { margin: 6px 0; font-size: 11px; }
.rvns-replay { min-width: 0; }
.rvns-replay-controls { display: grid; gap: 12px; padding: 12px 32px 16px; background: var(--replay-background); }
.rvns-replay-controls[hidden] { display: none; }
.rvns-replay-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rvns-replay button:focus-visible, .rvns-replay input:focus-visible, [data-replay-play]:focus-visible { outline: 3px solid var(--replay-highlight); outline-offset: 4px; }
.rvns-replay-range { display: grid; margin: 0; font-size: 0; }
[data-replay-slider] { width: 100%; margin: 0; accent-color: var(--replay-accent); }
.rvns-replay-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; min-width: 0; }
.rvns-replay-thumbs button { position: relative; flex: 1 0 90px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 5px; background: var(--replay-panel); cursor: pointer; overflow: hidden; opacity: .55; }
.rvns-replay-thumbs button[aria-pressed="true"] { border-color: var(--replay-highlight); opacity: 1; }
.rvns-replay-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rvns-replay-thumbs button > span:last-child { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px 2px 3px; background: linear-gradient(transparent, rgba(6,23,31,.9)); color: var(--t-on-media, #fffdf7); font: 9px var(--replay-mono); }
.rvns-replay-stage { min-width: 0; background: var(--replay-panel); }
.rvns-replay-profile-moment { fill: var(--replay-accent); stroke: var(--replay-background); stroke-width: 2; }
[data-replay-unmatched] .rvns-dive-profile-cursor,
[data-replay-unmatched] .rvns-dive-profile-dot { visibility: hidden; }
.rvns-replay-frame { position: relative; }
.rvns-replay-frame[hidden] { display: none !important; }
.rvns-replay-frame figure { position: relative; margin: 0; width: 100%; max-width: none; padding: 0; }
.rvns-replay-frame :is(.block-image-frame, .block-video-frame) { height: var(--replay-viewer-height) !important; }
/* Also override the base crop rule for images with authored frame heights. */
body[data-rvns-layout="experience-replay"] .rvns-replay-frame figure img,
body[data-rvns-layout="experience-replay"] .rvns-replay-frame figure video { display: block; width: 100%; height: var(--replay-viewer-height); object-fit: contain; background: var(--replay-panel); }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame figcaption { margin: 0; padding: 36px 22px 20px; color: var(--t-on-media, #fffdf7); font: 400 16px/1.5 var(--replay-font); text-align: left; overflow-wrap: anywhere; }
.rvns-replay-frame .block-image figcaption { position: absolute; bottom: 0; left: 0; right: 0; max-height: 55%; overflow-y: auto; background: linear-gradient(transparent, rgba(6,23,31,.92) 36px); }
.rvns-replay-frame .block-video video { object-fit: contain; }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame .block-video figcaption { background: var(--replay-panel); color: var(--t-text); }
.rvns-replay-stamp { display: block; margin: 0 0 6px; color: var(--t-on-media, #fffdf7); font: 700 10px/1.6 var(--replay-mono); letter-spacing: .12em; text-transform: uppercase; overflow-wrap: anywhere; }
.rvns-replay-frame > .rvns-replay-stamp { position: absolute; top: 20px; left: 22px; right: 22px; width: fit-content; padding: 4px 8px; background: rgba(6,23,31,.75); }
.rvns-replay-composition { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0; }
.rvns-replay-composition > *, .rvns-replay-details > * { min-width: 0; }
.rvns-replay-composition:has([data-replay]) > .rvns-dive-narrative,
.rvns-replay-composition:has([data-replay]) .rvns-replay { display: contents; }
.rvns-replay-composition:has([data-replay]) .rvns-replay-controls { grid-column: 1 / -1; }
.rvns-replay-composition:has([data-replay]) .rvns-replay-stage { grid-column: 1; grid-row: 2; }
.rvns-replay-composition:has([data-replay]) .rvns-replay-details { grid-column: 2; grid-row: 2; }
.rvns-replay-composition:has([data-replay]) .story { grid-column: 1 / -1; width: 100%; box-sizing: border-box; }
.rvns-replay-details { padding: 4px 32px 20px; background: var(--replay-panel); border-left: 1px solid var(--dd-line); }
.rvns-replay-details .rvns-dive-module { width: 100%; margin: 0; padding-block: 18px 0; border: 0; }
.rvns-replay-details .rvns-dive-module-head { display: block; margin-bottom: 12px; }
.rvns-replay-details .rvns-dive-conditions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0; background: transparent; gap: 16px 12px; }
.rvns-replay-details .rvns-dive-stat { min-height: 0; padding: 0; border: 0; gap: 4px; flex-direction: column-reverse; }
.rvns-replay-details .rvns-dive-stat dd { margin: 0; font: 700 22px/1.3 var(--replay-mono); overflow-wrap: anywhere; }
.rvns-replay-details .rvns-dive-stat dt { font: 400 10px/1.5 var(--replay-font); color: var(--replay-muted); }
.rvns-replay-details .rvns-dive-stat dd span { font-size: 12px; }
.rvns-replay-details .rvns-dive-attribution { font: 400 10px/1.5 var(--replay-font); margin: 12px 0 0; color: var(--replay-muted); }
.rvns-replay-details .rvns-dive-gear-grid { grid-template-columns: minmax(0, 1fr); border: 0; background: transparent; gap: 0; }
.rvns-replay-details .rvns-dive-gear-item { min-height: 0; padding: 7px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; background: transparent; border-bottom: 1px solid var(--dd-line); }
.rvns-replay-details .rvns-dive-gear-item dt { margin: 0; color: var(--t-text); font: 600 12px/1.5 var(--replay-font); letter-spacing: 0; text-transform: capitalize; }
.rvns-replay-details .rvns-dive-gear-item dd { margin: 0; color: var(--replay-muted); font: 11px/1.5 var(--replay-mono); text-align: right; }
.rvns-replay-location .rvns-dive-site { position: relative; padding: 22px 32px; background: var(--replay-panel); border: 0; min-height: 260px; isolation: isolate; }
.rvns-replay-location .rvns-dive-site-layout { display: block; }
.rvns-replay-location .rvns-dive-site .rvns-dive-module-head { position: relative; z-index: 1; display: block; margin: 0; width: fit-content; background: var(--replay-panel); padding: 6px 10px; }
.rvns-replay-location .rvns-dive-site-copy { position: relative; z-index: 1; min-height: 0; width: fit-content; max-width: min(75%, 440px); margin-top: 120px; padding: 10px 14px; background: var(--replay-panel); }
.rvns-replay-location .rvns-dive-site-copy h3 { color: var(--t-text); margin: 0 0 4px; font: 700 15px/1.3 var(--replay-font); }
.rvns-replay-location .rvns-dive-site-copy p { color: var(--replay-muted); margin: 2px 0; font: 11px/1.5 var(--replay-mono); }
.rvns-replay-location .rvns-dive-map { position: absolute; z-index: -1; inset: 0; }
.rvns-replay-location .rvns-dive-map iframe { height: 100%; min-height: 260px; border: 0; filter: saturate(.65); }
.rvns-replay-location .rvns-dive-map > p { position: absolute; right: 0; top: 0; margin: 0; padding: 4px 8px; max-width: 45%; background: var(--replay-panel); font-size: 10px; }
.rvns-replay-record { padding: 18px 32px; display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--replay-panel); color: var(--replay-muted); font: 11px/1.6 var(--replay-mono); }
.rvns-replay-record .rvns-dive-provenance { padding: 0; border: 0; }
.rvns-replay-record .rvns-dive-module-head { display: none; }
.rvns-replay-record .rvns-dive-provenance-list { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; gap: 6px 18px; }
.rvns-replay-record li { margin: 0; color: inherit; }
body[data-rvns-layout="experience-replay"] .rvns-story-end { margin-top: 24px; padding-top: 0; }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame :is(.block-image, .block-video) { width: 100%; max-width: 100%; margin: 0; padding: 0; left: auto; right: auto; transform: none; }
.rvns-replay-composition:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame rvns-scene { height: var(--replay-viewer-height); min-height: 0; }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame .rvns-scene-text { font-size: 15px; padding: 20px; }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame .rvns-st-bg { position: absolute; height: 100%; margin: 0; }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame .rvns-st-panels { padding-top: 52px; min-height: var(--replay-viewer-height); box-sizing: border-box; display: flex; flex-direction: column; justify-content: end; }
body[data-rvns-layout="experience-replay"] .rvns-replay-frame .rvns-st-panel { min-height: 0; padding: 12px 20px; font-size: 15px; opacity: 1 !important; }
@media (max-width: 760px) {
  body[data-rvns-layout="experience-replay"] { --replay-viewer-height: clamp(280px, 43svh, 400px); }
  .rvns-replay-composition { grid-template-columns: minmax(0, 1fr); }
  .rvns-replay-details { border-left: 0; border-top: 1px solid var(--dd-line); padding: 0 22px 24px; }
  .rvns-replay-controls { padding: 14px 20px 18px; }
  .rvns-replay-thumbs button { flex: 0 0 88px; }
  .rvns-replay-opening .rvns-layout-hero { padding: 26px 22px 160px !important; }
  .rvns-replay-opening .rvns-dive-summary { padding: 0 22px 22px; }
  .rvns-replay-opening .rvns-dive-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .rvns-replay-opening .rvns-dive-stat dd { font-size: 23px; }
  .rvns-replay-composition:has([data-replay]) .rvns-replay-details { grid-column: 1; grid-row: auto; }
  body[data-rvns-layout="experience-replay"] .rvns-dive-profile { padding: 18px 22px 0; }
  .rvns-replay-profile-actions > span { display: none; }
  .rvns-replay-location .rvns-dive-site { padding: 20px; }
  .rvns-replay-location .rvns-dive-site-copy { max-width: 80%; }
}

body[data-rvns-layout="experience-replay"] :is(.rvns-replay-details, .rvns-replay-location) a { color: var(--replay-accent); }
.rvns-replay-details .rvns-dive-stat dd { color: var(--t-text); }
.rvns-replay-weather-details { margin-top: 12px; color: var(--replay-muted); font: 11px/1.5 var(--replay-font); }
.rvns-replay-weather-details summary { width: fit-content; cursor: pointer; }
body[data-rvns-layout="experience-replay"] .rvns-replay-composition .story { max-width: 780px; margin: 0 auto; padding: 24px 32px; }
body[data-rvns-layout="experience-replay"] .rvns-replay-composition .story > * { margin-block: 0; }
.rvns-replay-record .rvns-dive-provenance-list li { font: inherit; }
.rvns-replay-record .rvns-dive-provenance-list li::before { display: none; }

@media (min-width: 761px) {
  .rvns-replay-composition:has(.rvns-replay.is-enhanced) .rvns-replay-details { max-height: var(--replay-viewer-height); box-sizing: border-box; overflow-y: auto; scrollbar-color: var(--replay-accent) var(--replay-panel); }
}
.rvns-replay-details:focus-visible { outline: 2px solid var(--replay-accent); outline-offset: -2px; }
.rvns-replay-record .rvns-dive-provenance { font: inherit; }
body[data-rvns-layout="experience-replay"]:has(.rvns-replay-record) .story-date,
body[data-rvns-layout="experience-replay"]:has(.rvns-replay-record) .story-credits:not(:has(ul)) { display: none; }

.rvns-replay-location .rvns-dive-site:not(:has(.rvns-dive-map)) { min-height: 0; }
.rvns-replay-location .rvns-dive-site:not(:has(.rvns-dive-map)) .rvns-dive-site-copy { margin-top: 20px; }

.rvns-replay-record .rvns-dive-provenance-list { font: inherit; }

.rvns-replay-frame .block-video .rvns-replay-stamp { color: var(--t-text-muted); }
