/* ==========================================================================
   Home
   ========================================================================== */

/* --------------------------------------------------------------------------
   Banner principal
   -------------------------------------------------------------------------- */
.hero {
  padding-top: clamp(2rem, 1rem + 3vw, 3.5rem);
  padding-bottom: clamp(3.5rem, 2.5rem + 3vw, 5rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 3vw, 4rem);
}

.hero-titulo {
  font-size: clamp(2.4rem, 1.1rem + 3.6vw, 4.25rem);
  font-stretch: 115%;
  color: var(--rojo-fuerte);
  letter-spacing: -0.02em;
}
.hero-bajada {
  max-width: 46ch;
  margin-top: clamp(1rem, 0.75rem + 1vw, 1.5rem);
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--tinta-suave);
}
.hero-acciones { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.hero-foto {
  position: relative;
  isolation: isolate;
}
.hero-foto img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 3.3;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: var(--radio-lg);
}

/* Agitos del logo: el rojo asoma detrás de la foto, azul y verde en su base */
.hero-agito { position: absolute; pointer-events: none; }
.hero-agito--rojo {
  z-index: 0;
  color: var(--rojo);
  width: clamp(150px, 19vw, 270px);
  aspect-ratio: 64 / 61;
  right: clamp(-3.5rem, -4vw, -1.5rem);
  top: clamp(-3.25rem, -4vw, -1.75rem);
  transform: rotate(-8deg);
  animation: barrido-rojo 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
.hero-agito--azul {
  z-index: 2;
  color: var(--azul);
  width: clamp(60px, 7vw, 105px);
  aspect-ratio: 45 / 73;
  left: clamp(-1.25rem, -2vw, -0.5rem);
  bottom: clamp(-3rem, -4vw, -1.75rem);
  animation: barrido 0.9s 0.35s cubic-bezier(.2, .8, .2, 1) both;
}
.hero-agito--verde {
  z-index: 2;
  color: var(--verde);
  width: clamp(110px, 13vw, 190px);
  aspect-ratio: 74 / 40;
  left: clamp(2rem, 4.5vw, 4.5rem);
  bottom: clamp(-2.5rem, -3vw, -1.25rem);
  animation: barrido 0.9s 0.5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes barrido-rojo {
  from { opacity: 0; transform: rotate(-40deg) translate(12%, -10%); }
  to   { opacity: 1; transform: rotate(-8deg); }
}
@keyframes barrido {
  from { opacity: 0; transform: translateY(30%) rotate(-18deg); }
  to   { opacity: 1; transform: none; }
}

/* Próximo evento sobre la foto */
.hero-evento {
  position: absolute;
  z-index: 3;
  right: clamp(0.75rem, 1.5vw, 1.25rem);
  bottom: clamp(0.75rem, 1.5vw, 1.25rem);
  display: grid;
  gap: 0.15rem;
  max-width: 300px;
  padding: 1.1rem 1.35rem;
  border-radius: 18px;
  background: var(--noche);
  color: var(--blanco);
  text-decoration: none;
  box-shadow: 0 24px 50px -24px rgba(11, 33, 71, 0.7);
  transition: transform 0.2s;
}
.hero-evento:hover { transform: translateY(-3px); }
.hero-evento-etiqueta { font-size: var(--t-xs); color: #9fb8de; }
.hero-evento-nombre {
  font-stretch: 115%;
  font-weight: 800;
  font-size: var(--t-md);
  line-height: 1.2;
}
.hero-evento-fecha { font-size: var(--t-sm); color: #c9d5ea; }
.hero-evento-cuenta {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: var(--t-sm);
}
.hero-evento-cuenta strong {
  font-stretch: 125%;
  font-weight: 800;
  font-size: 1.6rem;
  color: #ff8a8e;
  margin-inline: 0.15rem;
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-foto img { aspect-ratio: 16 / 10; }
}
@media (max-width: 640px) {
  .hero-foto img { aspect-ratio: 4 / 3; }
  .hero-agito--azul, .hero-agito--verde { display: none; }
  .hero-agito--rojo { width: 120px; right: -1.75rem; top: -2.25rem; }
  .hero-acciones .boton { flex: 1 1 auto; }
  /* La tarjeta del evento pasa a ser una franja compacta bajo la foto */
  .hero-evento {
    position: relative; right: auto; bottom: auto;
    max-width: none;
    margin: -1.75rem 0.75rem 0;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 1rem;
    padding: 0.9rem 1.1rem;
  }
  .hero-evento-etiqueta, .hero-evento-fecha { grid-column: 1; }
  .hero-evento-nombre { grid-column: 1; font-size: var(--t-base); }
  .hero-evento-cuenta {
    grid-column: 2; grid-row: 1 / span 3;
    margin: 0; padding: 0 0 0 1rem;
    border-top: 0; border-left: 1px solid rgba(255, 255, 255, 0.25);
    text-align: center;
    line-height: 1.1;
  }
  .hero-evento-cuenta strong { display: block; font-size: 1.5rem; }
}

/* --------------------------------------------------------------------------
   Noticias
   -------------------------------------------------------------------------- */
.noticias { padding-top: clamp(1.5rem, 1rem + 2vw, 3rem); padding-bottom: var(--seccion); }

.noticias-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(1.25rem, 1rem + 1vw, 2rem);
}
.noticia--destacada { grid-row: span 2; }


@media (max-width: 960px) {
  .noticias-grid { grid-template-columns: 1fr 1fr; }
  .noticia--destacada { grid-column: 1 / -1; grid-row: auto; }
  .noticia--destacada .noticia-img img { aspect-ratio: 16 / 9; }
}
@media (max-width: 560px) {
  .noticias-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Paradeportes (carrusel de Jawis)
   -------------------------------------------------------------------------- */
.paradeportes {
  position: relative;
  overflow: hidden;
  padding-block: var(--seccion);
  background: var(--azul-fuerte);
  color: var(--blanco);
}
.paradeportes .contenedor { position: relative; z-index: 1; }
.paradeportes .seccion-intro { color: #d5e5f6; }
.paradeportes-agito {
  position: absolute;
  color: var(--verde);
  opacity: 0.55;
  width: clamp(320px, 42vw, 640px);
  aspect-ratio: 74 / 40;
  right: -8%;
  top: -12%;
  pointer-events: none;
}

.carrusel-controles { display: flex; gap: 0.5rem; }
.carrusel-boton {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  color: var(--blanco);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.carrusel-boton:hover { background: var(--blanco); color: var(--azul-fuerte); }
.carrusel-boton[aria-disabled="true"] { opacity: 0.6; border-style: dashed; cursor: default; background: transparent; color: var(--blanco); }
.carrusel-boton svg { width: 22px; height: 22px; }

.paradeportes .carrusel {
  --inicio: max(var(--gutter), calc((100vw - var(--ancho)) / 2));
  position: relative; z-index: 1;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0.5rem var(--inicio) 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--inicio);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.8) transparent;
  list-style: none;
}
.carrusel:focus-visible { outline-color: var(--blanco); outline-offset: -3px; }

.jawi {
  flex: 0 0 clamp(210px, 21vw, 260px);
  scroll-snap-align: start;
}
.jawi a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 22px;
  background: var(--blanco);
  color: var(--tinta);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s;
}
.jawi a:hover { transform: translateY(-6px); }
.jawi a:focus-visible { outline-color: var(--blanco); outline-offset: 4px; border-radius: 22px; }
.jawi img {
  order: -1;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: 0.75rem 0.75rem 0;
}
.jawi-nombre {
  margin-top: auto;
  padding: 1rem 1.25rem 1.25rem;
  font-stretch: 112%;
  font-weight: 800;
  font-size: var(--t-md);
  line-height: 1.15;
  border-top: 4px solid var(--rojo);
}
.jawi:nth-child(3n + 2) .jawi-nombre { border-top-color: var(--azul); }
.jawi:nth-child(3n + 3) .jawi-nombre { border-top-color: var(--verde); }

.jawi--otros a { justify-content: flex-start; }
.jawi-agitos {
  width: 62%;
  aspect-ratio: 140 / 102;
  margin: 2.5rem auto 1.5rem;
}
.jawi-otros-texto {
  padding: 0 1.25rem 1rem;
  color: var(--tinta-suave);
  font-size: var(--t-sm);
}

/* --------------------------------------------------------------------------
   Logros
   -------------------------------------------------------------------------- */
.logros { padding-block: var(--seccion); }
.logros-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2.5rem, 2rem + 3vw, 5rem);
  align-items: start;
}
.logros-subtitulo {
  font-size: var(--t-base);
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.medallistas li {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "nombre" "detalle" "medallas";
  column-gap: 1rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--linea);
}
.medallistas li:last-child { border-bottom: 1px solid var(--linea); }
.medallista-nombre { grid-area: nombre; font-weight: 700; }
.medallista-detalle { grid-area: detalle; font-size: var(--t-sm); color: var(--tinta-suave); }
.medallas { grid-area: medallas; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.medalla {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.15rem 0.65rem 0.15rem 0.4rem;
  border: 1px solid var(--borde-control);
  border-radius: 999px;
  font-size: var(--t-xs);
  font-weight: 600;
}
.medalla::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(19, 35, 63, 0.45);
}
.medalla--oro::before { background: var(--oro); }
.medalla--plata::before { background: var(--plata); }
.medalla--bronce::before { background: var(--bronce); }

.m-oro, .m-plata, .m-bronce {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(19, 35, 63, 0.45);
}
.m-oro { background: var(--oro); }
.m-plata { background: var(--plata); }
.m-bronce { background: var(--bronce); }

.delegacion-barras {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: end;
  height: 150px;
  max-width: 460px;
  padding: 0;
  list-style: none;
}
.delegacion-barras li {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem;
  text-align: center;
}
.delegacion-num { font-stretch: 120%; font-weight: 800; font-size: var(--t-md); }
.delegacion-barra {
  height: calc(var(--v) / 17 * 92px);
  min-height: 6px;
  border-radius: 8px 8px 2px 2px;
  background: var(--azul);
}
.delegacion-barras li:last-child .delegacion-barra { background: var(--rojo); }
.delegacion-sede { font-size: var(--t-xs); color: var(--tinta-suave); }

.medallero {
  padding: clamp(1.5rem, 1rem + 2.5vw, 2.75rem);
  border-radius: var(--radio-lg);
  background: var(--niebla);
}
.medallero-cabecera {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem 1.5rem;
}
.medallero-cabecera .logros-subtitulo { margin: 0; font-size: var(--t-md); }
.leyenda { display: flex; gap: 1rem; font-size: var(--t-xs); color: var(--tinta-suave); }
.leyenda li { display: flex; align-items: center; gap: 0.4rem; }

.medallero-grupo { margin-top: 2rem; }
.medallero-grupo h4 { font-size: var(--t-sm); font-weight: 700; color: var(--tinta-suave); margin-bottom: 0.75rem; }
.barras { margin: 0; display: grid; gap: 0.85rem; }
.barra-fila {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  align-items: center;
  gap: 1rem;
}
.barra-fila dt { font-weight: 700; font-size: var(--t-sm); }
.barra-fila dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.barra-detalle { flex-basis: 100%; font-size: var(--t-xs); color: var(--tinta-suave); }
.barra {
  display: flex;
  width: calc(var(--n-total) / 32 * 78%);
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  font-size: var(--t-xs);
  font-weight: 700;
}
.barra > span { display: grid; place-items: center; min-width: 1.6rem; }
.barra > span + span { border-left: 2px solid var(--blanco); }
.b-oro { flex: var(--n-oro); background: var(--oro); color: var(--tinta); }
.b-plata {
  flex: var(--n-plata);
  background: repeating-linear-gradient(135deg, var(--plata) 0 6px, #c3ccd6 6px 9px);
  color: var(--tinta);
}
.b-bronce { flex: var(--n-bronce); background: var(--bronce); color: var(--blanco); }
.barra-total { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }

.medallero-destacado {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--linea);
}
.medallero-destacado p { display: flex; align-items: center; gap: 1.25rem; }
.medallero-destacado-texto { max-width: 42ch; }
.medallero-destacado-num {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2.75rem, 2rem + 2.5vw, 3.75rem);
  line-height: 1;
  color: var(--rojo-fuerte);
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .logros-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .barra-fila { grid-template-columns: 1fr; gap: 0.35rem; }
  .barra { width: calc(var(--n-total) / 32 * 70%); }
}

