/* ==========================================================================
   1. ACCESSIBILITY UTILITIES
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   2. VARIABLES & DESIGN SYSTEM
   ========================================================================== */

:root {
  /* --- PDP 2026 COLOR PALETTE --- */
  --pdp-1: #00205B;
  --pdp-2: #0B2E7E;
  --pdp-3: #005C9E;
  --pdp-4: #456EA8;
  --pdp-5: #D4E6F5;
  --pdp-6: #5B7A9A;
  --pdp-7: #819DB5;
  --pdp-8: #B0C4D6;
  --pdp-9: #F4F7FA;
  --pdp-10: #E8F0F8;
  --pdp-white: #FFFFFF;
  --pdp-black: #092933;

  /* Brand Colors */
  --color-primary: var(--pdp-3);
  --color-primary-light: var(--pdp-4);
  --color-primary-lighter: var(--pdp-5);
  --color-primary-dark: var(--pdp-2);
  --color-primary-deep: var(--pdp-1);
  --color-secondary: var(--pdp-6);

  /* Functional Colors */
  --color-text: var(--pdp-black);
  --color-text-muted: var(--pdp-6);
  --color-bg-default: var(--pdp-white);
  --color-bg-light: var(--pdp-9);
  --color-bg-card: var(--pdp-5);
  --color-bg-gradient: linear-gradient(180deg, var(--pdp-10), var(--pdp-white));

  /* Category Colors (Efemerides) */
  --color-cat-birth: #43a047;
  --color-cat-death: #e53935;
  --color-cat-event: var(--pdp-3);
  --color-cat-foundation: #7b1fa2;
  --color-cat-violence: #ef6c00;

  /* JS-accessible aliases for category colors */
  --cat-nacimiento: #8BC34A;
  --cat-fallecimiento: #E57373;
  --cat-hecho: #1E88E5;
  --cat-fundacion: #8E24AA;
  --cat-asesinato: #FB8C00;

  /* --- SPACING SCALE --- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;
  --space-5xl: 60px;
  --space-6xl: 80px;

  /* --- TYPOGRAPHY --- */
  --font-family-base: "Codec Pro", "DIN Arabic", "Inter", "Manrope", "Source Sans Pro", sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.75rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: clamp(2rem, 5vw, 3.25rem);
  --font-size-6xl: clamp(2.5rem, 6vw, 4rem);

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.15;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.65;
  --line-height-loose: 1.8;

  /* --- SHADOWS --- */
  --shadow-sm: 0 2px 8px rgba(0, 32, 91, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 32, 91, 0.08);
  --shadow-lg: 0 10px 28px rgba(0, 32, 91, 0.12);
  --shadow-xl: 0 14px 36px rgba(0, 32, 91, 0.10);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 32, 91, 0.25);

  /* --- TRANSITIONS --- */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  /* --- BORDER RADIUS --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 99px;

  /* --- BUTTON TOKENS --- */
  --btn-primary-bg: var(--pdp-3);
  --btn-primary-text: var(--pdp-white);
  --btn-primary-hover-bg: var(--pdp-2);
  --btn-primary-hover-text: var(--pdp-white);
  --btn-secondary-bg: transparent;
  --btn-secondary-text: var(--pdp-3);
  --btn-secondary-border: var(--pdp-3);
  --btn-secondary-hover-bg: var(--pdp-3);
  --btn-secondary-hover-text: var(--pdp-white);
  --btn-ghost-bg: transparent;
  --btn-ghost-text: var(--pdp-3);
  --btn-ghost-hover-bg: var(--pdp-10);
}

/* --- ACCESSIBILITY: REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
       2. RESET & NORMALIZACIÃ“N
       ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: var(--color-bg-gradient);
  padding-top: 160px;
  /* Para el header fijo */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- ANIMACIÃ“N SUAVE PARA PÃRRAFOS --- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* --- HEADINGS --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--font-size-5xl);
}

h2 {
  font-size: var(--font-size-4xl);
}

h3 {
  font-size: var(--font-size-3xl);
}

h4 {
  font-size: var(--font-size-2xl);
}

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}

/* --- PARAGRAPHS & TEXT --- */
p {
  margin: 0;
  margin-bottom: var(--space-lg);
}

small {
  font-size: var(--font-size-sm);
}

/* --- LISTS --- */
ul,
ol {
  margin: 0;
  padding-left: var(--space-lg);
}

li {
  margin-bottom: var(--space-sm);
}

/* --- LINKS --- */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

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

/* --- FORM ELEMENTS --- */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--pdp-8);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 92, 158, 0.12);
}

/* ==========================================================================
       3. LAYOUT UTILITIES
       ========================================================================== */

/* Main Wrapper */
.wrap {
  width: 94%;
  max-width: 1180px;
  margin: var(--space-3xl) auto;
}

/* Flexbox Helpers */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-col {
  flex-direction: column;
}

/* Grid Helpers */
.grid {
  display: grid;
}

/* Spacing Utilities */
.mt-auto {
  margin-top: auto;
}

.mb-auto {
  margin-bottom: auto;
}

/* Clearfix */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ==========================================================================
     4. HEADER & NAVIGATION
     
     Estructura:
     - Header container (fixed positioning)
     - Logo with responsive scaling
     - Navigation menu (desktop & mobile)
     - Submenu dropdown
     - Mobile hamburger menu with animation
     
     Variables utilizadas:
     - Transiciones suave para animaciones
     - Espaciado consistente
     - Colores de tema
     ========================================================================== */

/* --- HEADER BASE STYLES --- */
#mainHeader,
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  height: 180px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 92, 158, 0.06);
}

/* Header Inner Container */
#mainHeader .header-container,
#mainHeader .header-inner,
.main-header .header-container,
.main-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  transition: var(--transition-smooth);
}

/* --- LOGO --- */
#mainHeader .logo,
.main-header .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  transform-origin: center;
}

#mainHeader .logo img,
.main-header .logo img {
  height: 90px;
  /* Hero state size */
  width: auto;
  transition: var(--transition-smooth);
}

/* --- LOGO TOGGLE (full vs shield) --- */
.main-header .logo .logo-full {
  display: block;
}
.main-header .logo .logo-shield {
  display: none;
}

.main-header.scrolled .logo .logo-full {
  display: none;
}
.main-header.scrolled .logo .logo-shield {
  display: block;
}

/* --- NAVIGATION (Desktop) --- */
#mainHeader nav,
.main-header nav {
  width: 100%;
  display: flex;
  justify-content: center;
  transition: var(--transition-smooth);
}

#mainHeader nav ul,
.main-header nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-2xl);
  /* 24px between items */
  align-items: center;
  margin: 0;
  padding: 0;
  justify-content: center;
}

/* Navigation Links */
#mainHeader nav a,
.main-header nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  position: relative;
  padding: var(--space-sm) var(--space-1);
  /* Small vertical padding */
  font-size: var(--font-size-base);
  transition: var(--transition-fast);
}

/* Underline animation on hover */
#mainHeader nav a::after,
.main-header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0%;
  background: var(--color-primary);
  transition: width 0.28s ease;
}

#mainHeader nav a:hover::after,
.main-header nav a:hover::after {
  width: 100%;
}

/* --- SUBMENU (Dropdown) --- */
.has-submenu {
  position: relative;
}

.has-submenu .submenu {
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--color-bg-default);
  padding: var(--space-sm) 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(var(--space-sm));
  transition: var(--transition-fast);
  min-width: 180px;
  list-style: none;
  margin: 0;
  z-index: 100;
}

.has-submenu .submenu li {
  margin: 0;
}

.has-submenu .submenu a {
  display: block;
  padding: var(--space-md) var(--space-lg);
  color: var(--color-text);
  text-decoration: none;
  transition: var(--transition-fast);
}

.has-submenu .submenu a:hover {
  background: var(--color-bg-light);
  color: var(--color-primary);
}

/* Show submenu on hover */
.has-submenu:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- SCROLL STATE (Collapsed Header) --- */
#mainHeader.scrolled,
.main-header.scrolled {
  height: 70px;
  /* Reduced height when scrolled */
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.main-header.scrolled .header-container {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0;
}

.main-header.scrolled .logo {
  transform: scale(1);
}

.main-header.scrolled .logo img {
  height: 48px;
  /* Smaller in scrolled state */
}

.main-header.scrolled nav {
  width: auto;
  justify-content: flex-end;
}

.main-header.scrolled nav ul {
  gap: var(--space-2xl);
  /* 24px */
  justify-content: flex-end;
}

.main-header.scrolled nav a {
  font-size: 0.92rem;
}

/* --- MOBILE MENU BUTTON --- */
.menu-btn,
.header-burger {
  display: none;
  /* Hidden on desktop */
  cursor: pointer;
  position: relative;
  z-index: 1001;
}

.menu-btn span,
.header-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: var(--space-sm) 0;
  border-radius: 2px;
  transition: var(--transition-normal);
  transform-origin: center;
}

