:root {
    --color-cream: #f7f2e7;
    --color-white: #ffffff;
    --color-moss: #7a9462;
    --color-moss-dark: #56713f;
    --color-navy: #233a5e;
    --color-navy-soft: rgba(35,58,94,0.08);
    --color-red: #c0392b;
    --color-red-soft: rgba(192,57,43,0.1);
    --color-black: #211f1c;
    --bg-primary: var(--color-cream);
    --bg-panel: var(--color-white);
    --text-primary: var(--color-black);
    --text-muted: #76705f;
    --text-accent: var(--color-red);
    --text-accent-soft: var(--color-red-soft);
    --border: rgba(35,58,94,0.12);
    --shadow: 0 18px 50px rgba(35,58,94,0.08);
    --font-scale: 1;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33,31,28,0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
}
.loading-overlay.visible { opacity: 1; visibility: visible; }
.loading-overlay-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    color: #233a5e;
    padding: 28px 36px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.loading-overlay-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 4px solid rgba(35,58,94,0.15);
    border-top-color: #c0392b;
    animation: loading-overlay-spin 0.8s linear infinite;
}
.loading-overlay-text {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    font-size: 0.95rem;
}
@keyframes loading-overlay-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .loading-overlay-spinner { animation-duration: 1.6s; }
}

/* Alto contraste: fondos y texto al máximo contraste posible */
:root[data-a11y-theme="alto-contraste"] {
    --color-cream: #ffffff;
    --color-white: #ffffff;
    --color-navy: #000000;
    --color-navy-soft: rgba(0,0,0,0.12);
    --color-red: #b00020;
    --color-red-soft: rgba(176,0,32,0.15);
    --color-black: #000000;
    --bg-primary: #ffffff;
    --bg-panel: #ffffff;
    --text-primary: #000000;
    --text-muted: #1a1a1a;
    --text-accent: #b00020;
    --border: #000000;
    --shadow: none;
}

/* Daltonismo: paleta Okabe-Ito, evita depender de la distinción rojo/verde */
:root[data-a11y-theme="daltonismo"] {
    --color-moss: #0072b2;
    --color-moss-dark: #00436b;
    --color-navy: #1a1a1a;
    --color-navy-soft: rgba(0,114,178,0.12);
    --color-red: #d55e00;
    --color-red-soft: rgba(213,94,0,0.15);
    --text-accent: #d55e00;
    --text-accent-soft: rgba(213,94,0,0.15);
    --border: rgba(0,0,0,0.25);
}

* {
    box-sizing: border-box;
}
html {
    font-size: calc(100% * var(--font-scale, 1));
    overflow-x: hidden;
}
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Barlow', sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    width: 100%;
}
.skip-link {
    position: absolute;
    top: -60px;
    left: 12px;
    z-index: 200;
    background: var(--color-navy);
    color: var(--color-white);
    padding: 10px 18px;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    font-weight: 700;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
.container {
    width: min(1240px, calc(100% - 36px));
    margin: 0 auto;
}
.topbar {
    background: var(--color-navy);
    color: var(--color-cream);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    color: rgba(247,242,231,0.85);
    font-size: 0.95rem;
}
.topbar-item { display: inline-flex; gap: 16px; align-items: center; }
.topbar-label { text-transform: uppercase; letter-spacing: 0.18em; color: #f3a99e; }
.topbar-secondary a { color: var(--color-cream); text-decoration: none; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-primary);
}
.logo { width: 54px; height: 54px; }
.site-name { display: block; font-size: 1.2rem; font-weight: 700; letter-spacing: 0.02em; color: var(--color-navy); }
.site-header small { display: block; color: var(--text-muted); letter-spacing: 0.04em; }
.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 22px;
}
.main-nav a {
    color: var(--color-navy);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--color-red); }
.has-dropdown { position: relative; padding-bottom: 14px; margin-bottom: -14px; }
.dropdown-toggle { display: flex; align-items: center; gap: 4px; }
.dropdown-arrow { font-size: 0.7em; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    background: var(--color-white);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    min-width: 220px;
    padding: 8px 0;
    display: none;
    flex-direction: column;
    z-index: 30;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
    display: flex;
}
.dropdown-menu a {
    padding: 10px 18px;
    white-space: nowrap;
}
.dropdown-menu a:hover { background: var(--color-navy-soft); color: var(--color-red); }
.nav-toggle-checkbox { display: none; }
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-navy);
}
.nav-overlay { display: none; }
.page-content { padding: 0; }

