/* css/comunidades.css - SOLUCIÓN DEFINITIVA */
:root {
    --primary-green: #013836;
    --primary-brown: #8d4c2c;
    --dark-text: #333;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-text);
    /* SIN padding-top aquí */
}

/* SOLUCIÓN: USAR POSITION RELATIVE Y TOP */
.pagina-resguardo {
    min-height: 100vh;
    background-image: url('../img/comunidades/DJI_0960.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    padding-top: 70px; /* Espacio para la navbar */
}

/* EL CONTENEDOR OCUPA TODA LA ALTURA */
.contenedor-texto-resguardo {
    height: 100vh; /* 100% del viewport */
    padding: 0 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -70px; /* Compensa el padding-top */
}

.texto-resguardo-interno {
    max-width: 800px;
    margin-top: 70px; /* Mueve el texto hacia abajo */
}

.texto-resguardo-interno h1 {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 30px;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.parrafo-resguardo p {
    font-size: 1.1rem;
    color: white;
    text-align: justify;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.6);
    line-height: 1.8;
}

/* MISMO AJUSTE PARA LAS IMÁGENES DERECHAS */
.contenedor-comunidades-horizontal {
    height: 100vh; /* 100% del viewport */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    position: relative;
    top: -70px; /* Compensa el padding-top */
}

.fila-comunidades-horizontal {
    display: flex;
    width: 100%;
    height: 80%;
    gap: 10px;
}

.comunidad-horizontal {
    flex: 1;
    height: 100%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: flex 0.3s ease;
}

.comunidad-horizontal:hover {
    flex: 1.4;
}

.imagen-comunidad-horizontal {
    width: 100%;
    height: 100%;
}

.imagen-comunidad-horizontal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.comunidad-horizontal:hover .imagen-comunidad-horizontal img {
    transform: scale(1.1);
}

/* TÍTULOS VISIBLES */
.overlay-comunidad-horizontal {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    text-align: center;
}

.overlay-comunidad-horizontal h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 1px;
}

/* HOVER: TÍTULO MÁS GRANDE */
.comunidad-horizontal:hover .overlay-comunidad-horizontal h3 {
    font-size: 1.5rem;
}

/* EL RESTO DE LA PÁGINA SÍ TIENE PADDING */
.seccion-comunidades-detalle {
    padding: 80px 0 0 0; /* Solo padding bottom, el top ya está cubierto */
    background-color: #f8f9fa;
}

/* EL RESTO DEL CÓDIGO SE MANTIENE IGUAL... */
.articulo-comunidad-detalle {
    margin-bottom: 100px;
    padding: 60px 0;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.contenedor-imagen-comunidad {
    padding: 0 40px;
}

.imagen-principal-comunidad {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.imagen-principal-comunidad img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contenido-comunidad-detalle {
    padding: 0 40px;
}

.encabezado-articulo {
    margin-bottom: 30px;
}

.titulo-comunidad {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-green);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.subtitulo-comunidad {
    font-size: 1.3rem;
    color: var(--primary-brown);
    font-weight: 600;
    padding-left: 15px;
    border-left: 3px solid var(--primary-brown);
}

.cuerpo-articulo {
    margin-top: 30px;
}

.texto-introduccion {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-text);
    margin-bottom: 30px;
    text-align: justify;
}

.contenido-expandible {
    display: none;
}

.seccion-expandida {
    margin-bottom: 30px;
}

.seccion-expandida h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 15px;
}

.seccion-expandida p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--dark-text);
}

.boton-expandir {
    background-color: var(--primary-brown);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
}

footer.footer-section {
    background-color: #013836;
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

/* RESPONSIVE CORREGIDO */
@media (max-width: 992px) {
    .pagina-resguardo {
        padding-top: 70px;
    }
    
    .contenedor-texto-resguardo {
        height: 50vh;
        padding: 0 30px;
        top: -70px;
    }
    
    .texto-resguardo-interno {
        margin-top: 70px;
    }
    
    .contenedor-comunidades-horizontal {
        height: 50vh;
        padding: 0 30px;
        top: -70px;
    }
    
    .texto-resguardo-interno h1 {
        font-size: 2.2rem;
    }
    
    .overlay-comunidad-horizontal h3 {
        font-size: 1.1rem;
    }
    
    .comunidad-horizontal:hover .overlay-comunidad-horizontal h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .contenedor-texto-resguardo {
        height: 50vh;
        padding: 0 20px;
        top: -70px;
    }
    
    .texto-resguardo-interno {
        margin-top: 70px;
    }
    
    .texto-resguardo-interno h1 {
        font-size: 1.8rem;
        text-align: center;
    }
    
    .contenedor-comunidades-horizontal {
        height: auto;
        min-height: 50vh;
        padding: 0 20px;
        top: -70px;
    }
    
    .fila-comunidades-horizontal {
        flex-direction: column;
        height: auto;
        gap: 15px;
        padding: 20px 0;
    }
    
    .comunidad-horizontal {
        width: 100%;
        height: 200px;
        flex: none !important;
    }
    
    .comunidad-horizontal:hover {
        height: 220px;
        flex: none !important;
    }
    
    .overlay-comunidad-horizontal {
        padding: 15px;
    }
    
    .overlay-comunidad-horizontal h3 {
        font-size: 1.2rem;
    }
    
    .comunidad-horizontal:hover .overlay-comunidad-horizontal h3 {
        font-size: 1.4rem;
    }
    
    .titulo-comunidad {
        font-size: 1.8rem;
        text-align: center;
    }
    
    .subtitulo-comunidad {
        font-size: 1.1rem;
        text-align: center;
        border-left: none;
        padding-left: 0;
        border-top: 2px solid var(--primary-brown);
        padding-top: 10px;
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .contenedor-texto-resguardo {
        height: 50vh;
        padding: 0 15px;
        top: -70px;
    }
    
    .texto-resguardo-interno {
        margin-top: 70px;
    }
    
    .texto-resguardo-interno h1 {
        font-size: 1.6rem;
    }
    
    .parrafo-resguardo p {
        font-size: 1rem;
    }
    
    .contenedor-comunidades-horizontal {
        padding: 0 15px;
        top: -70px;
    }
    
    .comunidad-horizontal {
        height: 180px;
    }
    
    .comunidad-horizontal:hover {
        height: 200px;
    }
    
    .overlay-comunidad-horizontal h3 {
        font-size: 1.1rem;
    }
    
    .comunidad-horizontal:hover .overlay-comunidad-horizontal h3 {
        font-size: 1.2rem;
    }
    
    .imagen-principal-comunidad {
        height: 300px;
    }
    
    .contenedor-imagen-comunidad,
    .contenido-comunidad-detalle {
        padding: 0 15px;
    }
    
    .titulo-comunidad {
        font-size: 1.6rem;
    }
    
    .subtitulo-comunidad {
        font-size: 1rem;
    }
    
    .boton-expandir {
        width: 100%;
        text-align: center;
    }
}