/* =====================================================================
 * pages/downloads.css — /downloads file list + empty state.
 *
 * Loaded LAST in the cascade (via $page_css in DownloadsController).
 * Reuses the shared .btn component for actions; everything here is
 * tokens / color-mix / currentColor only — NO hex literals (hex audit
 * stays clean).
 * ===================================================================== */

/* --- File list (when downloads exist) -------------------------------- */
.downloads-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 70ch;          /* comfortable single reading column */
    display: grid;
    gap: var(--space-4);
}

/* Whole card is the download link. */
.download-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform var(--transition-fast),
                box-shadow var(--transition-base),
                border-color var(--transition-base);
}
.download-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-strong);
}
.download-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.download-card__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-md);
    color: var(--color-primary);
    background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
}
.download-card__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.download-card__body {
    flex: 1 1 auto;
    min-width: 0;             /* allow long names to wrap rather than overflow */
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.download-card__name {
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    line-height: var(--lh-tight);
}
.download-card__meta {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* The visible "Download" pill is decorative (the whole card is the link),
   so it must not capture pointer/hover state of its own. */
.download-card__action {
    flex: 0 0 auto;
    pointer-events: none;
}

/* --- Empty state (no files yet) -------------------------------------- */
.downloads-empty {
    max-width: 48ch;
    margin-inline: auto;
    padding: var(--space-8) var(--space-6);
    text-align: center;
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.downloads-empty__icon {
    display: inline-grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: var(--space-4);
    border-radius: var(--radius-pill);
    color: var(--color-primary);
    background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
}
.downloads-empty__icon svg {
    width: 2rem;
    height: 2rem;
}
.downloads-empty__title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--color-primary);
    margin-bottom: var(--space-3);
}
.downloads-empty__text {
    color: var(--color-text-muted);
    line-height: var(--lh-relaxed);
    max-width: 40ch;
    margin-inline: auto;
}
