/* ==========================================================================
   CF SAN PEDRO — Design System "San Pedro Elite"
   Paleta oficial extraída de Stitch (proyecto 1703620140730208245)
   ========================================================================== */

:root {
  /* --- Colores de marca (San Pedro Elite) --- */
  --primary: #002a58;
  --primary-container: #004080;
  --on-primary: #ffffff;
  --on-primary-container: #83aef5;
  --primary-fixed: #d6e3ff;
  --primary-fixed-dim: #a9c7ff;
  --on-primary-fixed-variant: #0e4686;

  --secondary: #bc000a;
  --secondary-container: #ea0010;
  --on-secondary: #ffffff;
  --secondary-fixed: #ffdad5;
  --secondary-fixed-dim: #ffb4aa;

  --tertiary: #292b2b;
  --on-tertiary: #ffffff;

  --grass-accent: #27ae60;
  --pitch-black: #0a111a;
  --stadium-gray: #e2e8f0;

  --background: #f7fafc;
  --surface: #f7fafc;
  --surface-bright: #f7fafc;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f1f4f6;
  --surface-container: #ebeef0;
  --surface-container-high: #e5e9eb;
  --surface-container-highest: #e0e3e5;
  --surface-variant: #e0e3e5;
  --surface-dim: #d7dadc;

  --on-background: #181c1e;
  --on-surface: #181c1e;
  --on-surface-variant: #424750;

  --outline: #737781;
  --outline-variant: #c3c6d2;

  --error: #ba1a1a;
  --error-container: #ffdad6;

  /* --- Tipografía --- */
  --font-display: "Montserrat", sans-serif;
  --font-body: "Inter", sans-serif;

  /* --- Espaciado --- */
  --margin-mobile: 20px;
  --margin-desktop: 64px;
  --gutter: 24px;
  --section-gap: 96px;
  --component-gap: 16px;

  /* --- Bordes --- */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--on-background);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  padding-top: 80px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--margin-mobile);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--margin-desktop); }
}

.section-gap { padding-top: var(--section-gap); padding-bottom: var(--section-gap); }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 80px;
  background: var(--primary);
  border-bottom: 2px solid var(--secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1400px;
  padding-left: 10px;
  padding-right: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand img { height: 44px; width: auto; flex-shrink: 0; }

@media (max-width: 1279px) {
  /* Sin .nav-links visible (aparece a partir de 1280px), el navbar móvil
     sólo tiene marca + acciones: se reorganiza en 3 columnas (marca /
     hueco flexible / acciones) en vez de flex space-between a 2 puntas,
     para que el botón hamburguesa siempre quepa sin desbordar la pantalla.
     Dentro de la marca, el escudo se queda fijo a la izquierda de la barra
     y sólo el nombre del club se centra en el espacio disponible. */
  .navbar .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    justify-content: initial;
  }
  .brand {
    grid-column: 1 / 3; /* ocupa desde el borde izquierdo hasta el hueco central */
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    width: 100%;
  }
  .brand img { grid-column: 1; }
  .brand span { grid-column: 2; text-align: center; }
  .nav-actions { grid-column: 3; justify-self: end; }
  /* El CTA "Hazte Socio" ya está disponible dentro del menú desplegable
     (.mobile-menu); en la barra superior se retira sólo en este rango para
     dejar sitio garantizado al icono de menú. */
  .nav-actions > .btn { display: none; }
}

.nav-links {
  display: none;
  align-items: center;
  gap: 16px;
  height: 100%;
  flex-wrap: nowrap;
}
.nav-links a,
.nav-dropdown-toggle {
  color: #fff;
  opacity: 0.85;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-dropdown-toggle:hover { opacity: 1; color: var(--secondary-fixed); }
.nav-links a.active,
.nav-dropdown-toggle.active {
  opacity: 1;
  color: var(--secondary-fixed-dim);
  border-bottom-color: var(--secondary);
}

/* Submenú desplegable del navbar (desktop) — p.ej. "Galería" con sus dos
   opciones. El toggle es un <a> más de .nav-links (mismo look, sin caret ni
   apariencia de botón/dropdown); sólo el panel que aparece al pulsar se
   diferencia, como una lista plana pegada justo debajo del propio enlace. */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 14px); left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(10,17,26,0.25);
  padding: 8px;
  list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 110;
}
.nav-dropdown.open .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--primary) !important;
  font-size: 12px !important;
  border-bottom: none !important;
  opacity: 1 !important;
}
.nav-dropdown-menu a:hover { background: var(--surface-container-low); color: var(--secondary) !important; }
.nav-dropdown-menu a.active { background: var(--surface-container-low); color: var(--secondary) !important; }

