/**
 * Ampla Theme — OJS Override Styles
 *
 * Resolves conflicts between OJS's default pkp_* classes
 * and INSPINIA's Bootstrap 5 layout system.
 * Loaded with STYLE_SEQUENCE_LATE priority (after app.min.css).
 */

/* INSPINIA 기본 링크색(--theme-link-color: #1ab394 고정 초록)을 테마 primary로 통일.
   본문 인라인 링크가 스킨 강조색을 따르도록 재정의 (라이트/다크 공통). */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --theme-link-color: var(--bs-primary);
    --theme-link-color-rgb: var(--bs-primary-rgb);
    --theme-link-hover-color-rgb: var(--bs-primary-rgb);
}

/* alert 박스 안 링크: 배경과 같은 primary 계열이라 묻히는 문제 해결.
   본문색(진한 emphasis) 상속 + 굵게/밑줄로 대비 강조 (구버전 경고·투고 안내 등). */
.alert a:not(.btn) {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}
.alert a:not(.btn):hover {
    text-decoration: none;
}

/* ═══════ Ampla CSS Custom Properties ═══════ */

:root {
    /* Spacing scale (consistent across all pages) */
    --ampla-gap: 1rem;
    --ampla-gap-sm: 0.5rem;
    --ampla-gap-lg: 1.5rem;
    --ampla-gap-xl: 2rem;

    /* Card styling */
    --ampla-card-radius: var(--bs-border-radius);
    --ampla-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

    /* Typography */
    --ampla-font-size-sm: 0.8125rem;
    --ampla-font-size-base: 0.875rem;

    /* Accent colors (inherits from Bootstrap, overridable per skin) */
    --ampla-accent: var(--bs-primary);
    --ampla-accent-rgb: var(--bs-primary-rgb);

    /* Semantic surfaces */
    --ampla-surface: var(--bs-body-bg);
    --ampla-surface-alt: var(--bs-tertiary-bg);
    --ampla-text-primary: var(--bs-body-color);
    --ampla-text-secondary: var(--bs-secondary-color);
    --ampla-border: var(--bs-border-color);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] {
    --ampla-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    --ampla-surface-alt: var(--bs-tertiary-bg);
}

/* ═══════ Reset OJS default layout classes ═══════ */

.pkp_structure_page,
.pkp_structure_content,
.pkp_structure_main,
.pkp_structure_sidebar {
    display: block;
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
    max-width: none;
}

.pkp_structure_head,
.pkp_structure_footer {
    display: block;
    margin: 0;
    padding: 0;
}

/* Hide OJS default navigation (replaced by INSPINIA sidenav/topbar) */
.pkp_navigation_primary_wrapper,
.pkp_navigation_user_wrapper,
.pkp_head_wrapper {
    display: none !important;
}

/* ═══════ Content area ═══════ */
/* .content-page layout is handled by INSPINIA _layout.scss */

.content-page > .container-fluid {
    padding-top: 0;
    padding-bottom: var(--ampla-gap-xl);
}

/* ═══════ Page title & breadcrumb ═══════ */
/* .page-title-head is styled by INSPINIA _layout.scss */
/* Ensure it sticks right below topbar with no gap */

/* ═══════ Cards ═══════ */
/* .card, .card-header, .card-body are styled by INSPINIA _card.scss */
/* No overrides needed */

/* ═══════ Article page ═══════ */

.article-details {
    margin-bottom: var(--ampla-gap-lg);
}

.article-details .article-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    color: var(--ampla-text-primary);
}

.article-details .authors {
    color: var(--ampla-text-secondary);
    margin-bottom: var(--ampla-gap);
}

.article-details .abstract {
    line-height: 1.75;
    color: var(--ampla-text-primary);
}
/* 초록 문단 첫 줄 들여쓰기 (TinyMCE 리치텍스트 → <p> 래핑 기준).
 * 평문/단일 문단 초록은 .abstract 의 첫 줄만 들여쓰기되도록 폴백. */
