/* ========================================================================
   STYLES.CSS
   Identidad Visual: Juan Carlos de la Cruz Eligio
   Enfermería Informática + Salud Digital

   ÍNDICE:
   1. Tokens (Variables CSS)
   2. Reset & Base Global
   3. Tipografía
   4. Componentes UI (Botones, Cards, Pills, Alertas, Forms)
   5. Layout & Utilidades (Grid, Modo Oscuro)
   6. Header & Navegación (Estructura Base)
   7. Footer (Estructura Base)
   8. Lógica Responsive (Tablet & Mobile)
   9. Performance (Skeleton Loading / CLS Fix)
   ======================================================================== */

/* =========================================================
   1. TOKENS (SISTEMA DE DISEÑO)
   Definición de paleta, tipografía, espacios y escalas.
   ========================================================= */
:root {
  /* --- Paleta de Colores --- */
  --c-ink:     #0F172A; /* Azul Profundo (Texto Principal / Fondos Oscuros) */
  --c-primary: #0A66C2; /* Azul Corporativo (Enlaces / Botones) */
  --c-accent:  #06B6D4; /* Cian (Detalles / Salud Digital) */
  --c-text:    #475569; /* Gris Texto (Párrafos) */
  
  /* --- Fondos --- */
  --c-bg:      #F8FAFC; /* Fondo General Claro */
  --c-bg-dark: #172540; /* Fondo Footer / Modo Oscuro */

  /* --- Estados Interactivos --- */
  --c-primary-hover:  #084C94; 
  --c-primary-active: #063A73; 
  --c-accent-hover:   #0891B2;
  --c-accent-active:  #0E7490;
  --c-disabled:       #A5B4C3; 

  /* --- Tintas y Superficies --- */
  --c-primary-soft:   #E6F0FA; 
  --c-primary-soft-active: #D4E6F5;
  --surface-1: #FFFFFF; 
  --surface-2: #F1F5F9; 
  --border:    #E2E8F0; 
  
  /* --- Efectos --- */
  --shadow:    0 10px 30px rgba(15, 23, 42, 0.08); 
  --focus:     0 0 0 3px rgba(6, 182, 212, 0.35);

  /* --- Tipografía --- */
  --font-body:   "Roboto", system-ui, sans-serif;
  --font-head:   "IBM Plex Sans", system-ui, sans-serif;
  --font-accent: "Space Grotesk", system-ui, sans-serif;

  /* --- Escala Tipográfica (Mobile Base) --- */
  --h1: 28px; 
  --h2: 24px; 
  --h3: 20px; 
  --h4: 18px; 
  --h5: 16px; 
  --h6: 15px;
  --p:  14px;
  --note: 13px;

  --lh-tight: 1.15;
  --lh-normal: 1.6;

  /* --- Espaciado y Geometría --- */
  --container: 1120px;
  
  --radius-sm: 10px; 
  --radius-md: 14px; 
  --radius-lg: 18px; 
  --radius-xl: 22px;
  
  --space-1: 6px;  
  --space-2: 10px; 
  --space-3: 14px;
  --space-4: 18px; 
  --space-5: 26px; 
  --space-6: 36px; 
  --space-8: 64px;
}

/* Ajuste de Escala: Tablet (>= 768px) */
@media (min-width: 768px) {
  :root {
    --h1: 32px; --h2: 26px; --h3: 22px; 
    --h4: 20px; --h5: 18px; --h6: 16px;
    --p:  15px; --note: 14px;
  }
}

/* Ajuste de Escala: Desktop (>= 1024px) */
@media (min-width: 1024px) {
  :root {
    --h1: 36px; --h2: 30px; --h3: 24px; 
    --h4: 22px; --h5: 20px; --h6: 18px;
    --p:  16px; --note: 15px;
  }
}


