/* ========================================================
DOCUMENTO-GESTION.CSS - Estilos específicos para página de Documentos de Gestión
Municipalidad Distrital de Quiquijana
Color principal: #0056b3
======================================================== */

/* ========================================================
HERO SECTION
======================================================== */
.documentos-hero {
    background: linear-gradient(rgba(0, 86, 179, 0.85), rgba(0, 86, 179, 0.9)),
                url('/static/img/documentos/hero-documentos.jpg') center/cover no-repeat;
    color: white;
    padding: 100px 0 60px;
    position: relative;
}

.documentos-hero .hero-overlay {
    position: relative;
    z-index: 2;
}

.hero-content {
    text-align: center;
    padding: 30px 0;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-breadcrumb {
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    padding: 10px 25px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
}

.hero-breadcrumb a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.hero-breadcrumb a:hover {
    opacity: 0.9;
}

.hero-breadcrumb span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.hero-breadcrumb i {
    margin: 0 10px;
    font-size: 12px;
    opacity: 0.7;
}

/* ========================================================
SECCIÓN INTRODUCCIÓN
======================================================== */
.section-padding {
    padding: 80px 0;
}

.bg-light-section {
    background-color: #f8f9fa;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-subtitle {
    color: #0056b3;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.section-description {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========================================================
GRID DE DOCUMENTOS - 3 COLUMNAS
======================================================== */
.documentos-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

@media (max-width: 992px) {
    .documentos-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .documentos-grid-3col {
        grid-template-columns: 1fr;
    }
}

/* ========================================================
TARJETAS DE DOCUMENTOS COMPACTAS - CON IMAGEN RESPONSIVE
======================================================== */
.documento-card-compact {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.documento-card-compact:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Contenedor de imagen con relación de aspecto CUADRADA (1:1) */
.documento-imagen-compact {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Relación de aspecto 1:1 (cuadrada) */
    overflow: hidden;
}

/* Imagen que se ajusta automáticamente */
.documento-imagen-compact img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene la proporción y cubre el contenedor */
    transition: transform 0.5s ease;
    /* Fondo de carga sutil mientras carga la imagen */
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

/* Ajuste para hover */
.documento-card-compact:hover .documento-imagen-compact img {
    transform: scale(1.05);
}

/* Clase para cuando falla la carga de imagen */
.documento-imagen-compact img.error {
    object-fit: contain;
    padding: 20px;
}

/* Etiqueta de gobierno */
.documento-gob-text-compact {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3545;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

/* Resto del código permanece igual */
.documento-header-compact {
    padding: 20px 20px 0;
}

.documento-title-compact {
    font-size: 18px;
    font-weight: 600;
    color: #0056b3;
    margin-top: 15px;
    line-height: 1.4;
}

.documento-body-compact {
    padding: 0 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.documento-subtitle-compact {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 10px 0 12px;
}

.documento-text-compact {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.documento-btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0056b3;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin-top: auto;
    border: 2px solid #0056b3;
}

.documento-btn-compact:hover {
    background: white;
    color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

.documento-btn-compact i {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.documento-btn-compact:hover i {
    transform: translateX(3px);
}

/* ========================================================
INFORMACIÓN ADICIONAL
======================================================== */
.info-documentos {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.info-content {
    padding-right: 30px;
}

.info-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0056b3;
    margin-bottom: 20px;
}

.info-text {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.info-contacto {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.contacto-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.contacto-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contacto-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.contacto-list i {
    color: #0056b3;
    width: 20px;
}

.contacto-list span {
    color: #555;
}

.info-imagen {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-imagen img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

.info-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 86, 179, 0.9));
    color: white;
    padding: 25px;
    text-align: center;
}

.info-caption h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.info-caption p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* ========================================================
BOTÓN SCROLL TOP
======================================================== */
.btn-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}

.btn-scroll-top:hover {
    background: #004494;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.4);
}

/* ========================================================
ANIMACIONES
======================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.documento-card-compact {
    animation: fadeInUp 0.5s ease forwards;
}

.documento-card-compact:nth-child(1) { animation-delay: 0.1s; }
.documento-card-compact:nth-child(2) { animation-delay: 0.2s; }
.documento-card-compact:nth-child(3) { animation-delay: 0.3s; }
.documento-card-compact:nth-child(4) { animation-delay: 0.4s; }
.documento-card-compact:nth-child(5) { animation-delay: 0.5s; }
.documento-card-compact:nth-child(6) { animation-delay: 0.6s; }

/* ========================================================
RESPONSIVE ADICIONAL PARA IMÁGENES CUADRADAS
======================================================== */
@media (max-width: 576px) {
    /* Ajuste para relación de aspecto en móviles */
    .documento-imagen-compact {
        padding-top: 80%; /* Un poco menos cuadrado en móviles para mejor visualización */
    }
    
    /* Ajuste para hover en móviles (opcional) */
    .documento-card-compact:hover .documento-imagen-compact img,
    .documento-card-compact:active .documento-imagen-compact img {
        transform: scale(1.03);
    }
    
    /* Ajustes responsive generales */
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .info-content {
        padding-right: 0;
        margin-bottom: 30px;
    }
    
    .info-imagen img {
        height: 250px;
    }
    
    .documento-imagen-compact img {
        /* En móviles, podrías usar contain si las imágenes son muy detalladas */
        object-fit: contain;
        background: #f8f9fa;
        padding: 10px;
    }
    
    .documento-header-compact,
    .documento-body-compact {
        padding: 15px;
    }
    
    .documento-title-compact {
        font-size: 16px;
    }
    
    .documento-subtitle-compact {
        font-size: 15px;
    }
    
    .documento-text-compact {
        font-size: 13px;
    }
    
    .info-documentos {
        padding: 25px;
    }
}

/* ========================================================
OPCIONES ALTERNATIVAS DE RELACIÓN DE ASPECTO (SI LAS NECESITAS)
======================================================== */
/* Para relación 4:3 (75%) */
.documento-imagen-compact.aspect-4-3 {
    padding-top: 75%;
}

/* Para relación 16:9 (56.25%) */
.documento-imagen-compact.aspect-16-9 {
    padding-top: 56.25%;
}

/* Para relación 3:2 (66.66%) */
.documento-imagen-compact.aspect-3-2 {
    padding-top: 66.66%;
}

/* Para relación personalizada según contenido */
.documento-imagen-compact.aspect-custom {
    padding-top: 80%; /* Ajusta según tus necesidades */
}

/* ========================================================
MEJORA PARA IMÁGENES EN TARJETAS HOVER
======================================================== */
.documento-card-compact:hover .documento-imagen-compact::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 86, 179, 0.1);
    z-index: 1;
    transition: all 0.3s ease;
}

/* ========================================================
EFECTO DE CARGA PARA IMÁGENES
======================================================== */
.documento-imagen-compact.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: 1;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Remover el efecto de carga cuando la imagen se carga */
.documento-imagen-compact.loaded::before {
    display: none;
}