/* ============================================= */
/* ===== 1. ESTILOS GLOBALES Y RESET ========== */
/* ============================================= */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f2f5; 
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================= */
/* ===== 2. ENCABEZADO (HEADER) ============== */
/* ============================================= */

/* --- 2.0 Contenedor del Encabezado Fijo --- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- 2.1 Barra Superior del Gobierno --- */
.gov-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
}

.gov-logo-container {
    display: flex;
    align-items: center;
}

.gov-logo-container img {
    height: 40px;
    margin-right: 15px;
}

.gov-logo-text {
    display: flex;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.gov-logo-text .futuro-digital {
    background-color: #0078d4;
    padding: 12px 15px;
}

.gov-logo-text .mintic {
    background-color: #50b0e5;
    padding: 12px 15px;
}

.gov-search-container {
    position: relative;
    width: 250px;
}

.gov-search-container input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.gov-search-container .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    cursor: pointer;
}

/* --- 2.2 Navegación del Gobierno (Dividida) --- */
.gov-nav {
    background-color: #00823B;
    padding: 10px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gov-nav-group {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.gov-nav li {
    border-right: 1px solid #fff;
    position: relative;
}

.gov-nav ul li:last-child {
    border-right: none;
}

.gov-nav li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 13px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- 2.3 Encabezado Principal del Sitio --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #fff;
    gap: 20px;
}

.main-header .logo {
    flex-shrink: 0;
}

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

.site-title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
}

.title-block {
    display: flex;
    flex-direction: column;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.title-block .title-line-1 {
    background-color: #ffc400;
    padding: 5px 20px;
    font-size: 1.1em;
    color: #4d3700;
}

.title-block .title-line-2 {
    background-color: #6d4c41;
    padding: 8px 20px;
    font-size: 1.5em;
    color: white;
}

.slogan {
    margin-top: 5px;
    font-style: italic;
    color: #555;
    font-size: 1em;
    padding-left: 5px;
}

.header-right-content {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-shrink: 0;
}

.date-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
}

.date-info .calendar-icon {
    font-size: 24px;
}

.social-networks {
    background-color: #ffc400;
    padding: 8px 15px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #a67c00;
}

.social-networks h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #4d3700;
    font-weight: bold;
    border-bottom: 1px solid #a67c00;
    padding-bottom: 4px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social-icons a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: #4d3700;
    color: #ffc400;
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.2s;
}

.social-icons a:hover {
    transform: scale(1.1);
}

/* ============================================= */
/* ===== 3. NAVEGACIÓN PRINCIPAL Y DESPLEGABLES ===== */
/* ============================================= */
.main-nav {
    background-color: #00823B;
    width: 100%;
}

.main-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.main-nav > ul > li {
    position: relative;
    border-right: 1px solid #009a44;
}

.main-nav > ul > li:last-child {
    border-right: none;
}

.main-nav > ul > li > a {
    display: block;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    list-style: none;
    padding: 0;
    z-index: 1000;
}

.dropdown-content li {
    border-right: none;
}

.dropdown-content li a {
    padding: 12px 20px;
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: normal;
    text-transform: none;
    transition: background-color 0.2s;
}

.dropdown:hover > .dropdown-content {
    display: block;
}

.dropdown-content li a:hover {
    background-color: #f5f5f5;
}

.dropdown:hover > a {
    background-color: #ffc400;
    color: #333;
}

/* ============================================= */
/* ===== 4. CONTENIDO PRINCIPAL (MAIN) ======= */
/* ============================================= */
.hero-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-wrapper {
    display: flex;
    flex-direction: column; 
    padding: 20px 5%;
    gap: 30px;
}

.top-row {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content {
    flex: 3;
    min-width: 0;
}

.section-title-bar {
    background-color: #00823B;
    color: white;
    padding: 10px 20px;
    margin: -20px -20px 20px -20px; 
    text-align: center;
}

.section-title-bar h2 {
    margin: 0;
    text-transform: uppercase;
    font-size: 1.2em;
}

.normativa {
    background: #fff;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.normativa .cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.normativa .card {
    padding: 10px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.normativa .card img {
    max-width: 80px;
    height: auto;
    margin-bottom: 10px;
    align-self: center;
}

.normativa .card h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 0.9em;
}

.normativa .card p {
    font-size: 0.8em;
    color: #666;
    line-height: 1.5;
    flex-grow: 1;
}

.ampliar-link {
    margin-top: auto;
    padding-top: 10px;
    font-weight: bold;
    color: #00823B;
    font-size: 0.8em;
}

.dual-content-container {
    display: flex;
    gap: 30px;
    width: 100%;
}

.social-section,
.agenda-section {
    flex: 1;
    min-width: 0;
    background: #fff;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.social-media-content {
    display: grid;
    gap: 15px;
    grid-template-areas:
        "main secondary"
        "main facebook";
    grid-template-columns: 2fr 1fr;
}

.social-item {
    position: relative;
    cursor: pointer;
}

.social-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.video-main { grid-area: main; }
.video-secondary { grid-area: secondary; }
.facebook-embed { grid-area: facebook; }

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(128, 0, 128, 0.7);
    color: white;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.social-item:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(128, 0, 128, 0.9);
}

.agenda-content iframe {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
}

/* ============================================= */
/* ===== 5. BARRA LATERAL (SIDEBAR) ========== */
/* ============================================= */
.sidebar {
    flex: 1;
    position: sticky;
    top: 200px; 
}

.sidebar .widget {
    background-color: #e9e9e9;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.sidebar .widget h3 {
    font-size: 1em;
    color: #555;
    text-align: center;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    text-transform: uppercase;
}

