/**
 * ==============================================================================
 * HCD SANTA ROSA - ESTILOS DEL PORTAL PÚBLICO
 * Los tokens y componentes viven en design-system.css (se enlaza antes en el
 * <head>; ya no se usa @import para evitar la cascada de peticiones).
 * ==============================================================================
 */

:root {
    /* Alias heredados: apuntan a los tokens únicos --ds-* */
    --hcd-primary: var(--ds-color-navy-900);
    --hcd-primary-dark: var(--ds-color-navy-950);
    --hcd-primary-light: var(--ds-color-navy-700);
    --hcd-gold: var(--ds-color-gold-500);
    --hcd-gold-light: var(--ds-color-gold-100);
    --hcd-dark: var(--ds-gray-900);
    --hcd-muted: var(--ds-gray-600);
    --hcd-light: var(--ds-gray-50);
    --hcd-border: var(--ds-gray-200);
    --hcd-white: var(--ds-white);
}

html {
    scroll-padding-top: 5rem;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #F6F8FC;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Enlace de salto de accesibilidad */
.skip-link {
    position: absolute;
    top: -48px;
    left: 0;
    background: var(--ds-color-navy-900);
    color: var(--ds-white);
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* Barra superior institucional */
.top-bar-civic {
    background-color: var(--ds-color-navy-950);
    color: #E2E8F0;
    font-size: var(--ds-text-sm);
    padding: 6px 0;
    border-bottom: 2px solid var(--ds-color-gold-500);
}
.top-bar-civic a { color: #E2E8F0; text-decoration: none; }
.top-bar-civic a:hover, .top-bar-civic a:focus { color: var(--ds-color-gold-100); }

/* Encabezado y navegación principal */
.header-institutional {
    background-color: var(--ds-white);
    border-bottom: 1px solid var(--ds-gray-200);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--ds-shadow-sm);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ds-color-navy-900);
}

@media (min-width: 1200px) {
    .header-institutional .brand-container {
        margin-left: clamp(1rem, 2.5vw, 3rem);
    }
}

@media (max-width: 1199.98px) {
    .header-institutional > .container-fluid {
        position: relative;
    }

    .header-institutional .brand-container {
        position: absolute;
        left: 50%;
        margin: 0;
        transform: translateX(-50%);
    }

    .header-institutional .navbar-toggler {
        position: relative;
        z-index: 1;
        margin-left: auto;
    }
}

.brand-logo-img {
    height: 48px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
}

.brand-emblem {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--ds-color-navy-900);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-color-gold-500);
    font-size: 1.4rem;
}

.brand-titles {
    border-left: 2px solid #E2E8F0;
    padding-left: 14px;
}
.brand-titles .brand-super {
    font-size: var(--ds-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ds-gray-600);
    font-weight: 600;
    margin: 0;
}
.brand-titles .brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ds-color-navy-900);
    margin: 0;
    line-height: 1.2;
}