/* Mártires */
.martires-grid { display: flex; flex-direction: column; gap: 28px; margin-top: 28px; }
.martir-card {
    position: relative;
    display: grid;
    grid-template-columns: 240px 1fr;
    background: var(--bg-panel);
    border: 1px solid var(--color-navy);
    border-radius: 6px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.martir-card::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid var(--color-red);
    pointer-events: none;
    z-index: 1;
}
.martir-photo {
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
}
.martir-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-navy-soft);
    color: var(--color-navy);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 4rem;
    font-weight: 700;
}
.martir-info {
    position: relative;
    z-index: 2;
    padding: 28px 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.martir-info h3 {
    margin: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-navy);
}
.martir-dates {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-red);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.martir-resena {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
}
.martir-documentos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.martir-documentos a {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 1px solid var(--color-navy);
    border-radius: 4px;
    color: var(--color-navy);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}
.martir-documentos a:hover { background: var(--color-navy); color: var(--color-white); }

/* Oficiales Generales */
.oficiales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 28px;
}
.oficial-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    overflow: hidden;
    text-align: center;
}
.oficial-photo {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.oficial-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    background: var(--color-navy-soft);
    color: var(--color-navy);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
}
.oficial-info { padding: 18px 16px; }
.oficial-info h3 {
    margin: 0 0 4px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-navy);
}
.oficial-cargo { margin: 0; font-weight: 600; color: var(--color-red); }
.oficial-periodo { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }

/* Tabs (Oficiales Generales / Directores y Capitanes) */
.tabs { margin-top: 24px; }
.tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.tab-labels { display: flex; gap: 8px; border-bottom: 1px solid var(--border); }
.tab-labels label {
    padding: 12px 22px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.tab-panel { display: none; }
#tab-oficiales:checked ~ .tab-labels label[for="tab-oficiales"],
#tab-directores:checked ~ .tab-labels label[for="tab-directores"] {
    color: var(--color-red);
    border-bottom-color: var(--color-red);
}
#tab-oficiales:checked ~ #panel-oficiales,
#tab-directores:checked ~ #panel-directores {
    display: block;
}

/* Mando de la compañía (capitán / director / honorarios) */
.mando-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 20px;
}
.mando-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    text-align: center;
}
.mando-card img { width: 100%; height: 160px; object-fit: cover; }
.mando-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: var(--color-navy-soft);
    color: var(--color-navy);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
}
.mando-info { padding: 12px; }
.mando-info strong { display: block; color: var(--color-navy); font-size: 1rem; }
.mando-info span { color: var(--color-red); font-size: 0.85rem; font-weight: 600; }
a.mando-card { display: block; text-decoration: none; transition: transform 0.2s ease, box-shadow 0.2s ease; }
a.mando-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(35,58,94,0.15); }

/* Memorias Anuales */
.memorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 28px;
}
.memoria-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.memoria-card:hover { transform: translateY(-4px); border-color: var(--color-red); }
.memoria-card-anio {
    flex-shrink: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--color-red);
    background: var(--color-red-soft);
    border-radius: 12px;
    padding: 10px 14px;
    line-height: 1;
}
.memoria-card-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.memoria-card-body strong {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-navy);
    font-size: 1.05rem;
}
.memoria-card-desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.memoria-card-arrow {
    flex-shrink: 0;
    color: var(--color-navy);
    transition: transform 0.2s ease, color 0.2s ease;
}
.memoria-card:hover .memoria-card-arrow { color: var(--color-red); transform: translateX(4px); }

.memoria-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
}
.memoria-anio {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-red);
    min-width: 80px;
}
.memoria-info { flex: 1; }
.memoria-info h3 {
    margin: 0 0 4px;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-navy);
}
.memoria-info p { margin: 0; color: var(--text-muted); }
.pdf-viewer-wrapper {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    overflow: hidden;
    height: 80vh;
}
.pdf-viewer-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Material Mayor */
.material-mayor-compania {
    margin: 36px 0 12px;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-navy);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.vehiculos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}
