/*
 * Masters College Valdivia — Hoja de Estilos Unificada (Sitio Público)
 * Fusiona: style.css + reglas inline de páginas individuales
 * Versión: 2.0 | Fecha: 2026
 */

/* ═══════════════════════════════════════
   1. VARIABLES & RESET
═══════════════════════════════════════ */
:root {
   --primary:    #000000;
   --secondary:  #991b1b;
   --gold:       #991b1b; /* rojo institucional en lugar de amarillo */
   --light:      #ffffff;
   --dark:       #0b0b0b;
   --text:       #111111;
   --muted:      #6b7280;
  --border:     #e2e8f0;
  --radius:     14px;
  --shadow:     0 10px 40px rgba(0,0,0,.08);
  --transition: .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #fff;
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: none;
}

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--secondary); }

/* ═══════════════════════════════════════
   2. TOPBAR
═══════════════════════════════════════ */
.topbar {
   background: var(--primary);
   color: #ffffff;
   font-size: .8rem;
   padding: 6px 0;
}
.topbar i { color: var(--secondary); }
.topbar-social { color: #ffffff; transition: color var(--transition); }
.topbar-social:hover { color: var(--secondary); }

/* ═══════════════════════════════════════
   3. NAVBAR
═══════════════════════════════════════ */
.main-navbar {
  background: #fff;
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--transition);
}
.main-navbar.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.15); }
.navbar-logo { height: 50px; object-fit: contain; }
.navbar-brand-name { font-weight: 800; color: var(--primary); line-height: 1.2; }
.navbar-brand-sub  { font-size: 11px; color: var(--muted); }

.navbar-nav .nav-link {
  font-weight: 500;
  color: #334155;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { background: rgba(0,0,0,.05); color: var(--secondary); }
.dropdown-menu { border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.dropdown-item:hover { background: var(--light); color: var(--secondary); }

/* ═══════════════════════════════════════
   4. HERO
═══════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity .8s ease-in-out;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.75) 35%, rgba(0,0,0,.35) 65%, rgba(0,0,0,.05) 100%);
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; }
.hero-label { color: var(--secondary); font-size: 12px; letter-spacing: 2px; font-weight: 600; margin-bottom: 10px; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900; color: #fff; line-height: 1.1; }
.hero h1 span { color: var(--gold); }
.hero p { color: rgba(255,255,255,.85); font-size: 1.05rem; max-width: 520px; }

/* ═══════════════════════════════════════
   5. SECCIONES GENÉRICAS
═══════════════════════════════════════ */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .5rem;
}
.section-title span { color: var(--secondary); }
.section-sub { color: var(--muted); font-size: 1rem; max-width: 540px; }

/* Banner de páginas interiores */
.page-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #7f1d1d 100%);
  color: #fff;
  padding: 60px 0;
}
.page-banner h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; }

/* ═══════════════════════════════════════
   6. BOTONES
═══════════════════════════════════════ */
.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 10px 22px;
  font-size: .95rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(0,0,0,.15); }