.navbar-nav .nav-link {
    color: var(--ds-gray-900);
    font-weight: 600;
    font-size: var(--ds-text-base);
    padding: 0.75rem 0.75rem;
    border-radius: var(--ds-radius-md);
    white-space: nowrap;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link:focus {
    color: var(--ds-color-navy-900);
    background-color: var(--ds-color-navy-50);
}
.navbar-nav .nav-link.active {
    color: var(--ds-color-navy-900);
    box-shadow: inset 0 -2px 0 var(--ds-color-navy-900);
}

/* Botón Municipalidad en Navbar (sin azul, diseño institucional cálido con escudo oficial) */
.btn-muni {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.95rem;
    background-color: #EEF3FB;
    color: #173B68 !important;
    border: 1px solid #C6D5EA;
    border-radius: 999px;
    font-size: var(--ds-text-sm);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(17, 54, 105, 0.08);
    white-space: nowrap;
}

.btn-muni:hover, .btn-muni:focus-visible {
    background-color: #03258C;
    color: #FFFFFF !important;
    border-color: #03258C;
    box-shadow: 0 4px 14px rgba(3, 37, 140, 0.22);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-muni-crest-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #C6D5EA;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 1.5px;
    transition: transform 0.2s ease;
}

.btn-muni:hover .btn-muni-crest-badge {
    transform: scale(1.08);
    border-color: #FFFFFF;
}

.btn-muni-crest-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.btn-muni-text {
    font-weight: 700;
    line-height: 1;
}

.btn-muni-ext {
    font-size: 0.72rem;
    opacity: 0.75;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-muni:hover .btn-muni-ext {
    opacity: 1;
    transform: translate(1px, -1px);
}

/* Buscador Integrado en Barra de Navegación */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-wrap {
    display: inline-flex;
    align-items: center;
    background-color: #F1F5F9;
    border: 1.5px solid #CBD5E1;
    border-radius: 999px;
    padding: 2px 10px 2px 4px;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    flex-shrink: 0;
}

.nav-search-wrap:hover {
    background-color: #FFFFFF;
    border-color: #94A3B8;
}

.nav-search-wrap:focus-within {
    background-color: #FFFFFF;
    border-color: #03258C;
    box-shadow: 0 0 0 3px rgba(3, 37, 140, 0.14), 0 2px 8px rgba(3, 37, 140, 0.08);
}

.nav-search-btn {
    border: none;
    background: #03258C;
    color: #FFFFFF;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    margin-right: 6px;
    font-size: 0.75rem;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 5px rgba(3, 37, 140, 0.25);
}

.nav-search-btn:hover {
    background: #0A1E5C;
    transform: scale(1.08);
    box-shadow: 0 3px 8px rgba(3, 37, 140, 0.35);
}

.nav-search-btn:active {
    transform: scale(0.95);
}

.nav-search-btn:focus-visible {
    outline: 2px solid #03258C;
    outline-offset: 2px;
}

.nav-search-input {
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #0F172A;
    width: 135px;
    padding: 3px 0;
    outline: none;
    flex-shrink: 0;
}

.nav-search-input::placeholder {
    color: #64748B;
    font-size: 0.78rem;
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar-nav { gap: 0.15rem !important; }
    .navbar-nav .nav-link { padding-inline: 0.45rem !important; font-size: 0.85rem; }
    .btn-muni { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
    .brand-logo-img { height: 40px; }
    .nav-search-input { width: 115px; font-size: 0.78rem; }
}

@media (min-width: 1400px) {
    .nav-search-input { width: 155px; }
}

@media (max-width: 1199.98px) {
    .nav-search-item {
        margin-top: 0.75rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    .nav-search {
        width: 100%;
    }
    .nav-search-wrap {
        width: 100%;
        display: flex;
        padding-right: 12px;
    }
    .nav-search-input {
        width: 100%;
        flex-grow: 1;
    }
}

/* Hero (inicio) */
.hero-civic {
    background: var(--ds-color-navy-900);
    color: var(--ds-white);
    padding: 60px 0;
    border-bottom: 4px solid var(--ds-color-gold-500);
}
.hero-title { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.15rem; color: var(--ds-gray-300); max-width: 700px; }

/* Pie de página institucional */
/* Pie de página institucional */
.footer-institutional {
    background-color: var(--muni-night, #0E2338);
    color: #CBD5E1;
    margin-top: auto;
    border-top: 4px solid var(--muni-blue, #1E5AA8);
    padding: 48px 0 28px 0;
}
.footer-institutional h2, .footer-institutional h5 {
    color: #A9CCF0;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.footer-institutional a { color: #E2E8F0; text-decoration: none; transition: color 0.15s, transform 0.15s; }
.footer-institutional a:hover, .footer-institutional a:focus { color: #FFFFFF; text-decoration: underline; }
.footer-identity { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.footer-logo-wrap {
    background: #FFFFFF;
    padding: 6px 14px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.footer-logo-img { height: 44px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.footer-emblem {
    display: flex; align-items: center; justify-content: center;
    width: 50px; height: 50px;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    flex: none; overflow: hidden; padding: 4px;
}
.footer-emblem i { font-size: 1.75rem; color: #1E40AF; }
.footer-identity strong { color: #FFFFFF; font-size: 1.15rem; font-weight: 800; line-height: 1.3; display: block; }
.footer-identity span { color: #94A3B8; font-size: 0.92rem; display: block; margin-top: 2px; }
.footer-detail { color: #CBD5E1; font-size: 0.95rem; line-height: 1.6; margin-top: 10px; }
.footer-detail i { margin-right: 5px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.95rem; line-height: 1.6; display: inline-block; }
.footer-contact-link { font-size: 0.95rem; color: #E2E8F0; display: inline-block; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 36px;
    padding-top: 20px;
    font-size: 0.92rem;
    color: #94A3B8;
}
.footer-utility { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.footer-utility a { font-size: 0.92rem; color: #CBD5E1; }
.footer-utility a:hover { color: #FFFFFF; }
@media (max-width: 575.98px) { .footer-divider { display: none; } .footer-utility { gap: 12px; } }

/* ==============================================================================
   OPTIMIZACIONES DE EXPERIENCIA MÓVIL Y RESPONSIVIDAD (WCAG 2.2 AA)
   ============================================================================== */

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar-nav .nav-link i { display: none; }
}

@media (max-width: 1199.98px) {
    .header-institutional .navbar-collapse {
        background: #FFFFFF;
        border-radius: 12px;
        margin-top: 12px;
        padding: 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
        border: 1px solid #E2E8F0;
    }
    .header-institutional .navbar-nav .nav-link {
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 0.95rem;
    }
    .header-institutional .dropdown-menu {
        border: 1px solid #E2E8F0;
        box-shadow: none;
        background: #F6F8FC;
        border-radius: 8px;
        padding: 8px;
        margin-top: 4px;
        margin-bottom: 8px;
    }
    .header-institutional .dropdown-item {
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 0.9rem;
    }
}

@media (max-width: 991.98px) {
    .hero-title { font-size: 1.85rem; }
    .hero-lead { font-size: 0.98rem; }
    .hero-aside { margin-top: 20px; }
    .main-footer {
        padding: 30px 0 18px 0 !important;
        margin-top: 36px !important;
    }
}

@media (max-width: 767.98px) {
    .header-institutional .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .brand-container {
        gap: 8px;
        max-width: calc(100% - 56px);
    }
    .brand-logo-img {
        height: 38px;
        max-width: 140px;
    }
    .brand-titles {
        padding-left: 8px;
        border-left: 1.5px solid #E2E8F0;
    }
    .brand-titles .brand-super {
        font-size: 0.65rem;
        letter-spacing: 0.02em;
    }
    .brand-titles .brand-name {
        font-size: 0.95rem;
    }
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 6px 10px;
        font-size: 1rem;
        border: 1px solid #CBD5E1;
        border-radius: 8px;
        background: #F6F8FC;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
}

@media (max-width: 575.98px) {
    .brand-titles .brand-super {
        display: none;
    }
    .brand-titles {
        border-left: none;
        padding-left: 2px;
    }
    .brand-titles .brand-name {
        font-size: 0.9rem;
    }
    .top-bar-civic .ds-badge {
        display: none;
    }
    .footer-divider {
        display: none;
    }
    .footer-utility {
        gap: 12px;
    }
    .ds-card {
        padding: 14px !important;
    }
    .page-header-civic h1 {
        font-size: 1.35rem;
    }
}

/* Elevación interactiva estándar para tarjetas del portal */
.hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(15, 32, 56, 0.09) !important;
}

