/* MDPI-style journal landing (/journals/<slug>/) — responsive, high-contrast */

.public-container:has(.journal-layout) {
    max-width: 1240px;
}

.journal-layout {
    --jp-brand: #70204d;
    --jp-brand-hover: #5a1a3f;
    --jp-link: #1a45c1;
    --jp-surface: #fff;
    --jp-muted: #5c6370;
    --jp-border: #e5e1d8;
    --jp-bg-soft: #faf8f4;
    --jp-open: #15803d;
    width: 100%;
    min-width: 0;
}

.journal-layout a {
    text-decoration: none;
}

.journal-layout a:hover {
    text-decoration: none;
}

.journal-breadcrumb {
    font-size: 0.84rem;
    color: var(--jp-muted);
    margin: 0 0 1rem;
    padding: 0.35rem 0;
}

.journal-breadcrumb a {
    color: var(--jp-muted);
}

.journal-breadcrumb a:hover {
    color: var(--jp-link);
}

.journal-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr) minmax(0, 260px);
    gap: 1.75rem;
    align-items: start;
    width: 100%;
    min-width: 0;
}

/* Journal landing: main spans middle + former right column (same overall width as 3-col pages). */
.journal-layout-grid--no-right .journal-col--main {
    grid-column: 2 / span 2;
    min-width: 0;
}

.journal-col {
    min-width: 0;
}

.journal-col--left {
    background: var(--jp-surface);
    border: 1px solid var(--jp-border);
    border-radius: 6px;
    padding: 1.1rem 1rem;
}

.journal-col--main {
    background: var(--jp-surface);
    border: 1px solid var(--jp-border);
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
}

.journal-col--right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.jp-card {
    background: var(--jp-surface);
    border: 1px solid var(--jp-border);
    border-radius: 6px;
    padding: 1rem 1.1rem;
}

.jp-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

/* Left: journal identity */
.jp-journal-mark {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--jp-border);
}

.jp-journal-logo {
    width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.jp-journal-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    width: 100%;
    background: linear-gradient(145deg, var(--jp-brand), #8b2f5c);
    color: #fff;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.06em;
    border-radius: 4px;
}

.jp-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.jp-btn {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none !important;
    border: 1px solid transparent;
    text-align: center;
}

.jp-btn--primary {
    background: var(--jp-brand);
    color: #fff !important;
    border-color: var(--jp-brand);
}

.jp-btn--primary:hover {
    background: var(--jp-brand-hover);
    border-color: var(--jp-brand-hover);
}

.jp-btn--outline {
    background: #fff;
    color: var(--jp-brand) !important;
    border-color: var(--jp-brand);
}

.jp-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.82rem;
}

.jp-nav li {
    border-bottom: 1px solid #f0ebe3;
}

.jp-nav a {
    display: block;
    padding: 0.45rem 0.15rem;
    color: #333;
    border-radius: 4px;
    margin: 0.1rem -0.1rem;
}

.jp-nav a:hover {
    color: var(--jp-link);
    background: #f8fbff;
    text-decoration: none !important;
}

.jp-nav .jp-nav-link--active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* Reusable left-sidebar cards (see includes/jp_sidebar_card.html) */
.jp-sidebar-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid var(--jp-border);
}

.jp-sidebar-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

.jp-archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.jp-archive-link {
    display: block;
    color: var(--jp-link);
    text-decoration: none !important;
    padding: 0.25rem 0.5rem;
    margin: 0 -0.25rem;
    border-radius: 4px;
    line-height: 1.4;
}

.jp-archive-link:hover {
    background: #f9fafb;
    text-decoration: none !important;
}

.jp-archive-link--active {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.jp-archive-empty {
    font-size: 0.82rem;
    margin: 0;
    padding: 0.15rem 0;
}

/* Main: hero + description + articles */
.jp-hero {
    position: relative;
    background: var(--jp-bg-soft);
    border-bottom: 1px solid var(--jp-border);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jp-hero img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
}

.jp-hero-fallback {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--jp-muted);
    font-size: 0.9rem;
}

.jp-hero-fallback strong {
    display: block;
    font-size: 1.5rem;
    color: var(--jp-brand);
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
}

