/* library.css — Comprehensive site index page */

.library-intro {
    font-family: var(--font-sans);
    font-size: var(--text-size-small);
    color: var(--text-muted);
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}

/* ============================================================
   CONTROLS (sort + filter)
   ============================================================ */

.library-controls {
    margin-bottom: 2.5rem;
}

.library-controls-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.library-controls-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-faint);
}

.library-controls-options {
    display: flex;
    gap: 0.3rem;
}

.library-sort-btn {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.15em 0.55em;
    cursor: pointer;
    transition: border-color 0.1s, color 0.1s;
}

.library-sort-btn:hover {
    border-color: var(--border-muted);
    color: var(--text);
}

.library-sort-btn.is-active {
    border-color: var(--text-muted);
    color: var(--text);
    font-weight: 600;
}

/* Filter toggle */

.library-filter-toggle {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.15em 0.55em;
    cursor: pointer;
    margin-left: auto;
    transition: border-color 0.1s, color 0.1s;
}

.library-filter-toggle:hover,
.library-filter-toggle[aria-expanded="true"] {
    border-color: var(--text-muted);
    color: var(--text);
}

.filter-toggle-badge {
    font-weight: 600;
}

/* ============================================================
   FILTER PANEL
   ============================================================ */

.library-filters {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.library-filters[hidden] {
    display: none;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.filter-label {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-faint);
    width: 5.5rem;
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.filter-prefix {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-faint);
}

.filter-btn {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.1em 0.45em;
    cursor: pointer;
    transition: border-color 0.1s, color 0.1s;
}

.filter-btn:hover {
    border-color: var(--border-muted);
    color: var(--text);
}

.filter-btn.is-active {
    border-color: var(--text-muted);
    color: var(--text);
    font-weight: 600;
}

.filter-number {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    width: 3rem;
    padding: 0.1em 0.3em;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: transparent;
    color: var(--text);
}

.filter-number:focus {
    outline: none;
    border-color: var(--text-muted);
}

.filter-row-actions {
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.filter-clear-btn {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-faint);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.filter-clear-btn:hover {
    color: var(--text);
}

/* Filtered state */

.is-filtered {
    display: none !important;
}

/* Search-page result filtering (applied via search-filters.js) */

.search-filtered {
    display: none !important;
}

/* Search page filter controls — just the toggle, no sort buttons */

.search-filter-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

/* Empty state message */

.library-empty {
    font-family: var(--font-sans);
    font-size: var(--text-size-small);
    color: var(--text-faint);
    font-style: italic;
}

/* ============================================================
   PORTAL SECTIONS
   ============================================================ */

.library-section {
    margin-bottom: 2.5rem;
}

.library-section h2 {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: lowercase;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.library-section h2 a {
    color: inherit;
    text-decoration: none;
}

.library-section h2 a:hover {
    color: var(--text);
}

/* ============================================================
   ENTRY LIST
   ============================================================ */

.library-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.library-entry-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.library-entry-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    line-height: 1.3;
}

.library-entry-title:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.library-entry-date {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

.library-entry-abstract {
    font-family: var(--font-sans);
    font-size: var(--text-size-small);
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0.2rem 0 0;
}
