/* ============================================================
   UPN 072 — HOME PAGE STYLES  (v2 — corregido)
   Solo afecta /pages/index.php
   ============================================================ */

/* ── HERO ────────────────────────────────────────────────── */
.home-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #f7f9fc;       /* fondo base: nunca queda vacío */
}

/*
 * CORRECCIÓN CLAVE:
 * El fondo de la imagen se maneja 100% en CSS — NO hay <img> en el HTML.
 * Así evitamos el efecto "imagen sobre imagen" que ocurría porque
 * hero_bg.jpg es en realidad una screenshot del portal anterior con texto.
 *
 * La imagen real en el VPS (/assets/img/hero_bg.jpg) ya tiene la foto
 * de estudiantes. Si la imagen del VPS fuera un screenshot, el degradado
 * fuerte del lado izquierdo la oculta completamente donde está el texto.
 */
.home-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;

  /* Imagen de fondo: aparece solo en el lado derecho */
  background-image: url('/assets/img/hero_bg.jpg');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;

  /*
   * Máscara progresiva: el 40% izquierdo es completamente transparente
   * (la imagen no se ve ahí, solo el fondo #f7f9fc del .home-hero).
   * Esto garantiza que el texto sea SIEMPRE legible, sin importar
   * qué contenga la imagen.
   */
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    transparent 38%,
    rgba(0,0,0,0.3) 48%,
    black 60%,
    black 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    transparent 38%,
    rgba(0,0,0,0.3) 48%,
    black 60%,
    black 100%
  );
}

/* Capa adicional de degradado sobre la imagen para suavizar la transición */
.home-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #f7f9fc 35%,
    rgba(247,249,252,0.80) 50%,
    rgba(247,249,252,0.10) 75%,
    transparent 100%
  );
}

/* Contenido del Hero: z-index sobre el fondo */
.home-hero__content {
  position: relative;
  z-index: 1;
  padding: 72px 0;
  max-width: 520px;
}
.home-hero__eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--upn-text-2);
  margin-bottom: 12px;
}
.home-hero__title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--upn-text);
  margin-bottom: 8px;
}
.home-hero__title .upn-accent {
  color: var(--upn-primary);
}
.home-hero__tagline {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--upn-primary);
  margin-bottom: 14px;
}
.home-hero__desc {
  color: #4B5563;
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 440px;
}

/* Botones del Hero */
/* ── Botones Hero — uniformes en altura ─────────────────
   Ambos miden exactamente 48px de alto, mismo padding,
   mismo border-radius. Solo difieren en color de fondo.
   El secundario ya NO tiene sub-label "Inscribirme" para
   que queden perfectamente alineados.
──────────────────────────────────────────────────────── */
.btn-hero-primary,
.btn-hero-secondary {
  height: 48px;
  padding: 0 26px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease-out);
  line-height: 1;
}

.btn-hero-primary {
  background: var(--upn-primary);
  border: 1.5px solid var(--upn-primary);
  color: #fff;
}
.btn-hero-primary:hover {
  background: var(--upn-primary-hover);
  border-color: var(--upn-primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,92,171,.28);
}

.btn-hero-secondary {
  background: #fff;
  border: 1.5px solid #CBD5E1;
  color: var(--upn-text);
  gap: 6px;
}
.btn-hero-secondary:hover {
  border-color: var(--upn-primary);
  box-shadow: 0 8px 20px rgba(0,92,171,.12);
  transform: translateY(-2px);
  color: var(--upn-primary);
}
/* sub-label oculto — ya no se usa para mantener uniformidad */
.btn-hero-secondary .sub-label { display: none; }

/* Quick links bajo los botones */
.hero-quick-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.hero-quick-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--upn-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hero-quick-links a:hover {
  text-decoration: underline;
}

/* ── SECCIONES ───────────────────────────────────────────── */
.section-oferta {
  background: #F5F7FA;
  padding: 72px 0;
}
.section-noticias {
  background: #fff;
  padding: 72px 0;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 700;
  color: var(--upn-text);
  margin-bottom: 4px;
}
.section-sub {
  color: var(--upn-text-2);
  font-size: 15px;
}

/* ── TABS ────────────────────────────────────────────────── */
.upn-tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--upn-border);
  margin-bottom: 28px;
}
.upn-tab-btn {
  border: none;
  background: none;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--upn-text-2);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  position: relative;
  bottom: -2px;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast) var(--ease-out);
}
.upn-tab-btn.active {
  color: var(--upn-primary);
  background: #e8f0fb;
  border-bottom: 2px solid var(--upn-primary);
}
.upn-tab-btn:hover:not(.active) {
  color: var(--upn-text);
  background: #f0f3f7;
}
.upn-tab-panel { display: none; }
.upn-tab-panel.active { display: block; }