/* =========================================================
   2. RESET & BASE GLOBAL
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box; /* Manejo intuitivo del modelo de caja */
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--p);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased; /* Mejora renderizado de fuentes en Mac/iOS */
  overflow-x: hidden; 
  position: relative;
}

img { max-width: 100%; height: auto; display: block; }


/* =========================================================
   3. TIPOGRAFÍA
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  margin: 0 0 var(--space-3);
  line-height: var(--lh-tight);
}

h1 { font-size: var(--h1); font-weight: 900; color: var(--c-ink); }
h2 { font-size: var(--h2); font-weight: 800; color: var(--c-primary); }
h3 { font-size: var(--h3); font-weight: 700; color: var(--c-text); }
h4 { font-size: var(--h4); font-weight: 600; color: var(--c-text); }
h5 { font-size: var(--h5); font-weight: 500; color: var(--c-text); }
h6 { font-size: var(--h6); font-weight: 500; color: var(--c-text); }

p { margin: 0 0 var(--space-4); }

/* Kicker: Texto pequeño sobre títulos (ej: "CATEGORÍA") */
.kicker {
  font-family: var(--font-accent);
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85em;
  font-weight: 600;
}

/* Enlaces Generales */
a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
a:hover { color: var(--c-primary-hover); }
a:visited { color: var(--c-text); }
a[class] { text-decoration: none; } /* Enlaces con clase (botones/nav) sin subrayado */


/* =========================================================
   4. COMPONENTES UI
   ========================================================= */

/* --- Botones --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--p);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

/* Variantes de Botón */
.btn--primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-bg);
}
.btn--primary:hover { 
  background: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
  color: var(--c-bg); 
}
.btn--primary:active { 
  background: var(--c-primary-active);
  transform: translateY(1px);
}
a.btn--primary:visited { color: var(--c-bg); }

.btn--secondary {
  background: transparent;
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.btn--secondary:hover {
  background: var(--c-primary-soft);
  color: var(--c-primary-hover);
}
.btn--secondary:active {
  background: var(--c-primary-soft-active);
  transform: translateY(1px);
}
a.btn--secondary:visited { color: var(--c-primary); }

.btn--accent {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-ink);
}
.btn--accent:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  color: var(--c-ink);
}
.btn--accent:active {
  background: var(--c-accent-active);
  color: var(--c-bg);
}
a.btn--accent:visited { color: var(--c-ink); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-primary);
}
.btn--ghost:hover {
  background: rgba(10, 102, 194, 0.08);
  color: var(--c-primary-hover);
}
.btn--ghost:active {
  background: rgba(10, 102, 194, 0.12);
  color: var(--c-primary-active);
}
a.btn--ghost:visited { color: var(--c-primary); }


