/* ============================================================
   ENTRENAMIENTOS · Entrenamientos personalizados de fútbol
   Prefijos: entren-* / video-card
   Reutiliza los tokens "ink" de styles.css (--font-hero, --font-serif…)
   ============================================================ */

.entren-cta {
  margin-top: var(--space-6);
}

.entren-block {
  margin-top: clamp(3rem, 8vw, 6rem);
}

/* --- Videos --- */

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
}

.video-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.video-card .polaroid {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}

.video-card .polaroid__caption {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Los videos no se pueden pausar ni activar el sonido: no reciben clics */
.polaroid__media--video video {
  pointer-events: none;
}

.video-card__desc {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-muted);
  text-align: center;
  max-width: 40ch;
  margin: 0 auto;
}

.polaroid__media--video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b1220;
}

.polaroid__media--video iframe,
.polaroid__media--video video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card__soon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--space-4);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  color: #2a3340;
}

/* --- Qué trabajamos: cinco tarjetas en una fila --- */

.entren-block--first {
  margin-top: 0;
}

/* Sin el título de la página, el primer bloque no debe quedar bajo el menú fijo */
#entrenamientos,
#cursos,
#scouting {
  padding-top: calc(var(--header-h) + clamp(2rem, 5vw, 4rem));
}

.temas {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.tema {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: #1a212b;
  border: 1px solid var(--ink-line);
  border-top: 2px solid var(--ink-accent);
  border-radius: 4px;
  transition: transform 0.32s var(--ease-out), border-color 0.32s var(--ease-out);
}

.tema:hover {
  transform: translateY(-4px);
  border-color: var(--ink-accent);
}

.tema__num {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--ink-accent);
}

.tema__title {
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: clamp(1.4rem, 1.9vw, 1.75rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--ink-text);
  margin: 0;
}

.tema__text {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
}

@media (max-width: 1100px) {
  .temas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .temas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .temas {
    grid-template-columns: 1fr;
  }
}

/* --- Sedes: afiche a la izquierda, lista de comunas a la derecha --- */

.sedes-row .service-row__title {
  margin-bottom: 1rem;
}

.sedes-row__text {
  margin-bottom: var(--space-6);
}

/* Dos polaroids superpuestas: una arriba a la izquierda y otra abajo a la derecha */
.polaroid-duo {
  display: grid;
}

.polaroid-duo .polaroid {
  grid-area: 1 / 1;
  width: 74%;
  max-width: 380px;
}

.polaroid-duo .polaroid:first-child {
  justify-self: start;
  align-self: start;
  margin: 0 0 22% 0;
}

.polaroid-duo .polaroid:last-child {
  justify-self: end;
  align-self: end;
  margin: 22% 0 0 0;
}

.sedes {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--space-7);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink-line);
}

.sede {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--ink-line);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-text);
}

.sede__pin {
  flex: none;
  color: var(--ink-accent);
}

.sede__badge {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.15);
  color: #4ade80;
}

/* --- Contacto · acciones --- */

.entren-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

/* Subtítulos con la misma letra que los textos de Historia (.about__text) */
#entrenamientos .work__subtitle,
#cursos .work__subtitle,
#scouting .work__subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-muted);
}

.polaroid__media--square {
  aspect-ratio: 1;
}

.entren-actions--videos {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

/* Cursos y Scouting reutilizan esta estructura */
.temas--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .temas--3 {
    grid-template-columns: 1fr;
  }
}

.polaroid__media--vertical {
  aspect-ratio: 9 / 16;
}

/* Las fotos y videos verticales usan un marco más angosto */
.video-card .polaroid:has(.polaroid__media--vertical) {
  max-width: 320px;
}

.polaroid__media--vertical video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Cinta de atributos en movimiento (Scouting y Personalizados) --- */

.scout-marquee {
  position: relative;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
  padding-block: 1.1rem;
  border-block: 1px solid var(--ink-line);
  transform: rotate(-1.2deg);
  background: rgba(59, 130, 246, 0.06);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.scout-marquee__track {
  display: flex;
  width: max-content;
  animation: scout-marquee 32s linear infinite;
}

.scout-marquee__group {
  display: flex;
  flex: none;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-right: clamp(1.5rem, 4vw, 3rem);
  margin: 0;
  list-style: none;
}

.scout-marquee__item {
  display: inline-flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  font-family: var(--font-hero);
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--ink-text);
}

.scout-marquee__item:nth-child(even) {
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 244, 239, 0.55);
}

.scout-marquee__item::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink-accent);
}

@keyframes scout-marquee {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .scout-marquee__track {
    animation: none;
  }
}

/* --- Qué trabajamos (Personalizados): tarjetas interactivas --- */

.temas--interactive {
  perspective: 1000px;
}

