/* =============================================================
   TransRisk v3 — shots.css
   Product-screenshot component library.

   Every visual slot identified in docs/visual-proof-audit.md renders
   through one of these patterns. Images are real files in
   /images/product/ — replacing a placeholder is a file swap, not a
   markup change.

   Companion behaviour lives in /js/shots.js (lightbox + tabs).
============================================================= */

/* ========================
   BASE FIGURE
======================== */

.tr-shot {
  margin: 0;
  display: block;
}

.tr-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-light);
  box-shadow: var(--shadow-md);
}

.tr-shot figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-muted);
  text-align: left;
}

/* Clickable shots ------------------------------------------------ */

.tr-shot[data-lightbox] { cursor: zoom-in; }

.tr-shot[data-lightbox] img {
  transition: box-shadow var(--transition), transform var(--transition);
}

.tr-shot[data-lightbox]:hover img,
.tr-shot[data-lightbox]:focus-visible img {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tr-shot[data-lightbox]:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 6px;
  border-radius: var(--radius-lg);
}

/* "Screenshot pending" ribbon ------------------------------------
   Remove the data-pending attribute (or the whole rule) once real
   screenshots are in place. */

.tr-shot[data-pending] { position: relative; }

.tr-shot[data-pending]::after {
  content: "PENDING";
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(45, 122, 58, 0.92);
  color: #fff;
  pointer-events: none;
}

/* ========================
   LAYOUT PATTERNS
======================== */

/* Full-width anchor visual --------------------------------------- */

.tr-shot--full {
  margin: 48px auto 0;
  max-width: 1100px;
}

.tr-shot--full.tr-shot--wide { max-width: 1280px; }

.tr-shot--full figcaption { text-align: center; }

/* Split: copy one side, visual the other ------------------------- */

.tr-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-top: 48px;
}

.tr-split--rev .tr-split-visual { order: -1; }

.tr-split-copy > :last-child { margin-bottom: 0; }

/* Thumbnail grid -------------------------------------------------- */

.tr-shot-grid {
  display: grid;
  gap: 20px;
  margin-top: 40px;
}

.tr-shot-grid--2 { grid-template-columns: repeat(2, 1fr); }
.tr-shot-grid--3 { grid-template-columns: repeat(3, 1fr); }
.tr-shot-grid--4 { grid-template-columns: repeat(4, 1fr); }

.tr-shot-grid .tr-shot figcaption {
  margin-top: 8px;
  font-size: 0.78rem;
}

/* Card thumbnail — sits inside an existing card, above its text --- */

.tr-shot--card {
  margin: 0 0 16px;
}

.tr-shot--card img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.tr-shot--card figcaption {
  display: none; /* card already carries a title */
}

/* Sticky rail — visual holds position beside a run of cards ------- */

.tr-rail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 48px;
}

.tr-rail--rev .tr-rail-visual { order: -1; }

.tr-rail-visual {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}

/* Inline thumbnail — small, beside a link or list item ------------ */

.tr-shot--inline {
  max-width: 240px;
  margin: 16px 0 0;
}

.tr-shot--inline img { border-radius: var(--radius-md); }
.tr-shot--inline figcaption { font-size: 0.75rem; margin-top: 6px; }

/* ========================
   TABBED SWITCHER
   Role dashboards, P&L views, industry panels.
======================== */

.tr-tabs { margin-top: 40px; }

.tr-tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 0;
  list-style: none;
  justify-content: center;
}

.tr-tab {
  appearance: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: all var(--transition);
}

.tr-tab:hover {
  color: var(--color-navy);
  border-color: #cbd5e1;
}

.tr-tab[aria-selected="true"] {
  color: var(--color-white);
  background: var(--color-navy);
  border-color: var(--color-navy);
}

.tr-tab:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

.tr-tabpanel[hidden] { display: none; }

/* ========================
   DARK-SECTION VARIANT
   Several sections sit on --color-navy. A light screenshot dropped
   straight onto navy reads as a hole; wrap it in a light card.
======================== */

.tr-shot--on-dark img {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.tr-shot--on-dark figcaption { color: rgba(255, 255, 255, 0.62); }

.tr-tabs--on-dark .tr-tab {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
}

.tr-tabs--on-dark .tr-tab[aria-selected="true"] {
  background: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-navy);
}

/* ========================
   HERO SHOT
   Replaces the CSS-drawn body of .hero-panel with a real screenshot,
   keeping the existing .panel-float annotation chips on top.
======================== */

.hero-panel--shot { padding: 12px; }

.hero-panel--shot .tr-shot img {
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: none;
}

.hero-panel--shot .tr-shot figcaption { display: none; }

/* Play affordance over the hero shot ----------------------------- */

.tr-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 3;
}

.tr-play-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px 13px 18px;
  border-radius: 999px;
  background: rgba(15, 31, 46, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform var(--transition), background var(--transition);
}

.tr-play:hover .tr-play-btn,
.tr-play:focus-visible .tr-play-btn {
  transform: scale(1.04);
  background: rgba(45, 122, 58, 0.92);
}

.tr-play:focus-visible { outline: none; }
.tr-play:focus-visible .tr-play-btn { outline: 2px solid #fff; outline-offset: 3px; }

.tr-play-icon {
  width: 15px;
  height: 15px;
  flex: none;
  fill: currentColor;
}

/* ========================
   IMAGE LIGHTBOX
   Behaviour mirrors the existing video-modal.js contract.
======================== */

.tr-lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.tr-lb[hidden] { display: none; }

.tr-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 14, 22, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tr-lb-container {
  position: relative;
  max-width: min(1500px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tr-lb-container img {
  display: block;
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
  background: var(--color-light);
}

.tr-lb-cap {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.tr-lb-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.tr-lb-close:hover { background: rgba(255, 255, 255, 0.18); }
.tr-lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ========================
   RESPONSIVE
======================== */

@media (max-width: 900px) {
  .tr-split,
  .tr-rail {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* On one column the visual always follows its copy. */
  .tr-split--rev .tr-split-visual,
  .tr-rail--rev .tr-rail-visual { order: 0; }

  .tr-rail-visual { position: static; }

  .tr-shot-grid--3,
  .tr-shot-grid--4 { grid-template-columns: repeat(2, 1fr); }

  .tr-shot--full { margin-top: 32px; }
}

@media (max-width: 560px) {
  .tr-shot-grid--2,
  .tr-shot-grid--3,
  .tr-shot-grid--4 { grid-template-columns: 1fr; }

  .tr-shot--inline { max-width: 100%; }

  .tr-lb { padding: 16px; }
  .tr-lb-close { top: -40px; }

  .tr-play-btn { font-size: 0.78rem; padding: 10px 17px 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tr-shot[data-lightbox] img,
  .tr-play-btn { transition: none; }

  .tr-shot[data-lightbox]:hover img { transform: none; }
  .tr-play:hover .tr-play-btn { transform: none; }
}

@media print {
  .tr-lb { display: none !important; }
  .tr-shot img { box-shadow: none; }
}