.btn-primary { background: var(--secondary); border: none; color: #fff; }
.btn-primary:hover { background: #7a0000; color: #fff; }
.btn-gold { background: var(--gold); border: none; color: #000; }
.btn-gold:hover { background: #c9a000; }
.btn-dark { background: var(--primary); border: none; color: #fff; }
.btn-dark:hover { background: #1e293b; color: #fff; }
.btn-outline-light { border: 2px solid rgba(255,255,255,.6); color: #fff; background: transparent; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ═══════════════════════════════════════
   7. TARJETAS GENÉRICAS
═══════════════════════════════════════ */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(0,0,0,.1); }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 1.2rem; }
.card-meta { font-size: .78rem; color: var(--muted); }
.card-title { font-weight: 700; font-size: 1rem; color: var(--primary); margin: .4rem 0 .5rem; line-height: 1.3; }
.card-text { font-size: .88rem; color: var(--muted); }

/* ═══════════════════════════════════════
   8. ESTADÍSTICAS
═══════════════════════════════════════ */
.stats-section { background: var(--primary); padding: 60px 0; }
.stat-item { text-align: center; color: #fff; }
.stat-num { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 900; color: var(--secondary); line-height: 1; }
.stat-label { font-size: .85rem; color: rgba(255,255,255,.7); margin-top: .25rem; letter-spacing: .5px; }

/* ═══════════════════════════════════════
   9. NOTICIAS
═══════════════════════════════════════ */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.news-card { border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--border); transition: var(--transition); }
.news-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.news-card-img { width: 100%; height: 200px; object-fit: cover; transition: transform .4s ease; }
.news-card:hover .news-card-img { transform: scale(1.05); }
.news-card-body { padding: 1.2rem; }
.news-card-cat { display: inline-block; background: var(--secondary); color: #fff; font-size: .7rem; font-weight: 700; padding: .2rem .6rem; border-radius: 20px; margin-bottom: .5rem; letter-spacing: .5px; }
.news-card-title { font-weight: 700; color: var(--primary); font-size: .95rem; line-height: 1.3; margin-bottom: .4rem; }
.news-card-date { font-size: .75rem; color: var(--muted); }

/* ═══════════════════════════════════════
   10. GALERÍA / LIGHTBOX
═══════════════════════════════════════ */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery-item { border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 1; position: relative; background: var(--light); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, filter .4s ease; }
.gallery-item:hover img { transform: scale(1.08); filter: brightness(.85); }
.gallery-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.5), transparent); opacity: 0; transition: opacity var(--transition); display: flex; align-items: flex-end; padding: .8rem; }
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span { color: #fff; font-size: .8rem; font-weight: 600; }

#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 9999; display: none; align-items: center; justify-content: center; flex-direction: column; }
#lightbox-img { max-width: 90vw; max-height: 82vh; border-radius: 8px; object-fit: contain; }
#lightbox-caption { color: rgba(255,255,255,.8); margin-top: .8rem; font-size: .9rem; }
#lightbox-close { position: fixed; top: 1rem; right: 1.5rem; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none; line-height: 1; transition: color var(--transition); }
#lightbox-close:hover { color: var(--gold); }

/* ═══════════════════════════════════════
   11. FUNCIONARIOS
═══════════════════════════════════════ */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.staff-card { text-align: center; background: #fff; border-radius: var(--radius); padding: 1.5rem 1rem; border: 1px solid var(--border); transition: var(--transition); }
.staff-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.1); }
.staff-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto .8rem; border: 3px solid var(--border); }
.staff-name { font-weight: 700; color: var(--primary); font-size: .95rem; }
.staff-title { font-size: .82rem; color: var(--secondary); font-weight: 600; margin-top: .2rem; }
.staff-bio { font-size: .8rem; color: var(--muted); margin-top: .4rem; line-height: 1.5; }

/* ═══════════════════════════════════════
   12. DOCUMENTOS
═══════════════════════════════════════ */
.doc-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; background: #fff; border-radius: var(--radius); border: 1px solid var(--border); transition: var(--transition); margin-bottom: .75rem; }
.doc-item:hover { border-color: var(--secondary); transform: translateX(4px); box-shadow: var(--shadow); }
.doc-icon { font-size: 1.8rem; color: var(--secondary); flex-shrink: 0; }
.doc-name { font-weight: 600; color: var(--primary); font-size: .95rem; }
.doc-meta { font-size: .78rem; color: var(--muted); }
.doc-btn { margin-left: auto; background: var(--secondary); color: #fff; border: none; padding: .4rem 1rem; border-radius: 8px; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background var(--transition); }
.doc-btn:hover { background: #7a0000; }

/* ═══════════════════════════════════════
   13. EFEMÉRIDES / CALENDARIO
═══════════════════════════════════════ */
.efem-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 1.2rem 1.5rem; margin-bottom: .8rem; display: flex; gap: 1rem; align-items: flex-start; transition: var(--transition); }
.efem-card:hover { border-left: 4px solid var(--secondary); transform: translateX(4px); }
.efem-day { background: var(--secondary); color: #fff; font-size: 1.3rem; font-weight: 900; width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.efem-title { font-weight: 700; color: var(--primary); }
.efem-desc { font-size: .85rem; color: var(--muted); margin-top: .2rem; }

/* ═══════════════════════════════════════
   14. CUADRO DE HONOR
═══════════════════════════════════════ */
.honor-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.honor-card:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(0,0,0,.1); }
.honor-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.honor-avatar { display:block; margin:0 auto; }
/* Asegurar que las imágenes de alumnos se centran y recortan correctamente */
.honor-card img, .honor-avatar, .honor-card .honor-avatar {
   object-fit: cover;
   width: 90px;
   height: 90px;
   display: block;
   margin: 0 auto;
}
.honor-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 12px; }

/* ═══════════════════════════════════════
   15. CONTACTO / MAPA
═══════════════════════════════════════ */
.contact-card { background: #fff; border-radius: var(--radius); padding: 2rem; border: 1px solid var(--border); height: 100%; }
.contact-item { display: flex; gap: .75rem; margin-bottom: 1.2rem; align-items: flex-start; }
.contact-icon { width: 40px; height: 40px; background: var(--secondary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1rem; flex-shrink: 0; }
.map-iframe { width: 100%; height: 350px; border: 0; border-radius: var(--radius); }

/* ═══════════════════════════════════════
   16. ALERTAS / FEEDBACK
═══════════════════════════════════════ */
.alert { border-radius: 10px; padding: .9rem 1.2rem; border: none; font-size: .9rem; }
.alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid #16a34a; }
.alert-danger   { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--secondary); }
.alert-info     { background: #ffffff; color: #111111; border-left: 4px solid var(--secondary); }
.alert-warning  { background: #fff1f2; color: #7f1d1d; border-left: 4px solid var(--secondary); }

/* ═══════════════════════════════════════
   17. POPUP MODAL
═══════════════════════════════════════ */
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 9998; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.popup-box { background: #fff; border-radius: 18px; max-width: 520px; width: 100%; padding: 2rem; position: relative; box-shadow: 0 25px 60px rgba(0,0,0,.3); animation: popupIn .3s ease; }
@keyframes popupIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }
.popup-close { position: absolute; top: 1rem; right: 1rem; border: none; background: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); transition: color var(--transition); }
.popup-close:hover { color: var(--secondary); }

/* ═══════════════════════════════════════
   18. FOOTER
═══════════════════════════════════════ */
.site-footer { background: var(--primary); color: #ffffff; padding: 50px 0 0; }
.footer-logo { height: 48px; object-fit: contain; margin-bottom: 1rem; }
.footer-heading { color: #fff; font-weight: 700; margin-bottom: 1rem; font-size: .9rem; letter-spacing: .5px; text-transform: uppercase; }
.footer-nav { list-style: none; padding: 0; }
.footer-nav li + li { margin-top: .4rem; }
.footer-nav a { color: #ffffff; font-size: .88rem; transition: color var(--transition); }
.footer-nav a:hover { color: var(--secondary); }
.footer-social { display: flex; gap: .75rem; margin-top: .5rem; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 1rem; transition: background var(--transition), color var(--transition); }
.footer-social a:hover { background: var(--secondary); color: #fff; }
.footer-buttons { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.footer-btn img { height: 36px; object-fit: contain; border-radius: 8px; transition: opacity var(--transition); }
.footer-btn:hover img { opacity: .8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding: 1.2rem 0; margin-top: 2.5rem; font-size: .8rem; }

/* ═══════════════════════════════════════
   19. UTILIDADES
═══════════════════════════════════════ */
.tag { display: inline-block; background: var(--light); color: var(--muted); font-size: .72rem; font-weight: 600; padding: .2rem .6rem; border-radius: 20px; border: 1px solid var(--border); }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.text-gold { color: var(--gold); }
.text-secondary-brand { color: var(--secondary); }
.bg-primary-brand { background: var(--primary); }
.bg-secondary-brand { background: var(--secondary); }

/* ═══════════════════════════════════════
   20. RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 768px) {
  .hero { min-height: 70vh; }
  .hero h1 { font-size: 2.2rem; }
  .news-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .staff-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-section .row > div + div { margin-top: 1.5rem; }
  .page-banner { padding: 40px 0; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .staff-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   21. SECCIÓN GENÉRICA FALTANTE
═══════════════════════════════════════ */
.section { padding: 60px 0; background: #fff; }

/* ═══════════════════════════════════════
   22. TOPBAR (faltaba en site.css)
═══════════════════════════════════════ */
.topbar { background: var(--dark); color: rgba(255,255,255,.8); font-size: .82rem; }
.topbar i { color: var(--secondary); }
.topbar-social { color: rgba(255,255,255,.7); transition: color var(--transition); }
.topbar-social:hover { color: #fff; }

/* ═══════════════════════════════════════
   23. NAVBAR SCROLL EFFECT
═══════════════════════════════════════ */
.main-navbar.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.18) !important; }

/* ═══════════════════════════════════════
   24. NOTICIA SINGLE
═══════════════════════════════════════ */
.main-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity .8s ease;
}
.main-slide.active { opacity: 1; }

/* ═══════════════════════════════════════
   25. HERO SLIDER (noticias.php)
═══════════════════════════════════════ */
.hero-slider { position: relative; height: 520px; border-radius: var(--radius); overflow: hidden; background: #000; }
.hero-slide-abs { position: absolute; inset: 0; transition: opacity 1.2s ease; }

/* ═══════════════════════════════════════
   26. BREADCRUMB EN BANNER
═══════════════════════════════════════ */
.breadcrumb-item a { color: rgba(255,255,255,.75); }
.breadcrumb-item.active { color: rgba(255,255,255,.5); }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.4); }

/* ═══════════════════════════════════════
   27. CONTACT PAGE
═══════════════════════════════════════ */
.contact-card { background: #fff; border-radius: var(--radius); padding: 1.2rem 1.5rem; border: 1px solid var(--border); transition: var(--transition); }
.contact-card:hover { box-shadow: var(--shadow); }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-icon { width: 38px; height: 38px; background: var(--secondary); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.map-iframe { border-radius: var(--radius); border: 0; }

/* ═══════════════════════════════════════
   28. TIMELINE (nosotros)
═══════════════════════════════════════ */
.timeline { padding-left: 70px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 30px; top: 0; bottom: 0; width: 3px; background: var(--border); }
.timeline-dot { position: absolute; left: -45px; width: 52px; height: 52px; background: var(--secondary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }
.timeline-card { background: #fff; padding: 1.2rem; border-radius: var(--radius); margin-bottom: 1.2rem; border: 1px solid var(--border); }

/* ═══════════════════════════════════════
   29. CUADRO DE HONOR (agrupado)
═══════════════════════════════════════ */
.honor-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.honor-card:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(0,0,0,.1); }
.honor-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto; border: 3px solid var(--border); }

/* ═══════════════════════════════════════
   30. FOOTER DESDE ZIP (ya OK, reforzar)
═══════════════════════════════════════ */
.site-footer { background: linear-gradient(135deg,#020617,#0f172a); color: #cbd5e1; padding: 70px 0 30px; }
.footer-heading { color: #fff; font-weight: 700; margin-bottom: 1rem; font-size: .9rem; letter-spacing: .5px; }
.footer-nav { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: .5rem; }
.footer-nav a { color: rgba(255,255,255,.65); font-size: .88rem; transition: color var(--transition); }
.footer-nav a:hover { color: #fff; }
.footer-social { display: flex; gap: .6rem; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .95rem; transition: var(--transition); }
.footer-social a:hover { background: var(--secondary); }
.footer-buttons { display: flex; gap: .75rem; flex-wrap: wrap; }
.footer-btn img { height: 38px; border-radius: 8px; object-fit: contain; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); margin-top: 2.5rem; padding-top: 1.2rem; font-size: .8rem; color: #64748b; }
