/* styler.css — v06 (2025-10-08)
   Objetivo: Header fijo global + Hero Title fijo global (único) + Hero image que se desplaza con scroll, sin solapar contenido.
   Cambios principales:
   - NUEVO: .hero-title-fixed (título único, fijo en TODAS las vistas).
   - CAMBIO: .header-panel pasa a position: fixed en todas las vistas; z-index alto.
   - CAMBIO: .hero se mantiene absolute y visible solo en >=1201px; oculta en <=1200px.
   - CAMBIO: Sustitución de offsets rígidos (67px/123px) por cálculo con variables y safe-area.
   - CAMBIO: Reserva de espacio para el título en .icons-section (padding-top) en >=1201px; y padding-top del body en <=1200px.
   - Limpieza: Se eliminan .hero-title-movil y .hero-title-container (legacy). 
*/

/* =========================
   1) Fuentes (opcional)
   ========================= */
   @font-face {
    font-family: 'Overpass Mono';
    src: url('fonts/OverpassMono-VariableFont_wght.ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-VariableFont_wght.ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
  }
  
  /* =========================
     2) Reset básico
     ========================= */
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; }
  img { display: block; max-width: 100%; height: auto; }
  
  /* =========================
     3) Variables globales
     ========================= */
  :root{
    --blue-900: #1f3864;
    --blue-800: #173a63;
    --pill:      #465565;
    --text:      #333;
    --bg:        #ffffff;
    --white:     #fff;
  
    --header-h: 64px;
    --footer-h: 48px;
    --title-fixed-h: 50px;
  
    /* NUEVO v06: safe-area para notch */
    --safe-top: env(safe-area-inset-top);
  }
  
  /* NUEVO v06: evita que los anclajes queden tapados por header+title */
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--title-fixed-h) + var(--safe-top)); }
  
  body {
    font-family: 'Overpass', 'League Spartan', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
  }
  
  /* =========================
     4) Header (barra superior)
     ========================= */
  .header-panel {
    /* CAMBIO v06: fijo en TODAS las vistas */
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    width: 100%;
    background: var(--blue-900);
    color: #fff;
    border: none;
    box-shadow: 0 1px 0 rgba(0,0,0,.25);
  }
  .header-inner {
    width: 100%;
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    min-height: var(--header-h);
  }
  .title-logo { font-size: 1.8rem; font-weight: 800; letter-spacing: .3px; color: #fff; margin-right: 10px; }
  .logo-img-btn { border: 0; background: none; padding: 0; pointer-events: none; }
  .logo-img-btn img { height: 46px; width: auto; opacity: .98; }
  
  /* =========================
     5) Menú de navegación
     ========================= */
  .nav-menu { display: flex; margin-left: auto; }
  .nav-menu ul { list-style: none; display: flex; gap: 70px; align-items: center; }
  .nav-menu li { display: block; }
  .nav-menu a {
    display: inline-block; text-decoration: none; color: #fff; font-weight: 600; font-size: 1rem;
    padding: 5px 20px; border-radius: 25px; transition: background .15s ease, opacity .15s ease; white-space: nowrap;
  }
  .nav-menu a:hover { background: var(--blue-800); }
  .nav-menu a.active { background: var(--pill); color: #fff; padding: 5px 30px 2px 30px; }
  
  /* Botón cierre (móvil) */
  .close-menu {
    position: absolute; top: 10px; right: 10px;
    font-size: 2.2rem; font-weight: 200; line-height: 1; color: #fff;
    border: none; background: transparent; cursor: pointer; padding: 5px 10px; z-index: 1000;
  }
  /* Hamburguesa */
  .hamburger { display: none; margin-left: 10px; width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; cursor: pointer; }
  .hamburger-box { position: relative; display: block; width: 24px; height: 2px; margin: 0 auto; top: 0; background: transparent; }
  .hamburger-inner,
  .hamburger-inner::before,
  .hamburger-inner::after { position: absolute; left: 0; width: 24px; height: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
  .hamburger-inner { top: 0; }
  .hamburger-inner::before { content: ""; top: -7px; }
  .hamburger-inner::after  { content: ""; top: 7px; }
  .hamburger.is-active .hamburger-inner { transform: rotate(45deg); }
  .hamburger.is-active .hamburger-inner::before { transform: rotate(90deg) translateX(-7px); top: 0; }
  .hamburger.is-active .hamburger-inner::after  { opacity: 0; }
  
  /* =========================
     6) HERO IMAGE (scrolla con el contenido)
     ========================= */
  .hero{
    /* Mantengo absolute para que la imagen no sea fija y se desplace con el documento */
    position: absolute;
    top: var(--header-h); /* empieza bajo el header fijo */
    left: 0; right: 0;
    width: 100%;
    height: clamp(300px, 38vh, 460px);
    z-index: 10;
    overflow: hidden;
    background: #0f2847;
  }
  .hero-img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; pointer-events: none; }
  .hero-overlay{ position: absolute; inset: 0; z-index: 1; }
  
  /* =========================
     7) HERO TITLE (ÚNICO Y FIJO)
     ========================= */
  .hero-title-fixed{
    /* NUEVO v06: título fijo inmediatamente bajo el header, siempre visible */
    position: fixed;
    top: calc(var(--header-h) + var(--safe-top));
    left: 0; right: 0;
    height: var(--title-fixed-h);
    display: flex; align-items: center; justify-content: center;
    background-color: rgba(135, 161, 177, 0.7);
    color: var(--blue-900);
    padding: 10px 20px;
    box-sizing: border-box;
    z-index: 150; /* por encima del hero */
  }
  .main-title-hero{
    max-width: 66.67%;
    margin: 0 auto;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: clip;
  }
  
  /* LEGACY (oculto): eliminamos duplicidades de títulos antiguos */
  .hero-title-movil,
  .hero .hero-title-container { display: none !important; }
  
  /* =========================
     8) ICONS GRID
     ========================= */
  .icons-section{
    width: 100%;
    margin: 18px auto 24px;
    padding: 0 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    justify-items: stretch;
  }
  .icon{
    width: 100%; text-align: center; text-decoration: none; color: #0d1b2a; background: #fff; border-radius: 20px;
    padding: 10px 10px 10px;
    transition: transform .15s ease, box-shadow .15s ease; box-shadow: 0 2px 10px rgba(0,0,0,.05);
  }
  .icon img { width: min(300px, 80%); margin: 0 auto 0.5px; }
  .icon p { font-weight: 700; font-size: 1.06rem; line-height: 1.28; color: var(--blue-900); }
  .icon:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.12); }
  
  /* =========================
     9) FOOTER
     ========================= */
  .site-footer { background: #fff; border-top: 1px solid #e0e0e0; margin-top: auto; }
  .footer-container { width: 100%; margin: 0 auto; padding: 12px 16px; text-align: center; height: var(--footer-h); display:flex; align-items:center; justify-content:center; }
  .derechos { font-size: 13px; color: #666; margin: 0; }
  
  /* =========================
     10) ESCRITORIO (>=1201px)
     ========================= */
  @media (min-width: 1201px){
    /* Menú */
    .hero-title-fixed .main-title-hero { font-size: clamp(1.2rem, 2.2vw, 2.1rem); }
    .header-inner { justify-content: space-between; flex-wrap: nowrap; }
    .nav-menu { margin-left: auto; }
    .nav-menu ul { gap: 15px; }
    .nav-menu a { padding: 5px 12px; }
  
    /* Hero visible en escritorio */
    .hero{ display: block; }
  
    /* Contenido: margen por altura del hero + separación
       y reserva del alto del título para evitar solapes */
    .page-recursos-body .icons-section{
      margin-top: calc(38vh + 24px);  /* altura hero (38vh) + separación */
      padding-top: var(--title-fixed-h); /* reserva por el título fijo */
    }
  }
  
  /* Escritorios estrechos (1201px–1400px): 4 columnas y margen dinámico */
  @media (min-width: 1201px) and (max-width: 1400px){
    .page-recursos-body .icons-section{
      grid-template-columns: repeat(4, 1fr);
      gap: 12px; padding-left: 16px; padding-right: 16px;
    }
  }
  /* Ultra-wide (>=1600px): 6 columnas */
  @media (min-width: 1600px){
    .page-recursos-body .icons-section{
      grid-template-columns: repeat(6, 1fr);
      gap: 12px; padding-left: 16px; padding-right: 16px;
    }
  }
  
  /* =========================
     11) TABLET (993px–1200px)
     ========================= */
  @media (min-width: 993px) and (max-width: 1200px){
    /* Hero oculto en tablet */
    .hero{ display: none !important; height: 0 !important; }
    /*.main-title-hero {
        max-width: 66.67%;
        margin: 0 auto;
        font-size: clamp(1rem, 2.5vw, 1.8rem);
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }
        */
    .hero-title-fixed {margin-top: 4.5%;}    
    /* El título fijo global sigue visible; desplazamos el documento bajo header+title */
    .page-recursos-body{ padding-top: calc(var(--header-h) + var(--title-fixed-h) + var(--safe-top)) !important; }
  
    /* Rejilla: 3 columnas */
    .icons-section{ grid-template-columns: repeat(3, 1fr); gap: 12px; padding-left: 16px; padding-right: 16px;padding-top: 5%; }
  
    /* Menú responsive */
    .header-inner { flex-wrap: wrap; justify-content: center; gap: 10px; padding-top: 10px; }
    .logo-img-btn img { height: 46px; }
    .nav-menu { width: 100%; justify-content: center; margin-left: 0; }
    .nav-menu ul { gap: 5px; flex-wrap: wrap; justify-content: center; }
    .nav-menu a { font-size: 1rem; padding: 8px 24px; }
    .nav-menu a.active { padding: 8px 30px; }
  }
  
  /* =========================
     12) MÓVIL / TABLET PEQUEÑA (<=992px)
     ========================= */
  @media (max-width: 992px){
    /* Hero oculto */
    .hero{ display: none !important; height: 0 !important; }
  
    /* Desplazar bajo header + title fijos */
    .page-recursos-body{ padding-top: calc(var(--header-h) + var(--title-fixed-h) + var(--safe-top)) !important; }
  
    /* Rejilla */
    .icons-section{ grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px 5px 20px; }
  
    /* Menú móvil */
    .header-panel { top: 0; }
    .nav-menu { display: none; }
    .hamburger { display: inline-block; }
    .nav-menu.is-open{
      display: block;
      position: fixed; inset: 0; top: 0;
      padding-top: calc(var(--header-h) + var(--safe-top));
      background: rgba(10,37,64,.96);
      backdrop-filter: blur(2px);
      z-index: 999;
    }
    .nav-menu.is-open ul { flex-direction: column; gap: 18px; align-items: center; justify-content: flex-start; padding-top: 12px; }
    .nav-menu.is-open a { font-size: 1.05rem; padding: 10px 14px; border-radius: 999px; }
    .nav-menu.is-open a.active { padding: 10px 22px; }
    .close-menu { display: block; }
  }
  
  /* Smartphones muy estrechos (<=480px): 1 columna */
  @media (max-width: 480px){
    .icons-section{ grid-template-columns: 1fr; padding-left: 5px; padding-right: 5px; gap: 5px; }
    .icon{ padding: 18px 5px 10px; }
    .icon img{ width: min(150px, 95%); margin: 0 auto 6px; }
    .main-title-hero {max-width: 90%;}
    .hero-title-fixed {margin-top: 0.5% !important;}
    .icons-section {padding-top: 0.5% !important;}
  }
  /* Oculta cierre y hamburguesa en <=993px */
  @media (max-width: 992px){
    .hero-title-fixed {margin-top: 0.1%;}
    .icons-section{padding-top: 0.5%; }
  }
  
  /* Oculta cierre y hamburguesa en >=993px */
  @media (min-width: 993px){
    .close-menu, .hamburger { display: none !important; }
    /*
    .hero-title-fixed {margin-top: 9.5%;}    
    .icons-section{padding-top: 9.5%; }
    */
  }
  
  /* =========================
     13) Tipos de texto en iconos (sin cambios funcionales)
     ========================= */
  .page-recursos-body .icon-text-lines span{ display: block; white-space: nowrap; letter-spacing: .3px; margin-top: .5px; line-height: 1.0; }
  .page-recursos-body .icon-text-lines .line-1{
    font-size: 1.2rem; font-weight: 700; font-family: 'League Spartan', sans-serif; font-variant: small-caps; letter-spacing: .3px; color: var(--blue-900);
  }
  .page-recursos-body .icon-text-lines .line-2{
    font-size: 1.0rem; font-weight: 600;
    font-family: 'Overpass','League Spartan',system-ui,-apple-system, Segoe UI, Roboto, Ubuntu,'Helvetica Neue',Arial,sans-serif;
    font-variant: small-caps; color: var(--blue-800);
  }
  .page-recursos-body .icon-text-lines .line-3{
    font-size: .85rem; font-family: 'Overpass','League Spartan',system-ui,-apple-system, Segoe UI, Roboto, Ubuntu,'Helvetica Neue',Arial,sans-serif;
    color: var(--text);
  }
  /* Alineación de <p> en iconos */
  .page-recursos-body .icons-section .icon p{ padding: 0; }
  