/* home-dashboard.css — styles for the homepage practice dashboard.
   All selectors are prefixed 'home-' to avoid colliding with header.css's
   sidebar/tab classes. Reuses main.css tokens (--ink, --border, --radius,
   --surface, --shadow-sm) and header.css's --skill-* colors so the dashboard
   matches the app's existing look. The arch motif from the site header is
   carried into the per-skill stat tiles. */

.home-heading {
    margin: 0 0 6px;
    color: var(--ink);
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: 1.7rem;
    letter-spacing: 0.01em;
}

.home-summary {
    margin: 0 0 1.4em;
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.5;
}

/* ── At-a-glance stats ────────────────────────────────── */

.home-stats {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 1.6em;
    padding-bottom: 1.4em;
    border-bottom: 1px solid var(--border);
}

.home-stat-tiles {
    display: flex;
    gap: 28px;
}

.home-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.home-stat-value {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1;
    color: var(--ink);
}

.home-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
}

/* Per-skill mini arches — the header motif, reused as clickable stat tiles */
.home-arch-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.home-arch-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.home-arch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    width: 86px;
    padding: 0.9em 0 0.55em;
    border-radius: 999px 999px 0 0;
    background: var(--brand-blue);
    color: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-arch-column:hover .home-arch,
.home-arch-column:focus-visible .home-arch {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.home-arch-column.home-skill-speaking .home-arch { background: var(--skill-speaking); }
.home-arch-column.home-skill-writing .home-arch { background: var(--skill-writing); }
.home-arch-column.home-skill-reading .home-arch { background: var(--skill-reading); }
.home-arch-column.home-skill-listening .home-arch { background: var(--skill-listening); }

.home-arch-count {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
}

.home-arch-skill {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.9);
}

.home-arch-coverage {
    font-size: 0.72rem;
    color: var(--ink-faint);
    white-space: nowrap;
}

/* ── Do this next card ────────────────────────────────── */

.home-next-card {
    padding: 1em 1.2em;
    margin-bottom: 1.6em;
    background: var(--surface-sunken);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.home-next-eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 3px;
}

.home-next-link {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.home-next-link:hover {
    text-decoration: underline;
}

.home-next-reason {
    margin: 3px 0 0;
    font-size: 0.88rem;
    color: var(--ink-muted);
}

/* ── Section titles (recent practice, guide) ──────────── */

.home-section-title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
}

/* ── Activity list ────────────────────────────────────── */

.home-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.home-activity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0.7em 0.9em;
    background: var(--surface-sunken);
    border-left: 4px solid var(--brand-blue);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    /* Anchor for the stretched task link below — makes the whole row clickable */
    position: relative;
    transition: background 0.1s;
}

.home-skill-speaking { border-left-color: var(--skill-speaking); }
.home-skill-writing { border-left-color: var(--skill-writing); }
.home-skill-reading { border-left-color: var(--skill-reading); }
.home-skill-listening { border-left-color: var(--skill-listening); }
.home-skill-other { border-left-color: var(--ink-faint); }

/* Stretch the task link over its whole row, so clicking anywhere on the row
   continues that task. The label anchor stays the single tab stop. */
a.home-activity-label::after {
    content: "";
    position: absolute;
    inset: 0;
}

.home-activity-row:has(a.home-activity-label):hover {
    background: var(--surface);
    cursor: pointer;
}

.home-activity-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.home-activity-label {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.home-activity-label:hover {
    text-decoration: underline;
}

.home-activity-id {
    color: var(--ink-faint);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.home-activity-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.home-activity-status {
    font-size: 0.85rem;
    font-weight: 700;
}

.home-status-done {
    color: var(--good);
}

.home-status-in-progress {
    color: var(--ink-muted);
}

.home-activity-date {
    color: var(--ink-faint);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Feedback subtitle line — a third child of the flex-wrap row. flex-basis:
   100% forces it onto its own line under .home-activity-main/.home-activity-meta
   without changing the row's flex-direction, so the existing layout (and the
   mobile column layout, which is already 100% wide) is untouched. */
.home-activity-feedback {
    flex-basis: 100%;
    width: 100%;
    color: var(--ink-muted);
    font-size: 0.8rem;
}

/* ── Skill-tab practice section and task hints ────────── */

.home-skill-activity {
    margin: 0.4em 0 1.4em;
}

/* One-line blurb under an unpracticed task's menu row */
.home-task-hint {
    padding: 2px 0.7em 8px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--ink-muted);
}

/* ── Guide articles (editorial section below practice data) ── */

.home-guide {
    margin-top: 2em;
    padding-top: 1.3em;
    border-top: 1px solid var(--border);
    max-width: 68ch;
}

.home-guide-article + .home-guide-article {
    margin-top: 1.3em;
}

.home-guide-article-title {
    margin: 0 0 4px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
}

.home-guide-article-body {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--ink-muted);
}

/* ── First-visit welcome overview ─────────────────────── */

.home-intro {
    color: var(--ink-muted);
    line-height: 1.5;
    margin-bottom: 1em;
}

.home-parts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 1em;
}

.home-part-card {
    padding: 0.8em;
    background: var(--surface-sunken);
    border-top: 3px solid var(--brand-blue);
    border-radius: var(--radius-sm);
}

.home-part-card.home-skill-speaking { border-top-color: var(--skill-speaking); }
.home-part-card.home-skill-writing { border-top-color: var(--skill-writing); }
.home-part-card.home-skill-reading { border-top-color: var(--skill-reading); }
.home-part-card.home-skill-listening { border-top-color: var(--skill-listening); }

.home-part-title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: var(--ink);
}

.home-part-duration {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.home-notes {
    margin: 0 0 1.2em;
    padding-left: 1.2em;
    color: var(--ink-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.home-cta-lead {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.6em;
}

.home-cta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.home-cta-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9em;
    border-radius: var(--radius);
    color: var(--surface);
    font-weight: 700;
    text-decoration: none;
    background: var(--brand-blue);
    box-shadow: var(--shadow-sm);
    transition: opacity 0.1s;
}

.home-cta-card:hover {
    opacity: 0.9;
}

.home-cta-card.home-skill-speaking { background: var(--skill-speaking); }
.home-cta-card.home-skill-writing { background: var(--skill-writing); }
.home-cta-card.home-skill-reading { background: var(--skill-reading); }
.home-cta-card.home-skill-listening { background: var(--skill-listening); }

/* ── Mobile ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .home-stats {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-stat-tiles {
        gap: 22px;
    }

    .home-arch-row {
        width: 100%;
        justify-content: space-between;
        gap: 6px;
    }

    .home-arch {
        width: 72px;
    }

    .home-arch-coverage {
        font-size: 0.65rem;
    }

    .home-parts-grid {
        grid-template-columns: 1fr;
    }

    .home-cta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-activity-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-activity-meta {
        width: 100%;
        justify-content: space-between;
    }
}