/* --------------------------------------------------------------------------
   Patrocinadores
   -------------------------------------------------------------------------- */
.patrocinadores { padding-bottom: var(--seccion); }
.patrocinadores-caja {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2.4fr;
  align-items: center;
  gap: 2rem 3rem;
  padding: clamp(1.75rem, 1rem + 3vw, 3rem);
  border: 1px solid var(--linea);
  border-radius: var(--radio-lg);
}
.patrocinadores-texto h2 { font-size: var(--t-lg); }
.patrocinadores-texto p { margin: 0.5rem 0 1rem; color: var(--tinta-suave); }
.patrocinadores-logos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 1.5rem 2.5rem;
  padding: 0;
  list-style: none;
}
.patrocinadores-logos li { display: grid; place-items: center; }
.patrocinadores-logos img { max-height: 64px; width: auto; max-width: 100%; object-fit: contain; }

@media (max-width: 760px) {
  .patrocinadores-caja { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Redes sociales
   -------------------------------------------------------------------------- */
.redes-seccion {
  padding-block: var(--seccion);
  background: var(--niebla);
}
.redes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
}
.red-tarjeta {
  display: flex; flex-direction: column;
  border-radius: var(--radio-lg);
  background: var(--blanco);
  overflow: hidden;
  border: 1px solid var(--linea);
}
.red-cabecera {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--linea);
}
.red-cabecera .icono { width: 1.35rem; height: 1.35rem; }
.red-cabecera h3 { font-size: var(--t-base); font-weight: 700; }
.red-seguir {
  margin-left: auto;
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--blanco);
  font-size: var(--t-xs);
  font-weight: 700;
  text-decoration: none;
}
.red-seguir:hover { background: var(--rojo-fuerte); }
.red-perfil {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem;
  font-size: var(--t-sm);
  line-height: 1.3;
}
.red-perfil img { width: 44px; height: 44px; }
.red-perfil span { display: block; color: var(--tinta-suave); font-size: var(--t-xs); }