/* Hamburger to X animation */
.menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- BODY PADDING (Header offset) --- */
body.header-scrolled {
  padding-top: 180px;
}

body.header-scrolled .hero {
  margin-top: 0;
}

/* Home page override (hero full-screen) */
body:has(.hero) {
  padding-top: 0;
}

/* Body lock when mobile menu open */
body.menu-open {
  overflow: hidden;
}

body.menu-open .main-header {
  background: var(--color-bg-default);
  box-shadow: none;
}

/* ==========================================================================
     6. RESPONSIVE: MOBILE (max-width: 900px)
     ========================================================================== */

@media (max-width: 900px) {
  body {
    padding-top: 80px !important;
    /* Force mobile header offset */
  }

  body:has(.hero) {
    padding-top: 0 !important;
  }

  /* Mobile Header Size */
  .main-header {
    height: 80px;
    z-index: 1100;
  }

  .main-header .header-container {
    flex-direction: row;
    height: 100%;
    padding: 0 var(--space-lg);
    align-items: center;
    justify-content: center;
    position: relative;
  }

  /* Mobile Logo Centered */
  .main-header .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
  }

  .main-header .logo img {
    height: 50px;
  }

  /* Keep logo same in scrolled state */
  .main-header.scrolled .logo img {
    height: 50px;
  }

  /* Show Mobile Menu Button */
  .menu-btn,
  .header-burger {
    display: block;
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1200;
    padding: var(--space-md);
    margin-left: calc(var(--space-md) * -1);
  }

  /* Hide Desktop Navigation (will show via JS) */
  .main-header nav {
    width: 0;
    height: 0;
  }

  /* Mobile Menu Fullscreen */
  .main-header nav ul {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--color-bg-default);
    flex-direction: column;
    padding: var(--space-lg) 0;
    gap: 0;
    transform: translateX(-100%);
    transition: var(--transition-normal);
    box-shadow: none;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    z-index: 1000;
    border-top: 1px solid var(--color-bg-light);
  }

  .main-header nav ul.open {
    transform: translateX(0);
  }

  /* Mobile Menu Items */
  .main-header nav ul li {
    width: 100%;
    border-bottom: 1px solid var(--color-bg-light);
  }

  .main-header nav ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 55px;
    font-size: var(--font-size-xl);
    color: var(--color-text);
    padding: var(--space-xl) var(--space-2xl);
    font-weight: var(--font-weight-semibold);
    transition: var(--transition-fast);
    position: relative;
  }

  /* Disable underline animation on mobile */
  .main-header nav ul li a::after {
    display: none !important;
  }

  /* Submenu arrow indicator */
  .has-submenu>a::before {
    content: "";
    order: 1;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    transform: rotate(45deg);
    transition: var(--transition-normal);
    margin-left: var(--space-md);
    pointer-events: none;
  }

  .has-submenu.submenu-open>a::before {
    transform: rotate(-135deg);
  }

  /* Mobile Submenu */
  .has-submenu .submenu {
    position: static;
    box-shadow: none;
    background: var(--color-bg-light);
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    display: block;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  }

  .has-submenu.submenu-open .submenu {
    opacity: 1;
    visibility: visible;
    max-height: 250px;
    /* Adjusted for 3 items */
    border-bottom: 1px solid var(--color-bg-light);
  }

  .has-submenu .submenu a {
    min-height: 50px;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    padding-left: var(--space-3xl);
    /* 32px for indent */
    border-bottom: none;
  }

  body.header-scrolled {
    padding-top: 80px !important;
  }

  /* Internal page wrappers cleanup */
  .contact-wrapper,
  .historia-wrapper,
  .seccion-padding,
  .representantes-section {
    padding-top: var(--space-lg) !important;
    /* 16px small buffer */
  }

  /* Fix horizontal overflow globally to ensure centering works */
  html,
  body {
    overflow-x: hidden;
    position: relative;
  }
}

/* ==========================================================================
     7. RESPONSIVE: SMALL MOBILE (max-width: 480px)
     ========================================================================== */

@media (max-width: 480px) {

  /* Reduce padding on very small screens */
  .main-header .header-container {
    padding: 0 var(--space-md);
  }

  .main-header nav ul li a {
    padding: var(--space-lg) var(--space-lg);
  }

  .has-submenu .submenu a {
    padding-left: var(--space-2xl);
  }
}

/* ==========================================================================
     8. NEWS SECTION - Featured & List with Grid
  
     Estructura:
     - Featured card (full-width hero with overlay)
     - Secondary news grid (3 columns desktop, 1 column mobile)
     - Responsive layouts
  
     Componentes:
     - .news-featured (container)
     - .news-featured-card (hero card)
     - #newsList (grid container)
     - .news-card (secondary card)
  ========================================================================== */

/* --- FEATURED NEWS SECTION --- */

.news-featured {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-4xl);
}

.news-featured-card {
  position: relative;
  width: 100%;
  height: 600px;
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
}

.news-featured-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.news-featured-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  position: absolute;
  top: 0;
  left: 0;
}

.news-featured-card:hover img {
  transform: scale(1.05);
}

/* Overlay gradient at bottom */
.news-featured-card::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 280px;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.95),
      rgba(0, 0, 0, 0.6),
      transparent);
  z-index: 1;
}

.news-featured-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4xl);
  color: white;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.news-featured-content .date {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.5px;
}

.news-featured-content h2 {
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-md) 0;
  color: white;
  font-weight: var(--font-weight-bold);
}

.news-featured-content p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 var(--space-2xl) 0;
  line-height: 1.6;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-featured-card:hover .news-featured-content p {
  opacity: 1;
  max-height: 500px;
  animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.news-featured-content .btn {
  align-self: flex-start;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  transition: var(--transition-fast);
  border: none;
  cursor: pointer;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(0, 92, 158, 0.3);
}

.news-featured-content .btn:hover {
  background: var(--btn-primary-hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 92, 158, 0.4);
}

/* --- NEWS LIST GRID --- */

.news-list {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-6xl);
}

#newsList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
  margin-bottom: var(--space-4xl);
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 92, 158, 0.06);
  height: 100%;
  cursor: pointer;
  position: relative;
}

.news-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
  transform-origin: left;
  z-index: 10;
}

.news-card:hover::before {
  transform: scaleX(1);
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-lighter);
  background: var(--pdp-10);
}

.news-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-normal);
  display: block;
}

.news-card:hover img {
  transform: scale(1.08);
}

.news-card-content {
  padding: var(--space-lg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-card-content .date {
  font-size: var(--font-size-xs);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-sm) 0;
  text-transform: uppercase;
}

.news-card-content h3 {
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  flex: 1;
}

.news-card-content h3 a {
  text-decoration: none;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.news-card-content h3 a:hover {
  color: var(--color-primary-deep);
}

.news-card-content p {
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
  font-size: 0.875rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover .news-card-content p {
  opacity: 1;
  max-height: 500px;
  animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* --- RESPONSIVE: TABLET (max-width: 900px) --- */

@media (max-width: 900px) {
  .news-featured-card {
    height: 500px;
  }

  #newsList {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }

  .news-card img {
    height: 180px;
  }
}

/* --- RESPONSIVE: MOBILE (max-width: 768px) --- */

@media (max-width: 768px) {

  .news-featured,
  .news-list {
    padding: 0 var(--space-md);
  }

  .news-featured-card {
    height: 380px;
  }

  .news-featured-content {
    padding: var(--space-2xl);
  }

  .news-featured-content h2 {
    font-size: var(--font-size-2xl);
  }

  .news-featured-content p {
    display: none;
  }

  #newsList {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .news-card img {
    height: 150px;
  }

  .news-card-content {
    padding: var(--space-md);
  }

  .news-card-content h3 {
    font-size: var(--font-size-base);
  }
}

/* --- RESPONSIVE: SMALL MOBILE (max-width: 480px) --- */

@media (max-width: 480px) {
  .news-featured-card {
    height: 280px;
  }

  .news-featured-content {
    padding: var(--space-lg);
  }

  .news-featured-content h2 {
    font-size: var(--font-size-xl);
  }

  .news-featured-content .date {
    font-size: var(--font-size-xs);
  }

  .news-featured-content p {
    display: none;
  }

  #newsList {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .news-card img {
    height: 120px;
  }

  .news-card-content {
    padding: var(--space-md);
  }

  .news-card-content h3 {
    font-size: var(--font-size-sm);
  }
}

/* ===== LOAD MORE BUTTON ===== */
.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  padding: 40px 0;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 48px;
  border: none;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 4px 16px rgba(0, 92, 158, 0.2);
  transition: background 0.25s ease-out, box-shadow 0.25s ease-out,
    color 0.25s ease-out;
}

.load-more-btn:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-hover-text);
  box-shadow: 0 6px 20px rgba(0, 92, 158, 0.3);
}

.load-more-btn:active {
  box-shadow: 0 2px 8px rgba(0, 92, 158, 0.15);
}

