/* ============================================================
   Journal Hub — Design System
   Subject: multi-journal academic publishing platform.
   Signature: articles read like bound-journal index cards —
   a gold "spine" accent on hover, bibliographic metadata set in
   monospace like library call numbers, titles in Ubuntu (RatechPlus
   brand typeface), self-hosted — no CDN dependency.
   ============================================================ */

@font-face {
    font-family: 'Ubuntu';
    src: url('../vendor/fonts/ubuntu/Ubuntu-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Ubuntu';
    src: url('../vendor/fonts/ubuntu/Ubuntu-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Ubuntu';
    src: url('../vendor/fonts/ubuntu/Ubuntu-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Ubuntu';
    src: url('../vendor/fonts/ubuntu/Ubuntu-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Color */
    --ink:        #16233F;   /* primary text, headers, primary buttons */
    --ink-soft:   #4A5468;   /* secondary text */
    --ink-faint:  #8891A3;   /* tertiary / placeholder text */
    --paper:      #F5F4EF;   /* page background — warm, not stark white */
    --paper-raised: #FFFFFF;/* card surfaces */
    --paper-line: #E4E1D6;  /* hairline borders on paper */
    --gold:       #B8862E;  /* signature accent */
    --gold-dark:  #8C6621;
    --gold-tint:  #F3E9D3;  /* pale gold wash for badges */
    --oxblood:    #7A2E2E;  /* danger / rejected */
    --oxblood-tint: #F3E0DE;
    --forest:     #2F6844;  /* success / published */
    --forest-tint:#DDEAE1;

    /* Type — Ubuntu throughout (self-hosted above), monospace for
       bibliographic metadata (ISSN/DOI/dates), no external fonts */
    --font-display: 'Ubuntu', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Ubuntu', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", "Segoe UI Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    margin: 0;
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }

/* ---------------- Masthead / navbar ---------------- */
.navbar {
    background: var(--ink);
    color: #fff;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    border-bottom: 3px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 300;
}
.navbar a {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    margin-left: 20px;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.navbar a:hover { color: #fff; }
.navbar .brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.2px;
    color: #fff;
}

.container { max-width: 900px; margin: 0 auto; padding: 32px 20px 60px; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--paper-raised);
    border: 1px solid var(--paper-line);
    border-radius: 4px;
    padding: 26px;
    box-shadow: 0 1px 2px rgba(22,35,63,0.05);
    margin-bottom: 20px;
}
.card h2, .card h3 {
    font-family: var(--font-display);
    color: var(--ink);
}

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
input[type=text], input[type=email], input[type=password], input[type=file], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--paper-line);
    border-radius: 3px;
    font-size: 14.5px;
    font-family: var(--font-body);
    background: var(--paper-raised);
    color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-tint);
}
textarea { min-height: 120px; resize: vertical; }

/* ---------------- Buttons ---------------- */
.btn {
    background: var(--ink);
    color: #fff;
    border: 1px solid var(--ink);
    padding: 10px 20px;
    border-radius: 3px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: #0e1830; border-color: #0e1830; }
.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--paper-line);
}
.btn-secondary:hover { border-color: var(--ink); background: var(--paper); }

/* ---------------- Alerts ---------------- */
.alert { padding: 12px 16px; border-radius: 3px; margin-bottom: 16px; font-size: 14px; border-left: 3px solid; }
.alert-error { background: var(--oxblood-tint); color: var(--oxblood); border-color: var(--oxblood); }
.alert-success { background: var(--forest-tint); color: var(--forest); border-color: var(--forest); }

/* ---------------- Bound-journal listing rows (signature element) ---------------- */
.submission-item {
    border-bottom: 1px solid var(--paper-line);
    padding: 16px 0 16px 16px;
    border-left: 3px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}
.submission-item:hover { border-left-color: var(--gold); background: rgba(184,134,46,0.03); }
.submission-item:last-child { border-bottom: none; }
.submission-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
}
.submission-meta {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.3px;
    color: var(--ink-faint);
    margin-top: 4px;
    text-transform: uppercase;
}

/* ---------------- Badges ---------------- */
.badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-family: var(--font-mono);
}
.badge-progress { background: var(--gold-tint); color: var(--gold-dark); }
.badge-success  { background: var(--forest-tint); color: var(--forest); }
.badge-danger   { background: var(--oxblood-tint); color: var(--oxblood); }

