/* Public team schedules (Pages/Schedules, Pages/Schedule) and the table they
   share with the embed (Pages/_ScheduleTable, Pages/ScheduleEmbed). Written
   against site.css's tokens; the embed, which doesn't load site.css, defines
   the few it needs in schedule-embed.css. */

.schedule-page {
    max-width: 780px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.schedule-header h1 {
    margin: 0 0 0.25rem;
}

.schedule-subtitle {
    margin: 0 0 1.25rem;
    color: var(--color-text-muted);
}

.schedule-empty {
    color: var(--color-text-muted);
    padding: 1rem 0;
}

/* ---- The schools list ---- */

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

.schedule-school {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

.schedule-school-name {
    font-weight: 600;
}

.schedule-school-teams {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.schedule-team-link {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.schedule-team-link:hover,
.schedule-team-link:focus-visible {
    background: var(--color-surface-alt);
    border-color: var(--color-primary);
}

/* ---- One team's schedule ---- */

.schedule-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.schedule-season {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.schedule-season {
    align-items: center;
}

.schedule-season label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
}

.schedule-season select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.95rem;
}

.schedule-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.schedule-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    text-decoration: none;
}

.schedule-action-done {
    background-color: var(--color-success);
}

.schedule-embed {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.schedule-embed textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    resize: vertical;
}

/* ---- The table (page and embed) ---- */

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.schedule-table th,
.schedule-table td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.schedule-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border-strong);
}

.schedule-date,
.schedule-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.schedule-time {
    color: var(--color-text-muted);
}

.schedule-opponent {
    font-weight: 600;
}

/* "vs" and "at" set back so the opponent's name is what the eye lands on. */
.schedule-where {
    display: inline-block;
    min-width: 1.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.schedule-location {
    color: var(--color-text-muted);
}

.schedule-table td.schedule-result,
.schedule-table th.schedule-result {
    text-align: right;
    white-space: nowrap;
}

.schedule-outcome {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.schedule-outcome-win {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.schedule-outcome-loss {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
}

/* One of the two opponent names is always hidden: the full name, or the
   school's short one on a narrow screen. */
.schedule-name-short {
    display: none;
}

@media (max-width: 34rem) {
    .schedule-table {
        font-size: 0.88rem;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 0.5rem 0.35rem;
    }

    /* The location is the column a phone can most do without; it's the home
       side's courts, and "vs"/"at" already says whose. */
    .schedule-location {
        display: none;
    }

    .schedule-name-full:has(+ .schedule-name-short) {
        display: none;
    }

    .schedule-name-short {
        display: inline;
    }

    /* Short names fit beside "vs"/"at"; keep them on one line. */
    .schedule-opponent {
        white-space: nowrap;
    }

    .schedule-school {
        flex-wrap: wrap;
    }
}