.article-details .abstract p {
    text-indent: 1.5em;
}
.article-details .abstract p:empty {
    text-indent: 0;
}

.article-details .keywords .keyword,
.article-details .badge.bg-light {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    border-radius: var(--ampla-card-radius);
    background-color: var(--ampla-surface-alt);
    color: var(--ampla-text-primary);
    font-size: var(--ampla-font-size-sm);
}

.article-details .orcid-link {
    color: #a6ce39;
    text-decoration: none;
    margin-left: 0.125rem;
}

.article-details .orcid-link:hover {
    color: #8aad2e;
}

/* ═══════ Galley links ═══════ */

.galley-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: var(--ampla-font-size-base);
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    background-color: var(--ampla-accent);
    border: 1px solid var(--ampla-accent);
    border-radius: var(--ampla-card-radius);
    text-decoration: none;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.galley-link:hover,
.galley-link:focus {
    color: #fff;
    background-color: color-mix(in srgb, var(--ampla-accent) 85%, black);
    border-color: color-mix(in srgb, var(--ampla-accent) 85%, black);
    text-decoration: none;
}

/* ═══════ Issue TOC ═══════ */

.issue-toc .section,
.issue-toc-section {
    margin-bottom: var(--ampla-gap-lg);
}

.issue-toc .section-title,
.issue-toc-section h5 {
    font-size: 1.125rem;
    font-weight: 600;
    padding-bottom: var(--ampla-gap-sm);
    border-bottom: 1px solid var(--ampla-border);
    margin-bottom: 0.75rem;
    color: var(--ampla-text-primary);
}

/* ═══════ Search results ═══════ */

.search-results .search-result-item {
    padding: var(--ampla-gap) 0;
    border-bottom: 1px solid var(--ampla-border);
}

.search-results .search-result-item:last-child {
    border-bottom: none;
}

/* ═══════ Article summary in lists ═══════ */

.article-summary {
    padding: var(--ampla-gap);
    margin-bottom: var(--ampla-gap-sm);
    border: 1px solid var(--ampla-border);
    border-radius: var(--ampla-card-radius);
    background-color: var(--ampla-surface);
    transition: box-shadow 0.15s ease-in-out;
}

.article-summary:hover {
    box-shadow: var(--ampla-card-shadow);
}

.article-summary .article-summary-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.article-summary .article-summary-title a {
    color: var(--ampla-text-primary);
    text-decoration: none;
}

.article-summary .article-summary-title a:hover {
    color: var(--ampla-accent);
}

.article-summary .article-summary-authors {
    font-size: var(--ampla-font-size-base);
    color: var(--ampla-text-secondary);
    margin-bottom: 0.25rem;
}

/* ═══════ Pagination ═══════ */

.cmp_pagination {
    display: flex;
    justify-content: center;
    padding: var(--ampla-gap-lg) 0;
}

.cmp_pagination .page-link {
    padding: 0.375rem 0.75rem;
}

/* ═══════ Announcements ═══════ */

.announcement-summary {
    padding: var(--ampla-gap);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--ampla-accent);
    background-color: var(--ampla-surface-alt);
    border-radius: 0 var(--ampla-card-radius) var(--ampla-card-radius) 0;
}

/* Individual announcement detail page */
.announcement-full .announcement-date {
    color: var(--ampla-text-secondary);
    font-size: var(--ampla-font-size-base);
    margin-bottom: var(--ampla-gap);
}

.announcement-full .announcement-body {
    line-height: 1.7;
}

/* ═══════ Sidebar blocks as cards ═══════ */

.ojs-sidebar-block {
    margin-bottom: var(--ampla-gap);
}

.ojs-sidebar-block .card-header {
    font-weight: 600;
    font-size: var(--ampla-font-size-base);
}

.ojs-sidebar-block .card-body {
    font-size: var(--ampla-font-size-sm);
}