/* ---------------- Progress tracker ---------------- */
.tracker { display: flex; flex-wrap: wrap; gap: 0; margin: 28px 0; }
.tracker-step { flex: 1; min-width: 90px; text-align: center; position: relative; padding: 0 4px; }
.tracker-step .dot {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--paper-line); color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px; font-size: 12px; font-weight: 700; font-family: var(--font-mono);
}
.tracker-step.done .dot { background: var(--forest); }
.tracker-step.current .dot { background: var(--gold); }
.tracker-step .label { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.3px; }
.tracker-step.done .label, .tracker-step.current .label { color: var(--ink); font-weight: 700; }
.tracker-step:not(:last-child)::after {
    content: ''; position: absolute; top: 13px; left: 55%; width: 90%; height: 1px;
    background: var(--paper-line); z-index: 0;
}
.tracker-step.done:not(:last-child)::after { background: var(--forest); }

/* ---------------- Activity log ---------------- */
.timeline-log { margin-top: 24px; }
.timeline-entry { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--paper-line); }
.timeline-entry .date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); min-width: 140px; padding-top: 2px; }
.timeline-entry .content { font-size: 14px; }
.timeline-entry .status-name { font-weight: 700; font-family: var(--font-display); }
.timeline-entry .notes { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

/* ============================================================
   Journal public page — professional layout, bound-journal styling
   ============================================================ */
.jr-page { max-width: 1320px; margin: 0 auto; padding: 32px 20px 70px; }

.jr-header {
    display: flex;
    gap: 32px;
    background: var(--paper-raised);
    border: 1px solid var(--paper-line);
    border-radius: 4px;
    padding: 32px;
    margin-bottom: 26px;
}
.jr-cover { flex: 0 0 170px; }
.jr-cover img {
    width: 170px; height: 226px; object-fit: cover; border-radius: 2px;
    box-shadow: 0 4px 14px rgba(22,35,63,0.22); display: block;
}
.jr-cover-placeholder {
    width: 170px; height: 226px; border-radius: 2px;
    background: linear-gradient(155deg, var(--ink) 0%, #0e1830 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(22,35,63,0.22);
    border-top: 4px solid var(--gold);
}
.jr-cover-placeholder span { font-family: var(--font-display); color: #fff; font-size: 32px; font-weight: 700; letter-spacing: 1px; }

.jr-header-main { flex: 1; min-width: 0; }
.jr-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 0 0 10px; color: var(--ink); line-height: 1.2; }
.jr-tagline { font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--gold-dark); margin: -4px 0 10px; }
.jr-issn { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3px; color: var(--ink-faint); margin-bottom: 18px; text-transform: uppercase; }

.jr-btn-row { display: flex; gap: 10px; margin-bottom: 20px; }
.jr-btn { display: inline-block; padding: 10px 22px; border-radius: 3px; font-size: 13.5px; font-weight: 700; letter-spacing: 0.3px; text-decoration: none; }
.jr-btn-primary { background: var(--ink); color: #fff; }
.jr-btn-primary:hover { background: #0e1830; }
.jr-btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--gold); }
.jr-btn-outline:hover { background: var(--gold-tint); }

.jr-description { font-size: 15px; color: var(--ink-soft); line-height: 1.7; margin: 0; }

.jr-body { display: flex; gap: 26px; align-items: flex-start; }
.jr-main { flex: 1; min-width: 0; }
.jr-sidebar { flex: 0 0 280px; }

.jr-section { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: 4px; padding: 26px; margin-bottom: 22px; }
.jr-section-title {
    font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink);
    margin: 0 0 18px; padding-bottom: 14px; border-bottom: 2px solid var(--gold);
    display: flex; flex-direction: column; gap: 3px;
}
.jr-section-sub { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.3px; }

.jr-article-list { display: flex; flex-direction: column; }
.jr-article-row {
    padding: 16px 0 16px 14px; border-bottom: 1px solid var(--paper-line); border-left: 3px solid transparent;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
    transition: border-color 0.15s, background 0.15s;
}
.jr-article-row:hover { border-left-color: var(--gold); background: rgba(184,134,46,0.03); }
.jr-article-row:last-child { border-bottom: none; }
.jr-article-title a { color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 15.5px; text-decoration: none; }
.jr-article-title a:hover { color: var(--gold-dark); }
.jr-article-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.2px; }
.jr-pdf-link {
    flex-shrink: 0; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink);
    border: 1.5px solid var(--gold); border-radius: 3px; padding: 5px 12px; text-decoration: none;
    white-space: nowrap; letter-spacing: 0.3px; text-transform: uppercase;
}
.jr-pdf-link:hover { background: var(--gold); color: #fff; }

.jr-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.jr-archive-item {
    display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--paper-line); border-left: 3px solid var(--gold);
    border-radius: 2px; padding: 13px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none;
    font-family: var(--font-display);
}
.jr-archive-item:hover { background: rgba(184,134,46,0.05); }
.jr-archive-year { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-faint); }

