/* ══════════════════════════════════════════════════════════════
   PREUNIVERSITARIO DEL NORTE — RESPONSIVE.CSS v4.0
   Mobile-first premium — layouts hermosos en cada breakpoint
   ══════════════════════════════════════════════════════════════ */

/* ─── CSS CUSTOM PROPERTIES OVERRIDE ───────────────────────── */
@media (max-width: 960px) { :root { --nav-h: 62px; } }
@media (max-width: 600px) { :root { --nav-h: 58px; } }

/* ══════════════════════════════════════════════════════════════
   BREAKPOINT 1 — TABLET ANCHO  ≤ 1100px
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .nav-links a    { font-size: 12.5px; padding: 7px 9px; }
  .nav-cta        { padding: 8px 15px !important; font-size: 12px; }
  .hero-title     { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
  .footer-inner   { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
}

/* ══════════════════════════════════════════════════════════════
   BREAKPOINT 2 — TABLET  ≤ 960px
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {

  /* ── Navbar ──────────────────────────────────────────────── */
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* ── Secciones generales ─────────────────────────────────── */
  .section-inner  { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  .section-header { margin-bottom: 2.75rem; }

  /* ── Hero ────────────────────────────────────────────────── */
  .hero-title { font-size: clamp(2rem, 5.5vw, 3rem); }
  .hero-text  { font-size: 15.5px; max-width: 520px; }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; }

  /* ── Nosotros ────────────────────────────────────────────── */
  .nosotros-inner { grid-template-columns: 1fr; gap: 3rem; }
  .nosotros-left  { padding-right: 0; }

  /* Numbers — 2×2 en tablet */
  .numbers-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .num-card span { font-size: 2rem; }

  /* ── Cursos ──────────────────────────────────────────────── */
  .courses-grid    { grid-template-columns: repeat(2, 1fr); }
  .courses-grid-v2 { grid-template-columns: repeat(2, 1fr); }

  /* ── Horarios ────────────────────────────────────────────── */
  .horarios-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Noticias ────────────────────────────────────────────── */
  .noticias-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Precios ─────────────────────────────────────────────── */
  .precios-grid               { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .precio-card.featured       { transform: none; }
  .precio-card.featured:hover { transform: translateY(-5px); }

  /* ── Contacto ────────────────────────────────────────────── */
  .contacto-inner   { grid-template-columns: 1fr; gap: 2.5rem; }
  .contacto-left h2 { text-align: center; }
  .contacto-left p  { text-align: center; }
  .contact-methods  { max-width: 480px; margin: 0 auto; }

  /* ── Footer ──────────────────────────────────────────────── */
  .footer-inner  { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer-brand  { grid-column: 1 / -1; }
  .footer-brand p { max-width: 440px; }
}

/* ══════════════════════════════════════════════════════════════
   BREAKPOINT 3 — MÓVIL  ≤ 600px
   Diseño premium mobile-first
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ── SECCIONES: espaciado fluido ─────────────────────────── */
  .section-inner  {
    padding: 3.5rem clamp(.9rem, 5vw, 1.25rem);
  }
  .section-header { margin-bottom: 2.25rem; }
  .section-header h2, h2 {
    font-size: clamp(1.65rem, 7.5vw, 2.1rem);
    letter-spacing: -.02em;
  }
  .section-sub  { font-size: 14.5px; line-height: 1.75; }
  .section-tag  { font-size: 9.5px; padding: 4px 14px; letter-spacing: .14em; }

  /* ── NAVBAR ──────────────────────────────────────────────── */
  .nav-logo-text .name    { font-size: 12.5px; }
  .nav-logo-text .tagline { display: none; }
  .nav-logo img           { height: 32px; }

  /* ── MENÚ MÓVIL — diseño limpio y aireado ────────────────── */
  .mobile-nav {
    padding: 1.25rem 1.1rem 1.75rem;
    background: rgba(4, 9, 26, .98);
    border-bottom: 1px solid rgba(200,150,14,.15);
  }
  .mobile-nav a {
    font-size: 15px;
    padding: 13px 6px;
    letter-spacing: .01em;
  }
  .mobile-nav a:hover { color: var(--white); padding-left: 10px; }
  .mobile-cta {
    margin-top: 1rem;
    padding: 13px 20px !important;
    font-size: 14.5px !important;
    border-radius: var(--r-md) !important;
  }

  /* ── HERO — impacto visual total ─────────────────────────── */
  .hero-title {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
    margin-bottom: 1rem;
    line-height: 1.12;
    letter-spacing: -.03em;
  }
  .hero-text {
    font-size: 15px;
    margin-bottom: 1.75rem;
    line-height: 1.7;
    max-width: 100%;
    color: rgba(255,255,255,.7);
  }
  .hero-badge {
    font-size: 9.5px;
    padding: 5px 14px;
    margin-bottom: 1.5rem;
    letter-spacing: .14em;
  }

  /* Botones hero — apilados, full-width, táctiles */
  .hero-btns {
    flex-direction: column;
    width: 100%;
    gap: 11px;
    margin-bottom: 2.25rem;
  }
  .btn-gold,
  .btn-ghost {
    width: 100%;
    justify-content: center;
    font-size: 15px;
    padding: 14px 22px;
    border-radius: var(--r-md);
  }
  .btn-gold svg, .btn-ghost svg { width: 15px; height: 15px; }

  /* Estadísticas del hero — compactas y legibles */
  .hero-stats {
    gap: .85rem;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .stat-divider { display: none; }
  .stat {
    flex: 1;
    text-align: center;
    min-width: 72px;
  }
  .stat span:first-child {
    font-size: 1.75rem;
    letter-spacing: -.03em;
  }
  .stat span:last-child {
    font-size: 10.5px;
    letter-spacing: .02em;
    opacity: .7;
  }

  /* ── CURSOS — cards full-width con cuerpo generoso ──────── */
  .courses-grid    { grid-template-columns: 1fr; gap: 1rem; }
  .courses-grid-v2 { grid-template-columns: 1fr; gap: 1rem; }

  .tabs    { gap: 5px; flex-wrap: wrap; }
  .tab-btn { font-size: 12.5px; padding: 7px 15px; }

  .ccard-header   { height: 96px; }
  .ccard-body     { padding: 1.2rem 1.1rem 1.4rem; }
  .ccard-body h3  { font-size: 1.05rem; }
  .ccard-body p   { font-size: 13px; line-height: 1.65; }
  .ccard-tags     { gap: 5px; }
  .ccard-tag      { font-size: 10.5px; padding: 4px 10px; }

  /* ── HORARIOS — stack limpio ─────────────────────────────── */
  .horarios-grid  { grid-template-columns: 1fr; gap: 1rem; }
  .horario-card   { padding: 1.85rem 1.4rem; border-radius: var(--r-lg); }
  .horario-icon   { width: 46px; height: 46px; font-size: 1.4rem; margin-bottom: 1rem; }
  .horario-card h3 { font-size: 1.15rem; }
  .horario-time   { font-size: 1.45rem; }
  .horario-days   { font-size: 11px; gap: 4px; }

  /* ── NOSOTROS — layout compacto y elegante ───────────────── */
  .nosotros-inner  { gap: 2.5rem; }
  .valores-list    { gap: 1rem; }
  .valor-item      { padding: .9rem 1.05rem; gap: 12px; border-radius: var(--r-md); }
  .valor-icon      { font-size: 1.4rem; min-width: 36px; }
  .valor-item strong { font-size: 13.5px; }
  .valor-item p    { font-size: 12.5px; margin-top: 2px; line-height: 1.55; }

  /* Numbers grid — 2×2 perfectamente proporcional */
  .numbers-grid {
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
  }
  .num-card {
    padding: 1.35rem 1rem;
    border-radius: var(--r-md);
    text-align: center;
  }
  .num-card span { font-size: 1.85rem; letter-spacing: -.02em; }
  .num-card p    { font-size: 11.5px; margin-top: .2rem; line-height: 1.4; }

  /* Award strip — lista compacta */
  .award-strip    { gap: .4rem; margin-top: 1rem; }
  .award-item     { padding: .65rem .85rem; font-size: 12.5px; border-radius: var(--r-sm); }

  /* ── NOTICIAS — cards legibles en 1 columna ─────────────── */
  .noticias-grid { grid-template-columns: 1fr; gap: 1rem; }
  .noticia-body  { padding: 1.3rem 1.15rem 1.5rem; }
  .noticia-title { font-size: 1.05rem; line-height: 1.4; }
  .noticia-emoji-header { height: 108px; font-size: 3.25rem; }

  /* ── PRECIOS — card única centrada ──────────────────────── */
  .precios-grid { max-width: 100%; }
  .precio-card  { padding: 1.85rem 1.4rem; border-radius: var(--r-lg); }
  .plan-price .amount { font-size: 2.6rem; }
  .plan-price sup, .plan-price sub { font-size: 1rem; }
  .plan-features { gap: .6rem; margin: 1.25rem 0; }
  .plan-feature  { font-size: 13.5px; padding: .5rem 0; }
  .btn-plan      { padding: 13px 20px; font-size: 14.5px; }

  /* ── CONTACTO ────────────────────────────────────────────── */
  .contacto-inner  { gap: 2rem; }
  .contacto-left h2,
  .contacto-left p { text-align: left; }
  .contact-methods { max-width: 100%; gap: .75rem; }
  .contact-method  { padding: .9rem 1.05rem; gap: 12px; border-radius: var(--r-md); }
  .cm-icon         { width: 40px; height: 40px; font-size: 17px; flex-shrink: 0; }
  .cm-text strong  { font-size: 13px; }
  .cm-text span    { font-size: 12px; }

  /* ── FORMULARIO — inputs cómodos para móvil ─────────────── */
  .form-row  { grid-template-columns: 1fr; gap: 0; }
  .form-card {
    padding: 1.6rem 1.15rem 1.75rem;
    border-radius: var(--r-lg);
  }
  .form-card h3 { font-size: 1.18rem; margin-bottom: 1.25rem; }

  /* font-size:16px previene zoom automático en iOS Safari */
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px;
    padding: 12px 13px;
    border-radius: var(--r-sm);
  }
  .form-group label   { font-size: 13px; }
  .form-group         { margin-bottom: 1rem; }
  .form-group:last-of-type { margin-bottom: 0; }

  /* ── FOOTER — stack vertical, aireado ───────────────────── */
  footer { padding: 3.25rem clamp(.9rem,5vw,1.25rem) 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 2.25rem; }
  .footer-brand { grid-column: auto; }
  .footer-brand p { max-width: 100%; font-size: 13.5px; line-height: 1.7; }
  .footer-col h4  { font-size: 11.5px; margin-bottom: .85rem; }
  .footer-col a   { font-size: 13.5px; padding: .3rem 0; }
  .social-links   { gap: .6rem; margin-top: 1.1rem; }
  .social-btn     { width: 38px; height: 38px; }
  .footer-bottom  {
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
    padding: 1.5rem 0 1.75rem;
  }
  .footer-bottom p { font-size: 12px; }

  /* ── WHATSAPP FLOTANTE ───────────────────────────────────── */
  .wa-float {
    padding: 15px;
    border-radius: 50%;
    bottom: 20px;
    right: 16px;
    gap: 0;
    box-shadow: 0 6px 24px rgba(37,211,102,.35);
  }
  .wa-float span { display: none; }
  .wa-float svg  { width: 26px; height: 26px; }

  /* ── TOAST ───────────────────────────────────────────────── */
  .toast {
    right: 12px;
    left: 12px;
    bottom: 78px;
    max-width: 100%;
    font-size: 13.5px;
    padding: 12px 16px;
    border-radius: var(--r-md);
  }

  /* ── SCROLL HINT ─────────────────────────────────────────── */
  .hero-scroll-hint { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   BREAKPOINT 4 — MÓVIL PEQUEÑO  ≤ 380px
   Ajustes finos para pantallas muy compactas
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .section-inner   { padding-left: .8rem; padding-right: .8rem; }
  .hero-title      { font-size: 1.75rem; }
  .hero-badge      { font-size: 9px; padding: 4px 12px; }
  .btn-gold,
  .btn-ghost       { font-size: 13.5px; padding: 12px 16px; }
  .section-tag     { font-size: 9px; padding: 4px 12px; }
  .num-card span   { font-size: 1.6rem; }
  .num-card p      { font-size: 10.5px; }
  .form-card       { padding: 1.35rem .9rem; }
  .form-card h3    { font-size: 1.05rem; }
  .ccard-body h3   { font-size: .95rem; }
  .ccard-body p    { font-size: 12px; }
  .tab-btn         { font-size: 11.5px; padding: 6px 13px; }
  .plan-price .amount { font-size: 2.15rem; }
  .horario-card    { padding: 1.5rem 1.1rem; }
  .horario-time    { font-size: 1.3rem; }
  .award-item      { font-size: 11.5px; padding: .55rem .75rem; }
}

/* ══════════════════════════════════════════════════════════════
   BREAKPOINT 5 — ESCRITORIO ANCHO  ≥ 1400px
   Aprovecha el espacio con más columnas y tamaños mayores
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 1400px) {
  :root            { --max-w: 1340px; }
  .hero-title      { font-size: 4.3rem; }
  .section-inner   { padding-top: 7rem; padding-bottom: 7rem; }
  .courses-grid-v2 { grid-template-columns: repeat(4, 1fr); }
  .horarios-grid   { grid-template-columns: repeat(4, 1fr); }
  .footer-inner    { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   ACCESIBILIDAD — Movimiento reducido
   ══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal      { opacity: 1; transform: none; }
  .badge-pulse { animation: none; }
}

/* ══════════════════════════════════════════════════════════════
   ACCESIBILIDAD — Alto contraste
   ══════════════════════════════════════════════════════════════ */
@media (prefers-contrast: high) {
  :root         { --text-soft: var(--text-mid); --gray-400: var(--gray-600); }
  .nav-links a  { color: rgba(255,255,255,.92); }
  .footer-col a { color: rgba(255,255,255,.75); }
  .hero-text    { color: rgba(255,255,255,.85); }
  .section-sub  { color: var(--text-mid); }
  .light-p      { color: rgba(255,255,255,.7); }
}

/* ══════════════════════════════════════════════════════════════
   HEROES DE PÁGINA — BASE + MÓVIL
   (quienes-somos.html · cursos.html)

   Los HTML NO tienen ningún <style> inline para .page-hero-*
   Este archivo es la ÚNICA fuente de verdad para ese componente.
   ══════════════════════════════════════════════════════════════ */

/* ── BASE (todas las pantallas) ──────────────────────────────── */
.page-hero-section {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #04091a;
}
.page-hero-img {
  width: 100%;
  display: block;
  height: 440px;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.72;
}
.page-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    to bottom,
    rgba(4,9,26,.55) 0%,
    rgba(4,9,26,.18) 45%,
    rgba(4,9,26,.68) 100%
  );
}

