/* Asegura que la página web ocupe siempre el 100% de la pantalla */
html, body {
    height: 100%;
    margin: 0;
}

/* Convierte el cuerpo en un contenedor flexible vertical */
body {
    display: flex;
    flex-direction: column;
}

/* Esto empuja automáticamente el footer hacia el extremo inferior */
.main-content, section, main {
    flex: 1 0 auto;
}

/* Le da un respiro al final del footer para la barra de tareas */
footer {
    flex-shrink: 0;
    margin-bottom: 25px; /* Empuja el footer un poco hacia arriba para que la barra de Windows no lo tape */
}

/* ==========================================
   VARIABLES DE COLOR E INSTALACIÓN GENERAL
   ========================================== */
:root {
    --azul-principal: #1A569B;
    --azul-oscuro: #113D70;
    --naranja: #F7941D;
    --naranja-oscuro: #D97E14;
    --verde-whatsapp: #25D366;
    --gris-fondo: #F9F9F9;
    --texto-oscuro: #333333;
    --morado-base: #9c27b0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--texto-oscuro);
    background-color: var(--gris-fondo);
}

/* Antes decía "overflow: hidden", lo que recortaba el contenido en
   pantallas pequeñas/celulares. Ahora se permite scroll vertical. */
body {
    overflow-y: auto;
    overflow-x: hidden;
}

/* ==========================================
   ENCABEZADO Y MENÚ COMPACTO (Siempre al frente)
   ========================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3%;
    background-color: var(--morado-base) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    height: 60px;
    overflow: visible;
    position: relative;
    z-index: 99999;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    height: 38px;
    width: auto;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff !important;
    white-space: nowrap;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.navigation a, .dropbtn {
    text-decoration: none;
    color: #ffffff !important;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 6px 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.navigation a:hover, .dropdown:hover .dropbtn, .navigation a.active {
    color: var(--naranja) !important;
}

/* Estructura del Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 260px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
    z-index: 10000;
}

.dropdown-content a {
    color: var(--texto-oscuro) !important;
    padding: 12px 16px;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--azul-principal) !important;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* ==========================================
   DISEÑO DE LA PORTADA (index.html) - CORREGIDO
   ========================================== */
.hero {
    position: relative;
    height: calc(100vh - 60px);
    background-image: url('imagenes/foto-sede.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: 0 20px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-logo {
    width: 100%;
    max-width: 280px;
    height: auto;
    margin-bottom: 15px;
    display: inline-block;
}

.hero h1 {
    font-size: 2.2rem;
    color: var(--azul-principal);
    margin-bottom: 8px;
    font-weight: 800;
}

.hero-tagline {
    font-size: 1.15rem;
    color: #444;
    margin-bottom: 25px;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 20;
}

/* Botones Principales */
.btn {
    padding: 10px 25px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 30px;
    transition: transform 0.2s, background-color 0.3s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--naranja);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--naranja-oscuro);
}

.btn-secondary {
    background-color: var(--azul-principal);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: var(--azul-oscuro);
}

/* ==========================================
   ESTILOS ESPECÍFICOS PARA SECCIÓN CÓMO AYUDAR
   ========================================== */
.help-container {
    position: relative;
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 25px 4% 45px 4%;
    overflow: hidden;
}

.help-header {
    text-align: center;
    max-width: 800px;
}

.help-header h2 {
    font-size: 2rem;
    color: var(--azul-principal);
    margin-bottom: 6px;
    font-weight: 800;
}

.help-header p {
    font-size: 1rem;
    color: #555;
    font-weight: 500;
}

/* Rejilla de Tarjetas */
.help-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    flex-grow: 1;
    align-items: center;
    margin: 15px 0;
}

/* Diseño de cada Tarjeta */
.help-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    padding: 20px 15px;
    flex: 1;
    height: 100%;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
}

.help-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.highlight-card {
    border: 2px solid var(--azul-principal);
    transform: scale(1.02);
}

.highlight-card:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Elementos Internos de Tarjetas */
.card-icon {
    font-size: 2rem;
    color: var(--naranja);
    margin-bottom: 8px;
}

.highlight-card .card-icon {
    color: var(--azul-principal);
}

.help-card h3 {
    font-size: 1.2rem;
    color: var(--azul-oscuro);
    margin-bottom: 8px;
    font-weight: 700;
}

.help-card p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.35;
    margin-bottom: 10px;
}

.card-list {
    list-style: none;
    text-align: left;
    width: 100%;
    margin-bottom: 12px;
}

.card-list li {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.card-list li i {
    color: var(--verde-whatsapp);
}

/* Botones de las Tarjetas */
.btn-card {
    width: 100%;
    padding: 8px 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color 0.3s ease;
    text-align: center;
}

.btn-orange {
    background-color: var(--naranja);
    color: #ffffff;
}

.btn-orange:hover {
    background-color: var(--naranja-oscuro);
}

.btn-blue {
    background-color: var(--azul-principal);
    color: #ffffff;
}

.btn-blue:hover {
    background-color: var(--azul-oscuro);
}

/* ==========================================
   ELEMENTOS DE DECORACIÓN COMUNES Y FLOTANTES
   ========================================== */
.purple-bar-base {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25px;
    background-color: var(--morado-base);
    z-index: 3;
}

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 45px;
    right: 30px;
    background-color: var(--verde-whatsapp);
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.25);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* ==========================================
   ADAPTACIÓN MÓVIL (Responsivo)
   ========================================== */
