﻿/* ==========================================
  COMPONENTE HEADER - HERO CON VÍDEO
   
  Filosofía de diseño:
  - Hero a pantalla completa con vídeo de fondo
  - Navegación posicionada en la parte superior
  - Contenido centrado
  - Efectos de desplazamiento (parallax)
  ========================================== */

:root {
  /* Paleta Fuerteventura */
  --color-primary: #00A8B5; /* Mar Turquesa */
  --color-primary-dark: #007A87; /* Mar Profundo */
  --color-accent: #D4A574; /* Arena Dorada */
  --color-text: #2C2C2C; /* Volcán Oscuro */
  --color-text-light: #6B7280; /* Gris Neutro */
  --color-text-lighter: #9ca3af; /* Gris Claro */
  --color-bg-white: #FFFFFF; /* Blanco */
  --color-bg-light: #E8D7C3; /* Arena Clara */
  --color-bg-lighter: #f3f4f6;
  --color-border: #E8D7C3; /* Arena Light */
  --color-accent-secondary: #F89B4B; /* Sol Cálido */
  
  --shadow-xs: 0 1px 2px rgba(44, 44, 44, 0.05);
  --shadow-sm: 0 2px 8px rgba(44, 44, 44, 0.08);
  --shadow-md: 0 4px 12px rgba(44, 44, 44, 0.1);
  --shadow-lg: 0 8px 24px rgba(44, 44, 44, 0.12);
  
  --transition-fast: 0.2s ease-in-out;
  --transition-base: 0.3s ease-in-out;
  --transition-slow: 0.4s ease-in-out;
  
  --font-display: 'Yeseva One', serif;
  --font-body: 'Nunito Sans', sans-serif;
}

/* ========== HERO HEADER ========== */

header.hero-header {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
  margin: 0;
  padding: 0;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* When mobile nav is open, ensure header sits above everything */
body.nav-open header.hero-header {
  z-index: 2000;
}

/* Vídeo de fondo */

header.hero-header .hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -1;
  will-change: transform;
  transform: translateZ(0);
}

/* Capa/overlay del hero */

header.hero-header .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 0;
  pointer-events: none;
}

/* Disable interactions on hero content while drawer is open */
body.nav-open .hero-overlay,
body.nav-open .hero-content {
  pointer-events: none;
}

/* Barra de navegación superior */

.header-nav.top-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  padding: 1.5rem 2rem;
  pointer-events: auto;
}

.header-nav.top-nav .header-nav-list {
  display: flex !important;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  visibility: visible !important;
  opacity: 1 !important;
}

.header-nav.top-nav .header-nav-link {
  padding: 0.6rem 1.1rem;
  background-color: transparent;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  position: relative;
  transition: all var(--transition-base);
  display: inline-block;
  white-space: nowrap;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.header-nav.top-nav .header-nav-link:hover {
  background-color: rgba(0, 168, 181, 1);
  border-color: rgba(0, 168, 181, 1);
  transform: translateY(-2px);
}

.header-nav.top-nav .header-nav-link.active {
  background-color: rgba(212, 165, 116, 1);
  border-color: rgba(212, 165, 116, 1);
  color: #2C2C2C;
}

.header-nav.top-nav .header-nav-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Contenido del Hero - Centrado */

header.hero-header .hero-content {
  position: relative;
  z-index: 50;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 2rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  will-change: opacity, transform;
}

header.hero-header .hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  text-shadow: 3px 6px 12px rgba(0, 0, 0, 0.5);
  letter-spacing: -1px;
  line-height: 1.1;
  word-break: break-word;
}

header.hero-header .hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  color: #f0f0f0;
  font-weight: 400;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
  margin: 0;
  max-width: 600px;
}

header.hero-header .btn {
  margin-top: 1rem;
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background-color: var(--color-accent);
  color: #ffffff; /* Ensure readable white text on accent */
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 15px rgba(212, 165, 116, 0.4);
}

