/* List pages: /lessons, /decks and /statistics. Shared header nav, page
   titles, the hairline-separated list rows, and the statistics cards.
   Loaded after style.css and uses its :root tokens. */

.header-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

/* Each link rule names :visited too, or Spectre's `a:visited` colour wins
   once a link has been clicked (see the note in style.css). */
.header-nav a,
.header-nav a:visited {
    color: var(--color-text-secondary);
}

.header-nav a[aria-current="page"] {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 4px;
}

.page-title {
    font-size: clamp(1.4rem, 6vw, 1.6rem);
    margin: 0 0 1.25rem;
}

.section-title {
    font-size: 1.2rem;
    margin: 2.25rem 0 0.75rem;
}

.page-action {
    margin-bottom: 1.25rem;
}

.deck-empty {
    color: var(--color-text-secondary);
    margin: 0 0 1.25rem;
}

/* ---- Rows: lessons and decks ----
   Each item sits between two hairlines, with its actions under the title,
   so on a phone it's clear which Whack-a-Mole belongs where. */

.lesson-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--color-border);
}

.lesson-row {
    margin: 0;
    padding: 18px 0;
    border-bottom: 1px solid var(--color-border);
}

.lesson-row-title,
.lesson-row-title:visited,
.lesson-row-title:hover,
.lesson-row-title:focus {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.3;
    color: var(--color-text);
    text-decoration: none;
}

.lesson-row-meta {
    margin: 4px 0 12px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.lesson-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.5rem;
}

/* The delete button lives in its own POST form, which would otherwise
   be a block and break the row. */
.lesson-row-actions form {
    display: inline;
    margin: 0;
}

.lesson-action,
.lesson-action:visited {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* Delete is a <button>, not a link: strip the browser's button look so it
   reads like the links next to it. */
button.lesson-action {
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.lesson-action:hover {
    color: var(--color-text);
}

.lesson-action--primary,
.lesson-action--primary:visited,
.lesson-action--primary:hover {
    color: var(--color-accent);
    font-weight: 500;
}

.lesson-action--danger:hover {
    color: var(--color-danger);
    text-decoration: underline;
}

/* ---- Statistics: a real table laid out as cards ---- */

.stats-table,
.stats-table tbody,
.stats-table tr,
.stats-table td {
    display: block;
}

.stats-table {
    width: 100%;
    border-top: 1px solid var(--color-border);
}

.stats-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 18px 0;
    border-bottom: 1px solid var(--color-border);
}

.stats-table td {
    padding: 0;
    border: 0;
    font-variant-numeric: tabular-nums;
}

.stats-table .stats-title {
    grid-column: 1 / -1;
    font-family: var(--font-display);
    font-size: 1.1rem;
    line-height: 1.3;
}

.stats-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.stats-muted {
    color: var(--color-text-secondary);
}
