/* Client video testimonials: one featured player with its thumbnail, and the rest of the videos beside it.
   Nothing plays until someone taps. Picking another video swaps it into the player. */

.tv-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 16px; }
.tv-head h3 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); }
.tv-head a { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.tv-head a:hover { text-decoration: underline; text-underline-offset: 3px; }

.tv { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 40px; }

/* The player */
.tv-stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* portrait 9:16, the shape the testimonials are filmed in, so there are no black bars */
.tv-screen { position: relative; aspect-ratio: 9 / 16; width: min(100%, calc(80vh * 9 / 16)); border-radius: 22px; overflow: hidden; background: #0b1f3a; max-width: 100%; }
.tv-screen img, .tv-screen video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tv-screen img { object-fit: cover; filter: grayscale(1); transition: filter 300ms ease, transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.tv-screen video { object-fit: cover; background: #000000; }
.tv-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 45%, rgba(4, 30, 64, 0.65)); transition: opacity 200ms ease; }
.tv-screen.is-playing::after { opacity: 0; }
.tv-start { all: unset; position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 22px; color: #ffffff; cursor: pointer; }
.tv-start:hover ~ img, .tv-start:focus-visible ~ img { filter: grayscale(0); transform: scale(1.02); }
.tv-start:focus-visible { outline: 2px solid #ffffff; outline-offset: -6px; border-radius: 22px; }
.tv-start .ap-play-disc { position: absolute; left: 50%; top: 50%; margin: -42px 0 0 -42px; }
.tv-start b { font-size: 20px; line-height: 26px; font-weight: 600; }
.tv-start span { font-size: 14px; line-height: 20px; opacity: 0.85; }
.tv-screen.is-playing .tv-start { display: none; }

.tv-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tv-count { font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tv-arrows { display: flex; gap: 8px; }
.tv-arrow { all: unset; box-sizing: border-box; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-soft); color: var(--ink); cursor: pointer; transition: background 200ms ease; }
.tv-arrow:hover { background: var(--surface-sunk); }
.tv-arrow:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }
.tv-arrow svg { width: 18px; height: 18px; }

/* The other videos */
.tv-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; min-width: 0; }
.tv-card { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 18px; background: var(--surface-soft); cursor: pointer; min-width: 0; transition: background 200ms ease, box-shadow 200ms ease; }
.tv-card:hover { background: var(--surface-sunk); }
.tv-card:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }
.tv-card.is-active { background: #ffffff; box-shadow: inset 0 0 0 2px var(--ink); }
.tv-thumb { position: relative; flex: none; width: 72px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-sunk); }
.tv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter 300ms ease; }
.tv-card:hover .tv-thumb img, .tv-card.is-active .tv-thumb img { filter: grayscale(0); }
.tv-mini { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 999px; background: #ffffff; color: var(--ink); display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.5); }
.tv-mini svg { width: 10px; height: 10px; margin-left: 2px; }
.tv-card.is-active .tv-mini { background: var(--ink); color: #ffffff; }
.tv-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tv-text b { font-size: 15px; line-height: 21px; font-weight: 600; color: var(--ink); }
.tv-text span { font-size: 13px; line-height: 18px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

@media (max-width: 900px) {
  .tv { grid-template-columns: minmax(0, 1fr); }
  .tv-screen { width: min(100%, calc(76vh * 9 / 16)); margin-inline: auto; }
  .tv-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
  .tv-list::-webkit-scrollbar { display: none; }
  .tv-card { flex: 0 0 min(74%, 300px); scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-screen img, .tv-card, .tv-arrow { transition: none; }
}

/* ---------- Homepage: testimonials on the left, the client gallery drifting behind on the right ---------- */
.tv.tv-cx { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 0; align-items: stretch; margin-bottom: 0; }
.cx-left { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding-right: 8px; }
.cx-label { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
.tv-cx .tv-screen { box-shadow: 0 30px 60px -30px rgba(4, 45, 98, 0.45); }

/* the thumbnail rail under the player */
.tv-rail { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: auto; gap: 8px; }
.tv-rail .tv-card { padding: 0; gap: 0; border-radius: 12px; background: none; }
.tv-rail .tv-card:hover { background: none; }
.tv-rail .tv-card.is-active { background: none; box-shadow: none; }
.tv-rail .tv-thumb { width: 100%; border-radius: 12px; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 200ms ease, opacity 200ms ease; opacity: 0.7; }
.tv-rail .tv-card:hover .tv-thumb { opacity: 1; }
.tv-rail .tv-card.is-active .tv-thumb { opacity: 1; outline-color: var(--ink); }
.tv-rail .tv-mini { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.tv-rail .tv-mini svg { width: 8px; height: 8px; }
.tv-rail .tv-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the gallery: one row of the ten photos and clips, each used once, sliding left and fading out behind the player.
   assets/client-videos.js moves each tile from the far left back to the far right, so nothing needs duplicating. */
.cx-gallery { position: relative; align-self: stretch; margin-left: -120px; min-height: 420px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 60px, #000 300px, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, transparent 60px, #000 300px, #000 calc(100% - 40px), transparent 100%); }
.cx-belt { position: absolute; inset: 0; }
/* centred on the player screen: label 22px + gap 14px + half the 4:5 screen */
.cx-item { position: absolute; left: 0; top: 356px; width: 260px; aspect-ratio: 3 / 4; margin-top: -193px; object-fit: cover; border-radius: 16px; background: var(--surface-sunk); will-change: transform; display: block; }
.cx-item:nth-child(even) { margin-top: -153px; }

@media (max-width: 1100px) {
}
@media (max-width: 900px) {
  .tv.tv-cx { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cx-left { padding-right: 0; }
  .tv-rail { display: flex; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: -4px; }
  .tv-rail .tv-card { flex: 0 0 56px; }
  .cx-gallery { margin-left: 0; min-height: 0; height: 230px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%); }
  .cx-item { top: 50%; width: 150px; margin-top: -100px; }
  .cx-item:nth-child(even) { margin-top: -100px; }
}
@media (prefers-reduced-motion: reduce) {
  
}
