/* The weather on bookings, the job page and the Fitter Schedule (docs/weather.md).
   Colours come from MudBlazor's palette variables, so dark mode follows the theme. */

/* ---- The forecast panel (Shared/JobWeatherPanel.razor) ---- */

/* Wide on a desktop, narrow on a phone: the table fits itself to the panel (see the narrow rules below). */
.job-weather {
    container-type: inline-size;
}

.job-weather-table-wrap {
    overflow-x: auto;
}

.job-weather-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.job-weather-table th,
.job-weather-table td {
    padding: 4px 8px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.job-weather-table th {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.job-weather-table tr.in-slot td {
    background: var(--mud-palette-action-default-hover);
}

.job-weather-table .job-weather-time {
    font-weight: 600;
}

.job-weather-credit,
.job-weather-where,
.job-weather-stale {
    color: var(--mud-palette-text-secondary);
}

.job-weather-credit a {
    color: inherit;
    text-decoration: underline;
}

/* Narrow (the job page on a phone): the sky as an icon, a shorter heading, tighter cells. After the rules above, so it wins. */
.job-weather-narrow {
    display: none;
}

@container (max-width: 520px) {
    .job-weather-sky-words,
    .job-weather-wide {
        display: none;
    }

    .job-weather-narrow {
        display: inline;
    }

    .job-weather-table {
        font-size: 0.8rem;
    }

    .job-weather-table th,
    .job-weather-table td {
        padding: 4px 5px;
    }
}

/* ---- The mark on a schedule tile (Shared/WeatherRiskMarker.razor) ---- */

.job-weather-risk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* The same size as the parts key beside it (Shared/PartsStateKeys.razor). */
    min-width: 15px;
    height: 15px;
    padding: 0 2px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1;
    background: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
    flex: 0 0 auto;
    cursor: help;
}

.job-weather-risk.risk-cold {
    background: var(--mud-palette-info);
    color: var(--mud-palette-info-text);
}

/* ---- The at-risk button on the schedule's date tools (Shared/WeatherRiskButton.razor) ---- */

.weather-risk-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--mud-palette-warning-darken, var(--mud-palette-warning));
}

.weather-risk-btn .weather-risk-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.weather-risk-btn.unavailable {
    opacity: 0.5;
    cursor: help;
}

.weather-risk-line {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: baseline;
}

.weather-risk-who,
.weather-risk-why {
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}