header.hero-header .btn:hover {
  background-color: var(--color-accent-secondary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(248, 155, 75, 0.5);
}

header.hero-header .btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* ========== HERO GENÉRICO (SECCIONES) ========== */
/* Aplica la misma tipografía y escala del hero de index a todas las secciones .hero */

.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  /* Neutralizar padding lateral inline para centrar respecto al viewport */
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.hero .hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 2rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.hero .hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 6rem) !important;
  font-weight: 900;
  color: #ffffff !important;
  margin: 0 !important;
  text-shadow: 3px 6px 12px rgba(0, 0, 0, 0.5) !important;
  letter-spacing: -1px;
  line-height: 1.1;
  word-break: break-word;
}

/* Subtítulo genérico: p directo dentro de hero-content o .hero-subtitle explícito */
.hero .hero-content > p,
.hero .hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 3vw, 1.8rem) !important;
  color: #f0f0f0 !important;
  font-weight: 400;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3) !important;
  margin: 0 !important;
  max-width: 600px;
}

/* Menú Hamburguesa */

/* ========== OVERRIDES: Mostrar títulos completos en feeds/cards ========== */
/* Portada (index.html) y listados (noticias.html, videos.html): quitar line-clamp */
.content-card .card-content h3,
.news-card .news-content h3 {
  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  overflow: visible !important;
  white-space: normal !important;
}

.header-hamburger {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 1001;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: auto;
  touch-action: manipulation;
}

.header-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all var(--transition-base);
}

.header-hamburger:hover span {
  background-color: var(--color-accent);
}

/* ========== RESPONSIVO ========== */

@media (max-width: 1024px) {
  .header-nav.top-nav .header-nav-list {
    gap: 0.5rem;
  }

  .header-nav.top-nav .header-nav-link {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
  }

  header.hero-header .hero-content {
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 768px) {
  header.hero-header {
    min-height: 80vh;
  }

  .header-nav.top-nav {
    padding: 1rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* Above overlay/content */
  }

  /* Offcanvas drawer */
  .header-nav.top-nav .header-nav-list {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80vw;
    max-width: 360px;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(0, 0, 0, 0.95);
    padding: 1rem 0;
    border-radius: 0;
    z-index: 1000;
    pointer-events: auto;
  }

  .header-nav.top-nav.active .header-nav-list,
  body.nav-open .header-nav.top-nav .header-nav-list {
    transform: translateX(0);
  }

  .header-nav.top-nav .header-nav-link {
    width: 100%;
    text-align: center;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 1rem;
    color: #ffffff;
    pointer-events: auto;
    position: relative;
    z-index: 1001;
  }

  .header-hamburger {
    display: flex;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001; /* Above nav */
  }

  header.hero-header .hero-content h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  header.hero-header .hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
  }

  header.hero-header .hero-content {
    padding: 3rem 1rem;
    gap: 1rem;
  }

  /* Escala responsiva para hero genérico */
  .hero .hero-content h1 {
    font-size: clamp(2rem, 8vw, 3.5rem) !important;
  }

  .hero .hero-content > p,
  .hero .hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem) !important;
  }

  /* Compensar barra de navegación fija en móviles para centrar visualmente */
  .hero {
    padding-top: 4rem;
    min-height: 60vh;
  }
}

/* Backdrop for offcanvas */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.mobile-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 480px) {
  header.hero-header {
    min-height: 70vh;
  }

  header.hero-header .hero-content h1 {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }

  header.hero-header .hero-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
  }

  .header-nav.top-nav {
    padding: 0.8rem 0.5rem;
  }

  header.hero-header .btn {
    padding: 0.7rem 2rem;
    font-size: 0.9rem;
  }

  /* Escala móvil para hero genérico */
  .hero .hero-content h1 {
    font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
  }

  .hero .hero-content > p,
  .hero .hero-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem) !important;
  }

  .hero {
    padding-top: 3.5rem;
    min-height: 55vh;
  }
}

/* Accesibilidad */

@media (prefers-reduced-motion: reduce) {
  .header-nav.top-nav .header-nav-link,
  header.hero-header .btn {
    transition: none;
  }

  header.hero-header .hero-content {
    will-change: auto;
  }
}

