/* ============================================================
   Arbah v3 — Timelapse surface layout (scoped under .av3)
   Wizard chrome for the timelapse page: project pill button,
   project picker card, vantage back-bar, and a v3-toned host that
   wraps the SHARED VantagePicker component (stage 2). The final stage
   (the player hero + scrubber + captures grid) is rendered by this
   surface directly — its layout lives below. All data is REAL.
   ============================================================ */

.av3 .tl-page { max-width: 1100px; }

/* project pill in the header (real selected project name; no fake code) */
.av3 .tl-page .phead-actions .btn-secondary { gap: 9px; }
.av3 .tl-proj-name { font-family: var(--font-serif); font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="rtl"] .av3 .tl-proj-name { font-family: var(--font-sans-ar); }

/* ---------- stage 1: project picker ---------- */
.av3 .tl-picker { max-width: 480px; }
.av3 .tl-picker-label { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--arbah-ink-muted); margin-bottom: 9px; }
.av3 .tl-select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-8);
  border: 1px solid var(--arbah-border-strong); background: var(--arbah-surface);
  color: var(--arbah-ink); font-family: var(--font-sans); font-size: 13.5px; cursor: pointer;
}
.av3 .tl-select:focus { outline: none; border-color: var(--arbah-navy-500); box-shadow: 0 0 0 3px var(--arbah-navy-100); }
[dir="rtl"] .av3 .tl-select { font-family: var(--font-sans-ar); }

/* ---------- back bar (vantage + viewer stages) ---------- */
.av3 .tl-backbar { display: flex; align-items: center; gap: 12px; }
.av3 .tl-backbar .flip-x { display: inline-block; }
[dir="rtl"] .av3 .tl-backbar .flip-x { transform: scaleX(-1); }

/* ---------- shared-component host (stage 2) ----------
   VantagePicker ships its own (legacy Tailwind) markup; this host gives
   it the v3 card frame + spacing without touching the component. */
.av3 .tl-vantage-host { padding: 18px; }

/* ============================================================
   Stage 3 — player hero + scrubber + captures grid
   Mirrors design/arbah-v3/project/timelapse.jsx. REAL photos.
   ============================================================ */

.av3 .tl-player-card { overflow: hidden; }
.av3 .tl-state-pad { text-align: center; color: var(--arbah-ink-muted); font-size: 13px; padding: 36px 18px; }

/* ---------- player hero (~380px, gradient + current frame) ---------- */
.av3 .tl-hero {
  position: relative; height: 380px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #24486e, #0e2640);
  overflow: hidden;
}
.av3 .tl-hero-empty { background: linear-gradient(150deg, #43607f, #2C4A6E); }
.av3 .tl-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #0e2640;
}

/* big circular play button, centered above the frame */
.av3 .tl-play {
  position: relative; z-index: 2;
  width: 72px; height: 72px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); color: var(--arbah-navy-700);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 8px 28px rgba(0,0,0,.3);
  transition: transform .12s ease, background .12s ease;
}
.av3 .tl-play:hover:not(:disabled) { transform: scale(1.05); background: #fff; }
.av3 .tl-play:disabled { opacity: .55; cursor: default; }

/* play triangle + pause glyph (no icon in the set — pure CSS glyphs) */
.av3 .tl-play-tri {
  width: 0; height: 0; margin-inline-start: 4px;
  border-style: solid; border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent currentColor;
}
.av3 .tl-play-tri.sm { border-width: 6px 0 6px 10px; margin-inline-start: 2px; }
[dir="rtl"] .av3 .tl-play-tri,
[dir="rtl"] .av3 .tl-play-tri.sm { transform: scaleX(-1); }
.av3 .tl-play-pause { display: inline-flex; gap: 6px; }
.av3 .tl-play-pause i { width: 6px; height: 24px; border-radius: 2px; background: currentColor; }
.av3 .tl-play-pause.sm { gap: 3px; }
.av3 .tl-play-pause.sm i { width: 3px; height: 12px; }

/* frame-date overlay chip (top-start) + frame counter (top-end) */
.av3 .tl-frame-chip,
.av3 .tl-frame-count {
  position: absolute; top: 14px; z-index: 2;
  color: rgba(255,255,255,.9); background: rgba(10,27,46,.45);
  padding: 4px 10px; border-radius: var(--r-6); font-size: 12px;
}
.av3 .tl-frame-chip { inset-inline-start: 16px; }
.av3 .tl-frame-count { inset-inline-end: 16px; }

/* ---------- scrubber row ---------- */
.av3 .tl-scrub { display: flex; align-items: center; gap: 14px; }
.av3 .tl-scrub-play { width: 38px; height: 38px; flex-shrink: 0; color: var(--arbah-navy-700); }
.av3 .tl-scrub-main { flex: 1; min-width: 0; }
.av3 .tl-track-wrap { position: relative; height: 24px; display: flex; align-items: center; }
.av3 .tl-track {
  position: absolute; inset-inline: 0; height: 5px; border-radius: 999px;
  background: var(--arbah-surface-raised);
}
.av3 .tl-track-fill {
  position: absolute; inset-inline-start: 0; height: 5px; border-radius: 999px;
  background: var(--arbah-bronze-500);
}
.av3 .tl-track-handle {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: var(--arbah-bronze-700); border: 3px solid var(--arbah-surface);
  transform: translateX(-50%); box-shadow: 0 1px 4px rgba(0,0,0,.25);
  pointer-events: none;
}
[dir="rtl"] .av3 .tl-track-handle { transform: translateX(50%); }
/* the real <input range> sits transparently on top for keyboard + drag */
.av3 .tl-track-input {
  position: absolute; inset-inline: 0; width: 100%; height: 24px;
  margin: 0; opacity: 0; cursor: pointer;
}
.av3 .tl-track-input:disabled { cursor: default; }
.av3 .tl-track-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.av3 .tl-track-labels .dt-mono { font-size: 10.5px; color: var(--arbah-ink-subtle); }

/* ---------- captures grid ---------- */
.av3 .tl-cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.av3 .tl-cap { border: none; background: none; padding: 0; cursor: pointer; text-align: center; }
.av3 .tl-cap-thumb {
  height: 84px; border-radius: var(--r-8); overflow: hidden;
  background: var(--arbah-surface-raised);
  display: flex; align-items: center; justify-content: center;
}
.av3 .tl-cap-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av3 .tl-cap-ph { color: var(--arbah-ink-subtle); display: flex; }
.av3 .tl-cap.is-active .tl-cap-thumb { outline: 2px solid var(--arbah-bronze-500); outline-offset: 1px; }
.av3 .tl-cap-date { font-size: 11px; color: var(--arbah-ink-muted); margin-top: 6px; }

.av3 .tl-empty { border: none; background: none; padding: 8px 0 0; }

/* responsive — keep the picker card full-width on narrow surfaces */
@container app (max-width: 760px) {
  .av3 .tl-picker { max-width: none; }
  .av3 .tl-proj-name { max-width: 140px; }
  .av3 .tl-hero { height: 280px; }
}