.vehiculo-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.vehiculo-photo {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.vehiculo-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: var(--color-navy-soft);
    font-size: 3rem;
}
.vehiculo-info { padding: 16px; }
.vehiculo-info h4 {
    margin: 0 0 4px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-navy);
}
.vehiculo-tipo { margin: 0; font-weight: 600; color: var(--color-red); }
.vehiculo-detalle { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.vehiculo-descripcion { margin: 8px 0 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* Compañías - tarjetas estilo perfil */
.companias-fb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 28px;
}
.compania-fb-card {
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.compania-fb-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg, var(--shadow));
}
.compania-fb-cover {
    position: relative;
    height: 140px;
    background-size: cover;
    background-position: center;
}
.compania-fb-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.compania-fb-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 18px 16px 104px;
    min-height: 44px;
}
.compania-fb-avatar {
    position: absolute;
    left: 18px;
    top: -50px;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--color-white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-white);
    z-index: 2;
}
.compania-fb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.compania-fb-titles { min-width: 0; }
.compania-fb-titles h3 {
    margin: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compania-fb-titles p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compañía - detalle estilo perfil */
.compania-profile-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 24px;
}
.compania-profile-cover {
    position: relative;
    height: 240px;
    background-size: cover;
    background-position: center;
}
.compania-profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.compania-profile-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 28px 24px 152px;
    min-height: 60px;
}
.compania-profile-avatar {
    position: absolute;
    left: 28px;
    top: -64px;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    border: 4px solid var(--color-white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--color-white);
    z-index: 2;
}
.compania-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.compania-profile-titles h2 {
    margin: 0;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-navy);
}
.compania-profile-lema {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-style: italic;
}

.compania-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 28px 0;
}
.compania-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.compania-info-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-red);
    font-weight: 600;
}
.compania-info-value { color: var(--color-navy); font-weight: 500; }

/* Hero carousel */
.hero-carousel {
    position: relative;
    height: clamp(420px, 42vw, 640px);
    overflow: hidden;
}
.hero-slide {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: flex-end;
}
.hero-slide.active {
    opacity: 1;
    visibility: visible;
}
.hero-slide-bg-blur {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(36px) brightness(0.8) saturate(1.15);
    transform: scale(1.1);
}
.hero-slide-bg-sharp {
    position: absolute;
    inset: 0;
    background-size: 75%;
    background-position: center;
    background-repeat: no-repeat;
}
.hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(33,31,28,0.78) 0%, rgba(35,58,94,0.45) 55%, rgba(35,58,94,0.15) 100%);
}
.hero-slide-content {
    position: relative;
    z-index: 1;
    padding: 64px 0;
    max-width: min(640px, 55vw);
    box-sizing: border-box;
    color: var(--color-white);
}
.hero-slide-tag {
    display: inline-block;
    padding: 8px 18px;
    background: var(--color-moss);
    color: var(--color-white);
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.hero-slide-content h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2.4rem, 4.4vw, 4rem);
    line-height: 1.05;
    margin: 0 0 16px;
    letter-spacing: -0.03em;
}
.hero-slide-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 24px;
    color: rgba(255,255,255,0.92);
}
.hero-dots {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 2;
    display: flex;
    gap: 10px;
}
.hero-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
}
.hero-dot.active { background: var(--color-white); }
.hero-empty {
    padding: 100px 0;
    text-align: center;
    background: var(--color-navy);
    color: var(--color-cream);
}

.section-intro {
    margin-top: 64px;
    display: grid;
    gap: 30px;
    grid-template-columns: 1.2fr 0.8fr;
}
.section-card {
    background: var(--bg-panel);
    border-radius: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 32px;
}
.section-card h2 { margin-top: 0; font-size: 2rem; letter-spacing: -0.03em; color: var(--color-navy); }

