/* =========================
   VARIABLES GOB.CL
========================= */
:root {
    --gob-primary: #D92E5E;
    --gob-secondary: #F06A8F;
    --gob-tertiary: #0A132D;
    --gob-accent: #E6B3C1;
    --gob-neutral: #F7F7F7;
    --gob-gray-a: #4A4A4A;
    --gob-black: #111111;
    --gob-white: #FFFFFF;
}

/* =========================
   BASE
========================= */
body {
    margin: 0;
    font-family: 'Roboto', Arial, sans-serif;
    background: var(--gob-white);
    color: var(--gob-black);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto Slab', Georgia, serif;
    font-weight: 400;
    color: var(--gob-black);
}

p {
    color: var(--gob-gray-a);
    line-height: 1.5;
}

a {
    color: inherit;
}

.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
}

/* =========================
   NAVBAR
========================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--gob-white);
    border-bottom: 1px solid var(--gob-accent);
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-img {
    height: 50px;
    width: auto;
    display: block;
}

.menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

    .menu a {
        color: var(--gob-black);
        text-decoration: none;
        font-weight: 700;
    }

        .menu a:hover {
            color: var(--gob-primary);
            text-decoration: underline;
        }

.login-icon {
    width: 42px;
    height: 42px;
    background: transparent;
    color: var(--gob-primary) !important;
    border: 2px solid var(--gob-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    text-decoration: none !important;
    position: relative;
}

    .login-icon::before {
        content: "👤";
        font-size: 20px;
    }

    .login-icon:hover {
        background: #00598f;
        color: var(--gob-white) !important;
    }

/* =========================
   BOTONES
========================= */
.btn {
    display: inline-block;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
}

.btn-primary {
    background: var(--gob-primary);
    color: var(--gob-white) !important;
}

    .btn-primary:hover {
        background: #00598f;
        text-decoration: none;
    }

.btn-outline {
    background: var(--gob-white);
    color: var(--gob-primary) !important;
    border-color: var(--gob-primary);
}

/* =========================
   CARRUSEL PRINCIPAL
========================= */
.hero-carousel {
    position: relative;
    width: calc(100% - 120px);
    max-width: 1500px;
    height: 560px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--gob-tertiary);
    border-bottom: 1px solid var(--gob-accent);
    border-left: 1px solid var(--gob-accent);
    border-right: 1px solid var(--gob-accent);
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .8s ease-in-out;
}

    .carousel-slide.active {
        opacity: 1;
        z-index: 1;
    }

    .carousel-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .carousel-slide::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( 90deg, rgba(10,19,45,.88) 0%, rgba(10,19,45,.60) 45%, rgba(10,19,45,.18) 100% );
    }

.carousel-content {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 9%;
    transform: translateY(-50%);
    max-width: 620px;
    color: var(--gob-white);
}

    .carousel-content .tag {
        display: inline-block;
        margin-bottom: 18px;
        padding: 8px 12px;
        background: var(--gob-primary);
        color: var(--gob-white);
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .carousel-content h1 {
        margin: 0 0 18px;
        color: var(--gob-white);
        font-size: 58px;
        line-height: 1.1;
        text-shadow: 0 4px 18px rgba(0,0,0,.35);
    }

    .carousel-content p {
        margin-bottom: 30px;
        color: rgba(255,255,255,.92);
        font-size: 19px;
        line-height: 1.6;
    }

.carousel-btn {
    position: absolute;
    z-index: 10;
    top: 50%;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255,255,255,.88);
    color: var(--gob-tertiary);
    font-size: 24px;
    cursor: pointer;
    transform: translateY(-50%);
}

    .carousel-btn:hover {
        background: var(--gob-white);
    }

    .carousel-btn.prev {
        left: 18px;
    }

    .carousel-btn.next {
        right: 18px;
    }

.carousel-dots {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 28px;
    display: flex;
    gap: 10px;
    transform: translateX(-50%);
}

