/**
 * Quote By Quote — Browse directory pages (categories, authors)
 * Uses global design tokens; supports light/dark via html[data-theme].
 */

/* ── Shared hero ─────────────────────────────────────────── */
.browse-hero,
.cats-hero,
.auth-hero {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--divider);
    padding: 3.5rem var(--gutter) 0;
}
.browse-hero__inner,
.cats-hero__inner,
.auth-hero__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2.5rem;
    align-items: end;
    max-width: 1600px;
    margin-inline: auto;
}
.browse-hero__label,
.cats-hero__label,
.auth-hero__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.85rem;
}
.browse-hero__label::before,
.cats-hero__label::before,
.auth-hero__label::before {
    content: "";
    display: block;
    width: 18px;
    height: 1.5px;
    background: currentColor;
}
.browse-hero__title,
.cats-hero__title,
.auth-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 0.5rem;
}
.browse-hero__sub,
.cats-hero__sub,
.auth-hero__sub {
    font-size: 1rem;
    color: var(--ink-muted);
    font-weight: 400;
    margin: 0;
    padding-bottom: 2.5rem;
}
.browse-hero__sub a,
.auth-hero__sub a {
    color: var(--accent);
}
.browse-hero__search,
.cats-hero__search,
.auth-hero__search {
    display: flex;
    gap: 0.5rem;
    min-width: 280px;
    padding-bottom: 2.5rem;
    align-items: flex-end;
}
.browse-hero__search input,
.cats-hero__search input,
.auth-hero__search input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid var(--divider);
    border-radius: var(--radius-pill);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.browse-hero__search input:focus,
.cats-hero__search input:focus,
.auth-hero__search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.browse-hero__search button,
.cats-hero__search button,
.auth-hero__search button {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--surface-on-accent);
    border: none;
    font: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.browse-hero__search button:hover,
.cats-hero__search button:hover,
.auth-hero__search button:hover {
    background: var(--accent-hover);
}

/* ── Sticky alpha / toolbar ──────────────────────────────── */
.cats-alpha,
.auth-toolbar {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--divider);
    position: sticky;
    top: var(--site-nav-offset, 57px);
    z-index: 90;
}
.cats-alpha {
    padding-block: 0.85rem;
    padding-inline: max(var(--gutter), calc((100vw - 1600px) / 2));
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.auth-toolbar {
    padding-inline: max(var(--gutter), calc((100vw - 1600px) / 2));
    display: flex;
    align-items: center;
}
.cats-alpha__link,
.auth-alpha-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s;
}
.auth-alpha-link {
    font-size: 0.78rem;
}
.cats-alpha__link:hover,
.auth-alpha-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.auth-alpha-link.is-current {
    background: var(--accent);
    color: var(--surface-on-accent);
}
.auth-alpha-link.is-current:hover {
    background: var(--accent-hover);
    color: var(--surface-on-accent);
}
.auth-toolbar__info {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-faint);
    padding: 0.9rem 1.25rem 0.9rem 0;
    border-right: 1px solid var(--divider);
    white-space: nowrap;
    flex-shrink: 0;
}
.auth-toolbar__info strong {
    color: var(--ink-muted);
}
.auth-toolbar__alpha {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.auth-toolbar__alpha::-webkit-scrollbar {
    display: none;
}

/* ── Content shell ─────────────────────────────────────────── */
.browse-content,
.cats-content,
.auth-content {
    padding: 2.5rem var(--gutter) 4rem;
    max-width: 1600px;
    margin-inline: auto;
    background: var(--bg);
    color: var(--ink);
}
.auth-content {
    padding-bottom: 1.5rem;
}

/* ── Letter sections ───────────────────────────────────────── */
.browse-section,
.cats-section,
.auth-section {
    margin-bottom: 2.75rem;
}
.auth-section {
    margin-bottom: 2.5rem;
}
.browse-section__header,
.cats-section__header,
.auth-section__header {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid var(--ink);
}
.browse-section__letter,
.cats-section__letter,
.auth-section__letter {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
}
.browse-section__count,
.cats-section__count,
.auth-section__count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Category cards ──────────────────────────────────────── */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0.75rem;
}
.cat-card-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1.1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    gap: 0.75rem;
    transition: all 0.22s ease;
}
.cat-card-v2:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.cat-card-v2__name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.35;
    transition: color 0.22s;
}
.cat-card-v2:hover .cat-card-v2__name {
    color: var(--accent);
}
.cat-card-v2__count {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-faint);
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.55rem;
    transition: all 0.22s;
}
.cat-card-v2:hover .cat-card-v2__count {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Author cards ────────────────────────────────────────── */
.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 0.75rem;
}
.auth-card {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    gap: 0.85rem;
    transition: all 0.22s ease;
}
.auth-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.auth-card__initial {
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent);
    transition: all 0.22s;
    text-transform: uppercase;
}
.auth-card:hover .auth-card__initial {
    background: var(--accent);
    color: var(--surface-on-accent);
    border-color: var(--accent);
}
.auth-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.auth-card__name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.22s;
}
.auth-card:hover .auth-card__name {
    color: var(--accent);
}
.auth-card__prof {
    font-size: 0.72rem;
    color: var(--ink-faint);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-card__count {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--ink-faint);
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-pill);
    padding: 0.18rem 0.5rem;
    transition: all 0.22s;
}
.auth-card:hover .auth-card__count {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Authors pagination ──────────────────────────────────── */
.auth-pagination {
    padding: 1.5rem var(--gutter) 4rem;
    max-width: 1600px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg);
}
.auth-page-info {
    font-size: 0.8rem;
    color: var(--ink-faint);
}
.auth-page-info strong {
    color: var(--ink-muted);
}
.auth-pager {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.auth-pager__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--divider);
    background: var(--bg-elevated);
    color: var(--ink);
    font-size: 0.83rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.auth-pager__link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.auth-pager__link.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--surface-on-accent);
    font-weight: 700;
}
.auth-pager__link.is-disabled {
    color: var(--ink-faint);
    pointer-events: none;
    opacity: 0.45;
}
.auth-pager__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.83rem;
    color: var(--ink-faint);
}

/* ── Footer CTAs ─────────────────────────────────────────── */
.browse-footer,
.cats-footer,
.auth-footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 2rem var(--gutter) 2.5rem;
    border-top: 1px solid var(--divider);
    background: var(--bg-elevated);
    max-width: none;
}

/* ── Empty state ─────────────────────────────────────────── */
.auth-empty {
    text-align: center;
    padding: 4rem var(--gutter);
    color: var(--ink-muted);
}
.auth-empty__title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--ink);
}
.auth-empty p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .browse-hero__inner,
    .cats-hero__inner,
    .auth-hero__inner {
        grid-template-columns: 1fr;
    }
    .browse-hero__search,
    .cats-hero__search,
    .auth-hero__search {
        padding-bottom: 0;
        min-width: 0;
    }
    .browse-hero__sub,
    .cats-hero__sub,
    .auth-hero__sub {
        padding-bottom: 1.5rem;
    }
    .auth-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .auth-toolbar__info {
        border-right: none;
        border-bottom: 1px solid var(--divider);
        width: 100%;
        padding: 0.65rem 0;
    }
    .auth-toolbar__alpha {
        padding: 0.65rem 0;
    }
}
