/* =====================================
   ESTILO GENERAL INSTITUCIONAL (LIMPIO)
===================================== */

/* Footer sobrio */
.main-footer {
    background-color: #2f2f2f !important;
    color: #ffffff !important;
}

.main-footer__top {
    background-color: #2f2f2f !important;
}

.main-footer__bottom {
    background-color: #262626 !important;
}

.main-footer a {
    color: #ffffff !important;
    transition: color 0.3s ease;
}

.main-footer a:hover {
    color: #60a072 !important;
}

/* Cabecera gris claro */
header,
.main-header,
.site-header,
#header {
    background-color: #f2f2f2 !important;
}

.site-header .site-title a,
.site-header a {
    color: #2f2f2f !important;
}

.site-header a:hover {
    color: #60a072 !important;
}

/* Ocultar banner global excepto inicio */
.banner {
    display: none;
}

.site-page-inicio .banner {
    display: block;
}

.banner::before {
    background: rgba(0, 0, 0, 0.45) !important;
}

/* Bloque institucional */
.intro-archivo {
    max-width: 780px;
    margin: 80px auto 70px auto;
    text-align: center;
}

.intro-archivo p {
    font-size: 1.6rem;
    line-height: 1.8;
    font-style: italic;
    color: #3a3a3a;
    margin: 0;
}

/* Enlaces institucionales */
a {
    color: #59A16E !important;
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover,
a:focus {
    color: #DE6A57 !important;
}

/* =====================================
   GRILLA DE RECURSOS
===================================== */

@media (min-width: 992px) {
    .resource-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 50px;
    }
}

@media (max-width: 991px) {
    .resource-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
}

.resource-grid img {
    width: 100%;
    height: auto;
    display: block;
}

/* =====================================
   FICHA DE RECURSO (VIDEO + FOTO)
   SISTEMA ESTABLE Y SIN CONFLICTOS
===================================== */

/* Aire del título */
.resource.show h1 {
    margin-bottom: 45px;
}