.dot {
    width: 13px;
    height: 13px;
    border: 2px solid var(--gob-white);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

    .dot.active {
        background: var(--gob-white);
    }

/* =========================
   ACCESOS RÁPIDOS
========================= */
.quick-links {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 35px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    background: var(--gob-white);
    border: 1px solid var(--gob-accent);
    border-left: 6px solid var(--gob-primary);
    color: var(--gob-black);
    text-decoration: none;
}

    .quick-card:hover {
        background: var(--gob-neutral);
    }

    .quick-card h3 {
        margin: 0 0 6px;
        color: var(--gob-black);
        font-size: 1.25rem;
    }

    .quick-card p {
        margin: 0;
    }

.quick-icon {
    font-size: 30px;
}

.quick-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

/* =========================
   SECCIONES
========================= */
.section {
    margin-top: 55px;
    margin-bottom: 55px;
}

.section-header h2 {
    position: relative;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gob-accent);
    font-size: 1.6875rem;
}

    .section-header h2::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 80px;
        height: 3px;
        background: var(--gob-primary);
    }

/* =========================
   NOTICIAS Y SERVICIOS
========================= */
.news-grid,
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.news-card,
.service-card {
    overflow: hidden;
    background: var(--gob-white);
    border: 1px solid var(--gob-accent);
}

.news-image {
    position: relative;
    height: 190px;
    overflow: hidden;
    background: var(--gob-neutral);
}

    .news-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    padding: 5px 8px;
    background: var(--gob-primary);
    color: var(--gob-white);
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-secondary {
    background: var(--gob-secondary);
}

.badge-tertiary {
    background: var(--gob-tertiary);
}

.news-body {
    padding: 22px;
}

    .news-body small {
        color: var(--gob-gray-a);
        font-size: .75rem;
    }

    .news-body h3 {
        margin: 12px 0;
        font-size: 1.25rem;
        color: var(--gob-black);
    }

    .news-body p {
        margin-bottom: 18px;
    }

.read-more {
    color: var(--gob-black);
    font-weight: 700;
    text-decoration: underline;
}

    .read-more:hover {
        color: var(--gob-primary);
    }

.service-card {
    padding: 25px;
    border-top: 5px solid var(--gob-primary);
}

    .service-card h3 {
        margin-top: 0;
        color: var(--gob-black);
        font-size: 1.25rem;
    }

