/* ===================================================
   CÓDIGO V6 - PROPORCIÓN SAGRADA (NO DEFORMAR)
   =================================================== */

/* --- 1. CABECERA (BANNER) --- */
.pkp_structure_page > header,
header.pkp_structure_head,
.pkp_head_wrapper {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

.pkp_site_name_wrapper img,
header .pkp_site_name img,
.pkp_head_wrapper img {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    display: block !important;
    object-fit: cover !important;
}

.pkp_site_name_wrapper a,
header .pkp_site_name a {
     display: block !important;
     width: 100% !important;
     opacity: 1 !important;
}

header h1.pkp_site_name:not(:has(img)) {
    display: none !important;
}


/* --- 2. PORTADA INICIAL (HOME) --- */
.homepage-image, 
.obj_issue_toc .cover {
    width: 100% !important;
    text-align: center;
    margin-bottom: 20px;
}

.homepage-image img, 
.obj_issue_toc .cover img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 600px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: inline-block;
}


/* --- 3. ARCHIVOS (LA SOLUCIÓN A LA DEFORMACIÓN) --- */

/* La Cuadrícula */
.page_issue_archive .issues_archive,
.page_issue_archive ul.issues_media_list,
div.issues_archive {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important; 
    gap: 30px !important;
    padding: 0 !important;
    margin-top: 30px !important;
    list-style-type: none !important;
}

/* La Tarjeta (Caja contenedora) */
.page_issue_archive .issue-summary,
.page_issue_archive .obj_issue_summary {
    background-color: #fff;
    padding: 10px !important;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    height: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center; 
}

/* DESBLOQUEO DEL CONTENEDOR DE IMAGEN */
/* A veces el enlace <a> tiene una altura fija que causa el problema. Lo liberamos. */
.page_issue_archive .cover,
.obj_issue_summary .cover,
.page_issue_archive .cover a {
    height: auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center; /* Centrar horizontalmente */
    margin-bottom: 15px;
}

/* LA IMAGEN (EL FIX DEFINITIVO) */
.page_issue_archive .cover img,
.obj_issue_summary .cover img {
    /* 1. Le decimos que intente llenar el ancho */
    width: 100% !important;
    
    /* 2. Le decimos que la altura es AUTOMÁTICA (vital para no estirar) */
    height: auto !important;
    
    /* 3. El seguro de vida: Si intenta deformarse, esto lo impide */
    object-fit: contain !important; 
    
    /* 4. Límites de seguridad */
    max-width: 100% !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}