/* --- Cards (Tarjetas) --- */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Estilos de Card */
.card--base {
  background: var(--surface-1);
  border-color: var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.card--base:hover {
  border-color: var(--c-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card--highlight {
  background: var(--c-primary-soft);
  border-color: var(--c-primary);
}
.card--highlight:hover {
  background: #DCEAF8;
  transform: translateY(-3px);
}

.card--dark {
  background: rgba(255, 255, 255, 0.03); 
  border-color: rgba(255, 255, 255, 0.1); 
  color: var(--c-disabled);
}
.card--dark:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}
.card--dark h3, .card--dark h4 { color: var(--c-bg); }

.card--dark-highlight {
  background: rgba(6, 182, 212, 0.1); 
  border-color: var(--c-accent); 
  color: var(--c-bg);
}
.card--dark-highlight:hover {
  background: rgba(6, 182, 212, 0.15);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* --- Pills (Etiquetas) --- */
.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 99px;
  line-height: 1;
}

.card--base .pill,
.card--highlight .pill {
  background-color: var(--c-primary-soft);
  color: var(--c-primary);
  border: 1px solid transparent;
}

.card--dark .pill,
.card--dark-highlight .pill {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--c-disabled);
}

/* --- Formularios --- */
.form-group { margin-bottom: var(--space-4); }

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--c-ink);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--p);
  transition: all 0.2s ease;
  box-sizing: border-box; 
  appearance: none;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* --- Alertas --- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--p);
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert--success { background: #DCFCE7; color: #14532D; border-left-color: #16A34A; }
.alert--warning { background: #FEF3C7; color: #78350F; border-left-color: #F59E0B; }
.alert--error   { background: #FEE2E2; color: #7F1D1D; border-left-color: #DC2626; }
.alert--info    { background: var(--c-primary-soft); color: var(--c-primary-active); border-left-color: var(--c-primary); }

/* --- Breadcrumbs (Migas de Pan) --- */
.breadcrumb {
  font-family: var(--font-body);
  font-size: 0.95rem;       
  color: var(--c-text);
  opacity: 0.9;             
  line-height: 1.5;
}

/* Enlaces (Niveles anteriores) */
.breadcrumb a {
  color: inherit;           
  text-decoration: none;
  opacity: 0.65;            
  transition: all 0.2s ease;
  font-weight: 400;
}

/* Interacción */
.breadcrumb a:hover {
  opacity: 1;               
  text-decoration: underline;
  color: var(--c-primary); 
}

/* Elemento Actual (Último nivel) */
.breadcrumb span,
.breadcrumb .is-active {
  opacity: 1;               
  font-weight: 600;         
  color: var(--c-ink); 
  cursor: default;          
}

/* Ajuste para Modo Oscuro */
.u-dark-theme .breadcrumb a,
.index-dark .breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
}
.u-dark-theme .breadcrumb a:hover,
.index-dark .breadcrumb a:hover,
.u-dark-theme .breadcrumb span,
.index-dark .breadcrumb span {
  color: #fff;
}

/* =========================================================
   5. LAYOUT & UTILIDADES
   ========================================================= */
.container {
  width: min(var(--container), 100% - 2rem);
  margin: 0 auto;
}

.section { padding: var(--space-6) 0; }

.grid { display: grid; gap: var(--space-5); }

/* Grid Responsive */
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.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;
}

/* Modo Oscuro / Temas Alternativos */
.u-dark-theme,
.index-dark { 
  background: var(--c-bg-dark); 
  color: var(--c-disabled);
}
.u-dark-theme h2, .index-dark h2,
.u-dark-theme h3, .index-dark h3,
.u-dark-theme h4, .index-dark h4 { color: var(--c-bg); }
.u-dark-theme p, .index-dark p,
.u-dark-theme .section__subtitle, .index-dark .section__subtitle { color: var(--c-disabled); }
.u-dark-theme .kicker, .index-dark .kicker { color: var(--c-accent); }

/* Overrides de Formulario y Alertas en Oscuro */
.u-dark-theme .form-input, .index-dark .form-input,
.u-dark-theme .form-textarea, .index-dark .form-textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--c-bg);
}
.u-dark-theme .alert, .index-dark .alert {
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--c-disabled);
}


/* =========================================================
   6. HEADER & NAVEGACIÓN (ESTRUCTURA BASE)
   ========================================================= */
#site-header, .site-header { display: contents; }

/* --- Barra Superior (Header Top) --- */
.site-header__top {
  background: var(--c-ink);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  width: 100%;
  z-index: 50; 
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: #fff;
}

.brand__logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  display: grid; place-items: center;
  flex-shrink: 0;
}

.brand__text { display: flex; flex-direction: column; gap: 3px; }

.brand__name {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 18px;
  line-height: 1.1;
  color: #FFFFFF;
}

.brand__role {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

/* Badge de Estado */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #16A34A;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.20);
}

/* Botón Contactar Header */
.site-header__top a.btn--secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9); /* Blanco suave forzado */
  padding: 8px 16px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.site-header__top a.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: #ffffff;
  color: #ffffff;
}

/* --- Barra de Navegación (Sticky) --- */
.site-header__nav {
  background: var(--c-bg-dark); 
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 99999; 
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateZ(0); 
}

