/* ============================================================
   demokratian — videos.css
   Página pública de vídeos de producto (/{lang}/videos, sitio 0).
   Rejilla de tarjetas con «fachada»: miniatura local + botón; el
   iframe de YouTube solo existe después del clic (functions_videos.js).
   Variables: components.css (--green, --ink, --line, fuentes…).
   ============================================================ */

.vid-section {
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
}
.vid-section .esp-wrap {
  padding: 0 var(--gutter);
}

.vid-intro {
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.55;
  color: var(--slate);
  margin: 0 0 clamp(28px, 4vw, 48px);
}

/* ---------- Rejilla ---------- */
.vid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(24px, 3vw, 40px) clamp(20px, 2.5vw, 32px);
}

.vid-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-margin-top: 96px; /* anclas #video-N bajo la cabecera fija */
}

/* ---------- Fachada (miniatura + play) ---------- */
.vid-facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.vid-facade-static { cursor: default; }

.vid-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease, opacity .35s ease;
}
.vid-facade:hover img,
.vid-facade:focus-visible img {
  transform: scale(1.03);
}
.vid-facade:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.vid-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: background .2s ease, transform .2s ease;
}
.vid-play svg { margin-left: 3px; }
.vid-facade:hover .vid-play,
.vid-facade:focus-visible .vid-play {
  background: var(--green-deep);
  color: var(--white);
  transform: translate(-50%, -50%) scale(1.06);
}

.vid-dur,
.vid-soon {
  position: absolute;
  right: 10px;
  top: 10px; /* arriba: abajo a la derecha la tapaba el botón «subir» */
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--paper);
  background: rgba(21, 24, 26, .92);
}
.vid-soon {
  right: auto;
  left: 10px;
  bottom: auto;
  top: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background: rgba(154, 202, 60, .95);
}
.vid-card-soon .vid-facade img { opacity: .7; }

/* Tras el clic: el iframe ocupa toda la fachada */
.vid-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.vid-card.is-playing .vid-facade { cursor: default; }

/* ---------- Texto de la tarjeta ---------- */
.vid-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}
.vid-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--green-deep);
}
.vid-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--slate);
}

/* ---------- Aviso de privacidad ---------- */
.vid-privacy {
  max-width: 72ch;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate);
}
.vid-privacy a {
  color: var(--green-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Cierre ---------- */
.vid-cta {
  margin-top: clamp(48px, 6vw, 80px);
  padding: clamp(32px, 4vw, 48px);
  border-radius: 18px;
  background: var(--green-mist);
  border: 1px solid var(--green-soft);
  text-align: center;
}
.vid-cta h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 8px;
}
.vid-cta p {
  max-width: 56ch;
  margin: 0 auto 22px;
  font-size: 15px;
  color: var(--slate);
}
.vid-cta-actions {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 480px) {
  .vid-play { width: 56px; height: 56px; }
  .vid-title { font-size: 21px; }
}