.ojs-sidebar-block ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.ojs-sidebar-block ul li {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--ampla-border);
}

.ojs-sidebar-block ul li:last-child {
    border-bottom: none;
}

.ojs-sidebar-block ul li a {
    text-decoration: none;
    color: var(--ampla-text-primary);
    transition: color 0.15s;
}

.ojs-sidebar-block ul li a:hover {
    color: var(--ampla-accent);
}

/* ═══════ Auth pages (login/register/reset) — INSPINIA card layout ═══════ */

.auth-box {
    min-height: 100vh;
    padding: 1.5rem 0;
    background-color: var(--bs-body-bg);
}

.auth-box .card {
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.08);
    border: none;
}

.auth-box .auth-brand img {
    max-height: 48px;
}

.auth-box .auth-overlay {
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.65) 100%);
}

.auth-box .card-side-img {
    background-size: cover;
    background-position: center;
}

.auth-box .input-group-text {
    border-right: 0;
}

.auth-box .input-group .form-control {
    border-left: 0;
}

.auth-box .input-group .form-control:focus {
    box-shadow: none;
    border-color: var(--bs-border-color);
}

.auth-box .input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15);
    border-radius: var(--bs-border-radius);
}

.auth-box .input-group:focus-within .input-group-text,
.auth-box .input-group:focus-within .form-control {
    border-color: var(--bs-primary);
}

/* Register form — no height constraint, full page display */
.ampla-auth-register {
    max-height: none;
    overflow-y: visible;
}

/* OJS form error styling within auth context */
.auth-box .pkp_form_error {
    margin-bottom: 1rem;
}

/* ALTCHA widget in auth */
.auth-box .altcha_wrapper {
    border: none;
    padding: 0;
    margin: 0;
}

/* ═══════ Error pages ═══════ */

.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--ampla-accent);
}

/* ═══════ Empty states ═══════ */

.ampla-empty-state {
    text-align: center;
    padding: var(--ampla-gap-xl) var(--ampla-gap);
    color: var(--ampla-text-secondary);
}

.ampla-empty-state i {
    font-size: 2.5rem;
    margin-bottom: var(--ampla-gap);
    display: block;
    opacity: 0.5;
}

/* ═══════ Language selector — INSPINIA style (img flags) ═══════ */
/* Uses <img> with height="18" and class="rounded" — same as INSPINIA original */
/* No custom CSS needed — Bootstrap rounded + height attr handle styling */

/* ═══════ Topbar ═══════ */
/* Topbar layout is handled by INSPINIA _topbar.scss — flat flex children */

/* ═══════ Sidenav divider ═══════ */

.sidenav-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1rem;
    opacity: 1;
}

[data-menu-color="light"] .sidenav-divider {
    border-color: rgba(0, 0, 0, 0.08);
}

/* ═══════ Sidenav menu — INSPINIA style supplements ═══════ */
/*
 * menu-icon, menu-text, menu-arrow, side-nav-link, side-nav-title,
 * sub-menu, side-nav-item — all styled by INSPINIA app.min.css.
 * Only OJS-specific overrides below.
 */

/* Sidenav logo alignment — controlled by data-logo-align attribute */
.sidenav-menu > a.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

html[data-logo-align="start"] .sidenav-menu > a.logo {
    justify-content: flex-start;
}

html[data-logo-align="end"] .sidenav-menu > a.logo {
    justify-content: flex-end;
}

/* Hide OJS default pkp_nav_list styling */
.sidenav-menu .pkp_nav_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Sidenav user name */
.sidenav-menu .sidenav-user-name {
    font-size: 0.9375rem;
}

/* ═══════ Sidenav user avatar ═══════ */

.ampla-avatar {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: block;
}

.ampla-avatar-placeholder {
    width: 64px;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    display: inline-flex;
}