/* Noticias section */
.noticias-section {
    margin-top: 64px;
    display: grid;
    gap: 24px;
    grid-template-columns: 3fr 1fr;
    align-items: stretch;
    padding: 0 18px;
}
.noticias-main h2 {
    margin-top: 0;
    font-size: 2rem;
    letter-spacing: -0.03em;
    color: var(--color-navy);
}
.noticias-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 24px 0 28px;
}
.noticias-col { display: grid; gap: 0; height: 100%; }
.noticias-col-featured { grid-template-rows: 1fr 1fr; }
.noticias-col-list {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr auto;
}
.button.noticias-ver-todas {
    grid-column: 1 / -1;
    margin-top: 0;
    border-radius: 0;
    background: var(--color-navy);
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    box-shadow: none;
}
.button.noticias-ver-todas:hover {
    box-shadow: none;
    background: var(--color-black);
    transform: none;
}
.news-item-large, .news-item-small {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    transition: transform 0.35s ease;
}
.news-item-small { min-height: 200px; }
.news-item-large:hover, .news-item-small:hover {
    transform: scale(1.04);
    z-index: 1;
}
.news-item-large-overlay, .news-item-small-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(33,31,28,0.85) 0%, rgba(35,58,94,0.25) 70%, transparent 100%);
}
.news-item-large-content, .news-item-small-content {
    position: relative;
    z-index: 1;
    padding: 24px;
    color: var(--color-white);
}
.news-item-small-content { padding: 16px; }
.news-item-large-content small, .news-item-small-content small {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-moss);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.news-item-large-content h3 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.25;
}
.news-item-small-content h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
}
.noticias-side {
    display: grid;
    gap: 16px;
    align-content: start;
}
.services-title {
    margin: 0 0 4px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-navy);
}
.noticias-side .service-card {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}
.noticias-side .service-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-navy-soft);
    color: var(--color-navy);
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.noticias-side .service-icon svg { width: 24px; height: 24px; }
.noticias-side .service-card-text { flex: 1; min-width: 0; }
.noticias-side .service-card-text h3 { margin: 0 0 4px; }
.noticias-side .service-card-text p { margin: 0; }
.noticias-side .service-arrow-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-moss);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.noticias-side .service-card:hover .service-icon {
    background: var(--color-red);
    color: var(--color-white);
    transform: rotate(-8deg) scale(1.08);
}
.noticias-side .service-card:hover .service-arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

/* Companies section */
.companias-grid {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
.compania-box {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-decoration: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.compania-box:hover {
    transform: scale(1.03);
    filter: brightness(1.08);
    z-index: 1;
}
.compania-box img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
}
.compania-box-numero {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-white);
}

.empresas-section { padding: 40px 0; background: var(--color-white); }
.empresas-marquee { overflow: hidden; width: 100%; margin-top: 16px; }
.empresas-marquee-track {
    display: flex;
    align-items: center;
    gap: 56px;
    width: max-content;
    animation: empresas-scroll 28s linear infinite;
}
.empresas-marquee:hover .empresas-marquee-track { animation-play-state: paused; }
.empresa-logo-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
}
.empresa-logo-item img {
    max-height: 100%;
    max-width: 150px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.65;
    transition: filter 0.25s ease, opacity 0.25s ease;
}
.empresa-logo-item:hover img { filter: grayscale(0%); opacity: 1; }
@keyframes empresas-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .empresas-marquee-track { animation: none; }
    .empresas-marquee { overflow-x: auto; }
}

.programas-juveniles-section { padding: 10px 0; text-align: center; }
.programas-juveniles-section h3.material-mayor-compania {
    display: inline-block;
    font-size: 1.7rem;
    margin: 6px 0 4px;
}
.programas-cards {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 20px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.programa-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 230px;
    flex: 1 1 200px;
    padding: 26px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.programa-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.programa-card-logo {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--color-navy-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    overflow: hidden;
    padding: 8px;
}
.programa-card-logo img { width: 100%; height: 100%; object-fit: contain; }
.programa-card-info { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.programa-card-info strong { color: var(--color-navy); font-size: 1.05rem; line-height: 1.3; }
.programa-card-info small { font-size: 0.86rem; }
.programa-card-info small { color: var(--text-muted); font-size: 0.82rem; }

.service-grid, .company-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 24px;
}
.service-card, .company-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow);
}
.service-card:hover, .company-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-moss);
}
.service-card h3, .company-card h3 { margin: 0 0 12px; font-size: 1.15rem; color: var(--color-navy); }
.company-thumb, .news-thumb {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 14px;
    background: var(--color-navy-soft);
}
.company-thumb img, .news-thumb img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}
.service-card p, .company-card p { color: var(--text-muted); line-height: 1.75; margin: 0; }
.news-list { display: grid; gap: 16px; margin-top: 24px; }
.news-item {
    display: grid;
    gap: 10px;
    padding: 20px;
    background: var(--color-cream);
    border: 1px solid var(--border);
    border-radius: 20px;
}
.news-item a { font-size: 1.05rem; font-weight: 600; text-decoration: none; color: var(--color-navy); }
.news-item small { color: var(--text-muted); }
/* Especialidades section */
.especialidades-section {
    margin-top: 64px;
    padding: 64px 0;
    background: var(--color-navy);
    color: var(--color-cream);
}
.section-heading {
    text-align: center;
    margin-bottom: 40px;
}
.section-heading .eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-moss);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 10px;
}
.section-heading h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    text-transform: uppercase;
    color: var(--color-white);
    margin: 0;
    letter-spacing: 0.02em;
}
.section-heading h2::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    background: var(--color-red);
    margin: 16px auto 0;
}
.especialidades-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.especialidad-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-top: 3px solid transparent;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}
.especialidad-card-highlight {
    border-top-color: var(--color-red);
}
.especialidad-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}
.especialidad-card h3 {
    color: var(--color-white);
    margin: 0 0 12px;
    font-size: 1.15rem;
}
.especialidad-card p {
    color: rgba(247,242,231,0.75);
    line-height: 1.7;
    margin: 0;
}
/* Cobertura / mapa */
.cobertura-section {
    margin-top: 64px;
    padding: 64px 0;
    background: var(--color-navy);
    color: var(--color-cream);
}
.cobertura-map {
    height: 480px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.cobertura-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--color-red);
    color: var(--color-white);
    border: 2px solid var(--color-white);
    box-shadow: var(--shadow);
}
.cobertura-marker svg { transform: rotate(45deg); }
.cobertura-map .leaflet-popup-content a {
    color: var(--color-red);
    font-weight: 600;
    text-decoration: none;
}
.cobertura-map .leaflet-popup-content a:hover { text-decoration: underline; }

