/* ==============================================
   RESEARCH PAGE
   ============================================== */

/* ── Filter Tabs ──────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: center;
    margin-bottom: var(--sp-10);
}
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0.45rem var(--sp-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast);
}
.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-section-alt);
}
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}
.filter-btn .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
}
.filter-btn:not(.active) .count {
    background: var(--bg-section-alt);
    color: var(--text-secondary);
}

/* ── Publications List ────────────────────────── */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-bottom: var(--sp-8);
}

/* Year Group */
.year-group {
    margin-bottom: var(--sp-6);
}
.year-label {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.year-label__text {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--primary);
}
[data-theme="dark"] .year-label__text { color: var(--primary); }
.year-label__line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Publication Item (Accordion) */
.pub-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.pub-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.pub-item.expanded { border-color: var(--primary); box-shadow: var(--shadow-md); }

.pub-item__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--sp-4);
    align-items: start;
    padding: var(--sp-5) var(--sp-6);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}
.pub-item__header:hover { background: var(--bg-section-alt); }

.pub-item__index {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--accent);
    min-width: 28px;
    padding-top: 2px;
}
.pub-item__meta { min-width: 0; }
.pub-item__title {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: var(--sp-2);
}
.pub-item__authors {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--sp-2);
}
.pub-item__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
}
.pub-item__date {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-body);
}

.pub-item__toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-section-alt);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-base);
    margin-top: 4px;
}
.pub-item__toggle:hover { background: var(--accent-subtle); color: var(--accent); }
.pub-item.expanded .pub-item__toggle {
    transform: rotate(180deg);
    background: var(--accent-subtle);
    color: var(--accent);
}

/* Expanded Details */
.pub-item__body {
    display: none;
    padding: 0 var(--sp-6) var(--sp-5);
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding-top: var(--sp-5);
}
.pub-item.expanded .pub-item__body { display: block; }

.pub-item__citation {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.75;
    background: var(--bg-section-alt);
    padding: var(--sp-4);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
    margin-bottom: var(--sp-4);
    font-style: italic;
}
.pub-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}
.pub-action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0.4rem var(--sp-4);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast);
}
.pub-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-section-alt);
    text-decoration: none;
}
.pub-action-btn--doi:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Toggle All Button ────────────────────────── */
.toggle-all-wrap {
    display: flex;
    justify-content: center;
    margin-top: var(--sp-8);
}

/* ── No Results ───────────────────────────────── */
.no-results {
    text-align: center;
    padding: var(--sp-16) 0;
    color: var(--text-secondary);
}
.no-results i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: var(--sp-4);
    display: block;
}

/* ── Stats Strip ──────────────────────────────── */
.pub-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    justify-content: center;
    margin-bottom: var(--sp-10);
}
.pub-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--sp-4) var(--sp-8);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 120px;
}
.pub-stat__number {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--accent);
}
.pub-stat__label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

@media (max-width: 640px) {
    .pub-item__header { grid-template-columns: auto 1fr; gap: var(--sp-3); }
    .pub-item__toggle { display: none; }
    .pub-item__header { cursor: default; }
    .pub-item__body { display: block; }
    .pub-item__index { display: none; }
}