.site-header__nav .nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-header .nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: rgba(255,255,255,0.92); 
  border: 1px solid transparent; 
  transition: all 0.2s ease;
}

.site-header .nav__link:hover,
.site-header .nav__link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.20); 
  border-color: rgba(255, 255, 255, 0.25);
}

.site-header .nav__link--active,
.site-header .nav__link[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08); 
  border-color: rgba(255, 255, 255, 0.10);
}

.site-header .nav__email {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid transparent;
  transition: background 0.2s ease;
}
.site-header .nav__email:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}

/* --- Dropdowns (Estilo Desktop/Tablet) --- */
/* Visible para pantallas >= 768px */
@media (min-width: 768px) {
  
  .nav__dropdown, 
  .nav__dropdown--nested {
    position: relative;
    height: 100%;
    display: flex; 
    align-items: center; 
  }

  /* Puentes invisibles para evitar cierre accidental al mover mouse */
  .nav__dropdown::after {
    content: ""; position: absolute; top: 100%; left: 0;
    width: 100%; height: 20px; background: transparent; display: none;
  }
  .nav__dropdown--nested::after {
    content: ""; position: absolute; top: 0; left: 100%;
    width: 20px; height: 100%; background: transparent; display: none;
  }
  
  .nav__dropdown:hover::after, .nav__dropdown:focus-within::after,
  .nav__dropdown--nested:hover::after, .nav__dropdown--nested:focus-within::after {
    display: block;
  }

  /* Menús flotantes */
  .nav__submenu {
    position: absolute;
    top: 100%; left: 0;
    min-width: 260px;
    padding: 8px;
    border-radius: 16px;
    background: var(--c-ink);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 16px 40px rgba(0,0,0,0.30);
    display: none;
    z-index: 100;
    margin-top: 8px;
  }

  .nav__submenu--nested {
    position: absolute;
    top: -8px; left: 100%;
    margin-left: 8px;
    min-width: 260px;
    padding: 8px;
    border-radius: 16px;
    background: var(--c-ink);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 16px 40px rgba(0,0,0,0.30);
    display: none;
    z-index: 100;
  }

  .nav__dropdown:hover > .nav__submenu,
  .nav__dropdown:focus-within > .nav__submenu,
  .nav__dropdown--nested:hover > .nav__submenu--nested,
  .nav__dropdown--nested:focus-within > .nav__submenu--nested {
    display: block;
    animation: fadeIn 0.2s ease-out;
  }

  .site-header .nav__sublink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.86);
    text-decoration: none;
  }
  .site-header .nav__sublink:hover {
    color: #fff;
    background: rgba(6, 182, 212, 0.12);
  }
}


/* =========================================================
   7. FOOTER (ESTRUCTURA BASE & ESTILOS)
   ========================================================= */
.site-footer { border-top: 1px solid rgba(255,255,255,0.08); }

.site-footer__top {
  background: var(--c-bg-dark);
  color: rgba(255,255,255,0.72);
  padding: var(--space-6) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1.25fr;
  column-gap: var(--space-4);
  row-gap: var(--space-5);
  align-items: start;
}

.footer-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  margin: 0 0 16px;
  color: rgba(255,255,255,0.92);
}

.footer-text {
  margin: 0 0 16px;
  line-height: 1.6;
  font-size: var(--note);
  color: rgba(255,255,255,0.72);
}

/* Enlaces de listas (Col 2 y 3) */
.footer-links {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.footer-links a, .footer-note a {
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: var(--note);
  color: rgba(255,255,255,0.65); 
  transition: color 0.2s ease;
}
.footer-links a:hover, .footer-note a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* --- Redes Sociales (Estilo Botón Ghost) --- */
.footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
/* Estilo específico para los botones pill dentro del footer */
.footer-actions .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9); /* Blanco suave */
  text-decoration: none;
  text-transform: none; 
  transition: all 0.2s ease;
}
.footer-actions .pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
}

