/* SLCTC Runs — styles for [slctc_week] and [slctc_runs].
 * Override any of these variables from Divi → Theme Options → Custom CSS. */
.slctc-week,
.slctc-list {
    --slctc-accent: #2a6fdb;
    --slctc-text: #1f2933;
    --slctc-muted: #6b7682;
    --slctc-line: #e3e7ec;
    --slctc-surface: #ffffff;
    --slctc-soft: #f5f7fa;
    --slctc-radius: 12px;
    color: var(--slctc-text);
    line-height: 1.4;
}

/* Divi pads every p and heading and gives them a tall line-height; reset inside our components. */
.slctc-week p,
.slctc-week h3,
.slctc-week h4,
.slctc-list p,
.slctc-list h4 {
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

.slctc-week a,
.slctc-list a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 2px;
}

.slctc-week a:hover,
.slctc-list a:hover {
    text-decoration-color: currentColor;
}

/* ---------- [slctc_week] ---------- */

.slctc-week {
    margin: 0 0 2.5em;
}

.slctc-week__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1em;
    margin-bottom: 12px;
}

.slctc-week .slctc-week__title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.slctc-week__range {
    color: var(--slctc-muted);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.slctc-week__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.slctc-day {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 170px;
    padding: 12px 10px 14px;
    background: var(--slctc-surface);
    border: 1px solid var(--slctc-line);
    border-radius: var(--slctc-radius);
    list-style: none;
}

.slctc-day.is-empty {
    background: var(--slctc-soft);
}

.slctc-day.is-today {
    border-color: var(--slctc-accent);
    box-shadow: 0 0 0 1px var(--slctc-accent), 0 6px 18px rgba(20, 40, 80, 0.10);
}

.slctc-day.is-past {
    opacity: 0.55;
}

.slctc-day__label {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.slctc-day__dow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--slctc-muted);
}

.slctc-day__num {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.slctc-day.is-today .slctc-day__dow,
.slctc-day.is-today .slctc-day__num {
    color: var(--slctc-accent);
}

.slctc-day__today {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--slctc-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.slctc-day__events {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slctc-day__empty {
    color: var(--slctc-muted);
    font-size: 13px;
}

.slctc-event {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 9px;
    border-left: 3px solid var(--slctc-cal, var(--slctc-accent));
    font-size: 13px;
    overflow-wrap: anywhere;
}

/* Earlier today; whole past days are already dimmed above. */
.slctc-day.is-today .slctc-event.is-past {
    opacity: 0.6;
}

.slctc-event__meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: 6px;
    font-size: 12px;
}

.slctc-event__cal {
    color: var(--slctc-cal, var(--slctc-accent));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    line-height: 1.6;
}

.slctc-event__meta time {
    font-weight: 700;
}

.slctc-week .slctc-event__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    /* Long workout titles: show three lines, the rest is behind "Details". */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slctc-event__where,
.slctc-event__host {
    color: var(--slctc-muted);
}

.slctc-event__more {
    align-self: flex-start;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--slctc-cal, var(--slctc-accent)) !important;
}

/* Phones and narrow tablets: one row per day. */
@media (max-width: 900px) {
    .slctc-week__days {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .slctc-day {
        display: grid;
        grid-template-columns: 56px 1fr;
        align-items: start;
        min-height: 0;
        padding: 12px;
    }

    .slctc-day__label {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .slctc-day__today {
        margin-left: 0;
    }

    .slctc-day.is-empty {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .slctc-day.is-empty .slctc-day__label {
        flex-direction: row;
        align-items: baseline;
    }

    .slctc-day.is-empty .slctc-day__num {
        font-size: 16px;
    }

    .slctc-day.is-empty .slctc-day__events {
        align-self: center;
    }

    .slctc-week .slctc-event__title {
        -webkit-line-clamp: unset;
    }
}

/* ---------- [slctc_runs] ---------- */

.slctc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1em 0 1.5em;
}

.slctc-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--slctc-surface);
    border: 1px solid var(--slctc-line);
    border-radius: var(--slctc-radius);
}

.slctc-card__date {
    flex: 0 0 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: flex-start;
    padding: 8px 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--slctc-cal, var(--slctc-accent)) 12%, white);
    color: var(--slctc-cal, var(--slctc-accent));
    line-height: 1.1;
}

.slctc-card__dow,
.slctc-card__mon {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.slctc-card__num {
    font-size: 28px;
    font-weight: 800;
}

.slctc-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.slctc-card__when {
    color: var(--slctc-muted);
    font-size: 14px;
    font-weight: 600;
}

.slctc-list .slctc-card__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.slctc-card__where,
.slctc-card__host {
    font-size: 14px;
}

.slctc-card__desc {
    font-size: 14px;
    color: var(--slctc-text);
    overflow-wrap: anywhere;
}

.slctc-card__desc p + p {
    margin-top: 0.6em !important;
}

.slctc-card__details summary {
    cursor: pointer;
    width: fit-content;
    font-size: 14px;
    font-weight: 600;
    color: var(--slctc-cal, var(--slctc-accent));
}

.slctc-card__details[open] summary {
    margin-bottom: 6px;
}

.slctc-card__actions {
    margin-top: 4px !important;
    font-size: 13px;
    font-weight: 600;
}

.slctc-list__empty {
    color: var(--slctc-muted);
}

@media (max-width: 480px) {
    .slctc-card {
        gap: 12px;
        padding: 12px;
    }

    .slctc-card__date {
        flex-basis: 52px;
    }

    .slctc-card__num {
        font-size: 22px;
    }
}

/* Admin-only error notice. */
.slctc-notice {
    padding: 10px 12px !important;
    margin: 0 0 1em !important;
    border-left: 4px solid #d63638;
    background: #fcf0f1;
    color: #1f2933;
    font-size: 14px;
}