.jp-intro {
    padding: 1.35rem 1.5rem 1rem;
}

.jp-intro h1 {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 1.45rem;
    font-weight: 700;
    font-style: italic;
    margin: 0 0 0.75rem;
    line-height: 1.3;
    color: #111;
}

.jp-intro-lead {
    font-size: 0.92rem;
    line-height: 1.65;
    color: #333;
    margin: 0 0 1rem;
}

.jp-highlights {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #333;
}

.jp-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--jp-border);
    font-size: 0.82rem;
    color: var(--jp-muted);
}

.jp-metrics strong {
    color: #222;
}

.jp-latest-head {
    padding: 0.85rem 1.5rem;
    background: #f6f3ec;
    border-top: 1px solid var(--jp-border);
    border-bottom: 1px solid var(--jp-border);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.jp-latest-head-filter {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--jp-muted);
}

.jp-filter-banner {
    padding: 0.65rem 1.5rem;
    background: #f0f4ff;
    border-bottom: 1px solid var(--jp-border);
    font-size: 0.86rem;
    color: #333;
}

.jp-filter-clear {
    margin-left: 0.35rem;
    font-weight: 600;
    white-space: nowrap;
}

.jp-article-feed {
    padding: 0;
}

.jp-article-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--jp-border);
}

.jp-article-item:last-child {
    border-bottom: none;
}

.jp-article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.jp-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.45rem;
    border-radius: 3px;
}

.jp-badge--oa {
    background: #dcfce7;
    color: var(--jp-open);
    border: 1px solid #bbf7d0;
}

.jp-badge--type {
    background: #f3e8ef;
    color: var(--jp-brand);
    border: 1px solid #e9d4df;
}

.jp-article-filemeta {
    font-size: 0.75rem;
    color: var(--jp-muted);
    margin-bottom: 0.35rem;
}

.jp-article-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.45rem;
}

.jp-article-title a {
    color: var(--jp-link);
}

.jp-article-title a:hover {
    color: #153a9e;
}

.jp-article-authors {
    font-size: 0.86rem;
    margin: 0 0 0.4rem;
    line-height: 1.45;
    color: #333;
}

.jp-article-authors a {
    color: var(--jp-link);
    font-weight: 500;
}

.jp-citation {
    display: block;
    font-size: 0.82rem;
    font-style: normal;
    color: #333;
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.jp-citation em {
    font-style: italic;
    color: #111;
}

.jp-article-abstract {
    font-size: 0.86rem;
    line-height: 1.6;
    color: #3a3a3a;
    margin: 0;
}

.jp-read-more {
    font-weight: 600;
    white-space: nowrap;
}

/* Right column */
.jp-subscribe .jp-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.jp-subscribe input[type="email"] {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--jp-border);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
}

.jp-subscribe button {
    padding: 0.45rem 0.75rem;
    background: var(--jp-brand);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
}

.jp-news-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid #f0ebe3;
    font-size: 0.8rem;
}

.jp-news-item:last-child {
    border-bottom: none;
}

.jp-news-date {
    font-size: 0.72rem;
    color: var(--jp-muted);
}

.jp-news-item a {
    font-weight: 600;
    color: #222;
}

.jp-topics-note {
    font-size: 0.8rem;
    color: var(--jp-muted);
    margin: 0 0 0.65rem;
}

/* Volume & issue (archive grid + TOC) */
.jp-volume-head,
.jp-issue-page-head {
    padding: 1.35rem 1.5rem 1rem;
    border-bottom: 1px solid var(--jp-border);
}

.jp-volume-title,
.jp-issue-page-title {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 1.35rem;
    font-weight: 700;
    font-style: italic;
    margin: 0 0 0.35rem;
    color: #111;
    line-height: 1.25;
}

.jp-volume-lead {
    margin: 0;
    font-size: 0.9rem;
    color: var(--jp-muted);
}

.jp-issue-page-sub {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.jp-issue-grid-wrap {
    padding: 1.25rem 1.5rem 1.5rem;
}

.jp-issue-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem 1.25rem;
}

.jp-issue-card {
    margin: 0;
    min-width: 0;
}

