/* ========================================================================== 
   GTheme Unified Premium Sidebar v12
   OJS 3.4.0-x | Sidebar Management + Custom Block Manager
   --------------------------------------------------------------------------
   Principles:
   - One clear, always-visible navigation menu (no nested disclosure menus).
   - Larger readable type, larger portraits/logos and a non-cropped journal cover.
   - Fewer, stronger cards: Identity, Journal Menu, Resources, People, Indexing,
     Statistics.
   - Custom Block Manager remains the content source; the theme owns styling.
   - Palette-aware, dark-mode aware, responsive and keyboard-accessible.
   ========================================================================== */

.gtheme-public-sidebar {
    min-width: 0;
}

/* A long editorial sidebar should scroll naturally with the page. Keeping an
   entire multi-card sidebar sticky can trap content below the viewport. */
.gtheme-sidebar-shell {
    position: static;
    width: 100%;
}

.gtheme-sidebar-block-list {
    display: grid !important;
    gap: 18px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* --------------------------------------------------------------------------
   Native OJS sidebar blocks
   -------------------------------------------------------------------------- */
.gtheme-sidebar-shell .pkp_block {
    position: relative;
    margin: 0 !important;
    padding: 20px !important;
    overflow: hidden;
    list-style: none !important;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .055);
}

.gtheme-sidebar-shell .pkp_block::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 52px;
    height: 3px;
    border-radius: 0 0 999px 0;
    background: var(--gtheme-mid);
}

.gtheme-sidebar-shell .pkp_block > .title,
.gtheme-sidebar-shell .pkp_block > a:first-child {
    display: block;
    margin: 0 0 14px !important;
    padding: 0 !important;
    color: var(--gtheme-dark) !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 1.22;
    font-weight: 600;
    letter-spacing: -.018em;
    text-decoration: none !important;
}

.gtheme-sidebar-shell .pkp_block .content,
.gtheme-sidebar-shell .pkp_block ul {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    list-style: none !important;
}

.gtheme-sidebar-shell .pkp_block li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.gtheme-sidebar-shell .pkp_block .content > a,
.gtheme-sidebar-shell .pkp_block .content li > a,
.gtheme-sidebar-shell .pkp_block ul li > a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 3px 0;
    padding: 10px 32px 10px 11px !important;
    border-radius: 11px;
    color: #475569 !important;
    background: transparent;
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 650;
    text-decoration: none !important;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.gtheme-sidebar-shell .pkp_block .content > a::after,
.gtheme-sidebar-shell .pkp_block .content li > a::after,
.gtheme-sidebar-shell .pkp_block ul li > a::after {
    content: "›";
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-52%);
    color: #94a3b8;
    font-size: 19px;
}

.gtheme-sidebar-shell .pkp_block .content > a:hover,
.gtheme-sidebar-shell .pkp_block .content li > a:hover,
.gtheme-sidebar-shell .pkp_block ul li > a:hover {
    background: var(--gtheme-soft) !important;
    color: var(--gtheme-dark) !important;
    transform: translateX(2px);
}

.gtheme-sidebar-shell .pkp_block img {
    max-width: 100%;
    height: auto;
}

/* One Custom Block can contain the complete GTheme sidebar. Remove the native
   block chrome so we do not get a card-inside-card effect. */