.social-section {
    margin-top: 64px;
}
.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.social-card {
    padding: 64px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}
.social-card .eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    font-size: 0.85rem;
}
.social-card h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.social-card p {
    margin: 0;
    line-height: 1.7;
    max-width: 38ch;
}
.social-card-instagram {
    background: var(--color-red);
    color: var(--color-white);
}
.social-card-instagram .eyebrow { color: rgba(255,255,255,0.8); }
.social-card-instagram .button-outline { margin-top: 8px; align-self: flex-start; }
.instagram-embed {
    width: 100%;
    min-height: 220px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
}
.instagram-embed iframe {
    width: 100% !important;
    border: 0;
    display: block;
}
.social-card-contacto {
    background: var(--color-navy);
    color: var(--color-cream);
}
.social-card-contacto .eyebrow { color: var(--color-moss); }
.social-card-contacto h2 { color: var(--color-white); }
.contact-info {
    display: grid;
    gap: 18px;
    margin: 8px 0;
}
.contact-info-item {
    display: flex;
    align-items: center;
    gap: 14px;
}
.contact-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-red);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-info-item small {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    color: rgba(247,242,231,0.6);
}
.contact-info-item strong {
    font-size: 1rem;
    color: var(--color-white);
    font-weight: 600;
}
.contact-info-item a {
    color: var(--color-white);
    text-decoration: none;
}
.contact-info-item a:hover { color: var(--color-red); }
.social-follow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 10px 0 4px;
    flex-wrap: wrap;
}
.social-follow span {
    font-weight: 600;
    color: var(--color-white);
}
.social-follow-icons { display: flex; gap: 10px; }
.social-follow-icons a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: var(--color-white);
    transition: background 0.2s ease;
}
.social-follow-icons a:hover { background: var(--color-red); }
.emergencias-button {
    margin-top: 8px;
    width: 100%;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.site-footer {
    padding: 42px 0;
    margin-top: 64px;
    border-top: 1px solid var(--border);
    background: var(--color-navy);
    color: var(--color-cream);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.footer-inner a { color: var(--color-cream); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: rgba(247,242,231,0.85); text-decoration: none; }
.footer-links a:hover { color: #f3a99e; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 26px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-white);
    background: var(--color-red);
    box-shadow: 0 14px 32px rgba(192,57,43,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(192,57,43,0.32); }
.button-outline {
    background: transparent;
    border: 1px solid rgba(247,242,231,0.5);
    color: var(--color-cream);
}
.button-secondary {
    background: var(--color-moss);
    color: var(--color-white);
    border: 1px solid var(--color-moss);
    box-shadow: 0 14px 32px rgba(122,148,98,0.25);
}
.feature-list li a { color: var(--color-navy); text-decoration: none; font-weight: 600; }
.feature-list li small { color: var(--text-muted); }
.form-card { display: grid; gap: 18px; margin-top: 24px; }
.form-card label { display: grid; gap: 10px; font-weight: 500; color: var(--text-primary); }
.form-card input, .form-card select, .form-card textarea { width: 100%; border-radius: 16px; border: 1px solid var(--border); background: var(--color-white); color: var(--text-primary); padding: 16px; }
.form-card textarea { resize: vertical; min-height: 130px; }

.form-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px; align-items: start; margin-top: 24px; }
.form-layout .form-card { margin-top: 0; }
.form-card-boxed { background: var(--color-white); border: 1px solid var(--border); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }

#destinatarios-lista { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.destinatario-fila { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr auto; gap: 8px; align-items: center; }
.destinatario-fila select,
.destinatario-fila input { margin: 0; }
.btn-quitar-destinatario { background: transparent; border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; font-size: 18px; line-height: 1; color: var(--color-red, #c0392b); cursor: pointer; }
.btn-quitar-destinatario:hover { background: #fbeaea; }
.button-agregar-destinatario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: 1px solid var(--color-red);
    border-radius: 999px;
    background: transparent;
    color: var(--color-red);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.button-agregar-destinatario:hover { background: var(--color-red); color: var(--color-white); }
@media (max-width: 640px) {
    .destinatario-fila { grid-template-columns: 1fr; }
}

.form-info-card {
    background: var(--color-navy);
    color: var(--color-cream);
    border-radius: 24px;
    padding: 32px;
    display: grid;
    gap: 22px;
    align-content: start;
    box-shadow: var(--shadow);
    position: sticky;
    top: 24px;
}
.form-info-card h3 { margin: 0; font-size: 1.3rem; color: var(--color-white); }
.form-info-item { display: flex; gap: 14px; align-items: flex-start; }
.form-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-cream);
}
.form-info-item small { display: block; color: rgba(247,242,231,0.65); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.form-info-item strong { font-weight: 600; line-height: 1.4; }
.form-info-item a { color: var(--color-cream); }
.form-info-divider { height: 1px; background: rgba(255,255,255,0.14); border: none; margin: 0; }
.form-info-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 16px;
    padding: 16px;
}
.form-info-note-icon { font-size: 1.4rem; line-height: 1; }
.form-info-note p { margin: 0; font-size: 0.92rem; line-height: 1.55; color: rgba(247,242,231,0.9); }

@media (max-width: 900px) {
    .form-layout { grid-template-columns: 1fr; }
    .form-info-card { position: static; }
}
.alert { padding: 16px; border-radius: 16px; }
.alert-success { background: rgba(122,148,98,0.16); color: var(--color-moss-dark); border: 1px solid rgba(122,148,98,0.3); }
.alert-danger { background: var(--color-red-soft); color: var(--color-red); border: 1px solid rgba(192,57,43,0.3); }
@media (max-width: 1120px) {
    .section-intro { grid-template-columns: 1fr; }
    .noticias-section { grid-template-columns: 1fr; }
    .especialidades-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .site-header { backdrop-filter: none; }
    .topbar-inner { font-size: 0.8rem; gap: 10px; }
    .topbar-secondary { display: block; }
    .topbar-inner .button { display: none; }
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 260px;
        max-width: 80%;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 90px 24px 24px;
        background: var(--color-white);
        box-shadow: var(--shadow);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 50;
    }
    .nav-toggle-checkbox:checked ~ .main-nav { transform: translateX(0); }
    .nav-toggle-checkbox:checked ~ .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 40;
    }
    .has-dropdown { width: 100%; padding-bottom: 0; margin-bottom: 0; }
    .dropdown-menu {
        position: static;
        display: flex;
        margin-top: 8px;
        border: none;
        box-shadow: none;
        padding-left: 16px;
        min-width: auto;
    }
    .hero-carousel { height: 460px; }
    .hero-slide-bg-sharp { background-size: auto 100% !important; }
    .hero-slide-content { max-width: 100%; }
    .hero-slide-content h1 { font-size: 2.4rem; }
    .service-grid, .company-grid, .news-list, .noticias-columns, .noticias-col-list, .especialidades-grid, .social-grid { grid-template-columns: 1fr; }
    .companias-grid { grid-template-columns: repeat(5, 1fr); }
    .compania-box { padding: 10px; }
    .compania-box-numero { font-size: 2rem; }
    .news-item-large { min-height: 240px; }
    .social-card { padding: 40px 24px; }
    .martir-card { grid-template-columns: 1fr; }
    .grid-news { grid-template-columns: 1fr; }
    .noticias-filtros { flex-wrap: wrap; }
    /* !important: la regla base .noticia-layout está más abajo en este
       archivo, así que por orden de cascada le ganaría a esta si no. */
    .noticia-layout { grid-template-columns: 1fr !important; }
    .noticia-main { order: 1 !important; }
    .noticia-sidebar { order: 2 !important; }
    .martir-photo, .martir-photo-placeholder { min-height: 220px; }
    .martir-info { padding: 24px; }
    .oficiales-grid, .vehiculos-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .companias-fb-grid { grid-template-columns: 1fr; }
    .compania-profile-cover { height: 160px; }
    .compania-profile-avatar { width: 76px; height: 76px; left: 18px; top: -38px; font-size: 1.6rem; }
    .compania-profile-header { padding: 8px 18px 18px 110px; min-height: 40px; }
    .compania-info-grid { grid-template-columns: 1fr; }
    .memoria-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .memoria-anio { font-size: 1.5rem; }
    .pdf-viewer-wrapper { height: 65vh; }
    .cobertura-map { height: 320px; }
}

/* Noticias: listado, detalle, filtros */
.page-section { padding: 48px 0 72px; }
.page-section > h2 { font-size: 2rem; margin-bottom: 24px; color: var(--color-navy); }

.noticias-search { display: flex; gap: 10px; margin-bottom: 20px; max-width: 480px; }
.noticias-search input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-panel);
}