@media (max-width: 768px) {
  .load-more-btn {
    padding: 12px 40px;
    font-size: 15px;
  }
}

/* ==========================================================================
     9. NEWS SECTION - Individual Article
     ========================================================================== */

.news-article {
  max-width: 800px;
  margin: var(--space-4xl) auto var(--space-6xl);
  padding: 0 var(--space-lg);
}

.news-article img.hero {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4xl);
  box-shadow: var(--shadow-lg);
}

.news-article h1 {
  font-size: var(--font-size-5xl);
  color: var(--color-primary-deep);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-tight);
}

.news-article .date {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--pdp-10);
}

.news-article .body {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-loose);
  color: var(--color-text);
}

.news-article .body p {
  margin-bottom: var(--space-2xl);
}

.news-article .body h2 {
  color: var(--color-primary-deep);
  font-size: var(--font-size-4xl);
  margin-top: var(--space-4xl);
  margin-bottom: var(--space-xl);
}

/* --- VIDEO Y EXTRAS --- */
.news-video-wrapper {
  margin: var(--space-4xl) 0;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.news-extra-actions {
  margin-top: var(--space-5xl);
  padding-top: var(--space-3xl);
  border-top: 1px solid var(--pdp-10);
  display: flex;
  justify-content: center;
}

.btn-pdf-download {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-primary);
  color: var(--pdp-white) !important;
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.btn-pdf-download:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-pdf-download svg {
  width: 20px;
  height: 20px;
}

.news-card.more-news a {
  background: var(--color-bg-default);
  color: var(--color-primary);
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-2xl);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

/* ==========================================================================
     10. NEWS IMAGE GALLERY - Individual Article
     
     Componentes:
     - .news-gallery-container (wrapper)
     - .news-gallery (flex container)
     - .gallery-slide (individual image)
     - .gallery-nav (prev/next buttons)
     - .gallery-dots (indicator dots)
     - .gallery-counter (current/total count)
     ========================================================================== */

.news-gallery-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: var(--space-4xl) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-light);
  aspect-ratio: 16 / 12;
}

.news-gallery {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

/* --- Video Support in Gallery --- */
.video-slide-container {
  width: 100%;
  height: 100%;
  flex: 0 0 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.drive-video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

/* Hide zoom button on video slides */

/* Better approach: handled in JS by checking slide type before opening lightbox */

/* --- Navigation Buttons --- */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: var(--transition-normal);
  z-index: 10;
  box-shadow: var(--shadow-lg);
}

.gallery-nav:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-xl);
}

.gallery-prev {
  left: var(--space-lg);
}

.gallery-next {
  right: var(--space-lg);
}

/* --- Indicator Dots --- */
.gallery-dots {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-md);
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition-normal);
  padding: 0;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: white;
}

.dot.active {
  background: white;
  border-color: white;
  width: 28px;
  border-radius: var(--radius-sm);
}

/* --- Image Counter --- */
.gallery-counter {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.counter-current {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-light);
}

/* ==========================================================================
     11. NEWS HOME GRID - Modern Large Hero + Grid Below
     
     Layout:
     - Hero grande (100% ancho)
     - Abajo: 4 cards en grid (3 noticias + 1 CTA)
     ========================================================================== */

.home-news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
  max-width: 1300px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* --- FEATURED NEWS (Full Width - Grande) --- */
.home-news-featured {
  grid-column: 1 / -1;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: all var(--transition-slow);
  min-height: 70vh;
  background: #000;
  margin-bottom: var(--space-2xl);
}

.home-news-featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
  z-index: 1;
  transition: opacity var(--transition-normal);
}

.home-news-featured:hover::before {
  opacity: 0.7;
}

.home-news-featured:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.home-news-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: absolute;
  top: 0;
  left: 0;
}

.home-news-featured:hover img {
  transform: scale(1.08);
}

.home-news-featured .content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4xl);
  color: white;
  z-index: 2;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.95),
      rgba(0, 0, 0, 0.6),
      transparent);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.home-news-featured .date {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 1px;
}

.home-news-featured h2 {
  font-size: var(--font-size-5xl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-lg);
  color: white;
  font-weight: var(--font-weight-extrabold);
  margin: 0 0 var(--space-lg) 0;
}

.home-news-featured p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-2xl);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-2xl) 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-news-featured:hover p {
  max-height: 300px;
  /* Suficiente para texto largo */
  opacity: 1;
  transform: translateY(0);
}

.home-news-featured a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-md) var(--space-3xl);
  background: var(--btn-primary-bg);
  border: 2px solid var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  transition: all var(--transition-fast);
  width: fit-content;
  box-shadow: 0 4px 15px rgba(0, 92, 158, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.home-news-featured:hover a {
  opacity: 1;
  transform: translateY(0);
}

.home-news-featured a:hover {
  background: white;
  color: var(--color-primary) !important;
  border-color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 92, 158, 0.4);
}

/* --- SECONDARY NEWS GRID (Abajo - 4 columns) --- */
.news-secondary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
}

/* --- SECONDARY CARDS (Grid de 4) --- */
.home-news-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 92, 158, 0.08);
  height: 400px;
  position: relative;
  cursor: pointer;
}

.home-news-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
  transform-origin: left;
  z-index: 10;
}

.home-news-card:hover::before {
  transform: scaleX(1);
}

.home-news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-lighter);
}

.home-news-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  transform-origin: center;
}

.home-news-card:hover img {
  transform: scale(1.1);
}

.home-news-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 2;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.6) 60%,
      transparent 100%);
  transition: all 0.3s ease;
}

.home-news-card-content .date {
  font-size: var(--font-size-xs);
  color: var(--pdp-white);
  opacity: 0.9;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-sm) 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.home-news-card-content h3 {
  font-size: var(--font-size-lg);
  margin-bottom: 0;
  color: var(--pdp-white);
  line-height: var(--line-height-tight);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.home-news-card-content h3 a {
  text-decoration: none;
  color: inherit;
}

.home-news-card-content p {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.5;
  font-size: 0.875rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  transform: translateY(10px);
}

.home-news-card:hover .home-news-card-content p {
  max-height: 200px;
  margin-top: var(--space-md);
  opacity: 1;
  transform: translateY(0);
}

.home-news-card:hover .home-news-card-content h3 {
  transform: translateY(-5px);
}

/* --- MORE NEWS CTA (Grid de 1 col) --- */
.home-news-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
      var(--color-primary-deep) 0%,
      var(--color-primary-dark) 100%);
  border-radius: var(--radius-lg);
  min-height: 300px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: none;
  position: relative;
  overflow: hidden;
  padding: var(--space-4xl) var(--space-2xl);
  text-align: center;
}

.home-news-more::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  transition: left var(--transition-slow);
}

.home-news-more:hover::before {
  left: 100%;
}

.home-news-more:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 92, 158, 0.3);
}

.home-news-more h3 {
  font-size: var(--font-size-3xl);
  color: white;
  margin-bottom: var(--space-2xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
}

.home-news-more a {
  display: inline-block;
  padding: var(--space-md) var(--space-3xl);
  background: var(--color-primary);
  color: white;
  border: 2px solid white;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.home-news-more a:hover {
  background: white;
  color: var(--color-primary) !important;
  border-color: white;
  transform: scale(1.05);
}

/* --- Section Background --- */
.home-news-section {
  background: var(--color-bg-light) !important;
  margin: 0;
  padding: var(--space-6xl) 0;
  display: block;
}

.home-news-section .section-title {
  padding-top: 0;
  margin-bottom: var(--space-4xl);
}

/* ==========================================================================
     12. RESPONSIVE: NEWS SECTION (max-width: 1024px)
     ========================================================================== */

@media (max-width: 1024px) {
  .news-secondary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-news-featured {
    min-height: 500px;
  }

  .home-news-featured h2 {
    font-size: var(--font-size-4xl);
  }
}

/* ==========================================================================
     13. RESPONSIVE: NEWS SECTION (max-width: 768px)
     ========================================================================== */

@media (max-width: 768px) {
  .home-news-grid {
    padding: var(--space-md);
    gap: var(--space-lg);
  }

  .home-news-featured {
    min-height: 500px;
    margin-bottom: var(--space-lg);
  }

  .home-news-featured .content {
    padding: var(--space-2xl);
  }

  .home-news-featured h2 {
    font-size: var(--font-size-3xl);
  }

  .home-news-featured p {
    display: none;
  }

  .news-secondary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    grid-auto-rows: 350px;
  }

  .home-news-card {
    height: 100%;
  }

  /* 
  .home-news-card img {
    height: 150px;
  }
  Removed to allow image to cover full card */

  .home-news-card-content {
    padding: var(--space-md);
  }

  .home-news-more {
    min-height: 250px;
    padding: var(--space-2xl);
  }

  .home-news-more h3 {
    font-size: var(--font-size-2xl);
  }
}

/* ==========================================================================
     14. RESPONSIVE: NEWS SECTION (max-width: 480px)
     ========================================================================== */

@media (max-width: 480px) {
  .home-news-grid {
    padding: var(--space-md);
    gap: var(--space-md);
  }

  .home-news-featured {
    min-height: 500px;
    margin-bottom: var(--space-md);
  }

  .home-news-featured .content {
    padding: var(--space-lg);
  }

  .home-news-featured h2 {
    font-size: var(--font-size-2xl);
  }

  .home-news-featured .date {
    font-size: var(--font-size-xs);
  }

  .home-news-featured p {
    display: none;
  }

  .home-news-featured a {
    padding: var(--space-sm) var(--space-2xl);
    font-size: var(--font-size-xs);
  }

  .news-secondary-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    /* Reset fixed height rows from tablet */
    gap: var(--space-sm);
    /* 8px gap */
  }

  .home-news-card {
    height: 240px !important;
  }

  /* 
  .home-news-card img {
     height: 150px; 
  }
  Removed to allow image to cover full card */

  .home-news-card-content {
    padding: var(--space-md);
  }

  .home-news-card-content h3 {
    font-size: var(--font-size-base);
  }

  .home-news-more {
    min-height: 200px;
    padding: var(--space-lg);
  }

  .home-news-more h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-lg);
  }

  .home-news-more a {
    padding: var(--space-sm) var(--space-xl);
    font-size: var(--font-size-xs);
  }
}