.nav-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.nav-icons { display: none; align-items: center; gap: 16px; color: #fff; }
.nav-icons .icon { opacity: 0.85; transition: opacity 0.2s, color 0.2s; cursor: pointer; }
.nav-icons .icon:hover { opacity: 1; color: var(--secondary-fixed); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: var(--radius);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--secondary); color: #fff; }
.btn-primary:hover { background: #96000a; }
.btn-secondary { background: var(--primary); color: #fff; }
.btn-secondary:hover { background: var(--primary-container); }
.btn-outline { background: transparent; border: 2px solid #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: var(--primary); }
.btn-outline-primary { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 12px; }

.nav-toggle {
  display: flex;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  background: none;
  border: none;
}

@media (min-width: 1280px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}
@media (min-width: 1480px) {
  .nav-icons { display: flex; }
}

/* Mobile menu drawer */
.mobile-menu {
  position: fixed;
  top: 80px; left: 0; right: 0;
  background: var(--primary);
  border-bottom: 2px solid var(--secondary);
  z-index: 99;
  display: none;
  flex-direction: column;
  padding: 8px 20px 24px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.25);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: #fff;
  padding: 14px 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-menu a.active { color: var(--secondary-fixed-dim); }
.mobile-menu .btn { margin-top: 16px; }

/* Submenú expandible del menú móvil (p.ej. "Galería" con sus 2 opciones). */
.mobile-submenu-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  color: #fff;
  padding: 14px 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: none; border-left: none; border-right: none; border-top: none;
}
.mobile-submenu-toggle.active { color: var(--secondary-fixed-dim); }
.mobile-submenu-toggle .nav-dropdown-caret { transition: transform 0.2s ease; }
.mobile-submenu.open .mobile-submenu-toggle .nav-dropdown-caret { transform: rotate(180deg); }
.mobile-submenu-list {
  display: none;
  flex-direction: column;
  padding-left: 16px;
}
.mobile-submenu.open .mobile-submenu-list { display: flex; }
.mobile-submenu-list a { border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 13px; }
.mobile-submenu-list a:last-child { border-bottom: 1px solid rgba(255,255,255,0.1); }

@media (min-width: 900px) {
  .mobile-menu { display: none !important; }
}

/* ==========================================================================
   HERO patterns
   ========================================================================== */
.hero {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--pitch-black);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,17,26,0.92) 0%, rgba(10,17,26,0.55) 45%, rgba(10,17,26,0.15) 100%);
}
.hero-content { position: relative; z-index: 2; width: 100%; }

.hero-home { height: 88vh; min-height: 640px; padding-bottom: var(--section-gap); }
.hero-page { height: 46vh; min-height: 340px; padding-bottom: 56px; }

.badge {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
}

.display-xl {
  font-family: var(--font-display);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 40px;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
@media (min-width: 768px) {
  .display-xl { font-size: 64px; line-height: 1.08; }
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  font-size: 32px;
  line-height: 1.15;
}
@media (min-width: 768px) {
  .display-lg { font-size: 48px; line-height: 1.15; }
}

.headline-lg {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 24px;
}
@media (min-width: 768px) {
  .headline-lg { font-size: 32px; }
}

.headline-md {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
}

.body-lg { font-size: 18px; line-height: 28px; }

.lede {
  color: var(--stadium-gray);
  max-width: 640px;
  font-size: 17px;
  line-height: 1.6;
}
@media (min-width: 768px) { .lede { font-size: 18px; line-height: 28px; } }

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 8px;
  column-gap: 16px;
  margin-bottom: 40px;
}
.section-heading h2 { min-width: 0; }
@media (max-width: 480px) {
  /* En móvil el título y el "Ver más →" no siempre caben en una sola fila;
     el link pasa a su propia línea completa en vez de forzar el título a
     partirse en dos y solaparse con él. */
  .section-heading .link { flex-basis: 100%; }
}
.section-heading .bar {
  width: 8px;
  height: 40px;
  background: var(--secondary);
  flex-shrink: 0;
}
.section-heading.bar-primary .bar { background: var(--primary); }
.section-heading h2 { flex: 1; }
.section-heading .link {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.section-heading .link:hover { text-decoration: underline; }

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
  background: var(--surface-container-lowest);
  border: 1px solid var(--stadium-gray);
  border-radius: var(--radius);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  box-shadow: 0 8px 24px rgba(0,42,88,0.10);
  transform: translateY(-3px);
  border-color: var(--primary);
}

