/* JUPEB papers — hub and per-paper pages.
   Reuses the theme's --pq-* palette; dark rules follow the theme convention:
   an explicit .dark-mode class plus the no-JS prefers-color-scheme fallback. */

.jupeb-lead {
    max-width: 68ch;
    margin: 0 0 2rem;
}

.jupeb-lead p {
    margin: 0 0 0.85rem;
    line-height: 1.65;
}

.jupeb-note {
    border-left: 3px solid var(--pq-gold, #F5A623);
    background: #FFF9EC;
    padding: 0.85rem 1rem;
    margin: 1.25rem 0;
    max-width: 68ch;
    line-height: 1.6;
    color: var(--pq-ink, #0F172A);
}

.jupeb-lead-answer {
    font-size: 1.0625rem;
    line-height: 1.7;
    max-width: 68ch;
    margin: 0 0 1.25rem;
}

/* Year blocks on the hub */
.jupeb-year {
    margin: 0 0 2.5rem;
}

.jupeb-year > h2,
.jupeb-siblings > h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.25rem;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--pq-line, #E7EBF1);
    color: var(--pq-navy, #0A1F44);
}

.jupeb-year-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #37507F;
    background: #EDF2FB;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
}

/* Paper cards */
.jupeb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 0.85rem;
}

.jupeb-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 48px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--pq-line, #E7EBF1);
    border-radius: 6px;
    background: #fff;
    color: var(--pq-ink, #0F172A);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.jupeb-card:hover,
.jupeb-card:focus-visible {
    border-color: var(--pq-blue, #2563EB);
    box-shadow: var(--pq-shadow, 0 6px 18px rgba(15,23,42,.05));
}

.jupeb-card-subject {
    font-weight: 600;
    line-height: 1.35;
}

.jupeb-card-meta {
    font-size: 0.8125rem;
    color: var(--pq-muted, #64748B);
}

/* Download */
.jupeb-download-wrap {
    margin: 0 0 1.75rem;
}

.jupeb-download {
    display: inline-block;
    min-height: 48px;
    padding: 0.8rem 1.4rem;
    background: var(--pq-navy, #0A1F44);
    color: #fff;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
}

.jupeb-download:hover,
.jupeb-download:focus-visible {
    background: #123067;
    color: #fff;
}

/* Facts table */
.jupeb-facts {
    border-collapse: collapse;
    width: 100%;
    max-width: 34rem;
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
}

.jupeb-facts th,
.jupeb-facts td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--pq-line, #E7EBF1);
    vertical-align: top;
}

.jupeb-facts th {
    width: 11rem;
    font-weight: 600;
    color: var(--pq-muted, #64748B);
}

.jupeb-siblings {
    margin: 2.5rem 0 0;
}

.jupeb-back {
    margin: 2rem 0 0;
}

@media (max-width: 30rem) {
    .jupeb-grid { grid-template-columns: 1fr; }
    .jupeb-facts th { width: 8.5rem; }
}

/* ---------- Dark mode ---------- */

.dark-mode .jupeb-card {
    background: #2d2d2d;
    border-color: #3d3d3d;
    color: #e8e8e8;
}
.dark-mode .jupeb-card:hover,
.dark-mode .jupeb-card:focus-visible { border-color: #5dade2; }
.dark-mode .jupeb-card-meta { color: #9a9a9a; }
.dark-mode .jupeb-year > h2,
.dark-mode .jupeb-siblings > h2 { color: #e8e8e8; border-bottom-color: #3d3d3d; }
.dark-mode .jupeb-year-count { background: #243247; color: #cfe0ff; }
.dark-mode .jupeb-note { background: #2a2418; border-left-color: #f0c069; color: #e8e8e8; }
.dark-mode .jupeb-facts th,
.dark-mode .jupeb-facts td { border-bottom-color: #3d3d3d; }
.dark-mode .jupeb-facts th { color: #9a9a9a; }
.dark-mode .jupeb-download { background: #2563EB; color: #fff; }
.dark-mode .jupeb-download:hover,
.dark-mode .jupeb-download:focus-visible { background: #1d4fd8; }

@media (prefers-color-scheme: dark) {
    html:not(.light-mode) .jupeb-card {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: #e8e8e8;
    }
    html:not(.light-mode) .jupeb-card-meta { color: #9a9a9a; }
    html:not(.light-mode) .jupeb-year > h2,
    html:not(.light-mode) .jupeb-siblings > h2 { color: #e8e8e8; border-bottom-color: #3d3d3d; }
    html:not(.light-mode) .jupeb-year-count { background: #243247; color: #cfe0ff; }
    html:not(.light-mode) .jupeb-note { background: #2a2418; border-left-color: #f0c069; color: #e8e8e8; }
    html:not(.light-mode) .jupeb-facts th,
    html:not(.light-mode) .jupeb-facts td { border-bottom-color: #3d3d3d; }
    html:not(.light-mode) .jupeb-facts th { color: #9a9a9a; }
    html:not(.light-mode) .jupeb-download { background: #2563EB; color: #fff; }
}
