.weather-forecast {
    background:
        radial-gradient(circle at 92% 0, rgba(230, 57, 70, .2), transparent 34%),
        linear-gradient(145deg, rgba(35, 35, 35, .98), rgba(17, 17, 17, .98));
    border: 1px solid #3b3b3b;
    border-top: 3px solid var(--primary);
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
    box-sizing: border-box;
    margin: 42px auto 0;
    max-width: 920px;
    overflow: hidden;
    padding: clamp(18px, 4vw, 28px);
    text-align: left;
    width: min(920px, calc(100% - 12px));
}

.weather-forecast__header {
    align-items: end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.weather-forecast__eyebrow {
    color: #ff929a;
    display: block;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .12em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.weather-forecast__eyebrow i { margin-right: 5px; }
.weather-forecast__header h2 {
    color: #fff;
    font-size: clamp(1.35rem, 4vw, 2rem);
    line-height: 1.12;
    margin: 0;
}

.weather-forecast__header p {
    color: #aaa;
    font-size: .84rem;
    line-height: 1.35;
    margin: 0;
    max-width: 42%;
    text-align: right;
}

.weather-forecast__header p i { color: var(--primary); margin-right: 4px; }
.weather-forecast__grid { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.weather-forecast--day { margin: 26px 0 0; max-width: 650px; width: 100%; }
.weather-forecast--day .weather-forecast__grid { grid-template-columns: minmax(0, 1fr); }

.weather-day-card {
    background: linear-gradient(150deg, #292929, #1b1b1b);
    border: 1px solid #414141;
    border-radius: 10px;
    box-sizing: border-box;
    min-height: 164px;
    padding: 15px;
}

.weather-day-card__heading { align-items: baseline; display: flex; gap: 8px; justify-content: space-between; }
.weather-day-card__heading strong { color: #fff; font-size: 1rem; }
.weather-day-card__heading span { color: #999; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.weather-day-card__condition { align-items: center; display: flex; gap: 9px; margin-top: 16px; }
.weather-day-card__condition i { color: #ff8c95; font-size: 1.55rem; min-width: 28px; text-align: center; }
.weather-day-card__condition span { color: #dedede; font-size: .82rem; font-weight: 750; line-height: 1.25; }
.weather-day-card__temperature { align-items: baseline; display: flex; gap: 5px; margin-top: 12px; }
.weather-day-card__temperature strong { color: #fff; font-size: 1.6rem; line-height: 1; }
.weather-day-card__temperature span { color: #a7a7a7; font-size: .9rem; }
.weather-day-card__details { color: #aaa; display: flex; flex-wrap: wrap; font-size: .73rem; gap: 6px 12px; margin-top: 10px; }
.weather-day-card__details i { color: #d56a74; margin-right: 3px; }
.weather-day-card__message { color: #aaa; font-size: .8rem; line-height: 1.45; margin: 25px 0 0; }

.weather-day-card__placeholder {
    animation: weather-loading 1.4s ease-in-out infinite;
    background: linear-gradient(90deg, #303030 15%, #3c3c3c 45%, #303030 75%);
    background-size: 220% 100%;
    border-radius: 7px;
    height: 74px;
    margin-top: 20px;
}

.weather-forecast__status { color: #aaa; font-size: .78rem; margin: 14px 0 0; }
.weather-forecast__status i { color: var(--primary); margin-right: 5px; }
.weather-forecast__source { color: #777; font-size: .7rem; margin: 7px 0 0; }
.weather-forecast__source a { color: #aaa; text-underline-offset: 2px; }

.weather-forecast--day .weather-day-card:not(.weather-day-card--loading) {
    align-items: center;
    display: grid;
    gap: 10px 18px;
    grid-template-columns: minmax(115px, .75fr) minmax(135px, 1fr) minmax(110px, .75fr);
    min-height: 118px;
}

.weather-forecast--day .weather-day-card__condition,
.weather-forecast--day .weather-day-card__temperature,
.weather-forecast--day .weather-day-card__details { margin-top: 0; }
.weather-forecast--day .weather-day-card__details { flex-direction: column; }

@keyframes weather-loading {
    0%, 100% { background-position: 100% 0; opacity: .55; }
    50% { background-position: 0 0; opacity: .9; }
}

html[data-theme="light"] .weather-forecast {
    background: radial-gradient(circle at 92% 0, rgba(230, 57, 70, .12), transparent 34%), linear-gradient(145deg, #fff, #f3f5f7);
    border-color: #cbd2d9;
    border-top-color: var(--primary);
    box-shadow: 0 12px 34px rgba(23, 26, 31, .13);
}

html[data-theme="light"] .weather-forecast__header h2,
html[data-theme="light"] .weather-day-card__heading strong,
html[data-theme="light"] .weather-day-card__temperature strong { color: #1d2329; }
html[data-theme="light"] .weather-forecast__eyebrow { color: #a52c3b; }
html[data-theme="light"] .weather-forecast__header p,
html[data-theme="light"] .weather-day-card__heading span,
html[data-theme="light"] .weather-day-card__temperature span,
html[data-theme="light"] .weather-day-card__details,
html[data-theme="light"] .weather-day-card__message,
html[data-theme="light"] .weather-forecast__status { color: #5d6974; }
html[data-theme="light"] .weather-day-card { background: linear-gradient(150deg, #fff, #edf0f3); border-color: #cbd2d9; }
html[data-theme="light"] .weather-day-card__condition span { color: #313a43; }
html[data-theme="light"] .weather-day-card__placeholder { background: linear-gradient(90deg, #e4e8ec 15%, #d5dbe0 45%, #e4e8ec 75%); background-size: 220% 100%; }

.weather-effect-layer { display: none; }

@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
    body.weather-effect-rain .weather-effect-layer,
    body.weather-effect-snow .weather-effect-layer,
    body.weather-effect-sun .weather-effect-layer,
    body.weather-effect-wind .weather-effect-layer,
    body.weather-effect-high-wind .weather-effect-layer {
        display: block;
        inset: -30%;
        overflow: hidden;
        pointer-events: none;
        position: fixed;
        z-index: 850;
    }

    body.weather-effect-rain .weather-effect-layer {
        opacity: .18;
        transform: rotate(6deg);
    }

    body.weather-effect-rain .weather-effect-layer::before,
    body.weather-effect-rain .weather-effect-layer::after {
        animation: weather-rain-fall 1.05s linear infinite;
        background-image: repeating-linear-gradient(105deg, transparent 0 25px, rgba(190, 215, 235, .42) 26px 27px, transparent 28px 52px);
        background-size: 140px 190px;
        content: '';
        inset: -30%;
        position: absolute;
    }

    body.weather-effect-rain .weather-effect-layer::after {
        animation-duration: 1.55s;
        background-size: 190px 240px;
        opacity: .5;
        transform: translateX(45px);
    }

    body.weather-effect-snow .weather-effect-layer { opacity: .32; }
    body.weather-effect-snow .weather-effect-layer::before,
    body.weather-effect-snow .weather-effect-layer::after {
        animation: weather-snow-fall 8s linear infinite;
        background-image:
            radial-gradient(circle, rgba(242, 247, 255, .9) 0 1.4px, transparent 1.8px),
            radial-gradient(circle, rgba(220, 234, 247, .72) 0 1px, transparent 1.5px);
        background-position: 0 0, 27px 31px;
        background-size: 54px 54px, 72px 72px;
        content: '';
        inset: -20%;
        position: absolute;
    }

    body.weather-effect-snow .weather-effect-layer::after {
        animation-duration: 12s;
        opacity: .55;
        transform: translateX(36px);
    }

    body.weather-effect-sun .weather-effect-layer {
        animation: weather-sun-breathe 5s ease-in-out infinite;
        background: radial-gradient(circle at 82% 12%, rgba(255, 196, 77, .2) 0 5%, rgba(255, 177, 48, .08) 18%, transparent 42%);
        inset: 0;
        opacity: .75;
    }

    body.weather-effect-wind .weather-effect-layer,
    body.weather-effect-high-wind .weather-effect-layer {
        inset: -15% -70%;
        opacity: .2;
    }

    body.weather-effect-wind .weather-effect-layer::before,
    body.weather-effect-wind .weather-effect-layer::after,
    body.weather-effect-high-wind .weather-effect-layer::before,
    body.weather-effect-high-wind .weather-effect-layer::after {
        animation: weather-wind-drift 6s linear infinite;
        background-image: repeating-linear-gradient(0deg, transparent 0 74px, rgba(205, 221, 232, .55) 76px 77px, transparent 79px 142px);
        border-radius: 50%;
        content: '';
        filter: blur(.35px);
        inset: 0;
        position: absolute;
        transform: rotate(-3deg);
    }

    body.weather-effect-wind .weather-effect-layer::after,
    body.weather-effect-high-wind .weather-effect-layer::after {
        animation-delay: -2.6s;
        animation-duration: 8.5s;
        opacity: .55;
        transform: rotate(4deg) translateY(42px);
    }

    body.weather-effect-high-wind .weather-effect-layer { opacity: .3; }
    body.weather-effect-high-wind .weather-effect-layer::before { animation-duration: 2.8s; }
    body.weather-effect-high-wind .weather-effect-layer::after { animation-delay: -1.1s; animation-duration: 4s; }
}

@keyframes weather-rain-fall {
    from { transform: translate3d(-35px, -170px, 0); }
    to { transform: translate3d(35px, 170px, 0); }
}

@keyframes weather-snow-fall {
    from { transform: translate3d(-18px, -120px, 0); }
    50% { transform: translate3d(24px, 0, 0); }
    to { transform: translate3d(-8px, 120px, 0); }
}

@keyframes weather-sun-breathe {
    0%, 100% { opacity: .52; transform: scale(.98); }
    50% { opacity: .85; transform: scale(1.03); }
}

@keyframes weather-wind-drift {
    from { transform: translate3d(-28%, 0, 0) rotate(-3deg); }
    to { transform: translate3d(28%, 0, 0) rotate(-3deg); }
}

@media (prefers-reduced-motion: reduce) {
    .weather-day-card__placeholder { animation: none; }
    .weather-effect-layer { display: none !important; }
}

@media (max-width: 760px) {
    .weather-forecast__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .weather-forecast--day .weather-forecast__grid { grid-template-columns: 1fr; }
    .weather-forecast__header { align-items: flex-start; flex-direction: column; gap: 7px; }
    .weather-forecast__header p { max-width: none; text-align: left; }
}

@media (max-width: 520px) {
    .weather-forecast { margin-top: 32px; padding: 17px 13px; width: 100%; }
    .weather-forecast--day { margin-top: 22px; }
    .weather-day-card { min-height: 150px; padding: 13px; }
    .weather-forecast--day .weather-day-card:not(.weather-day-card--loading) {
        align-items: start;
        gap: 10px 12px;
        grid-template-columns: 1fr auto;
    }
    .weather-forecast--day .weather-day-card__condition { grid-column: 1 / -1; }
    .weather-forecast--day .weather-day-card__details { align-items: flex-end; }
}