/* =========================
   CONTACTO Y MAPA
========================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    padding: 35px;
    background: var(--gob-white);
    border: 1px solid var(--gob-accent);
}

.map-box {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--gob-neutral);
    border: 1px solid var(--gob-accent);
}

    .map-box iframe {
        width: 100%;
        height: 100%;
        border: 0;
    }

/* =========================
   FOOTER
========================= */
.footer {
    padding: 35px 0;
    background: var(--gob-neutral);
    border-top: 4px solid var(--gob-primary);
    color: var(--gob-black);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.footer h3,
.footer p {
    margin: 5px 0;
}

/* =========================
   REDES SOCIALES FOOTER
========================= */
.footer-social {
    display: flex;
    gap: 14px;
    align-items: center;
}

.footer-social-btn {
    width: 60px;
    height: 60px;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: var(--gob-white);
    text-decoration: none;
    font-weight: 700;
    transition: width .3s ease, box-shadow .2s ease;
}

    .footer-social-btn span:first-child {
        width: 60px;
        min-width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        line-height: 1;
    }

    .footer-social-btn span:last-child {
        opacity: 0;
        white-space: nowrap;
        padding-right: 16px;
        transition: opacity .2s ease;
    }

    .footer-social-btn:hover {
        width: 185px;
        box-shadow: 0 6px 14px rgba(0,0,0,.18);
    }

        .footer-social-btn:hover span:last-child {
            opacity: 1;
        }

    .footer-social-btn.instagram {
        background: linear-gradient(135deg, #405DE6, #833AB4, #E1306C, #FCAF45);
    }

    .footer-social-btn.facebook {
        background: #1877F2;
    }

    .footer-social-btn.youtube {
        background: #FF0000;
    }

    .footer-social-btn.whatsapp {
        background: #25D366;
    }

        .footer-social-btn.whatsapp:hover {
            background: #1ebe5d;
        }

    .footer-social-btn.facebook span:first-child {
        font-size: 36px;
        font-family: Arial, sans-serif;
    }

/* =========================
   LAYOUT NOTICIAS + ACCESOS
========================= */
.home-layout {
    display: grid;
    grid-template-columns: 2fr .85fr;
    gap: 28px;
    align-items: start;
}

.main-news .news-grid {
    grid-template-columns: repeat(2, 1fr);
}

.side-access {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 55px;
}

.side-card {
    position: relative;
    min-height: 92px;
    padding: 18px 20px;
    overflow: hidden;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #0A132D, #006FB3);
    background-size: cover;
    background-position: center;
    border-left: 6px solid var(--gob-secondary);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .side-card::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, rgba(10,19,45,.9), rgba(0,111,179,.55));
        z-index: 0;
    }

    .side-card span,
    .side-card strong {
        position: relative;
        z-index: 1;
        color: white;
        text-transform: uppercase;
    }

    .side-card span {
        font-size: 14px;
        font-weight: 400;
    }

    .side-card strong {
        font-size: 24px;
        line-height: 1;
    }

    .side-card:hover {
        transform: translateX(4px);
    }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
    .hero-carousel {
        width: 100%;
        height: 500px;
        border-left: none;
        border-right: none;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .map-box {
        height: 320px;
    }

    .home-layout {
        grid-template-columns: 1fr;
    }

    .main-news .news-grid {
        grid-template-columns: 1fr;
    }

    .side-access {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .nav-container,
    .menu,
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .menu {
        margin-top: 15px;
        gap: 12px;
    }

    .hero-carousel {
        width: 100%;
        height: 430px;
    }

    .carousel-content {
        left: 7%;
        right: 7%;
        max-width: none;
    }

        .carousel-content h1 {
            font-size: 38px;
        }

        .carousel-content p {
            font-size: 16px;
        }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .quick-links {
        grid-template-columns: 1fr;
        margin-top: 25px;
    }

    .news-grid,
    .service-grid {
        grid-template-columns: 1fr;
    }

    .footer-social {
        flex-wrap: wrap;
        margin: 15px 0;
    }

    .footer-social-btn,
    .footer-social-btn:hover {
        width: 180px;
    }

        .footer-social-btn span:last-child {
            opacity: 1;
        }
}
.noticia-detalle {
    max-width: 850px;
    margin: 0 auto;
}

    .noticia-detalle h1 {
        margin-top: 20px;
        color: var(--gob-tertiary);
        font-size: 42px;
    }

    .noticia-detalle img {
        width: 100%;
        max-height: 420px;
        object-fit: cover;
        margin: 25px 0;
        border: 1px solid var(--gob-accent);
    }

.noticia-resumen {
    font-size: 20px;
    color: var(--gob-black);
    font-weight: 700;
}

.noticia-contenido {
    font-size: 17px;
    line-height: 1.8;
    color: var(--gob-gray-a);
    margin-bottom: 30px;
}
.side-card.only-image {
    padding: 0;
    min-height: 125px;
    border-left: 6px solid var(--gob-primary);
    background-size: cover;
    background-position: center;
}

    .side-card.only-image::after {
        display: none;
    }


.qs-value img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 15px;
}

.side-card.only-image {
    padding: 0;
    min-height: auto;
    background: transparent;
    border-left: 6px solid var(--gob-primary);
    overflow: hidden;
}

    .side-card.only-image::after {
        display: none;
    }

    .side-card.only-image img {
        width: 100%;
        height: auto;
        display: block;
    }

.service-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
    margin: -25px -25px 18px -25px;
    max-width: calc(100% + 50px);
}