/* --- Estilos para los botones de "Enlaces de Interés" --- */
.btn-interes {
    display: block;
    box-sizing: border-box;
    width: 100%;
    background: linear-gradient(to bottom, #009a44, #00823B);
    border: none;
    border-radius: 6px;
    color: white;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 1em;
    text-align: center;
    text-decoration: none;
    padding: 14px 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-interes:last-child {
    margin-bottom: 0;
}

.btn-interes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* --- Estilos para el Cuadro de Honor --- */
.honor-card {
    text-align: center;
}

.honor-title {
    background-color: #00823B;
    color: white;
    padding: 8px;
    margin: 0 -15px 10px -15px;
}

.honor-title h4 {
    margin: 0;
    font-size: 0.9em;
}

.honor-card img {
    max-width: 100%;
    height: auto;
    border: 4px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ============================================= */
/* ===== 6. PIE DE PÁGINA (FOOTER) =========== */
/* ============================================= */
footer {
    background-color: #f5f5f5;
    color: #555;
    padding: 20px 5%;
    font-size: 14px;
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.footer-logos img {
    max-height: 40px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-logos img:hover {
    opacity: 1;
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 30px 0;
}

.footer-col p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.footer-col p strong {
    color: #333;
}

.visitor-counter h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-weight: bold;
}

.visitor-counter table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.visitor-counter th, .visitor-counter td {
    padding: 8px;
    border: 1px solid #ddd;
}

.visitor-counter th {
    background-color: #e9e9e9;
    font-weight: normal;
}

.visitor-counter td {
    background-color: #f9f9f9;
}

.footer-bottom-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 12px;
}

.footer-bottom-links a {
    color: #005A3A;
    margin: 5px 10px;
}

.footer-bottom-links a:hover {
    text-decoration: underline;
}

/* ============================================= */
/* ===== 7. ESTILOS RESPONSIVOS (RESPONSIVE) ==== */
/* ============================================= */
@media (max-width: 992px) {
    header {
        position: static; 
    }
    .sidebar {
        position: static; 
    }

    .top-row, .dual-content-container, .gov-nav, .main-header, .gov-header-top, .main-nav > ul {
        flex-direction: column;
        align-items: center; /* Centra los elementos al apilarse */
    }

    .social-section, .agenda-section, .gov-nav-group, .main-nav > ul > li {
        width: 100%;
        box-sizing: border-box;
    }
    
    .gov-nav, .main-header, .gov-header-top {
        gap: 15px;
    }

    .gov-nav li {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    .gov-nav ul li:last-child {
       border-bottom: none;
    }

     .main-nav > ul > li {
        border-right: none;
        border-bottom: 1px solid #009a44;
        text-align: center;
     }
     .main-nav > ul > li:last-child {
        border-bottom: none;
     }
}

@media (max-width: 768px) {
     .normativa .cards-container {
        grid-template-columns: 1fr;
     }

    .social-media-content {
        grid-template-areas:
            "main"
            "secondary"
            "facebook";
        grid-template-columns: 1fr;
    }

    .footer-bottom-links {
        flex-direction: column;
        align-items: center;
    }
}

/* --- ESTILOS PARA LA SECCIÓN DE NOTICIAS --- */

/* Contenedor principal del artículo */
.news-article {
    width: 100%;
    max-width: 900px; /* Limita el ancho para mejor legibilidad */
    margin: 20px auto; /* Centra el artículo en la página */
    padding: 15px;
}

/* Estilos para el bloque de texto */
.news-text p {
    font-size: 1.1em;        /* Tamaño de letra un poco más grande */
    line-height: 1.6;        /* Espacio entre líneas para que no se vea apretado */
    color: #333;             /* Un color de texto gris oscuro, más suave que el negro puro */
    text-align: justify;     /* Justifica el texto para un look de "periódico" */
    margin-bottom: 30px;     /* Espacio entre el texto y la galería de imágenes */
}

/* --- Galería de Imágenes con CSS Grid --- */
.image-gallery {
    display: grid; /* ¡Activamos la magia de CSS Grid! */
    grid-template-columns: repeat(2, 1fr); /* Crea una cuadrícula de 2 columnas iguales */
    gap: 15px; /* Espacio de 15px entre las imágenes */
}

/* Estilos para cada imagen en la galería */
.image-gallery img {
    width: 100%; /* Hace que la imagen ocupe todo el espacio de su celda */
    height: auto; /* Mantiene la proporción de la imagen */
    border-radius: 8px; /* Bordes redondeados para un look más suave */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Sombra sutil */
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
    aspect-ratio: 16 / 10; /* Opcional: Da a todas las imágenes la misma proporción */
}


/* --- Hacerlo adaptable a móviles (Responsive) --- */
@media (max-width: 600px) {
    .image-gallery {
        /* En pantallas pequeñas, las imágenes se apilan en una sola columna */
        grid-template-columns: 1fr;
    }
}

/* --- ESTILOS DEL CARRUSEL --- */
.carousel-container {
    position: relative;
    width: 100%;
    /* Ajuste para hacerlo más pequeño */
    max-width: 600px; 
    margin: 20px auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    aspect-ratio: 16 / 9;
}

.carousel-slides {
    display: flex;
    height: 100%;
    /* La transición hace el movimiento suave */
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* --- Estilos de botones y puntos --- */
.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 18px;
    z-index: 10;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-prev:hover, .carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}
.dot.active, .dot:hover {
    background-color: rgba(255, 255, 255, 0.9);
}