.jr-widget { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: 4px; padding: 20px; margin-bottom: 16px; }
.jr-widget h3 {
    font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--gold-dark); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--paper-line);
}
.jr-info-list, .jr-link-list { list-style: none; margin: 0; padding: 0; }
.jr-info-list li { font-size: 13px; color: var(--ink-soft); margin-bottom: 9px; }
.jr-info-list strong { color: var(--ink); }
.jr-link-list li { margin-bottom: 10px; }
.jr-link-list a { font-size: 13.5px; color: var(--ink); text-decoration: none; }
.jr-link-list a:hover { color: var(--gold-dark); text-decoration: underline; }

.jr-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jr-stat-box { background: var(--paper); border-radius: 3px; padding: 12px 10px; text-align: center; }
.jr-stat-number { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1; }
.jr-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-faint); margin-top: 6px; }

@media (max-width: 760px) {
    .jr-header { flex-direction: column; align-items: flex-start; }
    .jr-body { flex-direction: column; }
    .jr-sidebar { flex: 1; width: 100%; }
    .navbar { flex-wrap: wrap; padding: 12px 20px; gap: 8px; }
}

/* ============================================================
   Home page (site index) — matches reference layout:
   header (logo left, auth buttons right, accent bar) →
   two columns: main journal list (cover + title + buttons + desc)
   and a widget sidebar (promo, journals list, quick links)
   ============================================================ */
.hm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: var(--paper-raised);
    border-bottom: 4px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 200;
}
.hm-brand { display: flex; align-items: center; gap: 16px; }
.hm-logo-circle {
    width: 68px; height: 68px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #24365e, var(--ink) 70%);
    border: 2px solid var(--gold);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.hm-logo-circle span { color: var(--gold); font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.hm-brand-text { display: flex; flex-direction: column; justify-content: center; }
.hm-brand-text .hm-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--ink); line-height: 1.2; }
.hm-brand-text .hm-tagline { font-family: var(--font-display); font-weight: 500; font-size: 16.5px; color: var(--gold-dark); margin-top: 4px; line-height: 1.35; }
.hm-auth-buttons { display: flex; gap: 10px; flex-shrink: 0; }
.hm-auth-btn {
    padding: 8px 20px; border-radius: 3px; font-size: 13px; font-weight: 700;
    text-decoration: none; background: var(--ink); color: #fff;
}
.hm-auth-btn:hover { background: #0e1830; }
.hm-auth-btn.outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }

/* Hamburger toggle — hidden on desktop, shown on mobile/tablet (see media query below) */
.hm-menu-toggle {
    display: none; background: none; border: none; color: var(--ink);
    font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 6px; flex-shrink: 0;
}
.hm-header-wrap { position: relative; }
.hm-mobile-menu {
    display: none; flex-direction: column;
    background: var(--paper-raised); border-bottom: 3px solid var(--gold);
    padding: 4px 16px;
    /* Overlay instead of pushing page content down — positioned relative to
       .hm-header-wrap (see markup), sits right below the header, floats
       above the body content, and scrolls internally if it's tall. */
    position: absolute; top: 100%; left: 0; right: 0; z-index: 500;
    max-height: 75vh; overflow-y: auto;
    box-shadow: 0 12px 28px rgba(22,35,63,0.18);
}
.hm-mobile-menu.open { display: flex; }
.hm-mobile-menu a {
    padding: 12px 4px; font-size: 14px; font-weight: 700; color: var(--ink);
    text-decoration: none; border-bottom: 1px solid var(--paper-line);
}
.hm-mobile-menu a:last-child { border-bottom: none; }
.hm-auth-btn.outline:hover { background: var(--paper); }

.hm-body { display: flex; gap: 28px; max-width: 1320px; margin: 30px auto; padding: 0 24px 60px; align-items: flex-start; }
.hm-main { flex: 1; min-width: 0; }
.hm-about {
    background: var(--paper-raised); border: 1px solid var(--paper-line); border-left: 4px solid var(--gold);
    border-radius: 4px; padding: 22px 26px; margin-bottom: 8px;
}
.hm-intro { font-size: 14.5px; color: var(--ink-soft); line-height: 1.75; margin-bottom: 10px; }
.hm-section-heading {
    font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--ink);
    margin: 26px 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--gold);
}

