/* Desarrollado por BorseWB · 2026 */

/* Movimiento y acabado. Se anima solo transform/opacity (o translate/scale)
   con un único easing, --ease. */

:root {
  --ease: cubic-bezier(.16, 1, .3, 1);
  --radius: 12px;
}

/* La marca de agua del escudo desbordaba en móvil y ensanchaba la página */
html { overflow-x: clip; }
/* Renderizado bajo demanda: el navegador no pinta secciones lejanas hasta necesitarlas. */
body > section:not(#inicio) { content-visibility: auto; contain-intrinsic-size: 760px; }
#valores, .hero { overflow-x: clip; }

/* ---------- Tipografía ---------- */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
h2 { line-height: 1.04; letter-spacing: -.035em; }
.hero h1 { letter-spacing: -.04em; }
.hero p { max-width: 34em; line-height: 1.7; }
.intro { font-size: 16px; line-height: 1.7; }
.brand-name small { font-size: 9px; }
.cat-schedule-item, .location-schedule-row { font-size: 13px; }
.cat-coach-info strong { font-size: 13px; }
.cat-coach-label { font-size: 10px; }
.squad-player, .squad-card-hint { font-size: 12px; }
.equipacion-details-text, .value p { font-size: 13px; }
.value.active p { max-height: 160px; }
.registration-field label { font-size: 12px; }
.footer { font-size: 13px; }

/* ---------- Foco visible (teclado) ---------- */
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.btn-red:focus-visible { outline-color: #fff; }
.registration-field input:focus-visible { outline: none; }

/* ---------- Cabecera: integrada arriba, sólida al hacer scroll ---------- */
header {
  background: rgba(4, 6, 5, .96);
  border-bottom-color: var(--line);
  transition: background-color .25s ease, border-color .25s ease;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.menu-open header {
  height: 80px;
  background: rgba(4, 6, 5, .96);
  border-bottom-color: var(--line);
  box-shadow: none;
}
.brand-logo { transition: scale .3s var(--ease); }

/* Enlaces del menú: subrayado que se dibuja (sustituye al aro con brillo) */
.navlinks a:not(.nav-cta)::after {
  inset: auto 10px 2px 10px; height: 1px; border: 0; border-radius: 0; box-shadow: none;
  background: var(--green); opacity: 1; transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.navlinks a:not(.nav-cta):hover::after,
.navlinks a:not(.nav-cta).active::after { transform: scaleX(1); border: 0; box-shadow: none; }
.nav-cta::after { display: none !important; }
.nav-cta { transition: transform .35s var(--ease), background-color .3s, color .3s !important; }
.nav-cta:hover, .nav-cta.active { box-shadow: none; transform: translateY(-1px); }

/* ---------- Entrada del hero (CSS puro, rápida) ---------- */
@keyframes rise { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
.hero-content > * { animation: rise 1s var(--ease) both; }
.hero-content > h1 { animation-delay: .08s; animation-duration: 1.1s; }
.hero-content > p { animation-delay: .22s; }
@supports (height: 100svh) { .hero { min-height: 100svh; } }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 180px; pointer-events: none;
  background: linear-gradient(transparent, var(--bg));
}

/* Sin parallax: el scroll permanece estable incluso en equipos modestos. */
.crest-wrap::after, .club-big-crest-wrap::after { translate: none; }

/* ---------- Reveal al hacer scroll ---------- */
.reveal { opacity: 0; translate: 0 26px; }
.reveal.visible { opacity: 1; translate: 0 0; }
.reveal:not(.rv-done) {
  transition: opacity 1s var(--ease) var(--d, 0s), translate 1s var(--ease) var(--d, 0s);
}
@media (scripting: none) { .reveal { opacity: 1; translate: none; } }

/* Entradas laterales en las sedes y el bloque del club */
.locations-grid .reveal:not(.visible):nth-child(odd) { translate: -28px 0; }
.locations-grid .reveal:not(.visible):nth-child(even) { translate: 28px 0; }

/* Cabeceras de sección: kicker → título → intro, cada uno un poco después */
.section-head.reveal, .gallery-header.reveal { opacity: 1; translate: none; }
.section-head :is(.kicker, h2, .intro), .gallery-header :is(.kicker, h2) {
  opacity: 0; translate: 0 20px;
  transition: opacity .9s var(--ease), translate .9s var(--ease);
}
.section-head.visible :is(.kicker, h2, .intro),
.gallery-header.visible :is(.kicker, h2) { opacity: 1; translate: 0 0; }
.section-head :is(h2) , .gallery-header h2 { transition-delay: .08s; }
.section-head .intro { transition-delay: .18s; }

/* Sin línea decorativa delante del kicker de cada sección */
.kicker::before { content: none; display: none; }

/* ---------- Continuidad entre secciones ---------- */
.vestimenta-section, .locations-section {
  border-color: transparent;
  background: linear-gradient(180deg, var(--bg) 0, var(--bg2) 140px, var(--bg2) calc(100% - 140px), var(--bg) 100%);
}
.squads-section, .news-section { border-color: transparent; background: transparent; }

/* ---------- Botones ---------- */
.btn {
  border-radius: 10px;
  transition: transform .35s var(--ease), background-color .3s, border-color .3s, color .3s, box-shadow .35s var(--ease);
}
.btn::after { content: "→"; display: inline-block; transition: transform .35s var(--ease); }
.btn:hover::after { transform: translateX(4px); }
.btn-no-arrow::after { display: none !important; content: none !important; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:disabled::after { display: none; }
.btn-red { box-shadow: 0 8px 22px rgba(196, 47, 40, .22); }
.btn-red:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(196, 47, 40, .3); }
.btn:active { transform: translateY(0) scale(.985); }

.filter { transition: background-color .3s, color .3s, border-color .3s, transform .35s var(--ease); }
.filter:hover { transform: translateY(-1px); }
.filter[data-filter]:hover, .filter[data-squad-filter]:hover { box-shadow: none; }
.filter.active { box-shadow: none !important; }

/* ---------- Tarjetas ---------- */
.vestimenta-card, .squad-card, .category, .news-card, .value, .location-card {
  transition: transform .5s var(--ease), border-color .35s, background-color .35s, box-shadow .5s var(--ease);
}
.category:hover:not(.active) { transform: translateY(-3px); border-color: var(--line-active); }
.category.active, .category.escuela-category.active, .category.fem-category.active {
  transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0, 0, 0, .42);
}
.vestimenta-card:hover, .vestimenta-card.active, .squad-card:hover, .squad-card.active { transform: translateY(-3px); }
.location-card:hover, .location-card.active { box-shadow: 0 14px 32px rgba(0, 0, 0, .3); }
.location small span::after { content: " →"; display: inline-block; transition: translate .35s var(--ease); }
.location:hover small span::after { translate: 4px 0; }
.location:hover { background: rgba(79, 157, 90, .045); }

/* ---------- Imágenes: zoom editorial ---------- */
.news-img { transition: scale 1s var(--ease); }
.news-card:hover .news-img { scale: 1.04; }

.gallery-item { position: relative; }
.gallery-item.reveal { translate: 0 0; }
.gallery-item img {
  transform: none !important; scale: 1.14;
  transition: scale 1.5s var(--ease); will-change: translate;
}
.gallery-item.reveal:not(.visible) img { scale: 1.26; }
.gallery-item:hover img { scale: 1.17; transition-duration: .9s; }
.gallery-lightbox img { scale: .96; transition: scale .5s var(--ease); }
.gallery-lightbox.active img { scale: 1; }

/* ---------- Enlaces ---------- */
.footer-social a, .social a { position: relative; padding-bottom: 2px; }
.footer-social a::after, .social a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--green);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.footer-social a:hover::after, .social a:hover::after { transform: scaleX(1); }
.contact-box { box-shadow: none; border-radius: 18px; }

/* ---------- Menú móvil ---------- */
.menu-toggle { width: 44px; height: 44px; padding: 13px 8px; margin-right: -8px; }
.menu-toggle span { transition: transform .4s var(--ease), opacity .2s; }
.menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1050px) {
  body.menu-open { overflow: hidden; }
  .navlinks { visibility: hidden; transition: transform .5s var(--ease), visibility 0s .5s; }
  .navlinks.active { visibility: visible; transition-delay: 0s; }
  .navlinks a { font-size: 16px; padding: 12px 18px; opacity: 0; translate: 0 10px; transition: opacity .4s, translate .5s var(--ease), color .3s; }
  .navlinks.active a { opacity: 1; translate: 0 0; transition-delay: calc(var(--i, 0) * 45ms + 120ms); }
  .navlinks a:not(.nav-cta)::after { inset: auto 18px 6px 18px; }
}

/* ---------- Móvil: menos movimiento, objetivos táctiles cómodos ---------- */
@media (max-width: 820px) {
  .gallery-item img { scale: 1; }
  .gallery-item.reveal:not(.visible) img { scale: 1.1; }
  .gallery-item:hover img { scale: 1.03; }
  .reveal { translate: 0 18px; }
  .locations-grid .reveal:not(.visible):nth-child(n) { translate: 0 18px; }
}
@media (max-width: 768px) {
  .btn { min-height: 48px; }
  .filter { min-height: 44px; }
  .intro { font-size: 15px; }
}

/* ---------- Movimiento reducido: todo visible, sin animaciones ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; transition-delay: 0s !important;
  }
  .reveal, .section-head :is(.kicker, h2, .intro), .gallery-header :is(.kicker, h2) { opacity: 1 !important; translate: none !important; }
  .gallery-item img, .gallery-item.reveal:not(.visible) img { scale: 1 !important; translate: none !important; }
}

/* ---------- Rendimiento: aislar elementos animados ---------- */
.crest-turntable, .kit-turntable,
.reveal, .gallery-item img, .news-img,
.ld-line i, .ld-arc, .ld-head {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Menos trabajo de composición en dispositivos que no soportan hover fino. */
