/* Fiches vidéo MÉDIANE : lecteur YouTube chargé au clic, chapitres et transcription.
   Chargée après /assets/ressources.css, dont elle reprend les variables (--green, --cream, --muted, --soft, --line). */

.tm-video { margin: 2rem 0 0; }
.tm-video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--cream); overflow: hidden; border-radius: .75rem;
                  box-shadow: 0 0 0 1px rgba(14,59,47,.14), 0 10px 30px -12px rgba(14,59,47,.25); }
.tm-video.is-playing .tm-video-frame { background: #000; }
.tm-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* Façade : reprend la disposition d'un lecteur intégré (bandeau titre en haut, bouton au centre), sans ressource YouTube */
.tm-video-play { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; border: 0;
                 background: none; cursor: pointer; display: block; text-align: left; }
.tm-video-play picture, .tm-video-play picture img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.tm-video-play:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.tm-video-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .75rem;
                padding: .9rem 1.1rem 2.5rem; background: linear-gradient(rgba(0,0,0,.72), rgba(0,0,0,0)); }
.tm-video-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.tm-video-meta { display: flex; flex-direction: column; min-width: 0; color: #fff; }
.tm-video-title { font-family: Inter, sans-serif; font-weight: 600; font-size: 1.05rem; line-height: 1.3;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-video-channel { font-family: Inter, sans-serif; font-size: .82rem; line-height: 1.3; opacity: .9; }
.tm-video-icon { position: absolute; left: 50%; top: 50%; width: 4.25rem; height: 3rem; transform: translate(-50%, -50%); }
.tm-video-icon svg { width: 100%; height: 100%; display: block; }
.tm-video-icon-bg { fill: rgba(33,33,33,.82); transition: fill .15s; }
.tm-video-icon path { fill: #fff; }
.tm-video-play:hover .tm-video-icon-bg, .tm-video-play:focus-visible .tm-video-icon-bg { fill: var(--green); }

/* Mention sous le lecteur (le figcaption de ressources.css est centré : on l'aligne à gauche) */
.tm-video figcaption.tm-video-consent { text-align: left; font-size: .78rem; line-height: 1.5; color: var(--soft); margin-top: .6rem; }
.tm-wrap .tm-video-consent a { color: inherit; }

/* Chapitres compacts, cliquables : lancent la vidéo au bon moment */
.tm-chapters { margin: 1.5rem 0 0; }
.tm-chapters-title { font-family: "JetBrains Mono", monospace; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
                     color: var(--soft); margin-bottom: .5rem; }
.tm-wrap .tm-chapters ol { list-style: none; padding: 0; margin: 0; columns: 2 18rem; column-gap: 2rem; }
.tm-wrap .tm-chapters li { margin: 0; padding: 0; break-inside: avoid; }
.tm-wrap .tm-chapters a { display: flex; gap: .75rem; padding: .3rem 0; font-size: .9rem; line-height: 1.45; text-decoration: none; color: var(--green); }
.tm-wrap .tm-chapters a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tm-chapter-time { font-family: "JetBrains Mono", monospace; font-size: .75rem; color: var(--soft); min-width: 2.25rem; padding-top: .1rem; }

/* Transcription en accordéon : le texte reste dans la page */
.tm-transcript { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tm-transcript > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline;
                           gap: 1.5rem; padding: 1.1rem 0; font-weight: 600; }
.tm-transcript > summary::-webkit-details-marker { display: none; }
.tm-transcript > summary::after { content: "+"; font-family: "JetBrains Mono", monospace; font-weight: 400; font-size: 1.15rem; line-height: 1; color: var(--soft); }
.tm-transcript[open] > summary::after { content: "\2212"; }
.tm-transcript > summary:hover { color: var(--soft); }
.tm-transcript > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.tm-transcript-body { padding-bottom: 1rem; }
.tm-transcript-body h3:first-child { margin-top: .5rem; }

@media (max-width: 640px) {
  .tm-video { margin-left: -1.5rem; margin-right: -1.5rem; }
  .tm-video-frame { border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .tm-video figcaption.tm-video-consent { padding: 0 1.5rem; }
  .tm-video-bar { padding: .6rem .75rem 1.75rem; gap: .5rem; }
  .tm-video-avatar { width: 1.9rem; height: 1.9rem; }
  .tm-video-title { font-size: .85rem; }
  .tm-video-channel { font-size: .72rem; }
  .tm-video-icon { width: 3.4rem; height: 2.4rem; }
}