.hm-journal-row { display: flex; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--paper-line); }
.hm-journal-row:first-of-type { padding-top: 0; }
.hm-journal-cover { flex: 0 0 340px; }
.hm-journal-cover img {
    width: 340px; height: 452px; object-fit: cover; border-radius: 2px;
    box-shadow: 0 3px 10px rgba(22,35,63,0.2); display: block;
}
.hm-journal-cover-placeholder {
    width: 340px; height: 452px; border-radius: 2px;
    background: linear-gradient(155deg, var(--ink), #0e1830);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 10px rgba(22,35,63,0.2); border-top: 4px solid var(--gold);
}
.hm-journal-cover-placeholder span { font-family: var(--font-display); color: #fff; font-weight: 700; font-size: 56px; }
.hm-journal-info { flex: 1; min-width: 0; }
.hm-journal-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ink); margin-bottom: 14px; line-height: 1.3; }
.hm-journal-title a { color: var(--ink); text-decoration: none; }
.hm-journal-title a:hover { color: var(--gold-dark); }
.hm-journal-btn-row { display: flex; gap: 10px; margin-bottom: 14px; }
.hm-jbtn {
    padding: 7px 16px; border-radius: 3px; font-size: 12.5px; font-weight: 700;
    text-decoration: none; border: 1.5px solid var(--ink); color: var(--ink); background: transparent;
}
.hm-jbtn:hover { background: var(--ink); color: #fff; }
.hm-journal-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }

.hm-sidebar { flex: 0 0 280px; }
.hm-promo {
    background: linear-gradient(155deg, var(--ink), #0e1830);
    border-top: 4px solid var(--gold);
    border-radius: 3px; padding: 22px 18px; margin-bottom: 18px; text-align: center;
}
.hm-promo .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.hm-promo h4 { font-family: var(--font-display); color: #fff; font-size: 16px; margin: 0 0 14px; line-height: 1.4; }
.hm-promo a { display: inline-block; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 12.5px; padding: 8px 18px; border-radius: 3px; text-decoration: none; }
.hm-promo a:hover { background: #cf9d3f; }

.hm-widget { border: 1px solid var(--paper-line); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.hm-widget-header { background: var(--ink); color: #fff; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 10px 16px; }
.hm-widget-list { list-style: none; margin: 0; padding: 0; }
.hm-widget-list li { border-bottom: 1px solid var(--paper-line); }
.hm-widget-list li:last-child { border-bottom: none; }
.hm-widget-list li:nth-child(even) { background: var(--paper); }
.hm-widget-list a { display: block; padding: 10px 16px; font-size: 12.5px; color: var(--ink); text-decoration: none; line-height: 1.4; }
.hm-widget-list a:hover { color: var(--gold-dark); text-decoration: underline; }

@media (max-width: 820px) {
    .hm-body { flex-direction: column; }
    .hm-sidebar { flex: 1; width: 100%; }
    .hm-journal-row { flex-direction: column; }
    .hm-journal-cover, .hm-journal-cover img, .hm-journal-cover-placeholder { width: 140px; height: 186px; }
    .hm-header { flex-wrap: wrap; gap: 12px; }
}
.site-footer {
    border-top: 1px solid var(--paper-line);
    margin-top: 40px;
    padding: 28px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}

/* ---------------- Professional site footer ---------------- */
.site-footer-pro {
    background: var(--ink);
    color: rgba(255,255,255,0.85);
    margin-top: 50px;
    border-top: 4px solid var(--gold);
}
.sf-inner {
    max-width: 1320px; margin: 0 auto; padding: 44px 24px 30px;
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px;
}
.sf-brand { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: #fff; margin-bottom: 10px; }
.sf-text { font-size: 13px; line-height: 1.7; color: rgba(255,255,255,0.65); margin: 0; }
.sf-col h4 {
    font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--gold); margin: 0 0 14px;
}
.sf-col ul { list-style: none; margin: 0; padding: 0; }
.sf-col li { font-size: 13px; margin-bottom: 10px; color: rgba(255,255,255,0.65); }
.sf-col a { color: rgba(255,255,255,0.75); text-decoration: none; }
.sf-col a:hover { color: var(--gold); text-decoration: underline; }
.sf-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    text-align: center; padding: 18px 20px; font-size: 11.5px;
    font-family: var(--font-mono); letter-spacing: 0.3px; color: rgba(255,255,255,0.5);
}
@media (max-width: 820px) {
    .sf-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
    .sf-inner { grid-template-columns: 1fr; }
}

/* ---------------- Media library grid (admin) ---------------- */
.media-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap:12px; margin-top:12px; }
.media-item { border:1px solid var(--paper-line); border-radius:3px; padding:8px; text-align:center; }
.media-item img { max-width:100%; height:80px; object-fit:contain; margin-bottom:6px; }
.media-item .pdf-icon { height:80px; display:flex; align-items:center; justify-content:center; font-size:12px; color:var(--ink-faint); background:var(--paper); border-radius:2px; margin-bottom:6px; font-family: var(--font-mono); }
.media-item .path-box { font-family: var(--font-mono); font-size:10px; word-break:break-all; background:var(--paper); padding:4px; border-radius:2px; margin-bottom:6px; }
.copy-btn { font-size:11px; padding:4px 8px; }

/* ---------------- Admin Dashboard ---------------- */
.dash-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.dash-stat-card {
    background: var(--paper-raised); border: 1px solid var(--paper-line); border-left: 4px solid var(--gold);
    border-radius: 4px; padding: 18px;
}
.dash-stat-card.warn { border-left-color: var(--oxblood); }
.dash-stat-card.ok { border-left-color: var(--forest); }
.dash-stat-number { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; }
.dash-stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-faint); margin-top: 8px; }

.dash-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-qa-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--paper); border: 1px solid var(--paper-line); border-radius: 4px;
    padding: 12px 18px; font-size: 13.5px; font-weight: 700; color: var(--ink); text-decoration: none;
    flex: 1; min-width: 160px; justify-content: center;
}
.dash-qa-btn:hover { border-color: var(--gold); background: var(--gold-tint); }