/* ==========================================================================
     5b. HOME - SECTIONS & ALTERNATING BACKGROUNDS
     ========================================================================== */

.authorities-main {
  background: transparent;
  margin: 0;
  padding: 80px 0;
  display: block;
}

.home-news-section {
  background: var(--pdp-10) !important;
  margin: 0;
  padding: 80px 0;
  display: block;
}

.home-news-section .section-title {
  padding-top: 0;
  /* Already has section padding */
}

/* ==========================================================================
       5b. HOME - CONTADORES (REPRESENTACIÃ“N)
       ========================================================================== */
.home-contadores {
  padding: 40px 20px;
  /* Reduced from 80px */
  background: white;
  text-align: center;
  margin: 0;
  display: block;
}

.contadores-header {
  display: none;
  /* Replaced by .section-title */
}

.contadores-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.contador-box {
  background: linear-gradient(135deg, var(--pdp-10) 0%, var(--pdp-white) 100%);
  border: 1px solid var(--pdp-8);
  border-radius: 16px;
  padding: 40px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.contador-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 92, 158, 0.15);
  border-color: var(--pdp-2);
}

.contador-num {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pdp-3), var(--pdp-5));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 12px;
}

.contador-box p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.contadores-link {
  margin-top: 30px;
  /* Reduced from 50px */
}

.contadores-link a {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: transparent;
  border: 2px solid var(--pdp-3);
  color: var(--pdp-3);
  font-weight: 600;
  border-radius: 99px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.contadores-link a:hover {
  background: var(--pdp-3);
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .contadores-wrap {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.historia-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.historia-block {
  position: relative;
  width: 100%;
  min-height: 80vh;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  display: flex;
  align-items: center;
  padding: 80px 0;
}

.historia-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.historia-content {
  position: relative;
  max-width: 700px;
  padding: 40px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--pdp-white);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.historia-block.left {
  justify-content: flex-start;
  padding-left: 8%;
}

.historia-block.right {
  justify-content: flex-end;
  padding-right: 8%;
}

.historia-content h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.historia-content p,
.historia-content li {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.historia-content ul {
  margin-left: 20px;
}

/* ==========================================================================
     15. EFEMERIDES - Calendar Section
     
     Estructura:
     - .next-card (prÃ³ximo evento)
     - .count-box (contador visual)
     - .legend (leyenda de categorÃ­as)
     - .months-grid (calendario 3 meses)
     - .month (tarjeta individual de mes)
     - .day (celda de dÃ­a)
     - .marker (punto de evento)
     
     Colores:
     - Cada categorÃ­a tiene su color (nacimiento, muerte, hecho, etc)
     ========================================================================== */

/* --- TOP SECTION: PrÃ³ximo Evento --- */
.top-row {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
  flex-wrap: wrap;
}

.next-card {
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  gap: var(--space-xl);
  align-items: center;
  width: 100%;
  box-shadow: var(--shadow-md);
  border-left: 6px solid var(--color-primary);
}

/* --- Count Box (Contador Visual) --- */
.count-box {
  background: linear-gradient(180deg,
      var(--color-primary-deep),
      var(--color-primary-dark));
  color: white;
  min-width: 110px;
  height: 86px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-md);
}

.count-box small {
  font-weight: var(--font-weight-semibold);
  opacity: 0.95;
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.95);
}

.count-number {
  font-size: var(--font-size-3xl);
  letter-spacing: 0.6px;
  margin: var(--space-1) 0;
}

/* --- Next Event Info --- */
.next-info {
  flex: 1;
}

.next-info h2 {
  margin: 0 0 var(--space-sm) 0;
  color: var(--color-primary);
  font-size: var(--font-size-lg);
}

.next-info p {
  margin: 0;
  color: var(--pdp-black);
}

/* --- Legend (Leyenda de CategorÃ­as) --- */
.legend {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.legend .item {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  box-shadow: 0 4px 10px rgba(2, 25, 35, 0.03);
}

.legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* --- CALENDAR GRID --- */
.months-grid {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.month {
  background: rgba(255, 255, 255, 0.98);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  height: 620px;
  display: flex;
  flex-direction: column;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.month h3 {
  margin: 0;
  color: var(--color-primary-deep);
  font-size: var(--font-size-lg);
  text-align: center;
}

/* --- Weekday Headers --- */
.weekday-row,
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-sm);
}

.weekday-row div {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-bold);
}

.days-grid {
  margin-top: var(--space-sm);
}

/* --- Day Cells --- */
.day {
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pdp-black);
  font-size: var(--font-size-base);
  position: relative;
  background: transparent;
}

.day.empty {
  opacity: 0.08;
}

/* --- Day Event Badge (circular background) --- */
.day.has-events span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--day-bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.day.has-events:hover span {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--day-border);
}

/* --- Month Events List --- */
.month-list {
  margin-top: var(--space-md);
  border-top: 1px dashed rgba(6, 40, 60, 0.06);
  padding-top: var(--space-sm);
  flex: 1;
  overflow: hidden;
}

.month-list .li {
  font-size: var(--font-size-sm);
  margin: var(--space-sm) 0;
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.month-list .bullet {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-top: var(--space-sm);
  flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.month-list .text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--pdp-black);
  line-height: var(--line-height-normal);
}

/* --- "Ver todas" button inside month cards --- */
.month-more {
  display: block;
  width: 100%;
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-align: center;
  transition: background 0.2s ease;
  line-height: 1.3;
}

.month-more:hover {
  background: var(--color-primary-deep);
}

/* --- Modal overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- Modal container --- */
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  width: 800px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-2xl);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(6, 40, 60, 0.08);
}

.modal-header h2 {
  font-size: var(--font-size-xl);
  color: var(--color-primary-deep);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(6, 40, 60, 0.06);
}

