/* The YouTube transcript page (/tools/youtube-transcript/) only.
   Everything shared by the tool pages is in site.css ("free tools" block);
   colours come from its tokens, so dark mode follows by itself. */

/* ---------- the link box ---------- */
.yt-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.yt-row input[type="text"] {
  flex: 1 1 18em; min-width: 0; min-height: 50px; margin: 0; padding: 11px 12px;
  border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit;
}
.tool-box .yt-row input[aria-invalid="true"] { border-color: #b3261e; }
.yt-row .btn { flex: 0 0 auto; min-height: 50px; }
.yt-box[aria-busy="true"] .btn.primary { cursor: progress; }
.tool-box .yt-send { margin: 8px 0 0; }
.yt-fallback p { margin: 0; }
.yt-fallback p + p { margin-top: 6px; }
.yt-fallback a { display: inline-block; padding: 10px 0; font-weight: 600; }

/* ---------- the video: picture, play button, then the player ---------- */
.yt-video { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px 22px; align-items: start; }
.yt-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface-2);
}
.yt-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.yt-frame img.broken { visibility: hidden; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-frame.playing img, .yt-frame.playing .yt-play { display: none; }

.yt-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 20px 10px 14px;
  border: 2px solid #ffffff; border-radius: 999px; background: rgba(19, 24, 41, .86); color: #ffffff;
  font: 600 1rem/1.2 var(--sans); cursor: pointer; white-space: nowrap;
}
.yt-play:hover { background: rgba(19, 24, 41, .96); }
.yt-play:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; box-shadow: 0 0 0 6px #5475fb; }
.yt-play-icon { width: 26px; height: 26px; flex: none; border-radius: 50%; background: #ffffff; position: relative; }
.yt-play-icon::after {
  content: ""; position: absolute; left: 10px; top: 7px;
  border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #131829;
}

/* The title sits above the picture, first in the reading and Tab order. */
.yt-head { margin: 0 0 14px; scroll-margin-top: 16px; }
.yt-head > * { margin: 0; }
.yt-about > * { margin: 0; }
.yt-about .result-note { margin-top: 6px; }
.yt-about .result-note:first-child { margin-top: 0; }
.yt-kicker { font: 700 .8rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.yt-head h2 { margin: 4px 0 0; font-size: clamp(1.3rem, 2.4vw, 1.7rem); overflow-wrap: anywhere; }
.result .yt-head h2 { margin-bottom: 0; }
.yt-close { margin-top: 12px; min-height: 44px; padding: 10px 18px; }

/* ---------- controls and the lines ---------- */
.yt-controls { margin-top: 20px; }
.yt-controls .check-row { margin-right: 6px; }
.result > .msg.error { margin-top: 12px; }

.yt-lines {
  list-style: none; margin: 14px 0 0; padding: 6px 0; max-height: 460px; overflow: auto;
  border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--surface);
}
.yt-lines li, .yt-chapters li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 0 10px; align-items: baseline; margin: 0; padding: 4px 16px; }
.yt-lines .w, .yt-chapters .w { overflow-wrap: anywhere; }
.yt-lines.no-times li { grid-template-columns: minmax(0, 1fr); }
.yt-lines.no-times .t { display: none; }

/* A time: a plain label while the player is closed, a button while it is open. */
.t { font: .86rem/1.5 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; color: var(--muted); font-variant-numeric: tabular-nums; }
button.t {
  -webkit-appearance: none; appearance: none; justify-self: start; min-height: 44px; min-width: 44px; padding: 0 8px; margin: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--fg); cursor: pointer;
}
button.t:hover { border-color: var(--fg); }
/* With the player open each row holds a 44px button: rows grow to fit it,
   with a small gap, so neighbouring buttons never touch. */
.yt-lines.playing li { padding-top: 2px; padding-bottom: 2px; }
.yt-lines.playing li + li { margin-top: 2px; }
/* ---------- the AI summary ---------- */
.yt-summary { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.yt-summary .tool-actions { margin-top: 14px; }
.yt-sum-note { max-width: 46em; }
.yt-summary > .msg.error { margin-top: 12px; }
.yt-summary[aria-busy="true"] #sum-go { cursor: progress; }
.yt-sum-result { margin-top: 20px; padding: 20px 22px; border: 2px solid var(--fg); border-radius: 14px; background: var(--surface); }
.yt-sum-result h3 { font-size: 1.15rem; margin: 18px 0 6px; }
.yt-sum-result h3:first-child { margin-top: 0; }
.yt-sum-result p, .yt-sum-result ul, .yt-sum-result ol { margin-top: 0; }
.yt-sum-result ul { padding-left: 1.2em; }
.yt-chapters { list-style: none; padding: 0; }
.yt-chapters li { padding: 4px 0; }
/* A chapter with no time keeps its title in the title column. */
.yt-chapters li > .w:first-child { grid-column: 2; }
.yt-sum-result .result-actions { margin-top: 10px; }


@media (prefers-reduced-motion: reduce) {
  .yt-play { transition: none; }
}
@media (max-width: 720px) {
  .yt-video { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .yt-row .btn { flex: 1 1 100%; justify-content: center; }
  .yt-lines { max-height: 380px; }
  .yt-lines li { padding: 4px 12px; grid-template-columns: 4.2em minmax(0, 1fr); }
  .yt-sum-result { padding: 16px; }
  .yt-controls .check-row { flex: 1 1 100%; }
}
