/* ================================================================== */
/* MINSALUD - ESTILOS PRINCIPALES                                    */
/* ================================================================== */

/* ------------------------------------------------------------------
   1. VARIABLES GLOBALES (Custom Properties CSS)
   - Ventaja: Permiten cambiar colores fácilmente desde un solo lugar
   - También soportan el modo oscuro sobrescribiendo las variables
   - Sintaxis: var(--nombre-variable)
------------------------------------------------------------------ */

:root {
    --primary-blue: #012e8b;      /* Color institucional principal (azul MINSALUD) */
    --accent-yellow: #febf00;     /* Color de acento amarillo (para detalles) */
    --accent-red: #ec3746;        /* Color de acento rojo (para badges y alertas) */
    --white: #ffffff;              /* Fondo blanco / texto en modo claro */
    --light-gray: #f4f4f4;        /* Gris claro para fondos secundarios */
    --text-dark: #333333;         /* Color de texto principal en modo claro */
    --bg-card: #ffffff;            /* Fondo de tarjetas (noticias, servicios) */
}

/* ------------------------------------------------------------------
   2. CONFIGURACIÓN GLOBAL Y RESET
   - Reset: elimina márgenes y paddings por defecto de los navegadores
   - box-sizing: border-box hace que padding y border no aumenten el ancho
   - scroll-behavior: smooth hace que los enlaces internos se desplacen suavemente
------------------------------------------------------------------ */

/* Scroll suave para toda la página */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;     /* Compensa la altura del navbar fijo */
}

/* Reset universal - se aplica a TODOS los elementos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Georama', sans-serif;  /* Fuente principal, fallback a sans-serif */
}

/* Carga de la fuente Georama desde archivos locales .ttf */
/* @font-face permite usar fuentes personalizadas sin conexión a internet */
@font-face {
    font-family: 'Georama';
    src: url('fonts/georama/Georama-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;  /* Muestra texto con fallback mientras carga la fuente */
}

@font-face {
    font-family: 'Georama';
    src: url('fonts/georama/Georama-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Georama';
    src: url('fonts/georama/Georama-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Georama';
    src: url('fonts/georama/Georama-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Georama';
    src: url('fonts/georama/Georama-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Estilos base del body */
html, body {
    overflow-x: hidden;      /* Elimina scroll horizontal no deseado */
    width: 100%;
}

body {
    padding-top: 0;
    margin: 0;
}

/* Logo - mantiene proporción con height fijo y width automático */
.logo img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

#mainLogo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Iconos de redes sociales - efecto hover y modo oscuro */
.social-icons a {
    text-decoration: none;  /* Elimina el subrayado de los enlaces */
}

.social-icons img {
    width: 20px;
    margin-left: 15px;
    /* Filtro CSS para convertir el icono a azul institucional */
    filter: brightness(0) saturate(100%) invert(13%) sepia(85%) saturate(2855%) hue-rotate(218deg) brightness(91%) contrast(101%);
    transition: filter 0.3s ease;
}

.social-icons a img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}


.search-container {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    width: 0;
    padding: 0;
    border: none;
    outline: none;
    border-radius: 50px;
    transition: all 0.4s ease;
    opacity: 0;
    visibility: hidden;
}

.search-input.active {
    width: 200px;
    padding: 5px 15px;
    opacity: 1;
    visibility: visible;
    margin-right: 10px;
    background: white;
    color: #333;
}


/* Efecto zoom en imágenes al hacer hover */
.zoom-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;   /* La imagen cubre todo el espacio sin deformarse */
    object-position: center center !important;
    display: block !important;
    max-width: none !important;
    transition: transform 5s linear;  /* Transición lenta para zoom gradual */
}


/* ============================================ */
/* FOOTER PRINCIPAL                             */
/* ============================================ */

.main-footer {
    background: var(--primary-blue);
    color: white;
    padding: 30px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    padding-bottom: 10px;
    margin-bottom: 0;
    border-bottom: none;
}

.footer-contact {
    justify-self: end;
    text-align: left;
}

.footer-contact h3 {
    color: var(--accent-yellow);
    margin-bottom: 20px;
}

.footer-contact ul {
    list-style: none;
}

.footer-contact li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.footer-contact img {
    width: 18px;
    filter: brightness(0) saturate(100%) invert(84%) sepia(34%) saturate(6689%) hue-rotate(358deg) brightness(108%) contrast(106%);
}

.footer-info {
    display: flex;
    flex-direction: column;
    max-width: 320px;
}

.footer-info img {
    height: auto;
    width: 100%;
    max-width: 280px;
    margin-bottom: 20px;
    display: block;
    object-fit: contain;
}

.footer-info p {
    width: 100%;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    margin: 0;
}

/* ============================================ */
/* ENTES ADSCRITOS - LOGOS EN UNA SOLA LÍNEA   */
/* ============================================ */

.entes-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 30px 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ente-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    width: auto;
    flex: 0 0 auto;
}

.ente-link img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.ente-link:hover {
    transform: translateY(-3px);
}

.ente-link:hover img {
    filter: brightness(0) saturate(100%) invert(77%) sepia(79%) saturate(1235%) hue-rotate(359deg) brightness(103%) contrast(104%);
    transform: scale(1.1);
}

/* Tooltip */
.ente-link::after {
    content: attr(data-nombre);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 10px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.ente-link::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.ente-link:hover::after,
.ente-link:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* ============================================ */
/* COPYRIGHT                                    */
/* ============================================ */

.copyright {
    text-align: center;
    padding-top: 20px;
    font-size: 12px;
    font-weight: 400;
    border-top: none;
}

.copyright strong,
.copyright a {
    color: var(--accent-yellow);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.copyright a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ------------------------------------------------------------------
   19. RESPONSIVE - UNIFICADO (Tablets y Móviles)
   - Media queries para pantallas de hasta 1024px (tablets)
   - Media queries para pantallas de hasta 768px (móviles)
   - Media queries para pantallas de hasta 480px (móviles pequeños)
------------------------------------------------------------------ */

/* Tablets */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-contact {
        justify-self: start;
    }

    .news-main-grid {
        flex-direction: column;
    }

    .news-slider-wrapper,
    .news-tabs {
        width: 100%;
        flex: 0 0 100%;
    }

    .news-slider-wrapper .mini-slide {
        height: 400px !important;
    }

    .news-tabs {
        height: auto;
        max-height: 450px;
    }


    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .footer-contact {
        justify-self: center;
        text-align: center;
    }
    
    .footer-contact li {
        justify-content: center;
    }
    
    .footer-info {
        max-width: 100%;
        text-align: center;
        align-items: center;
    }
    
    .footer-info p {
        text-align: center;
        text-align-last: center;
    }
    
    /* Entes adscritos */
    .ente-link img {
        width: 55px;
        height: 55px;
    }
    
    .entes-grid {
        gap: 8px;
    }
    
    /* Tooltip arriba en móviles */
    .ente-link::after {
        bottom: auto;
        top: -40px;
    }
    
    .ente-link::before {
        bottom: auto;
        top: -15px;
        border-bottom: none;
        border-top: 5px solid rgba(0, 0, 0, 0.85);
    }
}