/* ── MÓVIL ≤ 600px — imagen arriba, texto sólido debajo ──────── */
@media (max-width: 600px) {

  /* 1. Grid de 2 filas: imagen | texto. Sin position tricks. */
  .page-hero-section {
    display: grid;
    grid-template-rows: auto auto;
    overflow: hidden;
    position: relative; /* mantiene relative para que nada quede huérfano */
  }

  /* 2. Imagen ocupa su fila, altura controlada, fade suave abajo */
  .page-hero-img {
    grid-row: 1;
    width: 100%;
    height: 52vw;
    min-height: 180px;
    max-height: 250px;
    object-fit: cover;
    object-position: center 25%;
    opacity: 1;
    display: block;
    -webkit-mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
    mask-image:         linear-gradient(to bottom, black 45%, transparent 100%);
  }

  /* 3. Overlay: sale de absolute, ocupa su propia fila debajo */
  .page-hero-overlay {
    grid-row: 2;
    position: static;   /* cancela el absolute */
    inset: unset;
    display: block;
    background: #04091a;
    padding: 1.5rem 1.1rem 2.5rem;
    text-align: center;
    margin-top: -2px;   /* elimina gap de subpíxel entre filas */
  }

  /* 4. Tipografía */
  .page-hero-text .section-tag  { margin-bottom: .85rem; display: inline-flex; }
  .page-hero-text .light-title  {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
    line-height: 1.13;
    color: #fff;
    margin-bottom: .5rem;
    letter-spacing: -.025em;
  }
  .page-hero-text .light-p {
    font-size: 14.5px;
    line-height: 1.72;
    color: rgba(255,255,255,.62);
    max-width: 100%;
    margin: .7rem 0 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   HERO INDEX.HTML — fondo CSS (fondoipdn.png)
   Su <style> interno ya maneja desktop; aquí solo móvil.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  #hero {
    background-position: center center !important;
    padding-top: calc(var(--nav-h) + 2rem) !important;
    padding-bottom: 3rem !important;
  }
  /* Botones apilados full-width */
  #hero .hero-btns {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }
  #hero .btn-gold,
  #hero .btn-ghost {
    width: 100% !important;
    justify-content: center !important;
    font-size: 15px !important;
    padding: 14px 20px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   HERO PRE-MIL.HTML — fondo bg-esmil.jpg
   Su <style> interno define .premil-hero con height:92vh.
   Usamos !important solo donde ese inline <style> compite.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {

  .premil-hero {
    min-height: unset !important;
    height: auto !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    overflow: hidden !important;
  }

  /* Fondo-imagen: fila 1, altura acotada, fade suave */
  .premil-hero-bg {
    grid-row: 1;
    position: relative !important;
    inset: unset !important;
    width: 100% !important;
    height: 52vw !important;
    min-height: 180px !important;
    max-height: 250px !important;
    background-size: cover !important;
    background-position: center 20% !important;
    -webkit-mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
    mask-image:         linear-gradient(to bottom, black 45%, transparent 100%);
  }

  /* Overlay de oscurecimiento: permanece dentro del bg */
  .premil-hero-overlay {
    position: absolute !important;
    inset: 0 !important;
    height: 100% !important;
    background: linear-gradient(
      to bottom,
      rgba(4,9,26,.15) 0%,
      rgba(4,9,26,.55) 100%
    ) !important;
  }

  /* Contenido: fila 2, fondo sólido */
  .premil-hero-inner {
    grid-row: 2 !important;
    position: relative !important;
    background: #04091a !important;
    padding: 2rem 1.1rem 3rem !important;
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    margin-top: -2px !important;
  }

  /* Botones apilados */
  .premil-hero-ctas     { flex-direction: column !important; gap: .75rem !important; }
  .btn-premil-primary,
  .btn-premil-ghost     { width: 100% !important; justify-content: center !important; font-size: 15px !important; padding: 13px 20px !important; }

  /* Stats en 2 columnas */
  .premil-stat-row      { flex-wrap: wrap !important; gap: .65rem !important; }
  .premil-stat          { flex: 1 1 calc(50% - .35rem) !important; min-width: 110px !important; }
}

/* ── Cards con imágenes de fondo ─────────────────────────────── */
@media (max-width: 600px) {
  .inst-card-bg { background-position: center center !important; }
  .uni-slide-bg,
  .uni-card-bg  { object-position: center 30% !important; }
}

/* ══════════════════════════════════════════════════════════════
   IMPRESIÓN
   ══════════════════════════════════════════════════════════════ */
@media print {
  #navbar, .mobile-nav, .hamburger,
  .wa-float, .toast { display: none !important; }

  body           { background: white; color: black; font-size: 12pt; }
  .section-inner { padding: 2rem 0; }
  h2             { color: black; font-size: 20pt; }
  .hero-inner    { grid-template-columns: 1fr !important; direction: ltr !important; }
  .footer-inner  { grid-template-columns: 1fr 1fr; }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 10pt;
    color: #666;
  }

  .ccard, .horario-card,
  .precio-card, .noticia-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .courses-grid,
  .courses-grid-v2,
  .horarios-grid,
  .noticias-grid { grid-template-columns: repeat(2, 1fr); }
}