/**
 * H2 Vamos (H2go) — páginas de país. Ver php/ac-h2go.php.
 * Sin JS (o con "reducir movimiento") el banner y el carrusel se ven en su forma normal.
 */
.ac-h2go-hero {
  --ac-h2go-green: #1c6b34;
  --ac-h2go-overlay: 0;
  position: relative;
  isolation: isolate;
}

/* Header de logos de la página: fijo arriba y sin fondo (los logos quedan flotando) */
body:has(.ac-h2go-hero) .wp-block-post-content > header.wp-block-group {
  position: fixed;
  background: transparent;
  top: var(--wp-admin--admin-bar--height, 0px);
  left: 0;
  right: 0;
  z-index: 20;
  width: 100%;
}

/* Título del banner a todo el ancho (la palabra no se corta) */
.ac-h2go-intro {
  align-self: stretch;
  width: 100%;
}

.ac-h2go-intro h1 {
  max-width: var(--wp--style--global--wide-size, 100%);
}

.ac-h2go-intro h1 .word {
  white-space: nowrap;
}

/* Overlay verde oscuro -> negro, controlado por scroll */
.ac-h2go-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(28, 107, 52, 0.88) 0%,
    rgba(4, 22, 10, 0.94) 60%,
    rgba(0, 0, 0, 0.96) 100%
  );
  opacity: var(--ac-h2go-overlay);
  pointer-events: none;
}

.ac-h2go-hero > :not(.ac-h2go-overlay, .ac-h2go-stage, .ac-h2go-scroll) {
  position: relative;
  z-index: 1;
}

/* Flecha "scroll down" */
.ac-h2go-scroll {
  position: absolute;
  bottom: calc(
    max(24px, env(safe-area-inset-bottom)) + var(--ac-h2go-top, 0px)
  );
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  animation: ac-h2go-bounce 2s ease-in-out infinite;
}

.ac-h2go-scroll:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@keyframes ac-h2go-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* ---------- Modo animado (lo activa ac-h2go.js) ---------- */
.ac-h2go-hero.is-enhanced {
  height: 100vh;
  height: 100svh;
  min-height: 0 !important;
  overflow: hidden;
}

.ac-h2go-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  touch-action: pan-y;
}

.ac-h2go-stage:focus-visible {
  outline: none;
}

.ac-h2go-stage__track {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  width: max-content;
  will-change: transform;
}

.ac-h2go-stage__track > .wp-block-image {
  flex: none;
  margin: 0;
  transform-origin: center center;
  /* Sin will-change: el navegador guardaría la imagen rasterizada achicada y al agrandarla se vería pixelada. */
}

.ac-h2go-stage__track > .wp-block-image img {
  display: block;
  max-width: none;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.ac-h2go-stage__track > .wp-block-image:not(.is-active) {
  cursor: pointer;
}

.ac-h2go-stage__track a::after {
  content: none;
}

.ac-h2go-counter {
  margin-top: clamp(16px, 3vh, 32px);
  color: #fff;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ac-h2go-counter__bar {
  display: block;
  width: min(240px, 50vw);
  height: 2px;
  margin: 10px auto 0;
  background: rgba(255, 255, 255, 0.25);
}

.ac-h2go-counter__bar > span {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

/* El grupo que contenía el carrusel queda vacío al moverlo al banner */
.ac-h2go-collapsed {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .ac-h2go-scroll {
    animation: none;
  }
}

/* Lista de países: bandera redonda + nombre */
.ac-h2go-paises {
  gap: var(--wp--preset--spacing--s, 1rem);
  margin-top: var(--wp--preset--spacing--xl, 2rem);
}

.ac-h2go-pais {
  gap: 0.875rem;
  padding: 0.625rem 1.25rem 0.625rem 0.625rem;
  border: 1px solid rgba(28, 107, 52, 0.15);
  border-radius: 999px;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.ac-h2go-pais:hover {
  border-color: rgba(28, 107, 52, 0.4);
  box-shadow: 0 4px 14px rgba(28, 107, 52, 0.1);
}

.ac-h2go-pais .ac-h2go-bandera {
  flex: none;
  margin: 0;
}

.ac-h2go-pais .ac-h2go-bandera img {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3px rgba(0, 0, 0, 0.08);
}

.ac-h2go-pais p {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

/* Logos: alto máximo 80px (40px en mobile) */
.h2go-logos img {
  width: auto !important;
  height: auto !important;
  max-height: 80px;
}

@media (max-width: 781px) {
  .h2go-logos img {
    max-height: 40px;
  }
}

/* Logos del header: antes del scroll se ven normales; al bajar (clase is-scrolled desde JS)
   pasan a una pastilla verde redondeada con logos chicos (32px de alto) */
#h2go-header .h2go-logos {
  width: fit-content;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  transition:
    padding 0.3s ease,
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

#h2go-header .h2go-logos figure {
  margin: 0;
}

#h2go-header .h2go-logos img {
  transition: max-height 0.3s ease;
}

#h2go-header.is-scrolled .h2go-logos {
  padding: 0.5rem 1rem !important;
  background-color: #1f633b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  gap: 1rem;
}

#h2go-header.is-scrolled .h2go-logos img {
  max-height: 32px;
}

/* Lista de links a videos (clase h2-list-video-link en el bloque Lista): sin viñeta, ícono de YouTube verde. */
.h2-list-video-link {
  list-style: none;
  padding-left: 0;
}

.h2-list-video-link li {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.h2-list-video-link li::before {
  content: "";
  flex: none;
  width: 1.4em;
  height: 1em;
  background-color: #8bc53e;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Cpath d='M27.4 3.1A3.5 3.5 0 0 0 24.9.6C22.7 0 14 0 14 0S5.3 0 3.1.6A3.5 3.5 0 0 0 .6 3.1C0 5.3 0 10 0 10s0 4.7.6 6.9a3.5 3.5 0 0 0 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6a3.5 3.5 0 0 0 2.5-2.5C28 14.7 28 10 28 10s0-4.7-.6-6.9ZM11.2 14.3V5.7L18.5 10l-7.3 4.3Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Cpath d='M27.4 3.1A3.5 3.5 0 0 0 24.9.6C22.7 0 14 0 14 0S5.3 0 3.1.6A3.5 3.5 0 0 0 .6 3.1C0 5.3 0 10 0 10s0 4.7.6 6.9a3.5 3.5 0 0 0 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6a3.5 3.5 0 0 0 2.5-2.5C28 14.7 28 10 28 10s0-4.7-.6-6.9ZM11.2 14.3V5.7L18.5 10l-7.3 4.3Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.h2-list-video-link li a {
  color: #1f633b;
  text-decoration: none;
}

.h2-list-video-link li a:hover,
.h2-list-video-link li a:focus-visible {
  color: #1f633b;
  text-decoration: underline;
}

/* Menú del header de país: se oculta al hacer scroll (clase is-scrolled la pone ac-h2go.js). */
.h2-pais-header-menu {
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease;
}
.h2-pais-header-menu a {
  border-bottom: 0 !important;
}

.h2-pais-header-menu.is-scrolled {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
}

.h2-menu .lang-item a {
  color: #40bcf2 !important;
}