.modal-list .li {
  font-size: var(--font-size-sm);
  margin: var(--space-sm) 0;
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.modal-list .bullet {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-top: var(--space-sm);
  flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.modal-list .text {
  color: var(--pdp-black);
  line-height: var(--line-height-normal);
}

/* ==========================================================================
     16. RESPONSIVE: EFEMERIDES (max-width: 1199px)
     ========================================================================== */

@media (max-width: 1199px) {
  .months-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
     17. RESPONSIVE: EFEMERIDES (max-width: 767px)
     ========================================================================== */

@media (max-width: 767px) {
  .months-grid {
    grid-template-columns: 1fr;
  }

  .month {
    height: auto;
  }

  .month-list {
    flex: none;
    overflow: visible;
  }

  .month-list .text {
    display: block;
    -webkit-line-clamp: unset;
  }

  .next-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .count-box {
    width: 100%;
    height: 64px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: var(--space-md);
  }

  .month-list .li {
    font-size: var(--font-size-base);
  }

  .month-more {
    font-size: var(--font-size-base);
  }
}

/* ==========================================================================
     18. FUNCIONARIOS - Table Section
     
     Estructura:
     - .funcionarios-section (contenedor)
     - .tabla-wrapper (scroll wrapper)
     - .funcionarios-table (tabla principal)
     - .pagination-controls (controles de paginaciÃ³n)
     ========================================================================== */

.funcionarios-section {
  margin: var(--space-6xl) auto;
}

.funcionarios-section h1 {
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.funcionarios-section .subtitulo {
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
}

.tabla-wrapper {
  overflow-x: auto;
}

/* --- TABLA BASE --- */
.funcionarios-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.funcionarios-table thead {
  background: var(--color-primary);
  color: white;
}

.funcionarios-table th,
.funcionarios-table td {
  padding: var(--space-lg);
  text-align: left;
  vertical-align: middle;
}

.funcionarios-table tbody tr {
  border-bottom: 1px solid var(--pdp-10);
  transition: var(--transition-fast);
}

.funcionarios-table tbody tr:hover {
  background: var(--color-bg-light);
}

.foto-funcionario {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.funcionarios-table .nombre {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary-deep);
}

.funcionarios-table .contacto a {
  font-size: var(--font-size-lg);
  margin-right: var(--space-md);
  text-decoration: none;
}

/* --- RESPONSIVE TABLE vs CARDS --- */
.mobile-officials-list {
  display: none;
}

/* Base card styles */
.official-card {
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  overflow: hidden;
  transition: box-shadow var(--transition-normal);
  border: 1px solid rgba(0, 92, 158, 0.06);
}

.official-card:active {
  background-color: var(--pdp-10);
}

.official-card.expanded {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-lighter);
}

.card-header {
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
}

.card-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.card-main-info {
  flex: 1;
  min-width: 0;
  /* Prevents flex item from overflowing */
}

.card-name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 2px 0;
  line-height: var(--line-height-tight);
}

.card-position {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  margin: 0;
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
}

.card-toggle-icon {
  color: var(--color-text-tertiary);
  transition: transform var(--transition-normal);
  font-size: var(--font-size-sm);
}

.official-card.expanded .card-toggle-icon {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.card-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all var(--transition-normal);
  background: var(--pdp-10);
}

.official-card.expanded .card-details {
  max-height: 250px;
  opacity: 1;
  border-top: 1px solid rgba(0, 92, 158, 0.06);
}

.card-agency {
  padding: var(--space-md) var(--space-md) var(--space-sm) var(--space-md);
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.card-contact {
  padding: 0 var(--space-md) var(--space-md) var(--space-md);
  display: flex;
  gap: var(--space-lg);
}

/* Matched styles from .auth-socials a */
.card-contact a,
.funcionarios-table .contacto a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  color: var(--color-primary);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  margin: 0 4px;
}

.card-contact a:hover,
.funcionarios-table .contacto a:hover {
  background: var(--color-primary);
  color: white !important;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-contact a:hover svg,
.funcionarios-table .contacto a:hover svg {
  stroke: white;
}

.card-contact svg,
.funcionarios-table .contacto svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
  stroke: currentColor;
  fill: none;
}

/* Remove image styling since we are using SVGs now */
.social-link img {
  display: none;
}

/* Flex layout tweaks */
.funcionarios-table .contacto,
.card-contact {
  display: flex;
  align-items: center;
  gap: 0;
  /* Handled by margins on links */
}

.funcionarios-table .contacto {
  justify-content: flex-start;
}

.card-contact {
  justify-content: flex-start;
  /* Or center if preferred for mobile cards */
}

@media (max-width: 768px) {

  /* Hide Table, Show Cards */
  .funcionarios-table-wrapper,
  .tabla-wrapper {
    /* .tabla-wrapper wraps the table. */
    display: none;
  }

  .mobile-officials-list {
    display: block;
    padding: 0 var(--space-md);
  }
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
  padding: var(--space-xl);
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--btn-primary-hover-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pagination-btn:disabled {
  background: var(--pdp-8);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.pagination-btn span {
  font-size: var(--font-size-2xl);
  line-height: 1;
}

.pagination-info {
  padding: var(--space-md) var(--space-xl);
  background: var(--color-bg-default);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  min-width: 160px;
  text-align: center;
}

.pagination-info span {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

/* ==========================================================================
       19. REPRESENTANTES - Map & Cards Section
       
       Estructura:
       - .representantes-map-container (flex layout)
       - .mapa-wrapper (map container)
       - .map-dot (interactive dots)
       - .resultado-depto (results grid)
       - .rep-card (representative card)
       - .modal-overlay (modal para resultados)
       ========================================================================== */

.representantes-map-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
  align-items: center;
  margin: 0 auto var(--space-4xl);
  max-width: 1200px;
  width: 92%;
}

.representantes-map-container .mapa-wrapper {
  flex: none;
  width: 100%;
  max-width: 600px;
  position: relative;
  z-index: 10;
}

.mapa-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

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

.mapa-wrapper svg path {
  fill: var(--color-primary-lighter) !important;
  stroke: var(--color-primary) !important;
}

/* --- MAP DOTS (Interactive Points) --- */
.map-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: var(--color-primary);
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-md);
  z-index: 10;
  padding: 0;
}

.map-dot:hover {
  transform: translate(-50%, -50%) scale(1.3);
  background-color: var(--color-primary-light);
  box-shadow: var(--shadow-lg);
}

.map-dot.active {
  background-color: var(--color-primary-dark);
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 0 6px rgba(0, 92, 158, 0.2);
}

/* Tooltip on hover */
.map-dot::after {
  content: attr(aria-label);
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
  pointer-events: none;
}

.map-dot:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Pulse animation */
@media (prefers-reduced-motion: no-preference) {
  @keyframes pulse-dot {
    0% {
      box-shadow: 0 0 0 0 rgba(90, 148, 192, 0.7);
    }

    70% {
      box-shadow: 0 0 0 10px rgba(90, 148, 192, 0);
    }

    100% {
      box-shadow: 0 0 0 0 rgba(90, 148, 192, 0);
    }
  }
}

.map-dot:not(.active) {
  animation: pulse-dot 2s infinite;
}

/* --- RESULTS PANEL --- */
.representantes-map-container .resultado-depto {
  width: 100%;
  max-width: 1100px;
  min-height: 100px;
  text-align: left;
  padding: var(--space-3xl);
  background: var(--color-bg-light);
  border-radius: var(--radius-xl);
  transition: var(--transition-normal);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.resultado-depto h3,
.resultado-depto p {
  grid-column: 1 / -1;
  width: 100%;
}

.resultado-depto h3 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: var(--space-2xl);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

/* --- REPRESENTATIVE CARDS --- */
.cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3xl);
  margin: var(--space-4xl) auto;
  max-width: 1200px;
}

.rep-card {
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 380px;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  border: 1px solid rgba(0, 92, 158, 0.06);
}

.rep-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-lighter);
}

.rep-card img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-lg);
  border: 4px solid var(--pdp-10);
}

.rep-card h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-top: 0;
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-tight);
}

.rep-card .cargo {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-md);
}

.rep-card .lugar {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-normal);
}

/* Hidden by default, shown by JS */
section:not(.funcionarios-section) .rep-card {
  display: none;
}

.rep-card.visible {
  display: flex !important;
}

.rep-card.visible:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
  padding: var(--space-lg);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--color-bg-default);
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  border-radius: var(--radius-xl);
  position: relative;
  padding: var(--space-4xl);
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

.modal-close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  background: var(--pdp-10);
  border: none;
  font-size: var(--font-size-3xl);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-primary);
  color: white;
}

#modalResultBody {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-2xl);
  justify-items: center;
}

#modalResultBody h3 {
  grid-column: 1 / -1;
  text-align: center;
  font-size: var(--font-size-3xl);
  color: var(--color-primary);
  margin-bottom: var(--space-xl);
}

/* ==========================================================================
       20. RESPONSIVE: FUNCIONARIOS & REPRESENTANTES (max-width: 1100px)
       ========================================================================== */

@media (max-width: 1100px) {
  .representantes-map-container .resultado-depto {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
       21. RESPONSIVE: FUNCIONARIOS & REPRESENTANTES (max-width: 768px)
       ========================================================================== */

@media (max-width: 768px) {
  .pagination-controls {
    gap: var(--space-md);
  }

  .pagination-btn {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-sm);
  }

  .pagination-info {
    font-size: var(--font-size-sm);
    padding: var(--space-sm) var(--space-md);
    min-width: 130px;
  }

  .representantes-map-container {
    flex-direction: column;
  }

  .representantes-map-container .mapa-wrapper {
    flex: 1;
    width: 100%;
    position: relative;
    top: 0;
  }

  .representantes-map-container .resultado-depto {
    width: 100%;
    grid-template-columns: 1fr;
    padding: var(--space-xl);
  }
}

/* ==========================================================================
       22. RESPONSIVE: REPRESENTANTES (max-width: 500px)
       ========================================================================== */

@media (max-width: 500px) {
  .rep-card.visible {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-md);
  }

  .rep-card.visible img {
    grid-row: auto;
    margin: 0 auto var(--space-sm) auto;
    width: 100px;
    height: 100px;
  }

  .rep-card.visible h3 {
    text-align: center;
  }

  .rep-card.visible .dato {
    justify-content: center;
  }
}

/* --- Cleanups --- */
.representantes .block h2,
.representantes .block p.periodo {
  display: none !important;
}

[alt*="Argentina"],
[alt*="argentina"],
img[src*="argentina"],
img[src*="Argentina"] {
  display: none !important;
}

