/* Copyright (c) 2026 LoveByPDF. All rights reserved.
   Round 97l - "Video guide" section (templates/_tool_video.html). Same palette as the "How to use" guide
   (navy #1F3864 / blue #2E5395, lighter in dark mode) and the site's surface variables. */

.tvg {
  --tv-navy: #1F3864;
  --tv-blue: #2E5395;
  --tv-blue-soft: rgba(46, 83, 149, 0.10);
  --tv-blue-line: rgba(46, 83, 149, 0.28);
  --tv-red: #E5252A;
  max-width: 1120px;
  margin: 44px auto 12px;
  color: var(--text);
  text-align: left;
  scroll-margin-top: 90px;
}
:root[data-theme="dark"] .tvg {
  --tv-navy: #8FB0E8; --tv-blue: #7FA2DF; --tv-blue-soft: rgba(127, 162, 223, 0.14); --tv-blue-line: rgba(127, 162, 223, 0.34);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tvg {
    --tv-navy: #8FB0E8; --tv-blue: #7FA2DF; --tv-blue-soft: rgba(127, 162, 223, 0.14); --tv-blue-line: rgba(127, 162, 223, 0.34);
  }
}

.tvg-head { margin-bottom: 18px; }
.tvg-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; padding: 5px 12px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--tv-red); background: rgba(229, 37, 42, 0.08); border: 1px solid rgba(229, 37, 42, 0.26); border-radius: 999px;
}
.tvg h2 { margin: 0 0 10px; font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); line-height: 1.22; color: var(--tv-navy); }
.tvg-intro { margin: 0; max-width: 78ch; font-size: 1.02rem; line-height: 1.65; }

/* language tabs */
.tvg-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tvg-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; cursor: pointer;
  font: inherit; font-size: 0.92rem; font-weight: 600; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.tvg-tab:hover { border-color: var(--tv-blue); }
.tvg-tab:focus-visible { outline: 3px solid var(--tv-blue); outline-offset: 2px; }
.tvg-tab[aria-selected="true"] { color: #fff; background: var(--tv-blue); border-color: var(--tv-blue); }
.tvg-tab-n {
  min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px;
  font-size: 0.76rem; background: var(--tv-blue-soft); color: inherit;
}
.tvg-tab[aria-selected="true"] .tvg-tab-n { background: rgba(255, 255, 255, 0.22); }
.tvg-panel:focus-visible { outline: none; }

/* main card: player + info side by side */
.tvg-video {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 27, 51, 0.05), 0 18px 40px -24px rgba(15, 27, 51, 0.35);
}
.tvg-video[hidden], .tvg-panel[hidden] { display: none; }
.tvg-player { position: relative; aspect-ratio: 16 / 9; background: #0B1220; min-width: 0; }
.tvg-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.tvg-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; cursor: pointer;
  background: #0B1220; display: block; overflow: hidden;
}
.tvg-poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease, filter .35s ease; }
.tvg-poster::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 14, 28, 0) 55%, rgba(8, 14, 28, 0.45) 100%);
}
.tvg-playbtn {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; margin: -27px 0 0 -38px; z-index: 1;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45)); transition: transform .2s ease;
}
.tvg-playbtn svg { width: 100%; height: 100%; display: block; }
.tvg-playbg { fill: #212121; fill-opacity: 0.82; transition: fill .2s ease, fill-opacity .2s ease; }
.tvg-poster:hover .tvg-playbg, .tvg-poster:focus-visible .tvg-playbg { fill: #FF0000; fill-opacity: 1; }
.tvg-poster:hover .tvg-playbtn { transform: scale(1.08); }
.tvg-poster:hover img { transform: scale(1.02); }
.tvg-poster:focus-visible { outline: 4px solid var(--tv-blue); outline-offset: -4px; }
.tvg-dur {
  position: absolute; right: 10px; bottom: 10px; z-index: 1; padding: 2px 7px; border-radius: 6px;
  font-size: 0.78rem; font-weight: 700; line-height: 1.5; color: #fff; background: rgba(8, 14, 28, 0.82);
  font-variant-numeric: tabular-nums;
}

.tvg-info { display: flex; flex-direction: column; min-width: 0; padding: 20px 20px 18px; max-height: 100%; }
.tvg-title { margin: 0 0 8px; font-size: 1.12rem; line-height: 1.35; color: var(--tv-navy); }
.tvg-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; font-size: 0.84rem; color: var(--text-muted); }
.tvg-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tvg-desc { margin: 0 0 12px; font-size: 0.93rem; line-height: 1.6; white-space: pre-line; }
.tvg-ch-h { margin: 4px 0 8px; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.tvg-chapters {
  list-style: none; margin: 0 0 14px; padding: 0 4px 0 0; display: grid; gap: 4px;
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.tvg-chapters a {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 10px;
  font-size: 0.9rem; line-height: 1.35; color: var(--text); text-decoration: none;
  border: 1px solid transparent; transition: background-color .15s ease, border-color .15s ease;
}
.tvg-chapters a:hover, .tvg-chapters a:focus-visible { background: var(--tv-blue-soft); border-color: var(--tv-blue-line); outline: none; }
.tvg-chapters a.is-on { background: var(--tv-blue-soft); border-color: var(--tv-blue); }
.tvg-ch-t {
  flex: none; min-width: 48px; padding: 1px 6px; border-radius: 6px; text-align: center;
  font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tv-blue); background: var(--tv-blue-soft);
}
.tvg-ch-name { min-width: 0; }
.tvg-chapters { -webkit-mask-image: linear-gradient(180deg, #000 85%, transparent); mask-image: linear-gradient(180deg, #000 85%, transparent); padding-bottom: 18px; }
.tvg-chapters.is-short { -webkit-mask-image: none; mask-image: none; padding-bottom: 0; }
.tvg-yt {
  margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; text-decoration: none;
  color: var(--tv-red); border: 1px solid rgba(229, 37, 42, 0.32); background: rgba(229, 37, 42, 0.06);
}
.tvg-yt:hover, .tvg-yt:focus-visible { background: rgba(229, 37, 42, 0.12); }

/* more videos */
.tvg-more { margin-top: 18px; }
.tvg-more-h { margin: 0 0 10px; font-size: 1rem; color: var(--tv-navy); }
.tvg-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 560px) { .tvg-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tvg-pick-title { font-size: 0.82rem; } }
.tvg-pick {
  display: block; height: 100%; padding: 8px; border-radius: 14px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); transition: border-color .15s ease, transform .15s ease;
}
.tvg-pick:hover, .tvg-pick:focus-visible { border-color: var(--tv-blue); outline: none; }
.tvg-pick.is-on { border-color: var(--tv-blue); box-shadow: 0 0 0 2px var(--tv-blue-soft); }
.tvg-pick-img { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #0B1220; }
.tvg-pick-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tvg-pick-img .tvg-dur { right: 6px; bottom: 6px; font-size: 0.72rem; }
.tvg-pick-title { display: block; margin: 8px 2px 2px; font-size: 0.88rem; font-weight: 600; line-height: 1.35; }

@media (max-width: 900px) {
  .tvg-video { grid-template-columns: 1fr; }
  .tvg-chapters { max-height: 220px; }
}
@media (max-width: 820px) { .tvg { margin-top: 32px; } .tvg-info { padding: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .tvg-poster img, .tvg-playbtn, .tvg-tab, .tvg-pick { transition: none; }
  .tvg-poster:hover img, .tvg-poster:hover .tvg-playbtn { transform: none; }
}
@media print { .tvg { display: none !important; } }
