/* Importación de Google Fonts - Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

/* Tema global del sistema (colores y utilidades) */
:root {
  /* Paleta institucional */
  --brand-primary: #253259;  /* navy */
  --brand-secondary: #049DD9;/* cyan */
  --brand-accent: #D9048E;   /* magenta */
  --brand-danger: #F20505;   /* red */

  /* Tipografía - Montserrat */
  --font-family-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Derivados de interfaz (ajustan intensidad) */
  --topbar-bg: #1E2A4A;   /* navy más oscuro */
  --sidebar-bg: #253259;  /* navy base */
  --sidebar-hover-bg: #2E3A66; /* navy un poco más claro para hover */
  --footer-bg: #1A2340;   /* navy aún más oscuro para pie */

  --brand-bg: #F8F9FA;
  --brand-text: #333333;

  /* Neutros */
  --white: #ffffff;
  --black: #000000;
}

/* Base general */
html, body { 
  color: var(--brand-text); 
  background: var(--brand-bg); 
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-regular);
}
/* Layout para footer sticky */
html, body { min-height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }

/* Jerarquía tipográfica */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-primary);
  line-height: 1.2;
  margin-bottom: 0.5em;
}

/* Solo aplicar color por defecto si no tiene color específico */
h1:not([style*="color"]):not(.header-ayuntamiento h1):not(.panel-header h1) { 
  color: var(--brand-primary);
}

h2:not([style*="color"]):not(.tabla-section h2) { 
  color: var(--brand-primary);
}

h3:not([style*="color"]),
h4:not([style*="color"]),
h5:not([style*="color"]),
h6:not([style*="color"]) { 
  color: var(--brand-primary);
}

h1 { 
  font-size: 2.5rem; 
  font-weight: var(--font-weight-bold); 
  letter-spacing: -0.02em; 
}

h2 { 
  font-size: 2rem; 
  font-weight: var(--font-weight-semibold); 
  letter-spacing: -0.01em; 
}

h3 { 
  font-size: 1.75rem; 
  font-weight: var(--font-weight-semibold); 
}

h4 { 
  font-size: 1.5rem; 
  font-weight: var(--font-weight-medium); 
}

h5 { 
  font-size: 1.25rem; 
  font-weight: var(--font-weight-medium); 
}

h6 { 
  font-size: 1.125rem; 
  font-weight: var(--font-weight-medium); 
}

/* Textos y párrafos */
p, .text-body {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-regular);
  line-height: 1.6;
  margin-bottom: 1em;
}

.text-small {
  font-size: 0.875rem;
  font-weight: var(--font-weight-regular);
}

.text-large {
  font-size: 1.125rem;
  font-weight: var(--font-weight-regular);
}

/* Clases de peso tipográfico */
.font-light { font-weight: var(--font-weight-light); }
.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }

/* Estilos base para botones con Montserrat */
.btn, button {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.025em;
}

/* Estilos base para formularios con Montserrat */
label {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-medium);
}

input, textarea, select {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-regular);
}

/* Estilos base para tablas con Montserrat */
table th {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-semibold);
}

table td {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-regular);
}

/* Utilidades mínimas (optativas) */
.text-primary { color: var(--brand-primary) !important; }
.text-accent { color: var(--brand-accent) !important; }
.bg-primary { background: var(--brand-primary) !important; }
.bg-secondary { background: var(--brand-secondary) !important; }
.bg-accent { background: var(--brand-accent) !important; }
.border-accent { border-color: var(--brand-accent) !important; }

/* Links */
a { color: var(--brand-secondary); }
a:hover { color: var(--white); }

/* Footer global */
.site-footer {
  margin-top: auto; /* sticky: empuja el footer al fondo */
  background: var(--footer-bg);
  color: var(--white);
  padding: 16px 0;
}
.site-footer .container { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 0 16px; 
  text-align: center; 
}
.site-footer p { margin: 0; font-size: 0.95rem; }

/* Tablas responsivas (scroll horizontal en pantallas pequeñas) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* inercia en iOS */
}
.table-responsive > table {
  width: 100%;
  border-collapse: collapse;
}
@media (max-width: 768px) {
  .table-responsive > table { min-width: 640px; }
}