.dash-two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .dash-two-col { grid-template-columns: 1fr; } }

/* Simple CSS bar chart — no JS library, no CDN */
.dash-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-bar-label { flex: 0 0 130px; font-size: 12px; color: var(--ink-soft); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.2px; }
.dash-bar-track { flex: 1; background: var(--paper); border-radius: 3px; height: 18px; overflow: hidden; }
.dash-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.3s; }
.dash-bar-count { flex: 0 0 30px; text-align: right; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink); }

/* Monthly trend — simple column chart */
.dash-trend { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.dash-trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.dash-trend-bar { width: 100%; max-width: 34px; background: var(--gold); border-radius: 2px 2px 0 0; min-height: 3px; }
.dash-trend-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft); margin-bottom: 4px; }
.dash-trend-label { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); margin-top: 6px; text-transform: uppercase; }

.dash-activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--paper-line); }
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.dash-activity-text { font-size: 13px; color: var(--ink); }
.dash-activity-text strong { font-weight: 700; }
.dash-activity-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }

/* ---------------- Admin left sidebar layout ---------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px; flex-shrink: 0; background: var(--ink); color: #fff;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    border-right: 4px solid var(--gold);
}
.as-brand { display: flex; align-items: center; gap: 10px; padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.as-brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex-shrink: 0; }
.as-brand-mark {
    width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 2px solid var(--gold);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: var(--gold); flex-shrink: 0;
}
.as-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: #fff; line-height: 1.25; }
.as-brand-sub { font-family: var(--font-mono); font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.as-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.as-view-site {
    display: block; margin: 4px 14px 10px; text-align: center;
    background: var(--gold); color: var(--ink); font-weight: 700; font-size: 12.5px;
    padding: 9px 12px; border-radius: 4px; text-decoration: none;
}
.as-view-site:hover { background: #cf9d3f; }
.as-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 4px; font-size: 13.5px; font-weight: 600;
    color: rgba(255,255,255,0.72); text-decoration: none;
}
.as-nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.as-nav-link.active { background: var(--gold); color: var(--ink); font-weight: 700; }
.as-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.as-footer { padding: 14px 10px; border-top: 1px solid rgba(255,255,255,0.1); }
.as-logout { color: rgba(255,255,255,0.55); }
.as-logout:hover { color: #fff; background: rgba(255,255,255,0.06); }

.admin-content { flex: 1; min-width: 0; background: var(--paper); }

@media (max-width: 880px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; border-right: none; border-bottom: 4px solid var(--gold); }
    .as-brand { padding: 8px; border-bottom: none; }
    .as-nav { flex-direction: row; flex-wrap: wrap; padding: 8px; }
    .as-footer { border-top: none; padding: 8px; }
}

/* ---------------- Home sidebar: Indexed In / Verified By badges ---------------- */
.hm-indexed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--paper-line); }
.hm-indexed-item {
    background: var(--paper-raised); padding: 12px 10px; display: flex; flex-direction: column; align-items: center;
    gap: 6px; text-align: center;
}
.hm-indexed-icon { font-size: 20px; }
.hm-indexed-item span:last-child { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.3; }