[data-bs-theme="dark"] .ampla-avatar {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .ampla-avatar-placeholder {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ═══════ Sidenav user stats accordion ═══════ */

.ampla-stats-toggle {
    text-decoration: none;
    color: inherit;
    padding: 0.25rem 0;
    cursor: pointer;
    transition: opacity 0.15s;
    font-size: 0.875rem;
    overflow: hidden;
}

.ampla-stats-toggle > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.ampla-stats-toggle:hover {
    color: inherit;
    opacity: 0.85;
}

.ampla-stats-toggle .ampla-stats-arrow {
    transition: transform 0.2s;
}

.ampla-stats-toggle[aria-expanded="true"] .ampla-stats-arrow {
    transform: rotate(180deg);
}

.ampla-stats-toggle[aria-expanded="true"] .ampla-stats-badges .badge {
    display: none;
}

.ampla-stats-badges .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.ampla-stats-badges .badge.text-warning {
    color: #ffc107 !important;
}

/* ═══════ Sidenav user stats ═══════ */

.sidenav-user-stats {
    font-size: var(--ampla-font-size-sm);
}

.sidenav-user-stats .rounded {
    min-height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidenav-user-stats .fs-11 {
    font-size: 0.625rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidenav-user-stats .fw-bold {
    font-size: 1rem;
    line-height: 1.2;
}

/* ═══════ Footer ═══════ */
/* .footer is styled by INSPINIA _footer.scss (margin-top: auto, border-top, bg) */
/* No overrides needed */

/* ═══════ Print styles ═══════ */

@media print {
    .sidenav-menu,
    .app-topbar,
    .footer,
    .ojs-sidebar-block,
    .page-title-head .breadcrumb,
    .galley-buttons,
    .btn {
        display: none !important;
    }

    .content-page {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    .card-header {
        background: none !important;
        border-bottom: 1px solid #ccc !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    a[href^="#"]::after,
    a[href^="javascript"]::after,
    .article-summary-title a::after {
        content: none;
    }
}

/* ═══════ OJS form elements in Bootstrap context ═══════ */

.pkp_form input[type="text"],
.pkp_form input[type="email"],
.pkp_form input[type="password"],
.pkp_form input[type="url"],
.pkp_form input[type="search"],
.pkp_form textarea,
.pkp_form select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: var(--ampla-font-size-base);
    line-height: 1.5;
    color: var(--ampla-text-primary);
    background-color: var(--ampla-surface);
    border: 1px solid var(--ampla-border);
    border-radius: var(--ampla-card-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.pkp_form input:focus,
.pkp_form textarea:focus,
.pkp_form select:focus {
    border-color: var(--ampla-accent);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(var(--ampla-accent-rgb), 0.25);
}

.pkp_form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: var(--ampla-font-size-base);
    color: var(--ampla-text-primary);
}

.pkp_form .pkp_button,
.pkp_form button[type="submit"] {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: var(--ampla-font-size-base);
    font-weight: 500;
    color: #fff;
    background-color: var(--ampla-accent);
    border: 1px solid var(--ampla-accent);
    border-radius: var(--ampla-card-radius);
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.pkp_form .pkp_button:hover,
.pkp_form button[type="submit"]:hover {
    background-color: color-mix(in srgb, var(--ampla-accent) 85%, black);
    border-color: color-mix(in srgb, var(--ampla-accent) 85%, black);
}

/* ═══════ Responsive — INSPINIA breakpoint parity ═══════ */

/* Smooth margin transitions for sidebar mode changes */
.content-page {
    transition: margin-inline-start 0.25s ease-in-out;
}

.app-topbar {
    transition: margin-inline-start 0.25s ease-in-out;
}

/* Ultra-small screens (≤375px) — hide topbar logo */
@media (max-width: 375px) {
    .logo-topbar {
        display: none !important;
    }
}

/* Small screens (≤576px) — dropdown width constraint */
@media (max-width: 576px) {
    .app-topbar .dropdown {
        position: static;
    }

    .app-topbar .dropdown .dropdown-menu {
        width: 90%;
        margin-left: 5%;
    }
}

/* Mobile (≤767px) — typography + layout */
@media (max-width: 767.98px) {
    .page-title-head {
        flex-direction: column;
        align-items: flex-start !important;
        gap: var(--ampla-gap-sm);
    }

    .page-title-head .breadcrumb {
        font-size: 0.75rem;
    }

    .article-details .article-title {
        font-size: 1.25rem;
    }

    .error-page h1 {
        font-size: 3rem;
    }

    /* Sidenav overlay backdrop handled by JS (ampla-sidenav-backdrop) */

    /* Auth card adjustments */
    .auth-box {
        min-height: auto;
        padding: 1rem 0;
    }

    .auth-box .card-body {
        padding: 1.5rem !important;
    }

    /* Sidenav stats compact on mobile */
    .sidenav-user-stats .rounded {
        min-height: 40px;
    }

    /* Article summary: stack galley (PDF) buttons above the title so the
       title/abstract use the full mobile width */
    .article-summary-row {
        flex-direction: column;
    }

    .article-summary-row .article-summary-galleys {
        order: -1;
        margin-bottom: 0.5rem;
    }
}

/* Tablet (768–1140px) — condensed sidebar adjustments */
@media (min-width: 768px) and (max-width: 1140px) {
    /* Hide user stats in condensed mode (too narrow) */
    html[data-sidenav-size='condensed'] .sidenav-user-stats {
        display: none;
    }

    /* Hide user info text in condensed mode */
    html[data-sidenav-size='condensed'] .ampla-user-info {
        display: none;
    }

    /* Hide dashboard link in condensed mode */
    html[data-sidenav-size='condensed'] .sidenav-user + .sidenav-user-stats + a {
        display: none;
    }
}

/* Scrollable layout mode (≥992px) */
@media (min-width: 992px) {
    html[data-layout-position='scrollable'] .content-page {
        position: relative;
        min-height: max-content;
    }

    html[data-layout-position='scrollable'] .sidenav-menu {
        position: absolute;
    }

    html[data-layout-position='scrollable'] .logo,
    html[data-layout-position='scrollable'] .app-topbar {
        position: static;
    }
}

/* Boxed layout mode (≥1400px) */
@media (min-width: 1400px) {
    html[data-layout-width='boxed'] body {
        background-color: var(--bs-tertiary-bg);
    }

    html[data-layout-width='boxed'] .wrapper {
        margin: 0 auto;
        max-width: 1340px;
        box-shadow: var(--bs-box-shadow);
    }
}

/* 사이트 홈 아이콘 — topbar */
.ampla-home-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    background: #fff;
    padding: 1px;
}

/* ═══════ 저널 인덱스 — 히어로 배너 ═══════ */
.ampla-journal-hero {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ampla-journal-hero-gradient {
    background: linear-gradient(135deg, var(--bs-primary), #1e2a3a);
}
.ampla-journal-hero-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.ampla-journal-hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, var(--ampla-hero-overlay, 0.2));
}
.ampla-journal-hero-content {
    z-index: 1;
}
@media (max-width: 767.98px) {
    .ampla-journal-hero { min-height: 160px; }
    .ampla-journal-hero-content h1 { font-size: 1.5rem !important; }
}

/* ═══════ 저널 인덱스 — Highlights 캐러셀 ═══════ */
.ampla-highlight-card {
    background: var(--bs-tertiary-bg);
}
.ampla-highlight-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#ampla-highlights-carousel .carousel-control-prev,
#ampla-highlights-carousel .carousel-control-next {
    width: 5%;
    opacity: 0.6;
}
#ampla-highlights-carousel .carousel-control-prev:hover,
#ampla-highlights-carousel .carousel-control-next:hover {
    opacity: 1;
}

/* ═══════ 논문 요약 — 초록/키워드 강화 ═══════ */
.article-summary-abstract {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.article-summary-keywords .badge {
    font-weight: 500;
    font-size: 0.7rem;
}
.article-summary {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}
.article-summary:last-child {
    border-bottom: 0;
}
.article-summary-title a {
    text-decoration: none;
    color: var(--bs-heading-color);
}
.article-summary-title a:hover {
    color: var(--bs-primary);
}

/* ───────────────────────────────────────────────
   PDF 갤리 뷰 (pdfJsViewer display.tpl) 전체 화면
   amplaBase에 갤리뷰 CSS가 없어 iframe이 min-height:500px로만 표시되어
   화면 절반만 차지하던 문제 해결. OJS 기본 테마(viewPdf.less)의
   fixed+padding 방식을 Bootstrap 변수로 이식 (box-sizing: border-box 전제).
─────────────────────────────────────────────── */
.header_view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 48px;
    padding: 0 1rem;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
}
.header_view .title {
    font-weight: 600;
    text-decoration: none;
    color: var(--bs-heading-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header_view .download {
    margin-left: auto;
    white-space: nowrap;
    text-decoration: none;
    color: var(--bs-primary);
}
#pdfCanvasContainer.galley_view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}
#pdfCanvasContainer.galley_view iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding-top: 48px;
    border: none;
}
#pdfCanvasContainer.galley_view_with_notice iframe {
    padding-top: 96px;
}
#pdfCanvasContainer .galley_view_notice {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 0.5rem;
    background: var(--bs-warning-bg-subtle);
    text-align: center;
}

/* ─── Citation Style Language 블록 (사이드바 카드) ───
 * 플러그인 CSS(citationStyleLanguagePlugin.css)가 STYLE_SEQUENCE_LAST 로 나중에
 * 로드되므로, 동일/더 높은 특이도로 재정의해야 한다. 플러그인은 FontAwesome 캐럿
 * (:after \f0d7)과 외곽 테두리를 넣는데, INSPINIA에는 FontAwesome가 없어 깨진다.
 */
.citation-card .citation_display .citation_formats {
    margin-top: 0.75rem;
    border: 0;
    border-radius: 0;
}
/* 토글 버튼은 Bootstrap btn 사용 — 플러그인 FontAwesome 캐럿 무력화 */
.citation-card .citation-formats-toggle::after {
    content: none;
}
/* 플러그인 규칙 .citation_display [aria-hidden="true"]{display:none} 가 ti 아이콘까지
 * 숨기므로, citation_display 내부 <i> 아이콘은 다시 표시한다(드롭다운 div는 그대로 숨김 유지). */
.citation-card .citation_display i[aria-hidden="true"] {
    display: inline-block;
}
.citation-card .citation-formats-caret {
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}
.citation-card .citation-formats-toggle[aria-expanded="true"] .citation-formats-caret {
    transform: rotate(180deg);
}
/* 드롭다운 토글: aria-hidden 으로 표시/숨김 (articleCitation.js 가 제어) */
.citation-card #cslCitationFormats[aria-hidden="true"] {
    display: none;
}
.citation-card .citation_formats_list {
    overflow: hidden;
}
.citation-card .citation_display .citation_formats_styles a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--bs-primary);
    border-bottom: 1px solid var(--bs-border-color);
}
.citation-card .citation_display .citation_formats_styles a:hover {
    background: var(--bs-tertiary-bg);
}
.citation-card .citation_display .citation_formats_styles li:last-child a {
    border-bottom: 0;
}
.citation-card .citation-formats-heading {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.75rem;
}
/* 인용 복사 버튼 */
.citation-card .citation-copy-btn {
    line-height: 1;
    text-decoration: none;
    border: 0;
}
.citation-card .citation-copy-btn:hover .citation-copy-icon {
    color: var(--bs-primary);
}
.citation-card .citation-copy-icon {
    font-size: 1.05rem;
}
.citation-card #citationOutput {
    line-height: 1.6;
    word-break: break-word;
}

