/*
 * srl-season-schedule-table.css — the on-page schedule table ([srl_season_schedule_table]).
 *
 * OWNED by mu-plugins/srl-season-schedule-table.php; enqueued by
 * srl_ss_enqueue_schedule_assets() (handle "srl-season-schedule-table", version = file
 * mtime). CC-275 moved these rules out of the renderer's former inline <style> block and
 * added the phone layout, following the target table (CC-274) so the two read as siblings.
 *
 * MOBILE-FIRST (project policy): the BASE rules are the phone layout (< 600px) — each row a
 * stacked block, <thead> hidden. The desktop table (unchanged from before CC-275) is restored
 * in the single min-width:600px query at the bottom. 600px is written literally (CSS
 * variables cannot be used in @media conditions) and matches srl-forms.css and
 * srl-target-display.css.
 *
 * Scoping: every table rule is under .srl-schedule-table (and the srl-ss-* column classes are
 * prefixed), so nothing leaks into other tables. The print route uses its own sheet
 * (srl-season-schedule-print.css) and never loads this one.
 */

.srl-schedule-table {
    --srl-ss-muted: #666;        /* date line and field labels (phone) */
    --srl-ss-rule: #ddd;         /* hairline between blocks (phone); cell borders (desktop) */
    --srl-ss-head-bg: #f5f5f5;   /* header background (desktop, unchanged) */
    --srl-ss-secondary-size: 0.9em;
}

/* Wrapper and print button — unchanged from the former inline block. */
.srl-schedule-wrap {
    max-width: 900px;
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}

/* Scoped under the button's wrapping link (.srl-print-button) on purpose: the old inline
   block printed after srl-forms.css, so these values beat .srl-button by source order. This
   sheet prints in <head>, before srl-forms.css, so the extra class keeps the old result
   regardless of load order. */
.srl-print-button .srl-print-btn {
    margin: 0 0 .75rem 0;
    padding: .4rem .7rem;
    font: inherit;
    cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Base = PHONE (< 600px): one block per date, no horizontal scroll.   */
/* ------------------------------------------------------------------ */

.srl-schedule-table,
.srl-schedule-table tbody {
    display: block;
    width: 100%;
}

.srl-schedule-table thead {
    display: none;
}

.srl-schedule-table tbody tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--srl-ss-rule);
    background: transparent;          /* no zebra on the phone */
}

.srl-schedule-table tbody tr:last-child {
    border-bottom: none;
}

.srl-schedule-table tbody td {
    display: block;
    border: none;
    padding: 0;
    overflow-wrap: anywhere;          /* long values wrap instead of forcing sideways scroll */
}

/* A field with no value is omitted entirely: no label, no blank line. */
.srl-schedule-table tbody td.srl-empty {
    display: none;
}

.srl-schedule-table tbody td.srl-ss-date-col {
    font-size: var(--srl-ss-secondary-size);
    color: var(--srl-ss-muted);
}

.srl-schedule-table tbody td.srl-ss-name-col {
    font-size: 1.15em;
    font-weight: bold;
    margin-top: 2px;
}

.srl-schedule-table tbody td.srl-ss-comments-col,
.srl-schedule-table tbody td.srl-ss-oof-col {
    margin-top: 4px;
}

/* Labels come from each cell's data-label attribute (markup), not from CSS strings. */
.srl-schedule-table tbody td.srl-ss-comments-col::before,
.srl-schedule-table tbody td.srl-ss-oof-col::before {
    content: attr(data-label) " ";
    color: var(--srl-ss-muted);
}

/* ------------------------------------------------------------------ */
/* DESKTOP / TABLET (>= 600px): the table exactly as before CC-275.    */
/* ------------------------------------------------------------------ */

@media (min-width: 600px) {
    .srl-schedule-table {
        display: table;
        width: 100%;
        border-collapse: collapse;
    }

    .srl-schedule-table thead {
        display: table-header-group;
    }

    .srl-schedule-table tbody {
        display: table-row-group;
    }

    .srl-schedule-table tbody tr {
        display: table-row;
        padding: 0;
        border-bottom: none;
    }

    .srl-schedule-table th,
    .srl-schedule-table tbody td,
    .srl-schedule-table tbody td.srl-empty {
        display: table-cell;
        border: 1px solid var(--srl-ss-rule);
        padding: .5rem;
        vertical-align: top;
        margin: 0;
        overflow-wrap: normal;
    }

    .srl-schedule-table thead th {
        background: var(--srl-ss-head-bg);
        text-align: left;
    }

    .srl-schedule-table tbody td.srl-ss-date-col,
    .srl-schedule-table tbody td.srl-ss-name-col {
        font-size: inherit;
        font-weight: normal;
        color: inherit;
    }

    .srl-schedule-table tbody td.srl-ss-comments-col::before,
    .srl-schedule-table tbody td.srl-ss-oof-col::before {
        content: none;
    }

    /* Former nth-child(1)/(2) width rules, now keyed to the column classes. */
    .srl-schedule-table .srl-ss-date-col { width: 120px; white-space: nowrap; }
    .srl-schedule-table .srl-ss-name-col { width: 160px; }
}