/* Contenedor central del contenido */
.resource.show .main-region .metadata {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Media universal (video + imagen) */
.resource.show .main-region img,
.resource.show .main-region iframe {
    width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Altura video escritorio */
.resource.show .main-region iframe {
    height: 500px;
}

/* =====================================
   BOTÓN FICHA ARCHIVÍSTICA
===================================== */

.ficha-toggle {
    background-color: #2f6f73;
    color: #ffffff;
    padding: 12px 18px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    max-width: 900px;
    margin: 25px auto 0 auto;
    display: block;
    box-sizing: border-box;
    transition: background-color 0.25s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.ficha-toggle:hover {
    background-color: #24585b;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.ficha-toggle:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Contenido desplegable */
.ficha-contenido {
    display: none;
    max-width: 900px;
    margin: 15px auto 0 auto;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.ficha-contenido.ficha-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Panel de ficha */
.sidebar-region--right {
    background: #f8f9fa;
    padding: 15px;
    border-left: 3px solid #2f6f73;
}

/* Encabezado ficha */
.ficha-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 15px;
    color: #2f6f73;
    border-bottom: 2px solid #e6e6e6;
    padding-bottom: 6px;
}

/* Metadatos */
.metadata .property {
    margin-bottom: 12px;
}

.metadata .property-label {
    font-weight: 600;
    color: #2f6f73;
    font-size: 15px;
    letter-spacing: 0.3px;
}

/* =====================================
   FIX TEXTOS LARGOS DUBLIN CORE (CRÍTICO)
===================================== */

.sidebar-region--right .metadata,
.sidebar-region--right .property-value {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.sidebar-region--right .property-value a {
    overflow-wrap: anywhere;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
    font-size: 0.95em;
    line-height: 1.5;
    text-decoration: underline;
}

/* =====================================
   BOTÓN VOLVER (FINAL DE FICHA)
===================================== */

.ficha-nav-bottom {
    max-width: 900px;
    margin: 50px auto 30px auto;
    text-align: center;
}

.ficha-back-btn {
    background: #f5f5f5;
    border: 1px solid #dcdcdc;
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 6px;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ficha-back-btn:hover {
    background-color: #e9e9e9;
    transform: translateY(-1px);
}

/* =====================================
   BANNER (BLOQUE OMEKA) — CONTROL PROFESIONAL
===================================== */

.banner-block,
.block-banner,
.banner {
    width: 100%;
    overflow: hidden;
}

.banner-block img,
.banner img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    display: block;
}

/* Contenedor texto banner */
.banner-block .banner__content,
.banner .banner__content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Escritorio */
@media (min-width: 992px) {

    .banner-block .banner__heading,
    .banner .banner__heading {
        display: inline-block;
        max-width: 900px;
        font-size: 4.2rem;
        line-height: 1.08;
        letter-spacing: 1.1px;
        margin: 0 auto;

        /* SIN GUIONES (corrección tipográfica) */
        hyphens: none !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        white-space: normal;
    }

    .banner-block .banner__content {
        top: 35% !important;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .banner-block .banner__heading,
    .banner .banner__heading {
        font-size: 2.6rem !important;
        line-height: 1.15 !important;
        max-width: 90%;
        hyphens: none !important;
    }
}

/* Móvil — 3 líneas limpias SIN guiones */
@media (max-width: 600px) {

    .banner-block img,
    .banner img {
        max-height: 45vh !important;
    }

    .banner-block .banner__content,
    .banner .banner__content {
        width: 100%;
        max-width: 92%;
        margin: 0 auto;
        padding: 0 10px !important;
        text-align: center;
    }

    .banner-block .banner__heading,
    .banner .banner__heading {
        font-size: clamp(1.7rem, 5vw, 2.1rem) !important;
        line-height: 1.15 !important;
        max-width: 30ch;
        margin: 0 auto;

        /* CORRECCIÓN DEFINITIVA DE GUIONES */
        hyphens: none !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        white-space: normal;
    }
}

/* =====================================
   RESPONSIVE FICHA (MÓVIL)
===================================== */

@media (max-width: 768px) {

    .resource.show {
        display: block !important;
        min-height: auto !important;
        height: auto !important;
    }

    .resource.show .regions-container {
        display: block !important;
        height: auto !important;
    }

    .resource.show .main-region .metadata,
    .ficha-toggle,
    .ficha-contenido {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px;
        padding-right: 12px;
    }

    .resource.show .main-region iframe {
        height: 240px !important;
    }

    .ficha-toggle {
        font-size: 15px;
        padding: 12px 16px;
    }

    .ficha-header {
        font-size: 16px;
    }

    .ficha-back-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
}
/* Ajuste tipográfico limpio del banner (sin forzar layout) */
.banner .banner__heading {
    hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
    text-align: center;
}

/* Escala equilibrada en móvil */
@media (max-width: 600px) {
    .banner .banner__heading {
        font-size: clamp(1.8rem, 5vw, 2.2rem);
        line-height: 1.15;
        max-width: 32ch; /* mantiene ~3 líneas naturales */
        margin: 0 auto;
    }
/* =====================================
   UNIFICACIÓN TIPOGRÁFICA INSTITUCIONAL
   Garamond (títulos) + Sans serif (lectura)
===================================== */

/* Fuente base del sitio (lectura digital) */
body,
p,
.metadata,
.property-value,
.ficha-contenido,
.intro-archivo p {
    font-family: "Source Sans 3", "Open Sans", Arial, sans-serif;
    color: #333333;
}

/* Títulos institucionales (coherentes con el banner en Garamond) */
h1,
h2,
h3,
h4,
.site-title,
.ficha-header {
    font-family: "Garamond", "Libre Baskerville", "Times New Roman", serif;
    letter-spacing: 0.3px;
}

/* Título de secciones como "Colecciones Destacadas" */
h2 {
    font-weight: 600;
}

/* Navegación del menú (más legible y limpia) */
.site-header a,
nav,
.menu,
.menu a {
    font-family: "Source Sans 3", "Open Sans", Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0.4px;
}

/* Botones (ficha archivística y navegación) */
.ficha-toggle,
.ficha-back-btn {
    font-family: "Source Sans 3", "Open Sans", Arial, sans-serif;
    font-weight: 600;
}