/* ==========================================================================
     22. CONTACTO - Contact Section
     
     Estructura:
     - .contact-wrapper (contenedor principal)
     - .contact-container (contenedor con max-width)
     - .contact-grid (grid de tarjetas de contacto)
     - .contact-card (tarjeta individual)
     - .contact-form-box (formulario)
     ========================================================================== */

.contact-wrapper {
  padding-top: var(--space-6xl);
  /* 80px offset from header */
}

.contact-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-6xl);
}

/* --- CONTACT CARDS GRID --- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-6xl);
}

.contact-card {
  background: var(--color-bg-default);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.contact-card .icon {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-xl);
  color: var(--color-primary);
}

.contact-card h3 {
  margin-bottom: var(--space-md);
}

.contact-card p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-relaxed);
}

.card-btn {
  display: inline-block;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-xl);
  background: var(--color-primary);
  color: white;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  transition: var(--transition-fast);
  cursor: pointer;
}

.card-btn:hover {
  background: white;
  color: var(--color-primary) !important;
  border-color: white;
  transform: translateY(-2px);
}

/* --- CONTACT FORM --- */
.contact-form-box {
  background: var(--color-bg-default);
  padding: var(--space-4xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.contact-form-box h2 {
  margin-top: 0;
  margin-bottom: var(--space-xl);
  color: var(--color-primary);
}

.contact-form-box input,
.contact-form-box select,
.contact-form-box textarea {
  width: 100%;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--pdp-8);
  font-size: var(--font-size-base);
  font-family: inherit;
  transition: var(--transition-fast);
}

.contact-form-box input:focus,
.contact-form-box select:focus,
.contact-form-box textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 92, 158, 0.1);
}

.contact-form-box button {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: var(--space-lg) var(--space-2xl);
  border: 2px solid var(--btn-primary-bg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: var(--transition-normal);
}

.contact-form-box button:hover {
  background: white;
  color: var(--color-primary) !important;
  border-color: white;
  transform: translateY(-2px);
}

.contact-form-box button:active {
  transform: translateY(0);
}

#form-status {
  margin-top: var(--space-md);
  font-size: 0.9rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
}

#form-status.form-success {
  background: #d4edda;
  color: #155724;
}

#form-status.form-error {
  background: #f8d7da;
  color: #721c24;
}

/* ==========================================================================
     23. HOME SECTIONS - Background & Layout
     
     Estructura:
     - .authorities-main (secciÃ³n autoridades)
     - .home-news-section (secciÃ³n noticias con fondo)
     - .home-contadores (secciÃ³n contadores)
     ========================================================================== */

.authorities-main {
  background: transparent;
  margin: 0;
  padding: var(--space-6xl) 0;
  display: block;
}

.home-news-section {
  background: var(--pdp-10) !important;
  margin: 0;
  padding: var(--space-6xl) 0;
  display: block;
}

.home-news-section .section-title {
  padding-top: 0;
}

/* --- CONTADORES (Counters) --- */
.home-contadores {
  padding: var(--space-4xl) var(--space-lg);
  background: var(--color-bg-default);
  text-align: center;
  margin: 0;
  display: block;
}

.contadores-header {
  display: none;
  /* Replaced by .section-title */
}

.contadores-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3xl);
  max-width: 1000px;
  margin: 0 auto;
}

.contador-box {
  background: linear-gradient(135deg,
      var(--pdp-10) 0%,
      var(--color-bg-default) 100%);
  border: 1px solid var(--pdp-8);
  border-radius: var(--radius-lg);
  padding: var(--space-4xl) var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.contador-box:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-lighter);
}

.contador-num {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  background: linear-gradient(135deg,
      var(--color-primary-deep),
      var(--color-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: var(--space-md);
}

.contador-box p {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.contadores-link {
  margin-top: var(--space-3xl);
}

.contadores-link a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-md) var(--space-2xl);
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition-normal);
}

.contadores-link a:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

/* ==========================================================================
     24. HISTORIA - Background Sections (Full Height Blocks)
     ========================================================================== */

.historia-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.historia-block {
  position: relative;
  width: 100%;
  min-height: 80vh;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  display: flex;
  align-items: center;
  padding: var(--space-6xl) 0;
}

/* Dark overlay for readability */
.historia-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.historia-content {
  position: relative;
  max-width: 700px;
  padding: var(--space-4xl);
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
}

.historia-block.left {
  justify-content: flex-start;
  padding-left: 8%;
}

.historia-block.right {
  justify-content: flex-end;
  padding-right: 8%;
}

.historia-content h2 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-xl);
  font-weight: var(--font-weight-bold);
}

.historia-content p,
.historia-content li {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
}

.historia-content ul {
  margin-left: var(--space-lg);
}

/* ==========================================================================
     25. RESPONSIVE: CONTACTO & HOME SECTIONS (max-width: 768px)
     ========================================================================== */

@media (max-width: 768px) {
  .contact-wrapper {
    padding-top: var(--space-xl);
  }

  .contact-container {
    padding: 0 var(--space-lg) var(--space-4xl);
  }

  .contact-grid {
    gap: var(--space-xl);
    margin-bottom: var(--space-4xl);
  }

  .contact-form-box {
    padding: var(--space-xl);
  }

  .contadores-wrap {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .historia-block {
    min-height: auto;
    padding: var(--space-4xl) 0;
  }

  .historia-content {
    padding: var(--space-xl);
  }

  .historia-block.left,
  .historia-block.right {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
    justify-content: center;
  }

  .historia-content h2 {
    font-size: var(--font-size-4xl);
  }

  .historia-content p,
  .historia-content li {
    font-size: var(--font-size-lg);
  }
}

/* ==========================================================================
     26. RESPONSIVE: HOME SECTIONS (max-width: 600px)
     ========================================================================== */

@media (max-width: 600px) {
  .contact-card {
    padding: var(--space-lg);
  }

  .contact-form-box {
    padding: var(--space-lg);
  }

  .home-contadores {
    padding: var(--space-2xl) var(--space-lg);
  }

  .contador-box {
    padding: var(--space-2xl) var(--space-md);
  }

  .contador-num {
    font-size: var(--font-size-4xl);
  }
}

/* ==========================================================================
     27. FOOTER - Main Footer Section
     
     Estructura:
     - .main-footer (contenedor principal)
     - .footer-container (contenedor con max-width)
     - .footer-row (fila principal con flex space-between)
     - .footer-logo-box (logo a la izquierda)
     - .footer-info (direcciÃ³n/info en el medio)
     - .footer-links (redes sociales a la derecha)
     ========================================================================== */

.main-footer,
footer.main-footer {
  background: var(--color-primary-deep);
  color: white;
  padding: var(--space-lg);
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- MAIN FOOTER ROW --- */
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2xl);
  padding: var(--space-xl) 0;
}

/* --- FOOTER LOGO BOX (Left) --- */
.footer-logo-box {
  flex-shrink: 0;
}

.footer-logo {
  height: 50px;
  width: auto;
  display: block;
}

/* --- FOOTER INFO (Center) --- */
.footer-info {
  flex: 1;
  min-width: 250px;
}

.footer-item {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  transition: var(--transition-fast);
  text-decoration: none;
  gap: var(--space-sm);
}

.footer-item:hover {
  color: white;
  opacity: 1;
}

.footer-item svg {
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: currentColor;
}

/* --- FOOTER LINKS / SOCIAL (Right) --- */
.footer-links {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.footer-social a {
  color: rgba(255, 255, 255, 0.85);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
  text-decoration: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.footer-social a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.footer-social a img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.footer-social a svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ==========================================================================
        28. RESPONSIVE: FOOTER (max-width: 768px)
        ========================================================================== */

@media (max-width: 768px) {

  .main-footer,
  footer.main-footer {
    padding: var(--space-lg) 0;
  }

  .footer-container {
    padding: 0 var(--space-md);
  }

  .footer-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-2xl);
    padding: var(--space-xl) 0;
  }

  .footer-logo-box {
    order: 1;
    width: auto;
  }

  .footer-info {
    order: 2;
    min-width: auto;
    width: 100%;
  }

  .footer-item {
    font-size: var(--font-size-sm);
    justify-content: center;
  }

  .footer-links {
    order: 3;
    width: auto;
  }

  .footer-social {
    justify-content: center;
    gap: var(--space-lg);
  }

  .footer-logo {
    height: 45px;
  }
}

/* ==========================================================================
        29. RESPONSIVE: FOOTER (max-width: 480px)
        ========================================================================== */