.documentos-controles { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.documentos-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.documentos-control select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.noticias-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filtro-tab {
    --tab-color: var(--color-red);
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filtro-tab:hover { border-color: var(--tab-color); color: var(--tab-color); }
.filtro-tab.active { background: var(--tab-color); border-color: var(--tab-color); color: var(--color-white); }

.noticias-resultados { color: var(--text-muted); margin-bottom: 16px; }

.grid-news {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.news-card {
    background: var(--bg-panel);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}
.news-card:hover { transform: translateY(-4px); }
.news-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.news-card .card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card .tag {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 999px;
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.news-card h3 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.news-card h3 a { text-decoration: none; color: var(--color-navy); }
.news-card h3 a:hover { color: var(--color-red); }
.news-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.news-card small { color: var(--text-muted); margin-top: auto; }

.paginacion { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 40px; }
.paginacion a {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--color-navy);
    font-weight: 600;
}
.paginacion a:hover { background: var(--color-navy-soft); }
.paginacion-actual { color: var(--text-muted); }

/* Detalle de noticia */
.breadcrumb { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-red); }

.noticia-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 40px;
    align-items: start;
}
.noticia-main .tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--color-red);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.noticia-main h1 { font-size: 2.1rem; line-height: 1.25; color: var(--color-navy); margin: 0 0 12px; }
.noticia-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.noticia-imagen { width: 100%; border-radius: 16px; margin-bottom: 24px; aspect-ratio: 16/9; object-fit: cover; }
.content-text { line-height: 1.6; font-size: 1.05rem; color: var(--text-primary); text-align: justify; text-justify: inter-word; }
.content-text p { hyphens: none; }
.content-text img { border-radius: 12px; margin: 20px 0; }
.content-text a { color: var(--color-red); }