.gtheme-sidebar-shell .pkp_block.gtheme-custom-sidebar-host {
    padding: 0 !important;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.gtheme-sidebar-shell .pkp_block.gtheme-custom-sidebar-host::before,
.gtheme-sidebar-shell .pkp_block.gtheme-custom-sidebar-host > .title,
.gtheme-sidebar-shell .pkp_block.gtheme-custom-sidebar-host > a:first-child {
    display: none !important;
}

.gtheme-sidebar-shell .pkp_block.gtheme-custom-sidebar-host > .content {
    margin: 0 !important;
    padding: 0 !important;
}

@supports selector(.pkp_block:has(.gtheme-premium-sidebar)) {
    .gtheme-sidebar-shell .pkp_block:has(.gtheme-premium-sidebar) {
        padding: 0 !important;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .gtheme-sidebar-shell .pkp_block:has(.gtheme-premium-sidebar)::before,
    .gtheme-sidebar-shell .pkp_block:has(.gtheme-premium-sidebar) > .title,
    .gtheme-sidebar-shell .pkp_block:has(.gtheme-premium-sidebar) > a:first-child {
        display: none !important;
    }
    .gtheme-sidebar-shell .pkp_block:has(.gtheme-premium-sidebar) > .content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* --------------------------------------------------------------------------
   Unified premium custom sidebar
   -------------------------------------------------------------------------- */
.gtheme-premium-sidebar {
    --gside-border: rgba(15, 23, 42, .08);
    --gside-text: #0f172a;
    --gside-muted: #64748b;
    --gside-faint: #94a3b8;
    display: grid;
    gap: 18px;
    width: 100%;
}

.gtheme-sidecard {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gside-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 15px 42px rgba(15, 23, 42, .06);
}

.gtheme-sidecard--accent::before {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -86px;
    top: -86px;
    border-radius: 50%;
    background: var(--gtheme-accent);
    opacity: .28;
    pointer-events: none;
}

.gtheme-sidecard__head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 14px;
}

.gtheme-sidecard__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--gtheme-mid);
    font-size: 9.5px;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.gtheme-sidecard__title {
    margin: 0;
    color: var(--gside-text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -.018em;
}

.gtheme-sidecard__more {
    flex: 0 0 auto;
    margin-top: 3px;
    color: var(--gtheme-mid) !important;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 800;
    text-decoration: none !important;
}

.gtheme-sidecard__more:hover {
    color: var(--gtheme-dark) !important;
}

/* --------------------------------------------------------------------------
   Journal identity: full readable cover + actions
   -------------------------------------------------------------------------- */
.gtheme-side-identity {
    padding: 15px;
    background: linear-gradient(155deg, #fff 0%, #fff 64%, var(--gtheme-soft) 145%);
}

.gtheme-side-cover {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 250px;
    padding: 9px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--gtheme-dark), var(--gtheme-mid));
    box-shadow: 0 13px 30px rgba(15, 23, 42, .16);
}

.gtheme-side-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 430px;
    object-fit: contain;
    object-position: center;
    border-radius: 9px;
    background: #fff;
}

.gtheme-side-cover.is-missing {
    min-height: 180px;
    padding: 0;
}

.gtheme-side-cover.is-missing::before {
    content: "Journal Cover";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .92);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
}

.gtheme-side-cover.is-missing img { display: none; }

.gtheme-side-actions {
    display: grid;
    gap: 9px;
    padding-top: 13px;
}

.gtheme-sidebtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 14px !important;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 800;
    text-align: center;
    text-decoration: none !important;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.gtheme-sidebtn--primary {
    color: #fff !important;
    border: 1px solid var(--gtheme-mid);
    background: linear-gradient(135deg, var(--gtheme-dark), var(--gtheme-mid));
    box-shadow: 0 9px 22px rgba(15, 23, 42, .13);
}

.gtheme-sidebtn--primary:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}

.gtheme-side-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.gtheme-sidebtn--secondary {
    color: #475569 !important;
    border: 1px solid rgba(15, 23, 42, .1);
    background: rgba(255, 255, 255, .9);
}

.gtheme-sidebtn--secondary:hover {
    color: var(--gtheme-dark) !important;
    background: var(--gtheme-soft);
}

/* --------------------------------------------------------------------------
   ONE unified journal menu — all choices always visible
   -------------------------------------------------------------------------- */
.gtheme-side-nav {
    padding: 0 11px 14px;
}