@media (max-width: 480px) {
  .footer-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-lg) 0;
  }

  .footer-logo-box {
    order: 1;
  }

  .footer-info {
    order: 2;
    width: 100%;
    padding: 0 var(--space-md);
  }

  .footer-item {
    font-size: var(--font-size-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    line-height: 1.4;
  }

  .footer-item svg {
    display: inline-block;
    vertical-align: middle;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .footer-links {
    order: 3;
  }

  .footer-logo {
    height: 40px;
  }

  .footer-social {
    gap: var(--space-lg);
    justify-content: center;
  }

  .footer-social a {
    width: 40px;
    height: 40px;
  }

  .footer-social a img {
    width: 20px;
    height: 20px;
  }
}

/* ==========================================================================
     30. PRINCIPIOS - Principles Section
     
     Estructura:
     - .principios-section (contenedor)
     - .principios-carousel-wrapper (carrusel)
     - .principio-card (tarjeta individual)
     ========================================================================== */

.principios-section {
  padding: var(--space-4xl) 0 var(--space-lg);
  background: linear-gradient(180deg, var(--pdp-10) 0%, var(--color-bg-default) 100%);
  overflow: hidden;
  position: relative;
}

.principios-section.internal-page {
  background: transparent;
  padding-top: var(--space-4xl);
}

.principios-section .section-title {
  margin-top: var(--space-xl);
}

.principios-section.internal-page .section-title {
  margin-top: var(--space-4xl);
  margin-bottom: var(--space-5xl);
}

.principios-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-lg);
}

.principios-header h2 {
  font-size: var(--font-size-5xl);
  color: var(--color-text);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-bold);
}

.principios-header p {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

/* --- CAROUSEL WRAPPER --- */
.principios-carousel-wrapper {
  position: relative;
  width: 100%;
  mask-image: linear-gradient(to right,
      transparent,
      black 5%,
      black 95%,
      transparent);
  -webkit-mask-image: linear-gradient(to right,
      transparent 0%,
      black 5%,
      black 95%,
      transparent 100%);
  padding: var(--space-xl) 0 var(--space-4xl);
  min-height: 480px;
  display: flex;
  align-items: flex-start;
}

.principios-track {
  display: flex;
  gap: var(--space-2xl);
  width: max-content;
  padding: 0 5%;
  cursor: grab;
  will-change: transform;
}

.principios-track:active {
  cursor: grabbing;
}

/* --- PRINCIPIO CARD --- */
.principio-card {
  width: 300px;
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  border-top: 5px solid var(--color-primary);
  transition: var(--transition-slow);
  height: 340px;
  overflow: hidden;
}

.principio-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-lg);
  height: auto;
  max-height: 800px;
  z-index: 10;
}

.principio-num {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-xl);
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-primary-lighter);
  opacity: 0.4;
  line-height: 1;
  user-select: none;
}

.principio-content {
  margin-top: var(--space-md);
}

.principio-card h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.3;
  padding-right: var(--space-4xl);
}

.principio-card p {
  font-size: var(--font-size-base);
  color: var(--color-text);
  line-height: var(--line-height-relaxed);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.principio-card:hover p {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

/* ==========================================================================
       31. REGLAMENTOS - Documents Section
       ========================================================================== */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-3xl);
  max-width: 1000px;
  margin: 0 auto var(--space-6xl);
}

.doc-card {
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(0, 92, 158, 0.06);
}

.doc-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-lighter);
}

.doc-icon {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-xl);
  background: var(--pdp-10);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-card h3 {
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.doc-card p {
  color: var(--color-text);
  margin-bottom: var(--space-xl);
  flex: 1;
  line-height: var(--line-height-relaxed);
}

.doc-card a {
  display: inline-block;
  padding: var(--space-md) var(--space-2xl);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  transition: var(--transition-fast);
}

.doc-card a:hover {
  background: var(--btn-primary-hover-bg);
  transform: translateY(-2px);
}

/* ==========================================================================
32. AUTORIDADES - Authorities Section
Estructura:
- .authorities (contenedor)
- .authority-cards (grid de tarjetas)
- .authority-card (flip card individual)
- .auth-card-inner, .auth-card-front, .auth-card-back (3D flip)
========================================================================== */

.authorities {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section-subtitle {
  font-size: var(--font-size-4xl);
  color: var(--color-primary);
  margin-bottom: var(--space-3xl);
  text-align: center;
  position: relative;
  padding-bottom: var(--space-lg);
}

.section-subtitle::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--color-primary-light);
  border-radius: 3px;
}

/* --- AUTHORITY CARDS (Flip Animation) --- */
.authority-cards {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
  flex-wrap: nowrap;
  padding: var(--space-lg);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

/* --- AUTHORITY CARD WRAPPER --- */
.authority-card-wrapper {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 340px;
  flex: 0 1 340px;
}

.authority-card {
  width: 100%;
  height: 420px;
  min-height: 420px;
  perspective: 1000px;
  cursor: pointer;
  background-color: var(--color-bg-light);
  margin-bottom: var(--space-xl);
  flex: 0 1 340px;
  display: block;
}

.auth-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
}

.authority-card:hover .auth-card-inner,
.authority-card.hover-active .auth-card-inner {
  transform: rotateY(180deg);
}

/* --- CARD FACES --- */
.auth-card-front,
.auth-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 4px solid white;
}

.auth-card-front {
  background-color: var(--color-bg-light);
  position: relative;
  z-index: 2;
  transform: translateZ(1px);
}

.full-card-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.auth-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 0;
  border: none;
}

.auth-card-back {
  background: var(--color-bg-default);
  color: var(--color-text);
  transform: rotateY(180deg) translateZ(1px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-3xl);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.03);
  z-index: 1;
}

.auth-card-back h3 {
  display: inline-block;
  background-color: var(--color-primary-dark);
  color: white;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xl);
  font-weight: var(--font-weight-bold);
  box-shadow: 0 4px 10px rgba(0, 92, 158, 0.2);
}

.auth-card-back .name {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  margin: 0 0 var(--space-md) 0;
  line-height: var(--line-height-tight);
  color: var(--color-primary);
}

.auth-card-back .meta {
  font-size: var(--font-size-lg);
  opacity: 0.8;
  margin-bottom: var(--space-3xl);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}

.back-title-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-md);
  transition: var(--transition-fast);
}

.back-title-link:hover {
  opacity: 0.8;
  transform: scale(1.02);
}

.back-title-link .name {
  margin-bottom: 0 !important;
}

/* --- SOCIAL ICONS --- */
.auth-socials {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  align-items: center;
  width: 100%;
}

.auth-socials a,
.social-icon-btn {
  color: var(--color-primary);
  background: rgba(0, 92, 158, 0.08);
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: var(--transition-normal);
  border: 1px solid rgba(0, 92, 158, 0.1);
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
  position: relative;
  z-index: 15;
}

.auth-socials a:hover,
.social-icon-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-3px) translateZ(20px) !important;
  color: white !important;
  box-shadow: var(--shadow-lg);
}

.auth-socials a:hover svg {
  stroke: white;
}

.auth-socials svg {
  stroke-width: 1.5;
  width: 24px;
  height: 24px;
  display: block;
}

/* --- AUTHORITIES TABLE --- */
.authorities-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-6xl);
}

.authorities-table thead {
  background: var(--color-primary);
  color: white;
}

.authorities-table th,
.authorities-table td {
  padding: var(--space-lg);
  text-align: left;
}

.authorities-table th {
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  font-size: var(--font-size-sm);
  letter-spacing: 0.5px;
}

.authorities-table tbody tr:nth-child(even) {
  background: var(--pdp-9);
}

.authorities-table tbody tr:hover {
  background: var(--pdp-10);
}

/* --- SIMPLE LIST --- */
.simple-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-6xl);
}

.simple-list li {
  background: var(--color-bg-default);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  border-left: 4px solid var(--color-primary-light);
  font-size: var(--font-size-base);
}

.simple-list.highlight li {
  border-left-color: var(--color-primary);
  background: var(--pdp-10);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

/* ==========================================================================
33. HISTORIA - Background Sections (Already defined in Contacto section)
[Using styles from section 24]
========================================================================== */

/* Note: Historia styles are already included in the Contacto section */

/* ==========================================================================
34. FICHA REPRESENTANTE - Profile Page
Estructura:
- .ficha-section (contenedor principal)
- .ficha-hero (sección de hero)
- .ficha-body-wrapper (contenedor de contenido)
- .ficha-tabs (pestañas)
========================================================================== */

.ficha-section {
  padding: 0;
  min-height: 80vh;
  background: var(--color-bg-default);
  padding-bottom: var(--space-6xl);
}

.back-btn {
  display: inline-block;
  margin: var(--space-lg) 0 var(--space-lg) 4%;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.back-btn:hover {
  color: var(--color-primary);
}

/* --- FICHA HERO --- */
.ficha-hero {
  background: linear-gradient(135deg,
      var(--color-primary-dark),
      var(--color-primary));
  color: white;
  padding: var(--space-4xl) var(--space-lg);
  margin-bottom: var(--space-4xl);
  box-shadow: var(--shadow-lg);
}

.ficha-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-4xl);
}

.ficha-hero-left {
  flex-shrink: 0;
}

.ficha-hero-img {
  width: 170px;
  height: 170px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-lg);
}

.ficha-hero-right {
  flex: 1;
}

.ficha-hero-cargo {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ficha-hero-name {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-sm) 0;
}

