/* ============================================================================
   SISTEMA DE DISEÑO CSS INSTITUCIONAL - COLEGIO PÚBLICO COFEGO
   Arquitectura de Variables CSS Puro, Accesibilidad WCAG y Animaciones Fluidas
   ============================================================================ */

:root {
  /* Paleta de Colores Institucionales */
  --primary: #0B2545;         /* Azul Real Oscuro Institucional */
  --primary-light: #134074;   /* Azul Medio */
  --primary-dark: #001524;    /* Azul Noche */
  --secondary: #8DA9C4;      /* Azul Suave */
  --gold: #D4AF37;           /* Dorado Institucional */
  --gold-hover: #C5A059;     /* Dorado Oscuro */
  --accent-red: #8B0000;     /* Borgoña Educativo */
  
  /* Neutros & Fondos */
  --bg-main: #FFFFFF;
  --bg-light: #F4F6F9;
  --bg-card: #FFFFFF;
  --text-main: #1A202C;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  
  /* Estado */
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  
  /* Tipografía */
  --font-title: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Sombras y Efectos */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --transition: all 0.3s ease-in-out;
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--gold);
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

.section {
  padding: 4rem 0;
}
.bg-light {
  background-color: var(--bg-light);
}

/* Header & Navbar - Azul Clarito Institucional Alineado en Una Sola Línea */
.accessibility-bar {
  background-color: var(--primary-dark);
  color: #fff;
  padding: 0.35rem 0;
  font-size: 0.8rem;
}
.accessibility-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-access {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 0.4rem;
}
.btn-access:hover {
  background: rgba(255,255,255,0.2);
}

.main-header {
  background: #EBF3FA; /* Azul Clarito Suave */
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1rem;
  max-width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.logo-img {
  height: 40px;
  max-height: 40px;
  width: auto;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.98rem;
  color: #0B2545 !important;
  line-height: 1.1;
  white-space: nowrap;
}
.brand-sub {
  font-size: 0.68rem;
  color: #475569 !important;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.main-nav {
  margin-left: auto;
}

.main-nav .nav-list {
  display: flex;
  list-style: none;
  gap: 0.35rem; /* Espaciado compacto para garantizar 1 sola línea */
  align-items: center;
  flex-wrap: nowrap;
}
.nav-link {
  font-weight: 600;
  font-size: 0.8rem !important; /* Letra fina y proporcional */
  color: #1E3A8A !important;    /* Azul marino institucional */
  padding: 0.3rem 0.45rem;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover, .nav-link.active {
  color: var(--gold) !important;
  font-weight: 700;
}

/* Dropdown */
.has-dropdown {
  position: relative;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 250px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  list-style: none;
  padding: 0.4rem 0;
  z-index: 1000;
  border-top: 3px solid var(--gold);
}
.dropdown-header {
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: rgba(11, 37, 69, 0.05);
  letter-spacing: 0.5px;
}
.dropdown-menu li a {
  display: block;
  padding: 0.5rem 1.1rem;
  color: var(--text-main);
  font-size: 0.83rem;
  white-space: normal;
}
.dropdown-menu li a:hover {
  background: #F1F5F9;
  color: var(--primary);
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}
.dropdown-right {
  left: auto;
  right: 0;
}

/* Botones */
.btn {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-size: 0.88rem;
}
.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-light);
  color: #fff;
}
.btn-gold {
  background-color: var(--gold);
  color: var(--primary-dark);
}
.btn-gold:hover {
  background-color: var(--gold-hover);
  color: var(--primary-dark);
}
.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-outline-white {
  border-color: #fff;
  color: #fff;
  background: transparent;
}
.btn-outline-white:hover {
  background: #fff;
  color: var(--primary);
}
.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
}
.btn-block {
  display: block;
  width: 100%;
}

/* Hero Banner */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, #0B2545 0%, #134074 100%);
  color: #fff;
  padding: 5rem 0;
  text-align: center;
  overflow: hidden;
}
.hero-badge {
  display: inline-block;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.3rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: 3rem;
  color: #fff;
  margin-bottom: 1rem;
}
.hero-slogan {
  font-size: 1.3rem;
  color: var(--secondary);
  margin-bottom: 2.5rem;
}
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1.2rem;
}
.section-title {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 0.3rem;
}
.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Grids */
.grid {
  display: grid;
  gap: 2rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 2.2rem; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .nav-toggle { display: block; }
}

/* Cards & Components */
.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.quick-card {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.quick-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}
.quick-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.news-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.news-img-wrap {
  height: 180px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.news-img-placeholder {
  font-size: 4rem;
  color: rgba(255,255,255,0.4);
}
.news-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--gold);
  color: var(--primary-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.news-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.news-title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}
.news-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  flex: 1;
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

/* ============================================================================
   ESTILOS DE IMPRESIÓN OFICIAL INSTITUCIONAL (@media print)
   Garantiza que cualquier boletín, certificado, documento o guía se imprima
   de forma limpia, profesional y sin elementos sobrantes de la web.
   ============================================================================ */

@media print {
  /* Forzar visualización de bloque y eliminar colapso de Flexbox en la impresora */
  html, body, .admin-wrapper, .admin-main, main, article, div {
    display: block !important;
    float: none !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    overflow: visible !important;
  }

  /* Ocultar elementos de navegación web, menús, footers, barras laterales y botones */
  header,
  footer,
  .navbar,
  .accessibility-bar,
  .admin-sidebar,
  .no-print,
  .admin-header,
  .btn,
  button,
  .alert,
  .modal-overlay,
  .filter-form,
  .folder-list {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  /* Eliminar sombras y bordes pesados */
  .card-box, .news-card, .obs-card, table {
    box-shadow: none !important;
    border: 1px solid #000000 !important;
    background: #FFFFFF !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    page-break-inside: avoid;
  }

  /* Forzar visibilidad de textos y encabezados oficiales */
  h1, h2, h3, h4, h5, h6, p, span, td, th, div, label, strong {
    color: #000000 !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}