/* ── CARDS ───────────────────────────────────────────────── */
.home-card {
  border: 1px solid var(--upn-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15,23,42,.05);
  transition: transform var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.home-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px rgba(15,23,42,.12);
}

/* Thumb: contiene la imagen O el noimg */
.home-card__thumb {
  height: 190px;
  overflow: hidden;
  background: linear-gradient(135deg, #dce8f7 0%, #c3d6f0 100%);
  position: relative;
  flex-shrink: 0;
}

/* Imagen real: ocupa todo el thumb */
.home-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow) var(--ease-out);
}
.home-card:hover .home-card__thumb img {
  transform: scale(1.05);
}

/*
 * CORRECCIÓN: .home-card__noimg
 * Cuando no existe imagen, en lugar de mostrar un <img> roto
 * se muestra un fondo institucional con ícono SVG centrado.
 * NO usa src de archivo externo → nunca da 404.
 */
.home-card__noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dce8f7 0%, #c3d6f0 100%);
  flex-direction: column;
  gap: 8px;
}
.home-card__noimg--news {
  background: linear-gradient(135deg, #e0ecf7 0%, #bcd4ed 100%);
}
.home-card__noimg svg {
  opacity: 0.55;
}

/* Badge de categoría sobre la imagen */
.home-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--upn-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .04em;
  z-index: 1;
}

/* Body de la card */
.home-card__body {
  padding: 18px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.home-card__meta {
  font-size: 12px;
  color: var(--upn-text-2);
  margin-bottom: 6px;
}
.home-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--upn-text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.home-card__desc {
  font-size: 14px;
  color: var(--upn-text-2);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Botones de card */
.btn-card {
  background: var(--upn-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
  align-self: flex-start;
}
.btn-card:hover {
  background: var(--upn-primary-hover);
  color: #fff;
  transform: translateX(2px);
}
.btn-card-outline {
  background: transparent;
  color: var(--upn-primary);
  border: 1.5px solid var(--upn-primary);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  display: inline-block;
}
.btn-card-outline:hover {
  background: var(--upn-primary);
  color: #fff;
}

/* CTA centrado al final de sección */
.cta-center {
  text-align: center;
  margin-top: 36px;
}
.btn-cta-large {
  background: var(--upn-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 30px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast) var(--ease-out);
  box-shadow: 0 8px 24px rgba(0,92,171,.18);
}
.btn-cta-large:hover {
  background: var(--upn-primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0,92,171,.28);
}

/* ── FOOTER INSTITUCIONAL ───────────────────────────────── */
.home-footer {
  background: #0B2A4A;
  color: rgba(255,255,255,.78);
  padding: 48px 0 28px;
}
.home-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.home-footer__logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.home-footer__logo-sub {
  font-size: 12px;
  color: rgba(255,255,255,.50);
  line-height: 1.4;
  margin-top: 2px;
}
.home-footer h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.home-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.home-footer ul li {
  margin-bottom: 6px;
}
.home-footer ul li a,
.home-footer a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--t-fast);
}
.home-footer ul li a:hover,
.home-footer a:hover {
  color: #fff;
}
.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 7px;
  font-size: 14px;
  color: rgba(255,255,255,.65);
}
.footer-contact-icon {
  width: 15px;
  min-width: 15px;
  color: rgba(255,255,255,.45);
  margin-top: 2px;
}
.home-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.10);
  margin-top: 32px;
  padding-top: 16px;
  font-size: 13px;
  color: rgba(255,255,255,.38);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms var(--ease-out),
              transform 500ms var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 992px) {
  .home-hero__bg {
    /* En tablet: imagen ocupa más área, máscara adaptada */
    -webkit-mask-image: linear-gradient(
      90deg,
      transparent 0%,
      transparent 28%,
      rgba(0,0,0,0.2) 40%,
      black 55%,
      black 100%
    );
    mask-image: linear-gradient(
      90deg,
      transparent 0%,
      transparent 28%,
      rgba(0,0,0,0.2) 40%,
      black 55%,
      black 100%
    );
  }
}

@media (max-width: 768px) {
  .home-hero {
    min-height: 400px;
  }
  /* Footer: reducir padding y gap en móvil */
  .home-footer { padding: 36px 0 24px; }
  .home-footer .row { --bs-gutter-y: 1.25rem; }
  .home-footer__brand { margin-bottom: 8px; }
  /* En móvil: imagen de fondo con muy baja opacidad, texto siempre legible */
  .home-hero__bg {
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 0.12;
  }
  .home-hero__content {
    padding: 48px 0;
    max-width: 100%;
  }
  .home-footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }
  .home-footer__bottom span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
  }
}