/* ─── 참고문헌 목록: 매달린 들여쓰기(hanging indent) + 행간 ───
 * OJS는 참고문헌을 줄 단위 평문으로만 저장하므로 필드 단위(제목 이탤릭 등)
 * 서식은 불가. 스타일 무관하게 통용되는 들여쓰기·간격만 적용한다.
 * <ol class="references-list"><li> 구조: 번호는 좌측 거터에, 본문은 매달려
 * 줄바꿈 시 본문 시작선에 정렬된다(표준 인용 관행). */
.references-list {
    padding-left: 2rem;
    margin-bottom: 0;
}
.references-list li {
    padding-left: 0.35rem;
    margin-bottom: 0.6rem;
    line-height: 1.6;
}
.references-list li:last-child {
    margin-bottom: 0;
}
.references-list li::marker {
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
}
.references-list a {
    word-break: break-word;
}

/* 저자 정보(Details 카드 하단): 소속·약력. 좁은 사이드바에서 넘침 방지 */
.author-info .author-info-item {
    font-size: 0.85rem;
    line-height: 1.5;
}
.author-info .author-bio {
    color: var(--bs-secondary-color);
    overflow-wrap: break-word;
    word-break: break-word;
}
.author-info .author-bio :is(img, table, iframe, video) {
    max-width: 100%;
    height: auto;
}
.author-info .author-bio p:last-child {
    margin-bottom: 0;
}