.jp-issue-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
    color: #1a1a1a;
    padding: 0.35rem;
    border-radius: 6px;
}

.jp-issue-card-link:hover {
    background: var(--jp-bg-soft);
    color: #111;
}

.jp-issue-cover {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--jp-border);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.jp-issue-cover-top {
    flex: 0 0 42%;
    background: linear-gradient(160deg, var(--jp-brand), #8b2f5c);
    color: #fff;
    padding: 0.4rem 0.45rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}

.jp-issue-cover-journal {
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jp-issue-cover-art {
    flex: 1;
    background: linear-gradient(180deg, #e8e4dc 0%, #d4cfc4 100%);
}

.jp-issue-voliss,
.jp-issue-date {
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.jp-issue-count {
    font-size: 0.78rem;
    color: var(--jp-muted);
}

.jp-issue-toc {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--jp-link);
    margin-top: 0.15rem;
}

.jp-issue-empty {
    grid-column: 1 / -1;
    list-style: none;
}

.jp-toc-feed {
    padding: 0;
}

.jp-toc-article {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--jp-border);
}

.jp-toc-article:last-child {
    border-bottom: none;
}

.jp-toc-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.45rem;
}

.jp-toc-title a {
    color: var(--jp-link);
}

.jp-toc-title a:hover {
    color: #153a9e;
}

.jp-toc-authors {
    font-size: 0.86rem;
    margin: 0 0 0.35rem;
    color: #333;
}

.jp-toc-affiliations {
    margin: 0 0 0.3rem;
    color: #374151;
    font-size: 0.83rem;
    line-height: 1.45;
}

.jp-toc-affiliations strong {
    color: #111827;
    font-weight: 600;
}

.jp-toc-quicklinks {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    color: var(--jp-muted);
}

.jp-toc-quicklinks a {
    color: var(--jp-link);
    font-weight: 600;
}

.jp-toc-abstract {
    margin: 0 0 0.45rem;
    color: #1f2937;
    font-size: 0.85rem;
    line-height: 1.55;
}

.jp-citation--compact {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.jp-citation--compact a {
    color: var(--jp-link);
}

.jp-toc-actions {
    font-size: 0.82rem;
    margin: 0;
    color: var(--jp-muted);
}

.jp-toc-actions a {
    color: var(--jp-link);
    font-weight: 600;
}

/* Journal custom content pages */
.jp-page-content-card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border: 1px solid #dce6f4;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    padding: 1.4rem 1.45rem;
}

.jp-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.jp-page-head h1 {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.jp-page-content {
    font-size: 0.95rem;
    line-height: 1.76;
    color: #1e293b;
}

.jp-page-content h2,
.jp-page-content h3 {
    color: #111827;
    margin: 1.3rem 0 0.45rem;
    line-height: 1.3;
}

.jp-page-content p,
.jp-page-content ul,
.jp-page-content ol {
    margin-top: 0.55rem;
    margin-bottom: 0;
}

.jp-page-content ul,
.jp-page-content ol {
    padding-left: 1.2rem;
}

.jp-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
}

.jp-page-content th,
.jp-page-content td {
    border: 1px solid #e5e7eb;
    padding: 0.4rem 0.5rem;
    text-align: left;
}

.jp-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0.8rem 0;
    border: 1px solid #e2e8f0;
}

.jp-inline-editor {
    margin-top: 1.1rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

.jp-inline-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.jp-inline-editor-toolbar .jp-btn {
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
}

.jp-inline-image-upload {
    cursor: pointer;
}

.jp-inline-editor-textarea {
    width: 100%;
    min-height: 320px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.55;
    background: #fff;
}

.jp-inline-editor-textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.22);
    outline-offset: 1px;
    border-color: #93c5fd;
}

.jp-inline-editor-actions {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.jp-inline-editor-status {
    font-size: 0.82rem;
    color: #64748b;
}

@media (max-width: 640px) {
    .jp-page-content-card {
        padding: 1rem;
    }
}

@media (max-width: 1024px) {
    .journal-layout-grid {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .journal-col--main {
        order: -1;
    }

    .jp-issue-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .jp-issue-grid {
        grid-template-columns: 1fr;
    }
}