/* ============================================================
   MOBILE / TABLET RESPONSIVE OVERRIDES
   Most visitors, authors, editors, and reviewers use phones/tablets —
   this section tightens every header, nav, and layout component for
   small screens across both public and admin.
   ============================================================ */

/* Note: deliberately NOT setting overflow-x:hidden on html/body — that
   breaks position:sticky (our navbar/header) on iOS Safari, which a lot
   of visitors will be using. Width overflow is prevented per-component
   instead via max-width:100% and box-sizing:border-box (set globally above). */
body { max-width: 100%; }
img { max-width: 100%; } /* safety net for any image without an explicit sizing class */

/* ---------- Top navbar (journal/login/register/submit/track/etc.) ---------- */
@media (max-width: 640px) {
    .navbar {
        flex-wrap: wrap;
        min-height: auto;
        padding: 10px 14px;
        row-gap: 8px;
    }
    /* Logo has an inline size (40px) set in markup — !important needed to
       override it responsively without editing every page's HTML. */
    .navbar img { height: 30px !important; width: 30px !important; }
    .navbar .brand { font-size: 15px; }
    .navbar > div:last-of-type { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
    .navbar > div:last-of-type a { margin-left: 0; font-size: 12px; }
    .navbar > div:last-of-type span { font-size: 12px; }
}
@media (max-width: 400px) {
    .navbar .brand { font-size: 13.5px; }
    .navbar img { height: 26px !important; width: 26px !important; }
}

/* ---------- Home page masthead: tablet range (between desktop and phone) ---------- */
@media (max-width: 900px) {
    .hm-brand img { width: 56px !important; height: 56px !important; }
    .hm-logo-circle { width: 56px; height: 56px; }
    .hm-brand-text .hm-name { font-size: 21.5px; }
    .hm-brand-text .hm-tagline { font-size: 9.5px; }
    .hm-auth-buttons { display: none; }
    .hm-menu-toggle { display: block; }
}

/* ---------- Home page masthead (logo / site name / tagline) ---------- */
@media (max-width: 640px) {
    .hm-header { padding: 14px 16px; gap: 10px; flex-wrap: nowrap; }
    .hm-brand { gap: 10px; min-width: 0; flex: 1 1 auto; }
    .hm-brand-text { min-width: 0; }
    /* Uploaded logo image has an inline 68px size — override responsively. */
    .hm-brand img { width: 44px !important; height: 44px !important; }
    .hm-logo-circle { width: 44px; height: 44px; }
    .hm-logo-circle span { font-size: 15px; }
    .hm-brand-text .hm-name { font-size: 15px; line-height: 1.2; white-space: normal; overflow: visible; text-overflow: clip; }
    .hm-brand-text .hm-tagline { font-size: 7px; line-height: 1.2; white-space: normal; overflow: visible; text-overflow: clip; }
    .hm-menu-toggle { font-size: 22px; }
}
@media (max-width: 400px) {
    .hm-brand img { width: 38px !important; height: 38px !important; }
    .hm-logo-circle { width: 38px; height: 38px; }
    .hm-brand-text .hm-name { font-size: 14px; }
    .hm-brand-text .hm-tagline { font-size: 6.5px; }
}

/* ---------- Home body: journal rows, sidebar widgets ---------- */
@media (max-width: 640px) {
    .hm-body { padding: 0 14px 40px; margin-top: 18px; gap: 20px; }
    .hm-section-heading { font-size: 17px; margin: 18px 0 14px; }
    .hm-journal-row { padding: 16px 0; gap: 14px; }
    .hm-journal-cover, .hm-journal-cover img, .hm-journal-cover-placeholder { width: 96px !important; height: 128px !important; }
    .hm-journal-cover-placeholder span { font-size: 20px; }
    .hm-journal-title { font-size: 16px; }
    .hm-journal-btn-row { flex-wrap: wrap; gap: 8px; }
    .hm-jbtn { font-size: 11.5px; padding: 6px 12px; }
    .hm-journal-desc { font-size: 12.5px; }
    .hm-about { padding: 16px 18px; }
}

/* ---------- Individual journal page header (cover / title / buttons) ---------- */
@media (max-width: 640px) {
    .jr-page { padding: 16px 14px 50px; }
    .jr-header { padding: 18px; gap: 16px; }
    .jr-cover, .jr-cover img, .jr-cover-placeholder { width: 110px !important; height: 146px !important; }
    .jr-cover-placeholder span { font-size: 22px; }
    .jr-title { font-size: 20px; }
    .jr-issn { font-size: 11px; }
    .jr-btn-row { flex-wrap: wrap; gap: 8px; }
    .jr-btn { padding: 7px 14px; font-size: 12px; }
    .jr-description { font-size: 13px; }
    .jr-section { padding: 16px; }
    .jr-section-title { font-size: 16px; }
}
@media (max-width: 400px) {
    .jr-header { flex-direction: column; align-items: flex-start; text-align: left; }
    .jr-cover, .jr-cover img, .jr-cover-placeholder { width: 90px !important; height: 120px !important; }
    .jr-title { font-size: 18px; }
}

/* Sticky per-journal custom menu bar: on mobile the navbar itself may wrap
   to two rows (unpredictable height), so make the menu static there instead
   of guessing a top offset — it stays sticky from tablet width up. */
@media (max-width: 640px) {
    .jr-custom-menu { position: static !important; overflow-x: auto; }
}

/* ---------- Admin sidebar: horizontal scrollable bar on mobile instead of wrapping ---------- */
@media (max-width: 880px) {
    .as-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 8px; gap: 4px; -webkit-overflow-scrolling: touch; }
    .as-nav-link { white-space: nowrap; flex-shrink: 0; padding: 8px 12px; font-size: 12.5px; }
    .as-brand-name { font-size: 13px; }
    .as-brand-sub { font-size: 9px; }
    .as-view-site { margin: 4px 8px; font-size: 11.5px; padding: 7px 10px; }
    .as-footer { flex-shrink: 0; }
    .admin-content .container { padding: 20px 14px 40px; }
}
@media (max-width: 480px) {
    .as-brand { padding: 10px 12px; }
    .as-brand img, .as-brand-mark { width: 30px; height: 30px; }
}