@media (max-width: 768px) {
    .help-container {
        justify-content: flex-start;
        overflow-y: auto;
    }
    .help-grid {
        flex-direction: column;
        gap: 15px;
        margin: 15px 0;
    }
    .help-card {
        max-height: none;
        width: 100%;
        padding: 15px;
    }
    .highlight-card {
        transform: none;
    }
    .highlight-card:hover {
        transform: translateY(-5px);
    }
}
/* ==========================================
   FOOTER COMPARTIDO (footer.html)
   ========================================== */
.site-footer {
    background-color: var(--azul-oscuro, #1a5f7a);
    background-color: #1a5f7a;
    color: #ffffff;
    padding: 6px 20px 8px 20px;
    border-radius: 12px;
    margin: 0 10px 10px 10px;
    font-size: 0.8rem;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-info {
    flex: 1;
    min-width: 280px;
    text-align: left;
    line-height: 1.2;
}

.footer-titulo {
    font-weight: bold;
    font-size: 0.9rem;
    margin: 0 0 1px 0;
}

.footer-nit {
    margin: 0 0 1px 0;
    font-size: 0.72rem;
    opacity: 0.85;
}

.footer-direccion {
    margin: 0 0 1px 0;
    font-size: 0.75rem;
}

.footer-contacto {
    margin: 0;
    font-size: 0.75rem;
}

.footer-contacto a {
    color: #ffffff;
    text-decoration: underline;
}

.footer-social {
    text-align: center;
    min-width: 120px;
}

.footer-social p {
    font-weight: bold;
    margin: 0 0 2px 0;
    font-size: 0.75rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.social-icons a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.05rem;
}

.footer-logo {
    text-align: right;
    min-width: 80px;
}

.footer-logo img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

/* ==========================================
   ESTRUCTURA GENERAL DE PÁGINA (evita cortar
   contenido en pantallas pequeñas)
   ========================================== */
.pagina {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.pagina-contenido {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 4%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .pagina-contenido {
        justify-content: flex-start;
    }
}

/* ==========================================
   TARJETA BLANCA GENÉRICA DE CONTENIDO
   (historia, aliados, contacto, buscame)
   ========================================== */
.info-box {
    background-color: #ffffff;
    border: 2px solid #1a5f7a;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 900px;
    width: 100%;
    margin: 0 auto 12px auto;
    box-sizing: border-box;
}

.info-box h1 {
    color: #1a5f7a;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.info-box p {
    color: #333;
    line-height: 1.4;
    font-size: 0.92rem;
    text-align: justify;
    margin: 0 0 10px 0;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box ul {
    margin-left: 20px;
    color: #333;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Fila de botones debajo de una info-box (historia, buscame) */
.boton-fila {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .boton-fila {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }
}

.boton-fila a, .boton-fila button {
    padding: 10px 5px;
    background-color: #1a5f7a;
    color: #ffffff;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================
   MODALES (historia, cómo-ayudar, programas)
   ========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 620px;
    border-radius: 20px;
    padding: 25px;
    border: 3px solid #1a5f7a;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
}

.modal-content h2 {
    color: #1a5f7a;
}

.modal-content p {
    text-align: justify;
    font-size: 0.9rem;
    color: #333;
}

.modal-logo {
    height: 55px;
    margin-bottom: 10px;
}

.modal-contacto-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: center;
}

.modal-cerrar {
    display: block;
    margin: 15px auto 0;
    background-color: #9c27b0;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    cursor: pointer;
}

/* Página placeholder ("en construcción") */
.placeholder-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.placeholder-box i {
    font-size: 2.5rem;
    color: #9c27b0;
    margin-bottom: 12px;
}

/* ==========================================
   GALERÍA DE FOTOS (modal en historia.html)
   Fotos administradas desde admin/galeria.php
   ========================================== */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.galeria-foto {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}

.galeria-foto:hover {
    transform: scale(1.04);
}

.galeria-item {
    text-align: center;
}

.galeria-pie {
    font-size: 0.75rem;
    color: #555;
    margin-top: 4px;
    text-align: center;
}

/* ==========================================
   PUBLICACIONES (Transparencia y Noticias)
   Documentos y fotos administrados desde
   admin/publicaciones.php
   ========================================== */
.publicaciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    max-width: 1000px;
    width: 100%;
    margin: 24px auto 0;
}

.publicacion-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.publicacion-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
}

.publicacion-card-doc {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    background: #eef2f7;
    border-radius: 10px;
    margin-bottom: 8px;
    text-decoration: none;
}

.publicacion-card-icono {
    font-size: 2.4rem;
    color: #1a5f7a;
}

.publicacion-card-titulo {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a5f7a;
    margin: 0 0 4px;
}

.publicacion-card-desc {
    font-size: 0.82rem;
    color: #555;
    margin: 0 0 10px;
    line-height: 1.3;
}

.publicacion-card-boton {
    margin-top: auto;
    background-color: #F7941D;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 8px 0;
    border-radius: 20px;
}

.publicacion-card-boton:hover {
    background-color: #D97E14;
}

/* ==========================================
   MENÚ MÓVIL (botón hamburguesa)
   ========================================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px 8px;
}

@media (max-width: 1300px) {
    .menu-toggle {
        display: block;
    }

    .navigation {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--morado-base);
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }

    .navigation.menu-abierto {
        display: flex;
    }

    .navigation a {
        width: 100%;
        padding: 12px 20px;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        width: 100%;
    }
}