/* ════════════════════════════════════════════════════════════
   agenda-midia.css — peças de mídia do evento usadas em várias telas
   (Agenda Etapa 4b): fachada do YouTube e o resumo compacto da prévia
   (fileira de miniaturas no cartão/folha do evento, no comunicado e no
   dashboard). A galeria do painel da agenda fica em agenda.css.
   Tokens próprios (claro/escuro) para não depender da página.
   Movimento: só transform/opacity; :active scale(0.97); hover só com
   mouse; reduced-motion sem deslocamento.
   ════════════════════════════════════════════════════════════ */
.agm-resumo, .agm-yt {
  --agm-campo: #f2f2f5;
  --agm-tx2: #6e6e73;
  --agm-linha: rgba(0, 0, 0, 0.08);
  --agm-ease: cubic-bezier(0.23, 1, 0.32, 1);
}
html[data-tema="escuro"] .agm-resumo, html[data-tema="escuro"] .agm-yt {
  --agm-campo: #2c2c2e;
  --agm-tx2: #a1a1a6;
  --agm-linha: rgba(255, 255, 255, 0.12);
}

/* ── YouTube: fachada 16:9; o iframe nasce no toque ───────────── */
.agm-yt {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: #000; isolation: isolate; min-height: 200px; /* player do YouTube pede ≥ 200 px */
}
.agm-yt.is-prev { min-height: 0; }
.agm-yt > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.agm-yt-play {
  position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 55%); border: 0; padding: 0; cursor: pointer; color: #fff;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.agm-yt-bt {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; padding-left: 3px;
  background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 140ms var(--agm-ease), background-color 160ms ease;
}
.agm-yt-play:active .agm-yt-bt { transform: scale(0.94); }
.agm-yt-play:focus-visible { outline: 3px solid #0071e3; outline-offset: -3px; border-radius: 14px; }
.agm-yt-selo {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, 0.5); pointer-events: none;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.agm-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; }
.agm-yt.is-tocando .agm-yt-play, .agm-yt.is-tocando .agm-yt-selo { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  .agm-yt-play:hover .agm-yt-bt { transform: scale(1.05); background: rgba(0, 0, 0, 0.62); }
}

/* ── Resumo compacto da prévia ────────────────────────────────── */
.agm-resumo { margin-top: 12px; min-width: 0; }
.agm-r-fila { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 320px; }
.agm-resumo.is-p .agm-r-fila { grid-template-columns: repeat(4, 44px); max-width: none; }
.agm-r-it {
  position: relative; display: block; aspect-ratio: 1; width: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
  background: var(--agm-campo); cursor: pointer; isolation: isolate; color: #fff;
  transition: transform 120ms var(--agm-ease); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  box-shadow: inset 0 0 0 1px var(--agm-linha);
}
.agm-r-it:active { transform: scale(0.95); }
.agm-r-it:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }
.agm-r-it img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.agm-r-dur {
  position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px;
  border-radius: 999px; font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, 0.55);
}
.agm-resumo.is-p .agm-r-dur { padding: 0 4px; font-size: 0; gap: 0; height: 16px; }
.agm-resumo.is-p .agm-r-dur svg { width: 9px; height: 9px; }
.agm-r-yt { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1.3); display: block; line-height: 0; }
.agm-r-mais {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5);
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}
.agm-r-cont { margin-top: 6px; font-size: 12.5px; color: var(--agm-tx2); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agm-r-player { margin-top: 8px; }
.agm-r-player[hidden] { display: none; }

/* ── Mídia do evento citado no comunicado ({evento:N|midia}) ───── */
.agm-com { display: grid; gap: 8px; margin: 12px 0 2px; min-width: 0; }
.agm-com-ev {
  --agm-campo: #f2f2f5; --agm-tx2: #6e6e73; --agm-linha: rgba(0, 0, 0, 0.08); --agm-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative; padding: 12px 12px 10px 14px; border-radius: 14px; background: var(--agm-campo); min-width: 0; overflow: hidden;
}
html[data-tema="escuro"] .agm-com-ev { --agm-campo: #2c2c2e; --agm-tx2: #a1a1a6; --agm-linha: rgba(255, 255, 255, 0.12); }
.agm-com-ev::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--agc-ev-cor, #0071e3); }
.agm-com-cab { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 13.5px; }
.agm-com-ponto { display: none; }
.agm-com-tit { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agm-com-quando { flex: none; color: var(--agm-tx2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.agm-com-ev .agm-resumo { margin-top: 8px; }
.agm-com-abrir {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; min-height: 32px; font-size: 13px; font-weight: 600;
  color: #0066cc; text-decoration: none;
}
html[data-tema="escuro"] .agm-com-abrir { color: #4ea1ff; }
.agm-com-abrir:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; border-radius: 6px; }

.agm-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .agm-r-it, .agm-yt-bt { transition: none; }
  .agm-r-it:active, .agm-yt-play:active .agm-yt-bt { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .agm-yt-bt, .agm-yt-selo { background: rgba(20, 20, 22, 0.92); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
