﻿/**
 * Galley Viewer Styles for MyTheme
 *
 * ROOT CAUSE: The default OJS theme includes viewPdf.less which styles
 * .galley_view, .header_view, #htmlContainer, #pdfCanvasContainer.
 * Since mytheme is standalone (no setParent), those styles are never loaded.
 * This file provides the missing styles plus sidebar layout.
 *
 * These pages are served by:
 *   - plugins/generic/htmlArticleGalley/templates/display.tpl
 *   - plugins/generic/pdfJsViewer/templates/display.tpl
 */

/* Visually-hidden helper used by OJS markup (e.g. inside .header_view .return)
   Without this rule the screen-reader-only text overflows out of buttons. */
.pkp_screen_reader {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   GALLEY HEADER BAR (return arrow + title + download)
   ============================================================ */
.header_view {
    z-index: 2;
    position: relative;
    background: #0d4261;
    display: flex;
    align-items: center;
    height: 3rem;
    padding: 0;
    transition: margin-right 0.3s ease;
}

.header_view a {
    line-height: 3rem;
    text-decoration: none;
    color: #fff;
}

.header_view .return {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: rgba(255,255,255,0.1);
    color: #fff;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.header_view .return:hover,
.header_view .return:focus {
    background: rgba(255,255,255,0.25);
}

.header_view .return::before {
    font-family: "bootstrap-icons";
    content: "\F12F";
    font-size: 1rem;
}

[dir="rtl"] .header_view .return::before {
    content: "\F138";
}

.header_view .title {
    flex: 1;
    padding: 0 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    color: #fff;
}

.header_view .title:hover,
.header_view .title:focus {
    background: rgba(255,255,255,0.08);
}

.header_view .download {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    height: 3rem;
    background: rgba(255,255,255,0.1);
    color: #fff;
    flex-shrink: 0;
    gap: 0.5rem;
    transition: background 0.2s ease;
}

.header_view .download:hover,
.header_view .download:focus {
    background: rgba(255,255,255,0.25);
}

.header_view .download::before {
    font-family: "bootstrap-icons";
    content: "\F128";
    font-size: 1rem;
}

/* ============================================================
   GALLEY VIEW CONTAINER (shared by HTML and PDF)
   ============================================================ */
.galley_view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    transition: right 0.3s ease;
}

.galley_view iframe {
    width: 100%;
    height: 100%;
    padding-top: 3rem;
    border: none;
    display: block;
}

.galley_view.galley_view_with_notice iframe {
    padding-top: 9rem;
}

.galley_view .galley_view_notice {
    position: absolute;
    top: 3rem;
    width: 100%;
    height: 6rem;
    background: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.galley_view .galley_view_notice_message {
    color: #fff;
    font-weight: 700;
    text-align: center;
    padding: 0 1rem;
}

.galley_view .galley_view_notice_message a {
    color: #fff;
    text-decoration: underline;
}

/* ============================================================
   HTML-SPECIFIC (#htmlContainer)
   ============================================================ */
#htmlContainer {
    overflow: hidden !important;
}

#htmlContainer iframe {
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   PDF-SPECIFIC (#pdfCanvasContainer)
   ============================================================ */
#pdfCanvasContainer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    transition: right 0.3s ease;
}

#pdfCanvasContainer iframe {
    min-height: 0 !important;
    width: 100%;
    height: 100%;
    padding-top: 3rem;
    border: none;
    display: block;
}

