/* Give the desktop layout enough room for the full archive. */
#content {
    max-width: 1400px;
}

/* =========================================================
   Latest Puzzle + Statistics Dashboard
   ========================================================= */

.latest-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.latest-section > .section-label {
    grid-column: 1 / -1;
}

.latest-section #most-recent {
    grid-column: 1;
    min-width: 0;
    width: 100%;
}

.latest-section #puzzle-dashboard {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    margin: 0;
}

.latest-section #puzzle-dashboard .dashboard-cards {
    grid-template-columns: 1fr;
    gap: 8px;
}

.latest-section #puzzle-dashboard .dashboard-card {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 13px 14px;
}

.latest-section #puzzle-dashboard .dashboard-card-label {
    margin-bottom: 0;
}

.latest-section #puzzle-dashboard .dashboard-card-value {
    margin-top: 2px;
}

.latest-section #puzzle-dashboard > .update-monitor {
    display: none !important;
}

/* =========================================================
   Archive + Updates
   ========================================================= */

.listing-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "heading"
        "archive"
        "updates";
    row-gap: 24px;
    align-items: start;
}

.listing-section .section-heading {
    grid-area: heading;
    min-width: 0;
}

.listing-section #summary-table {
    grid-area: archive;
    width: 100%;
    min-width: 0;
}

#updates-monitor-host {
    grid-area: updates;
    width: 100%;
    min-width: 0;
    margin-top: 0;
}

#updates-monitor-host .update-monitor-list {
    max-height: 520px;
}


/* Keep the archive header and rows aligned while giving Rating enough room. */
#summary-table .archive-header,
#summary-table ul {
    grid-template-columns:
        42px
        minmax(220px, 1fr)
        138px
        122px
        52px
        52px
        86px
        100px
        94px
        2ch;
    min-width: 1026px;
}

/* =========================================================
   Responsive layout
   ========================================================= */

@media (max-width: 1100px) {
    #content {
        max-width: 1100px;
    }
    .latest-section {
        grid-template-columns: minmax(0, 1fr);
    }

    .latest-section > .section-label {
        grid-column: 1;
    }

    .latest-section #most-recent,
    .latest-section #puzzle-dashboard {
        grid-column: 1;
    }

    .latest-section #puzzle-dashboard {
        margin-top: 0;
    }

    .listing-section {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "heading"
            "archive"
            "updates";
        row-gap: 24px;
    }

    #updates-monitor-host {
        margin-top: 0;
    }
}

@media (max-width: 760px) {
    .latest-section #puzzle-dashboard .dashboard-cards {
        grid-template-columns: 1fr;
    }
}
