/*
 * RL-E106-WEATHER-CARD-V2
 *
 * Energy 106 Weather card rebuild.
 *
 * Uses original RadioLaunch weather forecast data.
 * Uses existing weather-icon Blade partial.
 * Scoped to Energy 106 via template and layout guards.
 *
 * This is the complete V2 presentation stylesheet,
 * not an override appended to legacy vibe.css.
 */

/* Base card */

.vibe-site--inner .vibe-page-sidebar .e106wx {
    --wx-pink: var(--e106-pink, #ed1584);
    --wx-yellow: var(--e106-yellow, #ecdd0e);
    --wx-card: var(--e106-card, #250638);
    --wx-border: var(--e106-border, #523866);
    --wx-muted: var(--e106-muted, #c8b0d4);

    box-sizing: border-box;
    container-type: inline-size;
    container-name: e106weather;

    width: 100%;
    min-width: 0;
    overflow: hidden;

    margin: 0 0 18px;
    padding: 0;

    background: var(--wx-card) !important;
    border: 1px solid var(--wx-border) !important;
    border-radius: var(--e106-radius, 5px) !important;

    box-shadow: none !important;
    color: #fff;
}

.e106wx,
.e106wx * {
    box-sizing: border-box;
}

.e106wx a {
    text-decoration: none;
}

/* Header */

.e106wx__masthead {
    display: flex;
    justify-content: space-between;
    align-items: center;

    min-width: 0;
    gap: 14px;

    padding: 19px 21px;

    background: var(--e106-card-raised, #35104c);
    border-bottom: 1px solid var(--wx-border);
}

.e106wx__brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 11px;
}

.e106wx__brand svg {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    color: var(--wx-pink);
}

.e106wx__brand strong {
    color: var(--wx-pink) !important;
    font-size: 22px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .035em;
    white-space: nowrap;
}

.e106wx__location {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    gap: 7px;
}

.e106wx__location svg {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    color: var(--wx-pink);
}

.e106wx__location span {
    overflow: hidden;
    color: #fff !important;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Current weather: approved three-part layout */

.e106wx__main {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, .88fr)
        minmax(0, 1.12fr);

    align-items: center;
    min-width: 0;
    padding: 27px 21px;
}

.e106wx__temperature-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    padding-right: 15px;
}

.e106wx__city {
    display: block;
    color: var(--wx-muted) !important;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.e106wx__temperature {
    display: block;
    margin-top: 7px;

    color: #fff !important;
    font-size: clamp(47px, 6vw, 90px);
    line-height: .96;
    font-weight: 950;
    letter-spacing: -.055em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.e106wx__yellow-rule {
    display: block;
    width: 61px;
    height: 4px;
    margin-top: 12px;
    border-radius: 3px;
    background: var(--wx-yellow);
}

/* Large central weather icon */

.e106wx__symbol {
    display: grid;
    place-items: center;

    min-width: 0;
    min-height: 122px;

    padding: 12px;

    border-left: 1px solid var(--wx-border);
    border-right: 1px solid var(--wx-border);

    color: var(--wx-pink);
}

.e106wx__symbol svg {
    display: block;
    width: min(100%, 118px);
    height: auto;
    max-height: 118px;

    stroke: currentColor;
    stroke-width: 1.6;
}

/* Yellow sun and pink cloud for clear/partly cloudy */

.e106wx__symbol--sunny svg path:first-of-type {
    stroke: var(--wx-yellow);
}

.e106wx__symbol--sunny svg circle {
    stroke: var(--wx-yellow);
}

/* Condition and forecast link */

.e106wx__details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;

    min-width: 0;
    gap: 16px;

    padding-left: 18px;
    text-align: right;
}

.e106wx__condition {
    color: #fff !important;
    font-size: clamp(19px, 2.4vw, 31px);
    line-height: 1.15;
    font-weight: 950;
    overflow-wrap: break-word;
}

.e106wx__forecast-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;

    color: var(--wx-muted) !important;

    font-size: 14px;
    line-height: 1.25;
    font-weight: 850;
}

.e106wx__forecast-link svg {
    flex: 0 0 21px;
    width: 21px;
    height: 21px;
    color: var(--wx-yellow);
}

.e106wx__forecast-link:hover {
    color: #fff !important;
}

.e106wx__forecast-link:focus-visible {
    outline: 2px solid var(--wx-yellow);
    outline-offset: 5px;
}

/* Five-day forecast */

.e106wx__forecast {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));

    gap: 0;
    min-width: 0;

    margin: 0 21px;
    padding: 21px 0 22px;

    border-top: 1px solid var(--wx-border);
}

.e106wx__day {
    display: flex;
    align-items: center;
    flex-direction: column;

    min-width: 0;
    padding: 0 9px;

    text-align: center;
}

.e106wx__day + .e106wx__day {
    border-left: 1px solid var(--wx-border);
}

.e106wx__day-name {
    display: block;
    color: #fff !important;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 950;
    text-transform: uppercase;
    white-space: nowrap;
}

.e106wx__day-icon {
    display: grid;
    place-items: center;

    width: 53px;
    height: 53px;
    margin: 12px auto 13px;

    color: var(--wx-pink);
}

.e106wx__day-icon svg {
    display: block;
    width: 49px;
    height: 49px;
    max-width: 100%;
    max-height: 100%;
    stroke-width: 1.7;
}

.e106wx__day-icon--sunny svg path:first-of-type,
.e106wx__day-icon--sunny svg circle {
    stroke: var(--wx-yellow);
}

.e106wx__day-high {
    display: block;
    color: #fff !important;

    font-size: 24px;
    line-height: 1.1;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.e106wx__day-low {
    display: block;
    margin-top: 5px;

    color: var(--wx-muted) !important;

    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/*
 * Narrow sidebar adaptation.
 *
 * The approved wide design has 3 main columns.
 * At standard sidebar widths we use 2 columns,
 * with condition + forecast beneath them.
 */

/*
 * RL-E106-WEATHER-THREE-COLUMN-V3
 *
 * Preserve the approved three-column weather presentation
 * inside the public sidebar, including at narrow widths.
 *
 * Left: location / temperature
 * Centre: live weather icon
 * Right: condition / forecast link
 *
 * Uses existing live forecast and shared brand tokens.
 */

@container e106weather (max-width: 560px) {

    .e106wx__masthead {
        gap: 9px;
        padding: 16px 17px;
    }

    .e106wx__brand {
        gap: 8px;
    }

    .e106wx__brand svg {
        flex: 0 0 23px;
        width: 23px;
        height: 23px;
    }

    .e106wx__brand strong {
        font-size: 18px;
        letter-spacing: .025em;
    }

    .e106wx__location {
        gap: 5px;
    }

    .e106wx__location svg {
        flex: 0 0 15px;
        width: 15px;
        height: 15px;
    }

    .e106wx__location span {
        font-size: 10px;
    }

    /*
     * Key fix: three columns, NOT two rows.
     */

    .e106wx__main {
        display: grid;
        grid-template-columns:
            minmax(0, 1.03fr)
            minmax(0, .83fr)
            minmax(0, 1.26fr);
        align-items: center;
        gap: 0;
        min-width: 0;
        padding: 21px 16px 20px;
    }

    /* Left — current temperature */

    .e106wx__temperature-block {
        min-width: 0;
        padding-right: 7px;
        align-items: flex-start;
        justify-content: center;
    }

    .e106wx__city {
        font-size: 11px;
        line-height: 1.15;
    }

    .e106wx__temperature {
        margin-top: 8px;
        font-size: clamp(43px, 13cqw, 62px);
        line-height: .96;
        letter-spacing: -.055em;
        white-space: nowrap;
    }

    .e106wx__yellow-rule {
        width: 48px;
        height: 4px;
        margin-top: 11px;
    }

    /* Centre — prominent live weather icon */

    .e106wx__symbol {
        display: grid;
        place-items: center;
        min-width: 0;
        min-height: 99px;
        padding: 6px;

        border-left: 1px solid var(--wx-border);
        border-right: 1px solid var(--wx-border);
    }

    .e106wx__symbol svg {
        display: block;
        width: min(100%, 79px);
        height: auto;
        max-height: 80px;
    }

    /* Right — condition and forecast link */

    .e106wx__details {
        grid-column: auto;

        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;

        min-width: 0;
        gap: 12px;
        margin: 0;
        padding: 0 0 0 10px;

        border: 0;
        text-align: right;
    }

    .e106wx__condition {
        font-size: clamp(15px, 4.3cqw, 20px);
        line-height: 1.15;
        font-weight: 950;
        overflow-wrap: anywhere;
    }

    .e106wx__forecast-link {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;

        gap: 5px;
        font-size: clamp(10px, 2.7cqw, 12px);
        line-height: 1.2;
        white-space: normal;
        text-align: right;
    }

    .e106wx__forecast-link svg {
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
    }

    /* Bottom — five evenly spaced forecast days */

    .e106wx__forecast {
        display: grid;
        grid-template-columns:
            repeat(5, minmax(48px, 1fr));

        gap: 0;
        min-width: 0;
        margin: 0 16px;
        padding: 17px 0 19px;

        overflow-x: auto;
        scrollbar-width: thin;
    }

    .e106wx__day {
        min-width: 0;
        padding: 0 4px;
    }

    .e106wx__day-name {
        font-size: 10px;
        line-height: 1.2;
    }

    .e106wx__day-icon {
        display: grid;
        place-items: center;

        width: 32px;
        height: 32px;
        margin: 10px auto;
    }

    .e106wx__day-icon svg {
        width: 30px;
        height: 30px;
    }

    .e106wx__day-high {
        font-size: 18px;
        line-height: 1.1;
    }

    .e106wx__day-low {
        margin-top: 5px;
        font-size: 12px;
    }
}

/*
 * Smallest sidebar sizes:
 * retain the same structure with smaller elements.
 */

@container e106weather (max-width: 345px) {

    .e106wx__masthead {
        padding: 14px 12px;
    }

    .e106wx__brand strong {
        font-size: 15px;
    }

    .e106wx__location span {
        font-size: 9px;
    }

    .e106wx__main {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, .75fr)
            minmax(0, 1.15fr);

        padding: 17px 11px;
    }

    .e106wx__temperature {
        font-size: clamp(40px, 13cqw, 47px);
    }

    .e106wx__symbol {
        min-height: 77px;
        padding: 4px;
    }

    .e106wx__symbol svg {
        width: min(100%, 62px);
        max-height: 62px;
    }

    .e106wx__details {
        gap: 8px;
        padding-left: 7px;
    }

    .e106wx__condition {
        font-size: 14px;
    }

    .e106wx__forecast-link {
        font-size: 10px;
    }

    .e106wx__forecast {
        margin: 0 11px;
    }
}