.gtheme-side-nav__link {
    position: relative;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    margin: 3px 0;
    padding: 10px 10px !important;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #334155 !important;
    background: transparent;
    text-decoration: none !important;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.gtheme-side-nav__index {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: var(--gtheme-mid);
    background: var(--gtheme-soft);
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .02em;
}

.gtheme-side-nav__link strong {
    display: block;
    color: inherit;
    font-size: 13.25px;
    line-height: 1.3;
    font-weight: 750;
}

.gtheme-side-nav__arrow {
    color: #94a3b8;
    font-size: 19px;
    line-height: 1;
    text-align: center;
    transition: transform .18s ease, color .18s ease;
}

.gtheme-side-nav__link:hover,
.gtheme-side-nav__link.is-active,
.gtheme-side-nav__link[aria-current="page"] {
    color: var(--gtheme-dark) !important;
    border-color: rgba(15, 23, 42, .055);
    background: var(--gtheme-soft) !important;
    transform: translateX(2px);
}

.gtheme-side-nav__link.is-active::before,
.gtheme-side-nav__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: var(--gtheme-mid);
}

.gtheme-side-nav__link:hover .gtheme-side-nav__arrow,
.gtheme-side-nav__link.is-active .gtheme-side-nav__arrow,
.gtheme-side-nav__link[aria-current="page"] .gtheme-side-nav__arrow {
    color: var(--gtheme-mid);
    transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   Resources & support — larger visual tiles
   -------------------------------------------------------------------------- */
.gtheme-side-resource-list {
    display: grid;
    gap: 10px;
    padding: 0 14px 16px;
}

.gtheme-side-resource {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) 18px;
    gap: 11px;
    align-items: center;
    min-height: 72px;
    padding: 9px 10px !important;
    border: 1px solid rgba(15, 23, 42, .075);
    border-radius: 14px;
    color: #334155 !important;
    background: #fff;
    text-decoration: none !important;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.gtheme-side-resource:hover {
    color: var(--gtheme-dark) !important;
    border-color: rgba(15, 23, 42, .13);
    transform: translateY(-1px);
    box-shadow: 0 9px 24px rgba(15, 23, 42, .06);
}

.gtheme-side-resource__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, var(--gtheme-dark), var(--gtheme-mid));
    font-size: 12px;
    line-height: 1;
    font-weight: 900;
}

.gtheme-side-resource__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.gtheme-side-resource__copy strong {
    display: block;
    color: inherit;
    font-size: 12.75px;
    line-height: 1.3;
    font-weight: 750;
}

.gtheme-side-resource__copy small {
    display: block;
    margin-top: 3px;
    color: var(--gside-muted);
    font-size: 10px;
    line-height: 1.35;
}

.gtheme-side-resource__arrow {
    color: #94a3b8;
    font-size: 17px;
}

/* --------------------------------------------------------------------------
   Editorial + reviewer board — larger portraits and readable metadata
   -------------------------------------------------------------------------- */
.gtheme-side-people-section {
    padding: 0 14px 2px;
}

.gtheme-side-people-section + .gtheme-side-people-section {
    margin-top: 5px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, .065);
}

.gtheme-side-people-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    padding: 0 2px;
}

.gtheme-side-people-label strong {
    color: var(--gside-text);
    font-size: 11px;
    line-height: 1.3;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.gtheme-side-people-label a {
    color: var(--gtheme-mid) !important;
    font-size: 10.5px;
    font-weight: 800;
    text-decoration: none !important;
}

.gtheme-side-people {
    padding: 0 0 10px;
}

.gtheme-side-person {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 2px;
    border-top: 1px solid rgba(15, 23, 42, .055);
}

.gtheme-side-person:first-child { border-top: 0; }

.gtheme-side-person__photo {
    width: 60px;
    height: 60px;
    border: 2px solid #fff;
    border-radius: 15px;
    object-fit: cover;
    object-position: center;
    background: var(--gtheme-soft);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .1);
}

.gtheme-side-person__name {
    display: block;
    color: var(--gside-text);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 760;
}

.gtheme-side-person__role {
    display: block;
    margin-top: 3px;
    color: var(--gtheme-mid);
    font-size: 9.75px;
    line-height: 1.25;
    font-weight: 850;
}

.gtheme-side-person__affiliation {
    display: block;
    margin-top: 3px;
    color: var(--gside-muted);
    font-size: 9.5px;
    line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Indexing logos — large enough to identify at a glance
   -------------------------------------------------------------------------- */
.gtheme-side-logos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 14px 16px;
}