/* Documentos: listado y lector */
.documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.document-card {
    background: var(--bg-panel);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.document-thumb { display: block; }
.document-thumb img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top; }
.document-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.document-body .tag {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--color-navy);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.document-body h3 { margin: 0; font-size: 1.1rem; color: var(--color-navy); }
.document-tema { margin: 0; font-weight: 600; color: var(--color-red); }
.document-meta { margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.document-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }

.documento-lector { max-width: 820px; }
.documento-prevnext {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 4px;
    margin-bottom: 14px;
}
.documento-prevnext.documento-prevnext-abajo { margin: 28px 0 0; border-top: 1px solid var(--border); padding-top: 20px; }
.documento-prevnext-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--color-navy);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.documento-prevnext-link:hover { border-color: var(--color-red); color: var(--color-red); }
.documento-prevnext-disabled { opacity: 0.35; pointer-events: none; }
.documento-prevnext-contador { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.documento-lector-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.documento-lector-header h1 { font-size: 1.9rem; color: var(--color-navy); margin: 8px 0 6px; }
.documento-tema { font-weight: 600; color: var(--color-red); margin: 0 0 6px; }
.documento-meta { color: var(--text-muted); margin: 0; }
.documento-paginas { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.documento-pagina img { width: 100%; border-radius: 8px; box-shadow: var(--shadow); }

/* Botón discreto de descarga del PDF original (icono + texto chico) */
.document-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.document-pdf-link:hover { color: var(--color-red); border-color: var(--color-red); }
.document-actions .document-pdf-link { align-self: flex-start; }

/* Lector modo revista */
.documento-revista-nav { display: none; }
.documento-revista.modo-revista .documento-revista-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 24px;
}
.documento-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--color-navy);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.documento-nav-btn:hover:not(:disabled) { background: var(--color-navy); color: var(--color-white); }
.documento-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.documento-contador { font-weight: 700; color: var(--color-navy); min-width: 70px; text-align: center; }