/* ---------- Dashboard stat cards / bar charts on small screens ---------- */
@media (max-width: 600px) {
    .dash-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dash-stat-number { font-size: 24px; }
    .dash-quick-actions { flex-direction: column; }
    .dash-qa-btn { min-width: 0; }
    .dash-bar-row { flex-wrap: wrap; }
    .dash-bar-label { flex-basis: 100%; margin-bottom: 4px; }
    .dash-bar-track { flex-basis: calc(100% - 40px); }
}

/* ---------- Forms / cards general mobile tightening ---------- */
@media (max-width: 480px) {
    .container { padding: 20px 14px 40px; }
    .card { padding: 18px; }
    .btn { padding: 9px 16px; font-size: 13px; }
}

/* ---------- Footer ---------- */
@media (max-width: 640px) {
    .sf-inner { padding: 30px 18px 20px; gap: 24px; }
    .sf-brand { font-size: 17px; }
}

/* ---------- Sticky headers: desktop/laptop only ----------
   On phones and tablets a sticky header eats too much vertical space and
   can visually collide with wrapped nav rows, so it's disabled below
   1024px and only kept for larger screens. */
@media (max-width: 1024px) {
    .navbar { position: static; }
    .hm-header { position: static; }
    .jr-custom-menu { position: static; }
}

/* ============================================================
   Auth pages (Login / Register) — centered, compact, professional card
   ============================================================ */
