/* papers.css — research archive catalog */

/* ── Hero ─────────────────────────────────────────────── */
.papers-hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2rem;
    text-align: center;
}
.papers-hero__label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.papers-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1rem;
}
.papers-hero__desc {
    color: var(--text-dim);
    font-size: 0.85rem;
    max-width: 580px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}

/* ── Stats strip ──────────────────────────────────────── */
.papers-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    border: 1px solid var(--border);
    max-width: 640px;
    margin: 0 auto;
}
.stat {
    flex: 1;
    text-align: center;
    padding: 1.1rem 0.5rem;
    border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat__val {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}
.stat__label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-faint);
    margin-top: 0.35rem;
}

/* ── Featured papers ──────────────────────────────────── */
.papers-featured {
    max-width: 960px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem;
}
.papers-featured__label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.75rem;
}
.featured-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    border: 1px solid var(--border);
}
.featured-card {
    padding: 1rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.featured-card:last-child { border-right: none; }
.featured-card:hover { background: var(--surface-2); }
.featured-card__num {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.35rem;
}
.featured-card__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.82rem;
    line-height: 1.25;
    margin-bottom: 0.3rem;
}
.featured-card__desc {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.45;
    flex: 1;
}
.featured-card__tag {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* ── Catalog ──────────────────────────────────────────── */
.papers-catalog {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ── Toolbar ──────────────────────────────────────────── */
.papers-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    padding: 0.75rem 0 0.65rem;
    border-bottom: 1px solid var(--border);
}
#paper-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0.6rem 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}
#paper-search:focus { border-color: var(--accent); }
#paper-search::placeholder { color: var(--text-faint); }

.papers-filters {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}
.filter-chip {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: all 0.12s;
}
.filter-chip:hover {
    color: var(--text);
    border-color: var(--text-dim);
}
.filter-chip.active {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

/* ── Count + section headers ──────────────────────────── */
.papers-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-faint);
    padding: 0.75rem 0 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.papers-section { margin-bottom: 0; }
.papers-section__header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 1.25rem 0 0.5rem;
    border-bottom: 2px solid var(--border);
}
.papers-section__title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.papers-section__range {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-faint);
}
.papers-section__count {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-faint);
    margin-left: auto;
}

/* ── Paper row ────────────────────────────────────────── */
.paper-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-dim);
    transition: background 0.1s;
}
.paper-row:hover { background: var(--surface); }
.paper-row__num {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    padding-top: 0.05rem;
}
.paper-row__body { min-width: 0; }
.paper-row__title {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.3;
}
.paper-row__title a {
    color: inherit;
    text-decoration: none;
}
.paper-row__title a:hover { color: var(--accent); }
.paper-row__sub {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.4;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Meta (right column) ─────────────────────────────── */
.paper-row__meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-left: 0.75rem;
    white-space: nowrap;
}
.license {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.12rem 0.35rem;
    border: 1px solid;
}
.license--open {
    color: var(--green);
    border-color: color-mix(in srgb, var(--green) 35%, transparent);
}
.license--mrl {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.doi-link,
.detail-link {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-faint);
    transition: color 0.12s;
}
.doi-link:hover { color: var(--text); }
.detail-link { color: var(--accent); }
.detail-link:hover { color: var(--text); }

/* ── Missing-state indicators ─────────────────────────── */
.paper-row--no-page {
    opacity: 0.55;
}
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.35rem;
    margin-left: 0.5rem;
    vertical-align: middle;
    border: 1px solid;
}
.badge--missing {
    color: var(--kill);
    border-color: color-mix(in srgb, var(--kill) 45%, transparent);
}
.filter-chip--warn {
    color: var(--kill);
    border-color: color-mix(in srgb, var(--kill) 35%, transparent);
}
.filter-chip--warn:hover {
    color: var(--kill);
    border-color: var(--kill);
}
.filter-chip--warn.active {
    background: var(--kill);
    border-color: var(--kill);
    color: #fff;
}

/* ── Empty state ──────────────────────────────────────── */
.papers-empty {
    padding: 3.5rem 0;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.85rem;
}

/* ── Footer CTA ───────────────────────────────────────── */
.papers-footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .featured-card:nth-child(3) { border-right: none; }
    .featured-card:nth-child(n+4) { border-top: 1px solid var(--border); }
    .featured-card:nth-child(4) { border-right: 1px solid var(--border); }
}

@media (max-width: 650px) {
    .papers-hero { padding: 2rem 1rem 1.5rem; }
    .papers-stats { flex-wrap: wrap; max-width: 100%; }
    .stat { min-width: 33%; }
    .stat:nth-child(3) { border-right: none; }
    .stat:nth-child(n+4) { border-top: 1px solid var(--border); }
    .stat:nth-child(4) { border-right: 1px solid var(--border); }
    .stat__val { font-size: 1.3rem; }
    .papers-featured { padding: 0 1rem; }
    .featured-grid { grid-template-columns: 1fr 1fr; }
    .featured-card:nth-child(2n) { border-right: none; }
    .featured-card:nth-child(n+3) { border-top: 1px solid var(--border); }
    .featured-card:nth-child(3) { border-right: 1px solid var(--border); }
    .papers-catalog { padding: 2rem 1rem 3rem; }
    .paper-row {
        grid-template-columns: 38px 1fr;
        grid-template-rows: auto auto;
    }
    .paper-row__num { grid-column: 1; grid-row: 1; }
    .paper-row__body { grid-column: 2; grid-row: 1; }
    .paper-row__meta {
        grid-column: 2;
        grid-row: 2;
        padding-left: 0;
        margin-top: 0.3rem;
    }
    .paper-row__sub { white-space: normal; }
    .papers-footer { padding: 0 1rem 3rem; }
}

@media (max-width: 420px) {
    .featured-grid { grid-template-columns: 1fr; }
    .featured-card { border-right: none !important; border-top: 1px solid var(--border); }
    .featured-card:first-child { border-top: none; }
}