.gtheme-side-logo {
    display: grid !important;
    place-items: center;
    min-height: 86px;
    padding: 12px !important;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .075);
    border-radius: 13px;
    background: #fff;
    text-decoration: none !important;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.gtheme-side-logo:hover {
    border-color: rgba(15, 23, 42, .13);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.gtheme-side-logo img {
    display: block;
    max-width: 100%;
    max-height: 62px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Statistics */
.gtheme-side-stat { padding: 0 14px 16px; }
.gtheme-side-stat a {
    display: block !important;
    overflow: hidden;
    padding: 10px !important;
    border: 1px solid rgba(15, 23, 42, .075);
    border-radius: 13px;
    background: #fff;
}
.gtheme-side-stat img {
    display: block;
    width: 100%;
    height: auto;
}

/* Prevent generic OJS link rules from injecting arrows into custom elements. */
.gtheme-sidebar-shell .gtheme-premium-sidebar a::after {
    display: none !important;
    content: none !important;
}

/* --------------------------------------------------------------------------
   Dark mode
   -------------------------------------------------------------------------- */
html.dark .gtheme-premium-sidebar {
    --gside-border: rgba(255, 255, 255, .085);
    --gside-text: #f8fafc;
    --gside-muted: #cbd5e1;
    --gside-faint: #94a3b8;
}

html.dark .gtheme-sidebar-shell .pkp_block,
html.dark .gtheme-sidecard {
    border-color: rgba(255, 255, 255, .085);
    background: linear-gradient(165deg, #111827, #0f172a);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .18);
}

html.dark .gtheme-sidebar-shell .pkp_block > .title,
html.dark .gtheme-sidebar-shell .pkp_block > a:first-child,
html.dark .gtheme-sidecard__title,
html.dark .gtheme-side-people-label strong,
html.dark .gtheme-side-person__name {
    color: #f8fafc !important;
}

html.dark .gtheme-sidebar-shell .pkp_block .content > a,
html.dark .gtheme-sidebar-shell .pkp_block .content li > a,
html.dark .gtheme-sidebar-shell .pkp_block ul li > a,
html.dark .gtheme-side-nav__link,
html.dark .gtheme-side-resource,
html.dark .gtheme-sidebtn--secondary {
    color: #cbd5e1 !important;
}

html.dark .gtheme-sidebar-shell .pkp_block .content > a:hover,
html.dark .gtheme-sidebar-shell .pkp_block .content li > a:hover,
html.dark .gtheme-sidebar-shell .pkp_block ul li > a:hover,
html.dark .gtheme-side-nav__link:hover,
html.dark .gtheme-side-nav__link.is-active,
html.dark .gtheme-side-nav__link[aria-current="page"] {
    color: #fff !important;
    background: rgba(255, 255, 255, .055) !important;
}

html.dark .gtheme-side-identity {
    background: linear-gradient(155deg, #111827, #0f172a);
}

html.dark .gtheme-sidebtn--secondary,
html.dark .gtheme-side-resource,
html.dark .gtheme-side-logo,
html.dark .gtheme-side-stat a {
    border-color: rgba(255, 255, 255, .085);
    background: rgba(255, 255, 255, .035);
}

html.dark .gtheme-side-people-section + .gtheme-side-people-section,
html.dark .gtheme-side-person {
    border-color: rgba(255, 255, 255, .07);
}

html.dark .gtheme-side-person__photo {
    border-color: #111827;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    .gtheme-premium-sidebar,
    .gtheme-sidebar-block-list { gap: 14px; }

    .gtheme-sidecard,
    .gtheme-sidebar-shell .pkp_block { border-radius: 17px; }

    .gtheme-side-cover { min-height: 220px; }
}

@media (max-width: 480px) {
    .gtheme-sidecard__head { padding-left: 16px; padding-right: 16px; }
    .gtheme-side-auth { grid-template-columns: 1fr; }
    .gtheme-side-person { grid-template-columns: 56px minmax(0, 1fr); }
    .gtheme-side-person__photo { width: 56px; height: 56px; }
    .gtheme-side-logos { grid-template-columns: 1fr 1fr; }
}