.auth-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--paper);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--paper-raised);
    border: 1px solid var(--paper-line);
    border-top: 4px solid var(--gold);
    border-radius: 6px;
    padding: 36px 32px;
    box-shadow: 0 4px 20px rgba(22,35,63,0.08);
}
.auth-title {
    font-family: var(--font-display); font-weight: 700; font-size: 22px;
    color: var(--ink); text-align: center; margin: 0 0 6px;
}
.auth-subtitle {
    text-align: center; font-size: 13px; color: var(--ink-faint); margin-bottom: 26px;
}
.auth-field { margin-bottom: 16px; position: relative; }
.auth-field label {
    display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft);
    text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px;
}
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--ink-faint); pointer-events: none;
}
.auth-input-wrap input {
    width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--paper-line);
    border-radius: 4px; font-size: 14.5px; font-family: var(--font-body);
    background: var(--paper-raised); color: var(--ink);
}
.auth-input-wrap input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.auth-submit {
    width: 100%; padding: 12px; border-radius: 4px; border: none;
    background: var(--ink); color: #fff; font-size: 14px; font-weight: 700;
    cursor: pointer; margin-top: 6px;
}
.auth-submit:hover { background: #0e1830; }
.auth-footer-link { text-align: center; font-size: 13.5px; color: var(--ink-soft); margin-top: 20px; }
.auth-footer-link a { color: var(--gold-dark); font-weight: 700; text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .auth-card { padding: 26px 20px; }
    .auth-wrap { padding: 24px 14px; }
}

/* ============================================================
   Site-wide main navigation (mega-menu) — About/Journals/Books/
   Authors/Editors/Ethics/Submit — DB-driven via SiteMenuManager
   ============================================================ */
.main-menu {
    background: var(--ink);
    border-bottom: 3px solid var(--gold);
    position: sticky; top: 0; z-index: 300;
}
.main-menu-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: stretch; padding: 0 20px; overflow: visible; }
.main-menu-item { position: relative; flex-shrink: 0; }
.main-menu-link {
    display: flex; align-items: center; gap: 4px; height: 100%;
    padding: 13px 16px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.2px;
    color: rgba(255,255,255,0.85); text-decoration: none; white-space: nowrap;
}
.main-menu-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.main-menu-caret { font-size: 9px; opacity: 0.7; }
.main-menu-submit-btn { background: var(--gold); color: var(--ink) !important; margin: 8px 6px; padding: 7px 16px; border-radius: 3px; }
.main-menu-submit-btn:hover { background: #cf9d3f; }

.main-menu-dropdown {
    display: none; position: absolute; top: 100%; left: 0; min-width: 250px;
    background: var(--paper-raised); border: 1px solid var(--paper-line); border-top: 3px solid var(--gold);
    box-shadow: 0 10px 24px rgba(22,35,63,0.18); z-index: 400;
}
.main-menu-item:hover .main-menu-dropdown { display: block; }
.main-menu-dropdown a {
    display: block; padding: 10px 16px; font-size: 12.5px; color: var(--ink);
    text-decoration: none; border-bottom: 1px solid var(--paper-line);
}
.main-menu-dropdown a:last-child { border-bottom: none; }
.main-menu-dropdown a:hover { background: var(--paper); color: var(--gold-dark); }

/* Mobile accordion (reuses .hm-mobile-menu shell from Phase 21) */
.mm-accordion-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 4px; font-size: 14px; font-weight: 700; color: var(--ink);
    border-bottom: 1px solid var(--paper-line); cursor: pointer;
}
.mm-accordion-body { display: none; flex-direction: column; padding-left: 12px; }
.mm-accordion-body.open { display: flex; }
.mm-accordion-body a { padding: 9px 4px; font-size: 13px; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--paper-line); }
.mm-accordion-body a:last-child { border-bottom: none; }

@media (max-width: 900px) {
    .main-menu { display: none; }
}

/* ---------------- CMS page body + Publication Process flow ---------------- */
.pg-body { font-size: 14.5px; color: var(--ink-soft); line-height: 1.75; }
.pg-body p { margin: 0 0 14px; }
.pg-body h2, .pg-body h3 { font-family: var(--font-display); color: var(--ink); margin: 22px 0 10px; }
.pg-body ul, .pg-body ol { padding-left: 22px; margin: 0 0 14px; }
.pg-table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 13.5px; }
.pg-table th, .pg-table td { border: 1px solid var(--paper-line); padding: 9px 12px; text-align: left; }
.pg-table th { background: var(--paper); font-weight: 700; color: var(--ink); font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.3px; }
.pg-table td { color: var(--ink-soft); }

.pg-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 22px; }
.pg-flow-step {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--paper); border: 1px solid var(--paper-line); border-radius: 4px;
    padding: 12px 14px; font-size: 12px; font-weight: 700; color: var(--ink); text-align: center; min-width: 100px;
}
.pg-flow-num {
    width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff;
    display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px;
}
.pg-flow-arrow { color: var(--gold-dark); font-size: 18px; font-weight: 700; }
@media (max-width: 640px) {
    .pg-flow { flex-direction: column; }
    .pg-flow-arrow { transform: rotate(90deg); }
}