.documento-revista.modo-revista .documento-paginas {
    position: relative;
    margin-top: 0;
}
.documento-revista.modo-revista .documento-pagina {
    display: none;
}
.documento-revista.modo-revista .documento-pagina.activa {
    display: block;
    animation: documentoPaginaEntrada 0.28s ease;
}
@keyframes documentoPaginaEntrada {
    from { opacity: 0; transform: scale(0.98) translateY(6px); }
    to { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
    .documento-revista-nav { gap: 10px; }
    .documento-nav-btn { width: 38px; height: 38px; font-size: 1.2rem; }
}

/* Widget de accesibilidad */
.a11y-widget {
    position: fixed;
    right: 18px;
    right: max(18px, env(safe-area-inset-right));
    bottom: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 999;
}
.a11y-toggle {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: var(--color-navy);
    color: var(--color-white);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.a11y-toggle:hover { background: var(--color-red); }
.a11y-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 280px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    padding: 18px;
}
.a11y-panel h2 { margin: 0 0 12px; font-size: 1.1rem; color: var(--color-navy); }
.a11y-panel fieldset { border: none; padding: 0; margin: 0 0 16px; }
.a11y-panel legend { font-weight: 700; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 0 0 8px; }
.a11y-btn-row { display: flex; gap: 8px; }
.a11y-btn-row.a11y-btn-col { flex-direction: column; }
.a11y-panel button:not(.a11y-toggle) {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}
.a11y-panel button:hover:not(:disabled) { border-color: var(--color-red); color: var(--color-red); }
.a11y-panel button[aria-pressed="true"] { background: var(--color-red); border-color: var(--color-red); color: var(--color-white); }
.a11y-panel button:disabled { opacity: 0.5; cursor: not-allowed; }
.a11y-reset-all { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-weight: 600; }
.a11y-reset-all:hover { color: var(--color-red); border-color: var(--color-red); }

@media (max-width: 480px) {
    .a11y-panel { width: calc(100vw - 36px); right: -18px; }
}

.noticia-compartir { display: flex; align-items: center; gap: 12px; margin: 32px 0; padding-top: 24px; border-top: 1px solid var(--border); }
.noticia-compartir span { color: var(--text-muted); font-weight: 600; }
.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-navy-soft);
    color: var(--color-navy);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.share-link:hover { background: var(--color-red); color: var(--color-white); transform: translateY(-2px); }

.noticia-compartir-flotante {
    position: sticky;
    top: 100px;
    z-index: 5;
    display: inline-flex;
    width: fit-content;
    margin: 0 0 24px;
    padding: 10px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow);
}
.noticia-compartir-label {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 4px;
}
.noticia-compartir-flotante .share-link { width: 32px; height: 32px; font-size: 0.78rem; }

.galeria-carrusel {
    position: relative;
    margin: 32px 0;
    padding: 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.galeria-carrusel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.galeria-carrusel-track::-webkit-scrollbar { display: none; }
.galeria-carrusel-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}
.galeria-carrusel-slide img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 14px;
    background: var(--color-navy-soft);
    display: block;
}
.galeria-carrusel-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(33,31,28,0.6);
    color: var(--color-white);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.galeria-carrusel-flecha:hover { background: var(--color-red); }
.galeria-carrusel-prev { left: 12px; }
.galeria-carrusel-next { right: 12px; }
.galeria-carrusel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.galeria-carrusel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--color-navy);
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease;
}
.galeria-carrusel-dot.active { background: var(--color-navy); }

.noticia-sidebar h3 { font-size: 1.25rem; color: var(--color-navy); margin-bottom: 18px; }
.related-list { display: flex; flex-direction: column; gap: 20px; }
.related-item { display: flex; gap: 16px; text-decoration: none; color: inherit; }
.related-item img { width: 140px; height: 108px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.related-item strong { display: block; font-size: 1.15rem; line-height: 1.4; color: var(--color-navy); }
.related-item:hover strong { color: var(--color-red); }
.related-item small { font-size: 0.95rem; color: var(--text-muted); }

.banner-interno-wrap {
    position: relative;
    margin: 28px auto;
    max-width: 970px;
    text-align: center;
}
.banner-interno-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.banner-interno { display: block; line-height: 0; }
.banner-interno img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0 auto;
}