/* --- Newsletter Input --- */
.footer-form {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px;
}
.footer-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px; 
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: var(--note);
  outline: none;
}
.footer-form input:focus {
  border-color: var(--c-accent);
  background: rgba(255,255,255,0.1);
}

/* --- Footer Bottom (Restaurado) --- */
.site-footer__bottom {
  background: var(--c-ink); 
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
}
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
}
.footer-copy { margin: 0; color: rgba(255,255,255,0.6); font-size: 13px; }

/* Navegación pequeña inferior (Sobre mí, Proyectos...) */
.footer-mini-nav { display: inline-flex; gap: 16px; }

.footer-mini-nav a {
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  color: rgba(255,255,255,0.65); /* Gris claro */
  transition: color 0.2s ease;
}
.footer-mini-nav a:hover { 
  color: #ffffff; /* Blanco al pasar cursor */
  text-decoration: underline; 
}

/* =========================================================
   8. LÓGICA RESPONSIVE (HOMOLOGADA)
   Control de breakpoints para Header y Footer.
   ========================================================= */

/* --- A) TABLET (768px - 1023px) ---
   Estrategia: "Modo Compacto". Mantenemos menú y correo visibles,
   pero reducimos espacios para evitar quiebres de línea.
*/
@media (min-width: 768px) and (max-width: 1023px) {
  
  /* 1. Optimización Barra Superior (Header Top) */
  .header-top { gap: 12px; }

  .brand__name { font-size: 16px; }
  .brand__role { font-size: 13px; }

  /* Botón de Estado: Compactado para ganar espacio */
  .status-badge {
    padding: 6px 10px; 
    font-size: 12px;   
    gap: 6px;
    white-space: nowrap; /* Evita que el texto se rompa */
  }

  .site-header__top .btn--secondary {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* 2. Optimización Navegación */
  .site-header .nav__link {
    padding: 8px 6px; 
    font-size: 13px; 
  }

  /* Correo: Visible, Compacto y Alineado a la Derecha */
  .site-header .nav__email {
    display: inline-flex; 
    font-size: 12px;
    padding: 4px 8px;
    margin-left: auto; /* Empuja el correo al extremo derecho */
  }

  /* 3. Footer Tablet (2 columnas) */
  .footer-grid { grid-template-columns: 1fr 1fr; }
}


/* --- B) MÓVIL (< 768px) ---
   Estrategia: Hamburguesa, Ocultar elementos secundarios y apilar Footer.
*/
/* Por defecto ocultamos el botón hamburguesa (Escritorio/Tablet) */
.nav__toggle { display: none; }

@media (max-width: 767px) {
  
  /* 1. Header: Ocultar correo y ajustar layout */
  .nav__email { display: none; }
  .header-top { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; justify-content: space-between; }
  
  /* 2. Configuración Menú Colapsable */
  .site-header__nav .nav {
    display: flex;
    justify-content: flex-end; 
    flex-wrap: wrap; 
    position: relative;
  }

  /* Botón Hamburguesa (Visible solo aquí) */
  .nav__toggle {
    display: flex; align-items: center; justify-content: center;
    margin-left: auto; width: 54px; height: 40px; padding: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px; color: #fff; cursor: pointer;
    transition: all 0.2s ease;
  }
  .nav__toggle:active { background: rgba(255,255,255,0.14); transform: scale(0.96); }

  /* Animación Icono Hamburguesa */
  .nav__burger {
    display: block; width: 20px; height: 2px;
    background: #fff; position: relative; border-radius: 2px;
    transition: background 0.2s;
  }
  .nav__burger::before, .nav__burger::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 2px;
    background: #fff; border-radius: 2px; 
    transition: transform 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55), top 0.25s; 
  }
  .nav__burger::before { top: -6px; }
  .nav__burger::after  { top: 6px; }

  .nav__toggle[aria-expanded="true"] .nav__burger { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__burger::before { top: 0; transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__burger::after { top: 0; transform: rotate(-45deg); }

  /* Contenedor de Enlaces (Dropdown Móvil) */
  .nav__links {
    display: none;
    flex-direction: column;
    width: 100%; order: 2; margin-top: 10px;
    background: var(--c-ink); 
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    animation: slideDown 0.2s ease-out;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .nav.is-open .nav__links { display: flex; }

  /* Submenús Móvil (Estilo Acordeón) */
  .nav__dropdown, .nav__dropdown--nested { display: block; width: 100%; }
  
  .nav__submenu, .nav__submenu--nested {
    position: static; width: 100%;
    box-shadow: none; border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.15);
    padding: 4px; margin-top: 4px;
    display: none; animation: none;
  }
  .nav__submenu .site-header .nav__sublink { padding-left: 20px; }
  .nav__submenu--nested { background: rgba(0,0,0,0.1); }
  .nav__submenu--nested .site-header .nav__sublink { padding-left: 32px; }

  .site-header .nav__link, .site-header .nav__sublink {
    width: 100%; justify-content: flex-start;
    padding: 12px; color: rgba(255,255,255,0.9);
    text-decoration: none; display: flex; align-items: center;
  }
  
  .nav__dropdown.is-open > .nav__submenu,
  .nav__dropdown--nested.is-open > .nav__submenu--nested { display: block; }

  /* 3. Footer Móvil (1 Columna) */
  .footer-grid { grid-template-columns: 1fr; row-gap: 32px; }
  .footer-form { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-mini-nav { width: 100%; flex-wrap: wrap; gap: 12px; }
}


/* =========================================================
   9. PERFORMANCE & UX (SKELETON LOADING)
   Estilos aplicados mientras el JS carga e inyecta el Header/Footer.
   Previene el "Layout Shift" (CLS) y mejora la percepción de velocidad.
   ========================================================= */

@keyframes skeleton-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.85; }
  100% { opacity: 1; }
}