/* Barra de "Compartir" (WhatsApp/Facebook/X + copiar enlace), reutilizada
   en las cards de noticias/vídeos (home, Publicaciones) y en el modal de
   noticia completa (ver js/share.js). Vive fuera del área clicable de la
   card para no anidar botones dentro de un <a>. */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 16px;
  border-top: 1px solid var(--stadium-gray);
  margin-top: 4px;
}
.news-modal-share.share-bar { border-top: none; padding: 20px 0 0; margin-top: 12px; }
.share-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--outline);
  margin-right: 2px;
}
.share-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.share-btn svg { width: 15px; height: 15px; fill: currentColor; }
.share-btn:hover { transform: translateY(-2px); }
.share-btn.whatsapp:hover { background: #25d366; color: #fff; }
.share-btn.facebook:hover { background: #1877f2; color: #fff; }
.share-btn.twitter:hover { background: #000; color: #fff; }
.share-btn.copy:hover { background: var(--primary); color: #fff; }
.share-btn.copy.copied { background: var(--grass-accent); color: #fff; }

.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(1, 1fr); }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.grid-12 { display: grid; grid-template-columns: repeat(1, 1fr); gap: var(--gutter); }
@media (min-width: 900px) { .grid-12 { grid-template-columns: repeat(12, 1fr); } }
.col-4 { grid-column: span 12; }
.col-5 { grid-column: span 12; }
.col-6 { grid-column: span 12; }
.col-7 { grid-column: span 12; }
.col-8 { grid-column: span 12; }
.col-12 { grid-column: span 12; }
@media (min-width: 900px) {
  .col-4 { grid-column: span 4; }
  .col-5 { grid-column: span 5; }
  .col-6 { grid-column: span 6; }
  .col-7 { grid-column: span 7; }
  .col-8 { grid-column: span 8; }
  .col-12 { grid-column: span 12; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--pitch-black);
  border-top: 4px solid var(--secondary);
  color: var(--stadium-gray);
  padding: var(--section-gap) 0 32px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand img { height: 44px; }
.footer-brand span {
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  font-size: 22px;
  text-transform: uppercase;
}
.footer-col h4 {
  color: var(--outline-variant);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col a, .footer-col p {
  display: block;
  color: var(--stadium-gray);
  opacity: 0.85;
  margin-bottom: 10px;
  font-size: 15px;
}
.footer-col a:hover { color: #fff; opacity: 1; text-decoration: underline; }
.footer-social { display: flex; gap: 14px; margin-top: 8px; }
.footer-social .icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  transition: background 0.2s, border-color 0.2s;
}
.footer-social .icon:hover { background: var(--secondary); border-color: var(--secondary); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
  opacity: 0.55;
}

/* ==========================================================================
   Material Symbols helper (inline SVG icon system - see icons.js)
   ========================================================================== */
.icon { display: inline-flex; align-items: center; justify-content: center; }
.icon svg { width: 1em; height: 1em; fill: currentColor; }

/* ==========================================================================
   Utility
   ========================================================================== */
.text-center { text-align: center; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.uppercase { text-transform: uppercase; }
.text-secondary { color: var(--secondary); }
.text-primary { color: var(--primary); }
.muted { color: var(--on-surface-variant); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(188,0,10,0.55); }
  50% { box-shadow: 0 0 0 6px rgba(188,0,10,0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Botón flotante para silenciar/activar el himno del club — sólo en home,
   ver js/anthem-player.js. */
.anthem-toggle {
  position: fixed;
  top: 96px; right: 20px;
  z-index: 90;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(10,17,26,0.35);
  transition: background 0.2s, transform 0.15s;
}
.anthem-toggle:hover { background: #96000a; }
.anthem-toggle:active { transform: scale(0.94); }
.anthem-toggle svg { width: 22px; height: 22px; fill: currentColor; }
.anthem-toggle .icon-muted { display: none; }
.anthem-toggle.is-muted .icon-unmuted { display: none; }
.anthem-toggle.is-muted .icon-muted { display: block; }
@media (max-width: 480px) {
  .anthem-toggle { top: 88px; right: 14px; width: 44px; height: 44px; }
}

/* Widget del tiempo (Elfsight) — OCULTO de momento a petición del usuario.
   Todo el CSS queda listo para cuando se reactive (junto con el HTML
   comentado en index.html): en desktop queda encima del botón de audio, en
   la misma columna derecha; en móvil/tablet pasa a la izquierda, a la misma
   altura que el audio (mismo criterio de "desktop" que usa el navbar).
.weather-widget-wrap {
  position: fixed;
  top: 96px; right: 20px;
  z-index: 89;
  width: 280px;
}
.weather-widget-wrap .consent-placeholder { min-height: 120px; }
@media (max-width: 1279px) {
  .weather-widget-wrap { top: 88px; left: 14px; right: auto; width: 240px; }
}
@media (min-width: 1280px) {
  .anthem-toggle { top: 268px; }
}
*/

/* Aviso "Tienda Oficial próximamente" — modal compartido, ver js/main.js */
.coming-soon-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,17,26,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.coming-soon-overlay.show { opacity: 1; pointer-events: auto; }
.coming-soon-box {
  position: relative;
  background: #fff; border-radius: var(--radius-lg);
  max-width: 380px; width: 100%;
  padding: 40px 32px 32px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 20px 60px rgba(10,17,26,0.3);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.coming-soon-overlay.show .coming-soon-box { transform: translateY(0); }
.coming-soon-box .coming-soon-icon { font-size: 40px; }
.coming-soon-box h3 { color: var(--primary); font-family: var(--font-display); font-size: 22px; text-transform: uppercase; }
.coming-soon-box p { color: var(--on-surface-variant); font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.coming-soon-box .coming-soon-close {
  position: absolute; top: 12px; right: 14px;
  font-size: 22px; line-height: 1; color: var(--outline);
}
.coming-soon-box .coming-soon-close:hover { color: var(--primary); }
