/* Paper pages (papers/*.html): one page per paper with links, a focal figure and a plain-language explainer */

.paper-kicker {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-text);
}

.paper-hero h1 {
    margin: 0 0 1rem !important;
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.paper-authors {
    margin: 0 0 0.25rem;
    line-height: 1.6;
}

.paper-authors sup {
    font-size: 0.7em;
    color: var(--muted-text);
}

.paper-affiliations {
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    color: var(--muted-text);
    line-height: 1.5;
}

.paper-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.paper-buttons a {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    min-height: 44px;
    padding: 0 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--foreground) !important;
    text-decoration: none !important;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.paper-buttons a:hover,
.paper-buttons a:focus-visible {
    border-color: var(--accent);
    background: var(--subtle-bg, #f6f4f1);
}

.paper-buttons a.primary {
    background: var(--foreground);
    border-color: var(--foreground);
    color: var(--background) !important;
}

.paper-buttons svg {
    width: 1em;
    height: 1em;
    flex: none;
}

.paper-tldr {
    margin: 0 0 2rem;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--accent);
    background: var(--subtle-bg, #f6f4f1);
    border-radius: 0 6px 6px 0;
}

.paper-tldr p {
    margin: 0;
}

.paper-tldr strong:first-child {
    color: var(--accent);
}

/* The focal figure may run wider than the 650px text column */
.paper-figure {
    width: min(960px, calc(100vw - 2rem));
    margin: 0 0 2.5rem 50%;
    transform: translateX(-50%);
}

.paper-figure .frame {
    padding: clamp(0.5rem, 2vw, 1.25rem);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.paper-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.paper-figure figcaption {
    max-width: var(--content-width);
    margin: 0.75rem auto 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--muted-text);
}

.paper-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0 2rem;
    padding: 0;
    list-style: none;
}

.paper-stats li {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    line-height: 1.3;
    font-size: 0.85rem;
    color: var(--muted-text);
}

.paper-stats b {
    display: block;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
    .paper-hero h1 { font-size: 1.6rem; }
}

.paper-body h2 {
    margin: 2.5rem 0 0.75rem !important;
    font-size: 1.35rem;
}

.paper-body blockquote {
    margin: 1.25rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 3px solid var(--border);
    color: var(--muted-text);
    font-style: italic;
}

/* Estimates with 95% credible intervals, drawn on a shared 0–25 pp scale */
.paper-estimates {
    margin: 1.5rem 0 0.5rem;
    padding: 0;
    list-style: none;
}

.paper-estimates li {
    margin: 0 0 1.1rem;
}

.paper-estimates .label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
    line-height: 1.4;
}

.paper-estimates .value {
    flex: none;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.paper-estimates .track {
    position: relative;
    height: 18px;
    margin-top: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.paper-estimates .ci {
    position: absolute;
    top: 8px;
    height: 2px;
    background: var(--accent);
    opacity: 0.55;
}

.paper-estimates .dot {
    position: absolute;
    top: 3px;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: var(--accent);
}

.paper-estimates-axis {
    position: relative;
    height: 1.2em;
    margin: -0.4rem 0 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-text);
    font-variant-numeric: tabular-nums;
}

.paper-estimates-axis span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.paper-estimates-axis span:first-child { transform: none; }
.paper-estimates-axis span:last-child { transform: translateX(-100%); }

.paper-note {
    font-size: 0.85rem;
    color: var(--muted-text);
}

.paper-cite pre {
    position: relative;
    margin: 0.75rem 0 0;
    padding: 1rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--subtle-bg, #f6f4f1);
    font: 0.8rem/1.5 var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
}

.paper-cite button {
    min-height: 36px;
    margin-top: 0.5rem;
    padding: 0 0.9rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--foreground);
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.paper-cite button:hover {
    border-color: var(--accent);
}

@media (prefers-color-scheme: dark) {
    .paper-figure .frame { border-color: transparent; }
}

/* Monochrome footer icons on pages one folder down (custom.css matches the root paths) */
@media (prefers-color-scheme: dark) {
    footer img[src="../gh.svg"],
    footer img[src="../em.svg"],
    footer img[src="../icons8-x-50.png"] {
        filter: invert(1) !important;
    }
}