.temas--interactive .tema {
  overflow: hidden;
  cursor: default;
  outline: none;
  transform: translateY(40px) scale(0.96);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform 0.7s var(--ease-out),
    border-color 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out),
    background-color 0.4s var(--ease-out);
}

.temas--interactive .tema:nth-child(2) { transition-delay: 0.08s; }
.temas--interactive .tema:nth-child(3) { transition-delay: 0.16s; }
.temas--interactive .tema:nth-child(4) { transition-delay: 0.24s; }
.temas--interactive .tema:nth-child(5) { transition-delay: 0.32s; }

/* Una vez visibles, sin retraso: responden al instante */
.temas--interactive.is-ready .tema {
  transition-delay: 0s;
}

.temas--interactive .tema.is-inview {
  transform:
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateY(var(--lift, 0px));
}

/* Mientras sigue al cursor, el giro es más rápido */
.temas--interactive .tema.is-active {
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform 0.15s linear,
    border-color 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out),
    background-color 0.4s var(--ease-out);
}

/* Luz que sigue al cursor */
.temas--interactive .tema::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(14rem circle at var(--mx, 50%) var(--my, 0%), rgba(59, 130, 246, 0.28), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}

/* Número grande de fondo */
.temas--interactive .tema::after {
  content: attr(data-num);
  position: absolute;
  right: -0.2rem;
  bottom: -1.4rem;
  font-family: var(--font-hero);
  font-size: clamp(5.5rem, 8vw, 7.5rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(59, 130, 246, 0.2);
  pointer-events: none;
  transition: transform 0.5s var(--ease-out), -webkit-text-stroke-color 0.5s var(--ease-out);
}

.temas--interactive .tema > * {
  position: relative;
  z-index: 1;
}

.temas--interactive .tema__icon {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: var(--ink-accent);
  transition: transform 0.5s var(--ease-out), background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

/* Estado encendido: al pasar el mouse, al enfocar o en el recorrido automático */
.temas--interactive .tema:hover,
.temas--interactive .tema:focus-visible,
.temas--interactive .tema.is-lit {
  --lift: -8px;
  border-color: var(--ink-accent);
  background-color: #1d2633;
  box-shadow: 0 24px 50px -24px var(--color-accent-glow), 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.temas--interactive .tema:hover::before,
.temas--interactive .tema:focus-visible::before,
.temas--interactive .tema.is-lit::before {
  opacity: 1;
}

.temas--interactive .tema:hover::after,
.temas--interactive .tema:focus-visible::after,
.temas--interactive .tema.is-lit::after {
  transform: translate(-6px, -8px);
  -webkit-text-stroke-color: rgba(59, 130, 246, 0.55);
}

.temas--interactive .tema:hover .tema__icon,
.temas--interactive .tema:focus-visible .tema__icon,
.temas--interactive .tema.is-lit .tema__icon {
  transform: scale(1.12) rotate(-10deg);
  background: var(--ink-accent);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .temas--interactive .tema,
  .temas--interactive .tema.is-inview {
    transform: none;
  }
}

/* En Cursos la cinta va entre el título y las tarjetas */
.scout-marquee--cursos {
  margin: 0 0 clamp(2.5rem, 5vw, 3.5rem);
}

/* --- Cursos: instituciones con convenio, con su logo al lado --- */

.sede--org {
  gap: 1.1rem;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.sede__logo {
  flex: none;
  width: 4.75rem;
  height: 4.75rem;
  padding: 0.3rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--ink-line);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.sede__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.sede--org:hover .sede__logo {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 10px 24px -10px var(--color-accent-glow);
}

/* --- Cursos: WhatsApp y "Ver cursos vigentes" lado a lado --- */

.cursos-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Botón amarillo para que destaque sobre el azul del sitio */
.btn--vigentes {
  position: relative;
  background: #facc15;
  color: #1a1400;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.4),
    0 30px 60px -30px rgba(250, 204, 21, 0.7);
  animation: vigentes-pulse 2.4s ease-out infinite;
}

.btn--vigentes:hover,
.btn--vigentes:focus-visible {
  transform: translateY(-3px);
  background: #fde047;
}

@keyframes vigentes-pulse {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.55), 0 30px 60px -30px rgba(250, 204, 21, 0.7); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(250, 204, 21, 0), 0 30px 60px -30px rgba(250, 204, 21, 0.7); }
}

@media (prefers-reduced-motion: reduce) {
  .btn--vigentes {
    animation: none;
  }
}

/* El logo del INAF trae mucho margen blanco: se acerca para que se lea mejor */
.sede__logo-img--zoom {
  transform: scale(1.3);
}

/* Una sola polaroid de video, centrada (Cursos Entrenadores) */
.videos-grid--single {
  grid-template-columns: minmax(0, 1fr);
}
