/* Club de Golf Angostura — Custom Styles
   These complement Tailwind utilities, not replace them */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  --color-green-900: #0f2b19;
  --color-green-800: #1a4a2e;
  --color-green-700: #2d6b42;
  /* Brand kit dorado — tokens diferenciados según fondo (WCAG AAA) */
  --color-gold-500:    #b8941f;  /* Dorado base — solo para BACKGROUNDS de botones */
  --color-gold-bright: #fbbf24;  /* Dorado luminoso — texto sobre fondos OSCUROS (verde, foto). Contraste 7.07:1 sobre #1a4a2e ✓ AAA */
  --color-gold-dark:   #854d0e;  /* Dorado profundo — texto sobre fondos CLAROS (white, gray). Contraste 9.18:1 sobre white ✓ AAA */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Base ─────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  /* Previene zoom en iOS al hacer focus en inputs */
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  /* WCAG AAA — texto base 16px mínimo para usuarios mayores */
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.font-display { font-family: var(--font-display); }

/* Targets táctiles mínimos (Ley de Fitts + WCAG AAA) */
a, button, [role="button"] {
  -webkit-tap-highlight-color: rgba(184, 148, 31, 0.2);
}

/* Alpine.js x-cloak: evita flash durante la carga */
[x-cloak] { display: none !important; }

/* Focus styles (accessibility) — 3px gold con offset */
:focus-visible {
  outline: 3px solid var(--color-gold-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip-to-content con focus destacado */
.skip-to-content:focus {
  outline-offset: 0;
  box-shadow: 0 0 0 3px var(--color-gold-500);
}

/* ── Skip-to-content (accessibility) */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  background: var(--color-green-800);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 0.5rem 0;
  text-decoration: none;
}
.skip-to-content:focus {
  left: 0;
  outline: 2px solid var(--color-gold-500);
  outline-offset: 2px;
}

/* ── Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Tailwind extended colors ─────────────────────────────── */
.bg-club-green   { background-color: var(--color-green-800); }
.text-club-green { color: var(--color-green-800); }
.bg-club-gold    { background-color: var(--color-gold-500); }
.text-club-gold  { color: var(--color-gold-dark); }            /* Default: para fondos claros */
.text-club-gold-bright { color: var(--color-gold-bright); }    /* Para fondos oscuros */
.border-club-gold { border-color: var(--color-gold-500); }

/* ── Hero principal (home) ────────────────────────────────── */
.hero-section {
  position: relative;
  height: 70vh;
  min-height: 540px;     /* asegura que el contenido (h1 + subtitle + CTAs) quepa */
  max-height: 800px;
  overflow: hidden;
}

@media (max-width: 768px) {
  /* Mobile: prioriza que el contenido quepa, no la altura visual */
  .hero-section { height: auto; min-height: 560px; }
}

/* ── Navigation ───────────────────────────────────────────── */
#main-nav {
  background-color: var(--color-green-800);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* ── Page Hero Banners ────────────────────────────────────── */
/* Masterpage: estructura unificada para todos los heroes internos */
.section-hero {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  color: white;
}
.section-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.section-hero .section-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.50) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0.75) 100%);
}
.section-hero .section-hero-content {
  position: relative;
  z-index: 10;
  max-width: 80rem;
  margin: 0 auto;
  /* Padding estándar: 4rem mobile / 5rem desktop (tras header sticky h-20) */
  padding: 4rem 1rem;
}
@media (min-width: 640px) {
  .section-hero .section-hero-content {
    padding: 4.5rem 1.5rem;
  }
}
@media (min-width: 1024px) {
  .section-hero .section-hero-content {
    padding: 5rem 2rem;
  }
}
.section-hero { min-height: 380px; }

/* Legacy fallback */
.page-hero {
  position: relative;
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, var(--color-green-900) 0%, var(--color-green-800) 60%, #2d6b42 100%);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ── Cards & Sections ─────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-green-800);
  line-height: 1.2;
}

.section-subtitle {
  color: #6b7280;
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 48rem;
}

/* ── Divider ──────────────────────────────────────────────── */
.gold-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.gold-divider::before {
  content: '';
  width: 3rem;
  height: 3px;
  background: var(--color-gold-500);
  border-radius: 2px;
}

/* ── Line clamp utilities ─────────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Spinner animation ────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 0.8s linear infinite; }

/* ── Scroll to top — WCAG AAA target 48px ────────────────── */
#scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  background: var(--color-green-800);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 40;
  border: none;
}
@media (min-width: 768px) {
  #scroll-top { bottom: 2rem; right: 2rem; }
}
#scroll-top.visible { opacity: 1; transform: translateY(0); }
#scroll-top:hover { background: var(--color-green-700); }

/* ── FAB Tarjeta de juego (solo home) ─────────────────────── */
.tarjeta-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-gold-500, #b8941f);
  color: #1a2e1a;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.18);
  text-decoration: none;
  z-index: 45;
  transition: box-shadow 0.2s;
  animation: tarjetaFabPulse 1.6s ease-out infinite;
}
.tarjeta-fab:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,0.32), 0 4px 8px rgba(0,0,0,0.22);
  animation-play-state: paused;
}
.tarjeta-fab svg { flex-shrink: 0; }
.tarjeta-fab .tarjeta-fab-label { white-space: nowrap; }

/* Parpadeo + ring ripple + scale heartbeat — la tarjeta es la acción más usada por socios,
   el FAB debe ser el primer elemento que detecta la vista al abrir el sitio en móvil. */
@keyframes tarjetaFabPulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 8px 24px rgba(0,0,0,0.28),
      0 0 0 0 rgba(251, 191, 36, 0.75);
    filter: brightness(1);
  }
  30% {
    transform: scale(1.06);
    box-shadow:
      0 8px 24px rgba(0,0,0,0.28),
      0 0 0 10px rgba(251, 191, 36, 0.35);
    filter: brightness(1.08);
  }
  70% {
    transform: scale(1);
    box-shadow:
      0 8px 24px rgba(0,0,0,0.28),
      0 0 0 24px rgba(251, 191, 36, 0);
    filter: brightness(1);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 8px 24px rgba(0,0,0,0.28),
      0 0 0 0 rgba(251, 191, 36, 0);
    filter: brightness(1);
  }
}

/* Cuando FAB está presente, scroll-top se apila arriba */
body:has(.tarjeta-fab) #scroll-top { bottom: 5.25rem; }

@media (min-width: 768px) {
  .tarjeta-fab { bottom: 2rem; right: 2rem; padding: 0.875rem 1.5rem; font-size: 0.9375rem; }
  body:has(.tarjeta-fab) #scroll-top { bottom: 6rem; }
}

/* En pantallas muy pequeñas, ocultar label y mostrar solo el icono */
@media (max-width: 480px) {
  .tarjeta-fab .tarjeta-fab-label { display: none; }
  .tarjeta-fab { padding: 0.85rem; }
}

/* Respetar preferencia de reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .tarjeta-fab { animation: none; }
}

/* ── Print styles ─────────────────────────────────────────── */
@media print {
  #main-nav, #scroll-top, .tarjeta-fab, footer { display: none; }
  body { font-size: 12pt; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 10pt; }
}