.ficha-hero-lugar {
  font-size: var(--font-size-xl);
  opacity: 0.9;
  margin-bottom: var(--space-xl);
  font-weight: var(--font-weight-light);
}

.ficha-hero-socials {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.hero-social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pdp-white);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: var(--font-size-2xl);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.hero-social-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: var(--color-primary-lighter);
}

/* --- FICHA BODY --- */
.ficha-body-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.ficha-text-content {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

.ficha-extra-data {
  margin-top: var(--space-4xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--pdp-10);
}

.ficha-extra-data h4 {
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

/* --- FICHA TABS --- */
.ficha-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 2px solid var(--pdp-10);
  margin-bottom: var(--space-3xl);
  margin-top: var(--space-xl);
}

.ficha-tab-btn {
  padding: var(--space-md) var(--space-2xl);
  background: transparent;
  border: none;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition-normal);
  margin: 0 var(--space-sm) -2px var(--space-sm);
}

.ficha-tab-btn:hover {
  color: var(--color-primary);
}

.ficha-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-panel.active {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(5px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* --- FICHA NEWS GRID --- */
.ficha-news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.ficha-news-grid .news-loader {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.ficha-news-grid .news-card {
  background: var(--color-bg-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.ficha-news-grid .news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.ficha-news-grid .news-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.ficha-news-grid .news-card-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ficha-news-grid .news-card-content .date {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.ficha-news-grid .news-card-content h3 {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-tight);
}

.ficha-news-grid .news-card-content p {
  color: var(--color-text);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  flex: 1;
}

@media (max-width: 768px) {
  .ficha-news-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

.bio {
  white-space: pre-line;
}

/* ==========================================================================
       35. HOME AUTHORITIES (Home Page Authority Cards Section)
       ========================================================================== */

.home-authorities {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
  margin-top: var(--space-4xl);
  flex-wrap: nowrap;
}

.home-authorities .authority-card {
  flex: 0 0 350px;
  max-width: 100%;
}

/* ==========================================================================
       36. RESPONSIVE: PRINCIPIOS (max-width: 768px)
       ========================================================================== */

@media (max-width: 768px) {
  .principios-section.internal-page {
    padding-top: var(--space-4xl);
  }

  .principio-card {
    width: 280px;
    min-height: 380px;
    height: auto;
    padding: var(--space-xl);
  }

  .principio-card p {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
  }

  .principios-carousel-wrapper {
    min-height: auto;
    padding-bottom: var(--space-xl);
  }
}

/* ==========================================================================
       37. RESPONSIVE: AUTORIDADES (max-width: 768px)
       ========================================================================== */

@media (max-width: 768px) {
  .ficha-hero-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-2xl);
  }

  .ficha-hero-name {
    font-size: var(--font-size-4xl);
  }

  .ficha-hero-socials {
    justify-content: center;
  }

  .authority-card {
    width: 100%;
    max-width: 320px;
    height: 420px;
    margin: 0 auto var(--space-xl);
  }

  .home-authorities {
    flex-wrap: wrap;
  }

  .home-authorities .authority-card {
    flex: 0 0 100%;
    max-width: 360px;
  }
}

/* ==========================================================================
       38. RESPONSIVE: FICHA (max-width: 768px)
       ========================================================================== */

@media (max-width: 768px) {
  .ficha-body-wrapper {
    padding: 0 var(--space-md);
  }

  .ficha-text-content {
    font-size: var(--font-size-base);
  }
}

/* ==========================================================================
       39. UTILITIES & GLOBAL FIXES
       ========================================================================== */

/* Main wrapper ensure footer at bottom */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#footer {
  margin-top: auto;
  width: 100%;
}

/* Section title global styles */
.section-title {
  text-align: center;
  margin: var(--space-6xl) auto var(--space-4xl);
  padding: 0 var(--space-lg);
  max-width: 800px;
  background: transparent;
}

.home-contadores .section-title,
.authorities-main .section-title,
.home-news-section .section-title {
  margin-top: var(--space-3xl);
}

.authorities-main,
.home-news-section {
  padding: var(--space-4xl) var(--space-lg);
}

.home-news-section {
  padding-bottom: var(--space-6xl);
}

.section-title h1,
.section-title h2 {
  font-size: var(--font-size-5xl);
  color: var(--color-primary);
  margin: 0 0 var(--space-md) 0;
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
}

.section-title p {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  margin: 0;
}

/* Hero section */
.hero {
  position: relative;
  width: 100%;
  height: 80vh;
  overflow: hidden;
  margin-top: 0;
}

.carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.8s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: rgba(0, 52, 102, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2xl);
  padding-top: var(--space-6xl);
  padding-bottom: var(--space-6xl);
}

.hero-logo {
  width: 150px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-4xl);
  background: var(--btn-primary-bg);
  border: 2px solid var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
}

.hero-btn:hover {
  background: white;
  color: var(--color-primary) !important;
  border-color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ==========================================================================
       40. RESPONSIVE: GLOBAL (max-width: 768px)
       ========================================================================== */

@media (max-width: 768px) {
  .hero {
    height: 60vh;
  }

  .hero-logo {
    width: 120px;
  }

  .section-title h1,
  .section-title h2 {
    font-size: var(--font-size-4xl);
  }

  .section-title {
    margin: var(--space-4xl) auto var(--space-2xl);
  }

  .authorities-main,
  .home-news-section {
    padding: var(--space-4xl) var(--space-md);
  }
}

/* ==========================================================================
       RESPONSIVE: MOBILE LANDSCAPE
       ========================================================================== */

@media (max-width: 900px) and (orientation: landscape) {
  body:has(.hero) {
    padding-top: 80px !important;
  }

  .hero {
    margin-top: 0 !important;
  }
}

/* ==========================================================================
       41. RESPONSIVE: GLOBAL (max-width: 480px)
       ========================================================================== */

@media (max-width: 480px) {
  .hero {
    height: 50vh;
  }

  .hero-overlay {
    gap: var(--space-lg);
    justify-content: flex-end;
    padding-bottom: var(--space-4xl);
  }

  .hero-btn {
    padding: var(--space-md) var(--space-2xl);
    font-size: var(--font-size-base);
  }

  .section-title h1,
  .section-title h2 {
    font-size: var(--font-size-3xl);
  }

  .section-title p {
    font-size: var(--font-size-base);
  }
}

/* Cache buster: 1769202112 */
/* ==========================================================================
     12. LATEST NEWS SECTION - Individual Article (Bottom)
     ========================================================================== */

.latest-news-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-6xl);
}

.latest-news-section .news-secondary-grid {
  /* Ensure grid fits within 800px */
  gap: var(--space-lg);
  /* Reduce gap slightly if needed */
  grid-template-columns: repeat(3, 1fr);
}

/* Full Image Card Styling */
.latest-news-section .home-news-card {
  height: 400px;
  /* Fixed height for immersive look */
  border: none;
  box-shadow: var(--shadow-md);
  position: relative;
  isolation: isolate;
  background: #000;
  /* Fallback background */
}

/* Hide the blue top border from the original card style */
.latest-news-section .home-news-card::before {
  display: none;
}

.latest-news-section .home-news-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Gradient Overlay */
.latest-news-section .home-news-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 75%;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.6) 50%,
      transparent 100%);
  z-index: 2;
  transition: opacity 0.3s ease;
  pointer-events: none;
  /* Let clicks pass through */
}

.latest-news-section .home-news-card:hover::after {
  opacity: 0.95;
}

.latest-news-section .home-news-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 3;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Text Colors */
.latest-news-section .home-news-card-content .date {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.latest-news-section .home-news-card-content h3,
.latest-news-section .home-news-card-content h3 a {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: var(--space-xs);
  font-weight: var(--font-weight-bold);
}

.latest-news-section .home-news-card-content h3 a:hover {
  color: var(--color-primary-lighter);
  /* Lighter blue for better visibility on dark */
  text-decoration: underline;
}

.latest-news-section .home-news-card-content p {
  color: rgba(255, 255, 255, 0.95);
  font-size: var(--font-size-sm);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: var(--space-xs);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
  .latest-news-section .news-secondary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
    /* Reduced for tablet too */
  }

  .latest-news-section .home-news-card {
    height: 320px;
  }

  .latest-news-section .home-news-card-content h3 {
    font-size: var(--font-size-base);
  }
}

@media (max-width: 600px) {
  .latest-news-section .news-secondary-grid {
    grid-template-columns: 1fr;
    gap: 12px !important;
    /* Extremely tight gap */
    display: flex !important;
    /* Try flex column for better control if grid fails */
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .latest-news-section .home-news-card {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    height: 280px !important;
    width: 100% !important;
    flex: 0 0 auto !important;
  }

  .latest-news-section .home-news-card-content {
    padding: var(--space-md);
  }

  .latest-news-section .home-news-card-content h3 {
    font-size: var(--font-size-base);
  }

  .latest-news-section .home-news-card-content p {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}