/* Header Skeleton: Altura exacta medida para evitar saltos */
#site-header.is-loading {
  display: block;
  min-height: 147px; 
  background-color: var(--c-ink);
  margin-bottom: 0;
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}

/* Footer Skeleton Responsive */
#site-footer.is-loading {
  display: block;
  background-color: var(--c-bg-dark);
  border-top: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 767px) {
  #site-footer.is-loading { min-height: 850px; } /* Móvil: Footer Alto */
}
@media (min-width: 768px) and (max-width: 1023px) {
  #site-footer.is-loading { min-height: 550px; } /* Tablet: Footer Medio */
}
@media (min-width: 1024px) {
  #site-footer.is-loading { min-height: 400px; } /* Desktop: Footer Compacto */
}

/* =========================================================
   10. MODAL SYSTEM (DEMO INFO)
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.9); /* Basado en tu --c-ink */
  display: none; /* Se activa con JS */
  align-items: center; justify-content: center;
  z-index: 100000;
  backdrop-filter: blur(5px);
}

.modal-overlay.is-visible { display: flex; }

.modal-content {
  max-width: 520px;
  width: min(90%, 520px);
  /* Reutiliza tus estilos de card base */
  background: var(--surface-1);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: var(--shadow);
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.modal-close {
  background: none; border: none;
  font-size: 28px; line-height: 1;
  color: var(--c-text); cursor: pointer;
  padding: 0; margin-top: -10px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--c-ink); }

.modal-body h3 { margin-bottom: var(--space-2); color: var(--c-ink); }
.modal-body p { margin-bottom: var(--space-3); }

.modal-body .note {
  display: block;
  font-size: var(--note);
  line-height: var(--lh-normal);
  margin-top: var(--space-3);
  opacity: 0.8;
  font-style: italic;
}

.modal-footer {
  display: flex; justify-content: flex-end;
  margin-top: var(--space-4);
}