/*
 * Journal System - Frontend Styles
 * Self-contained: header, footer, three-column layout, all components.
 */

/* =============== RESET / BASE =============== */
.ashbar-journal-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #222;
    background: #f0f0f0;
}

/* =============== SITE HEADER =============== */
.ashbar-site-header {
    background: #3d4d5f;
    color: #fff;
    padding: 0;
}

.ashbar-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.ashbar-site-title {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    font-style: italic;
    line-height: 1.2;
}

.ashbar-site-title a {
    color: #fff;
    text-decoration: none;
}

.ashbar-site-title a:hover {
    opacity: 0.9;
}

/* Navigation */
.ashbar-main-nav {
    flex-shrink: 0;
}

.ashbar-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.ashbar-nav-list li {
    position: relative;
}

.ashbar-nav-list li a {
    display: block;
    padding: 8px 14px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.ashbar-nav-list li a:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Dropdown menus */
.ashbar-nav-list li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2c3a48;
    list-style: none;
    margin: 0;
    padding: 5px 0;
    min-width: 200px;
    z-index: 1000;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ashbar-nav-list li:hover > ul {
    display: block;
}

.ashbar-nav-list li ul li a {
    padding: 6px 16px;
    font-size: 0.85em;
    border-radius: 0;
}

/* Third-level dropdown */
.ashbar-nav-list li ul li ul {
    top: 0;
    left: 100%;
}

@media (max-width: 768px) {
    .ashbar-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .ashbar-nav-list {
        flex-direction: column;
        width: 100%;
    }
    .ashbar-nav-list li ul {
        position: static;
        box-shadow: none;
        padding-left: 15px;
        display: block;
    }
    .ashbar-nav-list li ul li ul {
        position: static;
    }
}

/* =============== PAGE LAYOUT =============== */
.ashbar-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 280px) 1fr minmax(0, 280px);
    grid-template-areas: "archive main meta";
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.ashbar-sidebar-meta    { grid-area: meta; }
.ashbar-main            { grid-area: main; }
.ashbar-sidebar-archive { grid-area: archive; }

@media (max-width: 1024px) {
    .ashbar-page-layout {
        grid-template-columns: 25% 1fr;
        grid-template-areas:
            "meta main"
            "archive archive";
    }
    .ashbar-sidebar-archive {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .ashbar-page-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "meta"
            "archive";
    }
}

/* =============== SIDEBAR SHARED =============== */
.ashbar-sidebar {
    font-size: 0.9em;
    line-height: 1.5;
}

/* =============== ARTICLE HEADER =============== */
.ashbar-article-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.ashbar-article-title {
    font-size: 1.8em;
    line-height: 1.3;
    margin: 0 0 20px 0;
}

/* =============== AUTHORS =============== */
.ashbar-authors {
    margin-top: 15px;
}

.ashbar-authors-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
}

.ashbar-authors-list li.ashbar-author {
    display: inline;
    margin-right: 4px;
}

.ashbar-authors-list li.ashbar-author:not(:last-child)::after {
    content: ", ";
}

.ashbar-author-name {
    font-weight: 500;
}

.ashbar-author-affnum {
    font-size: 0.75em;
    margin-left: 2px;
}

.ashbar-author-corresponding {
    margin-left: 1px;
}

.ashbar-affiliations-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    font-size: 0.9em;
    color: #555;
}

.ashbar-affiliations-list li {
    margin-bottom: 3px;
}

.ashbar-corresponding-note {
    font-size: 0.85em;
    color: #555;
    font-style: italic;
    margin: 5px 0;
}

/* =============== ABSTRACT =============== */
.ashbar-abstract {
    margin: 25px 0;
    padding: 20px;
    background: #f9f9f9;
    border-left: 3px solid #2271b1;
}

.ashbar-abstract-heading {
    font-size: 1.1em;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ashbar-abstract-body {
    line-height: 1.6;
}

/* =============== KEYWORDS =============== */
.ashbar-keywords {
    margin: 20px 0;
    font-size: 0.95em;
}

.ashbar-keywords-label {
    font-weight: 600;
}

.ashbar-keyword {
    text-decoration: none;
}

.ashbar-keyword:hover {
    text-decoration: underline;
}

/* =============== ARTICLE CONTENT =============== */
.ashbar-article-content {
    margin-top: 30px;
    line-height: 1.7;
}

/* =============== META (LEFT SIDEBAR) =============== */
.ashbar-article-meta {
    margin: 0 0 20px 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
}

.ashbar-meta-label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.ashbar-meta-value {
    margin: 0;
    color: #222;
    word-break: break-word;
}

.ashbar-meta-value a {
    text-decoration: none;
}

.ashbar-meta-value a:hover {
    text-decoration: underline;
}

/* =============== PDF BUTTON =============== */
.ashbar-pdf-wrapper {
    margin: 15px 0;
}

.ashbar-pdf-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #c53030;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.15s ease;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.ashbar-pdf-button:hover {
    background: #9b2020;
    color: #fff !important;
}