.ig-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(110px, 1fr);
  gap: 3px;
}
.ig-grid img { width: 100%; height: 100%; object-fit: cover; }

.fb-post { display: flex; flex-direction: column; flex: 1; }
.fb-post p { padding: 0 1.25rem 1rem; font-size: var(--t-sm); }
.fb-post img { width: 100%; flex: 1; min-height: 200px; object-fit: cover; }

.tt-video { position: relative; display: block; flex: 1; min-height: 360px; background: var(--noche); color: var(--blanco); text-decoration: none; }
.tt-video:hover .tt-play { transform: translate(-50%, -50%) scale(1.06); }
.tt-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.tt-video::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11, 33, 71, 0.95) 0%, rgba(11, 33, 71, 0.8) 35%, transparent 75%);
}
.tt-play {
  position: absolute; z-index: 1;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--tinta);
  transition: transform 0.2s;
}
.tt-play svg { width: 28px; height: 28px; margin-left: 3px; }
.tt-texto {
  position: absolute; z-index: 1;
  left: 1.25rem; right: 1.25rem; bottom: 1.25rem;
  color: var(--blanco);
  font-weight: 700;
}

@media (max-width: 960px) {
  .redes-grid { grid-template-columns: 1fr 1fr; }
  .red-tarjeta:last-child { grid-column: 1 / -1; }
  .tt-video { min-height: 320px; }
}
@media (max-width: 620px) {
  .redes-grid { grid-template-columns: 1fr; }
}

/* Alto contraste (Windows): conservar los colores de medallas con borde del sistema */
@media (forced-colors: active) {
  .barra > span, .medalla::before, .m-oro, .m-plata, .m-bronce, .delegacion-barra {
    forced-color-adjust: none;
    border: 1px solid CanvasText;
  }
  .hero-agito, .paradeportes-agito { display: none; }
}
