/* Tibyan Theme — Custom styles */

/* ── Self-hosted Fonts ───────────────────────────────────────
   Files downloaded from Google Fonts (woff2, latin + latin-ext).
   Path is relative to this CSS file: ../public/fonts/
────────────────────────────────────────────────────────────── */

/* Noto Serif — normal 400 & 700 (variable) */
@font-face {
    font-family: 'Noto Serif';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../public/fonts/noto-serif-normal-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Noto Serif';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../public/fonts/noto-serif-normal-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Noto Serif — italic 400 */
@font-face {
    font-family: 'Noto Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../public/fonts/noto-serif-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Noto Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../public/fonts/noto-serif-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Work Sans — normal 300–600 (variable) */
@font-face {
    font-family: 'Work Sans';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('../public/fonts/work-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Work Sans';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('../public/fonts/work-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Material Symbols variation settings */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

/* Geometric pattern background */
.geometric-pattern {
    position: relative;
}
.geometric-pattern::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("../public/images/pattern1.svg");
    background-repeat: repeat;
    background-size: 120px 120px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* Islamic pattern background */
.islamic-pattern {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l2.5 12.5L45 15l-12.5 2.5L30 30l-2.5-12.5L15 15l12.5-2.5L30 0zm0 60l2.5-12.5L45 45l-12.5-2.5L30 30l-2.5 12.5L15 45l12.5 2.5L30 60zM0 30l12.5-2.5L15 15l2.5 12.5L30 30l-12.5 2.5L15 45l-2.5-12.5L0 30zM60 30l-12.5-2.5L45 15l-2.5 12.5L30 30l12.5 2.5L45 45l2.5-12.5L60 30z' fill='%230d631b' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Font body default */
body {
    font-family: 'Work Sans', sans-serif;
    background-color: #faf9f6;
    color: #1a1c1a;
}

/* Hide default OJS chrome that conflicts with our full custom layout */
.pkp_structure_head,
.pkp_structure_footer,
.pkp_structure_sidebar,
.pkp_site_nav_toggle,
.cmp_skip_to_content {
    display: none !important;
}

/* Override OJS main content wrapper to fill full width */
.pkp_structure_page {
    padding: 0 !important;
}

.pkp_structure_content {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.pkp_structure_main {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    float: none !important;
}

/* Tailwind reset for OJS elements */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Line clamp utilities */
.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Transition helpers */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* ── PDF Viewer (pdfJsViewer plugin) ────────────────────────
   display.tpl renders a standalone page that loads all
   frontend stylesheets but NOT the default OJS theme CSS.
   These rules replace plugins/themes/default viewPdf.less.
──────────────────────────────────────────────────────────── */
.header_view {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    z-index: 100;
    background: #022c22;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}
.header_view a { color: #fff; text-decoration: none; font-size: 13px; }
.header_view .title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header_view .return { font-size: 20px; opacity: 0.8; }
.header_view .download {
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 4px;
}
.header_view .download:hover { background: rgba(255,255,255,0.25); }

.galley_view {
    position: fixed;
    top: 48px; left: 0; right: 0; bottom: 0;
    overflow: hidden;
}
.galley_view iframe {
    width: 100%; height: 100%;
    border: none; display: block;
}
.galley_view.galley_view_with_notice { top: 144px; }
.galley_view_notice {
    position: fixed;
    top: 48px; left: 0; right: 0;
    height: 96px;
    background: #b45309;
    display: flex; align-items: center; justify-content: center;
}
.galley_view_notice_message {
    color: #fff; font-weight: bold; text-align: center; padding: 0 16px;
}

/* ── Mobile Navigation Drawer ────────────────────────────────
   State controlled via custom classes — does NOT depend on
   tibyan-tailwind.css so it works even when OJS CSS cache
   has not been invalidated on production.
──────────────────────────────────────────────────────────── */
#tibyan-mobile-overlay {
    display: none;
}
#tibyan-mobile-overlay.tibyan-overlay-visible {
    display: block;
}
#tibyan-mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}
#tibyan-mobile-menu.tibyan-drawer-open {
    transform: translateX(0);
}
/* Hide drawer & overlay completely on desktop (lg = 1024px) */
@media (min-width: 1024px) {
    #tibyan-mobile-overlay,
    #tibyan-mobile-menu {
        display: none !important;
    }
}