/* Details(Article Info) 표: 라벨/값 열맞춤. 값이 길어 줄바꿈돼도 라벨은 상단 정렬 */
.article-info-table td {
    vertical-align: top;
}
/* 라벨 열: 좌측 패딩 제거 → 아래 Authors 블록(패딩 없는 div)과 좌측 정렬 일치 */
.article-info-table td:first-child {
    white-space: nowrap;
    width: 1%;
    padding-left: 0;
    padding-right: 0.75rem;
}

/* 사이드바 카드 접기/펴기 (Details/Keywords/License) */
.ampla-collapse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}
.ampla-collapse-header .ampla-collapse-icon {
    flex-shrink: 0;
    color: var(--bs-secondary-color);
    transition: transform 0.2s ease;
}
.ampla-collapse-header.collapsed .ampla-collapse-icon {
    transform: rotate(-90deg);
}
.ampla-collapse-header:hover .ampla-collapse-icon {
    color: var(--bs-primary);
}
.ampla-collapse-header:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

/* ═══════ 호 표지 이미지 — 여백(매트) + 테두리 프레임 ═══════ */
/* 저널 홈(현재호)·호 보기·호 아카이브의 표지 이미지에 이미지와 테두리 사이 간격을 두어 액자 느낌.
   ※ INSPINIA는 --theme-* CSS 변수를 사용하며 --bs-*(border-color/body-bg 등)는 미정의라,
   var(--bs-border-color)를 쓰면 border 선언이 무효화되어 테두리가 아예 안 그려진다.
   --theme-* 변수 + 명시적 hex 폴백을 사용하고, 확실히 보이도록 gray-500 톤 + 옅은 그림자. */
.ampla-cover-img {
    padding: 0.375rem;
    background-color: var(--theme-body-bg, #fff);
    border: 1px solid var(--theme-gray-300, #e7e9eb);
    border-radius: var(--theme-border-radius, 0.375rem);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ═══════ 논문 보기 우측 저자 목록 — 약력 내 저자 이미지 테두리 + 여백 ═══════ */
/* 약력(biography) HTML 안에 삽입된 저자 사진(allowed_html img 허용)에 프레임 적용.
   선택자를 .author-info .author-bio img 로 두어 기존 max-width/height 규칙과 명시도를 맞춤. */
.author-info .author-bio img {
    padding: 0.25rem;
    background-color: var(--theme-body-bg, #fff);
    border: 1px solid var(--theme-gray-300, #e7e9eb);
    border-radius: var(--theme-border-radius, 0.375rem);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    max-width: 100%;
    height: auto;
}