.ashbar-pdf-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ashbar-pdf-label {
    font-size: 0.95em;
}

/* =============== CITATION (LEFT SIDEBAR) =============== */
.ashbar-citation {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.ashbar-citation-heading {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.ashbar-citation-text {
    margin: 0 0 10px 0;
    line-height: 1.5;
    font-size: 0.85em;
    color: #222;
}

.ashbar-citation-text a {
    word-break: break-all;
}

.ashbar-copy-btn {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.8em;
    cursor: pointer;
    color: #333;
    transition: background 0.15s ease;
}

.ashbar-copy-btn:hover {
    background: #e0e0e0;
}

/* =============== ISSUES ARCHIVE (RIGHT SIDEBAR) =============== */
.ashbar-issues-archive-heading {
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #2271b1;
    font-weight: 600;
}

.ashbar-volumes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ashbar-volumes-list > li.ashbar-volume {
    margin-bottom: 10px;
}

.ashbar-volumes-list > li.ashbar-volume > a {
    font-weight: 600;
    text-decoration: none;
    color: #222;
}

.ashbar-volumes-list > li.ashbar-volume > a:hover {
    color: #2271b1;
}

.ashbar-issues-list {
    list-style: none;
    padding: 0 0 0 15px;
    margin: 4px 0 0 0;
}

.ashbar-issues-list li.ashbar-issue {
    margin-bottom: 3px;
}

.ashbar-issues-list li.ashbar-issue a {
    text-decoration: none;
    color: #555;
    font-size: 0.95em;
}

.ashbar-issues-list li.ashbar-issue a:hover {
    color: #2271b1;
}

li.ashbar-current > a {
    color: #2271b1 !important;
    font-weight: 700 !important;
}

/* =============== SITE FOOTER =============== */
.ashbar-site-footer {
    background: #3d4d5f;
    color: #ccc;
    margin-top: 40px;
    padding: 0;
}

.ashbar-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.ashbar-copyright {
    margin: 0;
    font-size: 0.85em;
}

/* =============== MAIN CONTENT AREA BACKGROUND =============== */
.ashbar-main {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
}

.ashbar-sidebar {
    padding-top: 10px;
}

/* =============== RECENT ARTICLES =============== */
.ashbar-recent-articles {
    margin: 20px 0;
}

.ashbar-ra-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.ashbar-ra-item:last-child {
    border-bottom: none;
}

.ashbar-ra-main {
    flex: 1;
    min-width: 0;
}

.ashbar-ra-title-wrap {
    font-size: 1.05em;
    margin: 0 0 5px 0;
    line-height: 1.4;
}

.ashbar-ra-title-wrap a {
    text-decoration: none;
    color: #2271b1;
}

.ashbar-ra-title-wrap a:hover {
    text-decoration: underline;
}

.ashbar-ra-authors {
    font-size: 0.9em;
    color: #555;
}

.ashbar-ra-vi {
    font-size: 0.85em;
    color: #777;
}

.ashbar-ra-vi::before {
    content: " — ";
}

.ashbar-ra-actions {
    flex-shrink: 0;
    padding-top: 2px;
}

.ashbar-ra-pdf {
    display: inline-block;
    padding: 4px 10px;
    background: #c53030;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    transition: background 0.15s ease;
}

.ashbar-ra-pdf:hover {
    background: #9b2020;
}

/* =============== REGULAR PAGES =============== */
.ashbar-page-title {
    font-size: 1.8em;
    line-height: 1.3;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.ashbar-page-content {
    line-height: 1.7;
}

/* When left sidebar is empty, shift to two-column layout */
.ashbar-page-layout-page {
    grid-template-columns: 1fr minmax(0, 280px);
    grid-template-areas: "main archive";
}

@media (max-width: 768px) {
    .ashbar-page-layout-page,
    .ashbar-page-layout-archive {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "archive";
    }
}

/* =============== ARCHIVE PAGES =============== */
.ashbar-archive-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2271b1;
}

.ashbar-archive-title {
    font-size: 1.6em;
    margin: 0;
    line-height: 1.3;
}

.ashbar-archive-description {
    margin-top: 10px;
    color: #555;
    line-height: 1.6;
}

/* Pagination */
.ashbar-pagination,
.navigation.pagination {
    margin: 30px 0;
    text-align: center;
}

.navigation.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.navigation.pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
}

.navigation.pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.navigation.pagination .page-numbers:hover:not(.current) {
    background: #e0e0e0;
}