/**
 * AppVerso V49: estilos de los visores nativos PDF.js y HTML de OJS.
 * Solo se aplican a la cabecera y al contenedor propios de los visores.
 */

body > .header_view {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    min-height: 52px;
    margin: 0;
    padding: 0;
    background: #012140;
    color: #ffffff;
}

body > .header_view > a {
    box-sizing: border-box;
    height: 52px;
    margin: 0;
    color: #ffffff;
    text-decoration: none;
}

body > .header_view > .return,
body > .header_view > .download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    line-height: 1;
    background: #023668;
}

body > .header_view > .return::before {
    content: '\2190';
    font-size: 28px;
    font-weight: 700;
}

body > .header_view > .title {
    display: block;
    min-width: 0;
    overflow: hidden;
    padding: 0 16px;
    font-size: 15px;
    line-height: 52px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body > .header_view > .download {
    gap: 8px;
    background: #007f9c;
}

body > .header_view > .download::before {
    content: '\2193';
    font-size: 24px;
    font-weight: 700;
}

body > .header_view > .download > .label {
    display: none;
}

body > .header_view > a:hover,
body > .header_view > a:focus-visible {
    background: #04518b;
    color: #ffffff;
}

body > .header_view > a:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: -4px;
}

/* Mantiene los nombres accesibles aunque appverso.css oculte estos textos. */
body > .header_view > a > .pkp_screen_reader {
    position: absolute !important;
    display: block !important;
    visibility: visible !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

body > .galley_view {
    position: absolute;
    z-index: 1;
    top: 52px;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 0;
    overflow: hidden !important;
    background: #ffffff;
}

body > .galley_view > iframe {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0;
    border: 0;
    background: #ffffff;
}

/* Reserva espacio real para el aviso de versiones anteriores. */
body > .galley_view.galley_view_with_notice {
    display: flex;
    flex-direction: column;
}

body > .galley_view.galley_view_with_notice > iframe {
    flex: 1 1 0;
    height: 0 !important;
}

body > .galley_view > .galley_view_notice {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    padding: 10px 16px;
    border-bottom: 1px solid #e6cd83;
    background: #fff3cd;
    color: #604b08;
}

body > .galley_view .galley_view_notice_message {
    position: static;
    transform: none;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

body > .galley_view .galley_view_notice_message a {
    color: inherit;
    text-decoration: underline;
}

@media (min-width: 768px) {
    body > .header_view > .download {
        width: auto;
        padding: 0 18px;
    }

    body > .header_view > .download > .label {
        display: inline;
    }
}
