/* Weather module: hourly daylight strip + detailed weekly cards. */

.weather-content {
    display: grid;
    gap: 2.25rem;
    min-width: 0;
}

.weather-subsection { min-width: 0; }
.weather-subsection + .weather-subsection {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.weather-subsection__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.weather-subsection__title {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    letter-spacing: -.025em;
}
.weather-subsection__subtitle {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
}

/* Today summary */
.weather-today-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(26rem, 1fr);
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
}
.weather-today-summary__main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.weather-today-summary__icon {
    flex: 0 0 auto;
    font-size: clamp(3.2rem, 5vw, 5.2rem);
    line-height: 1;
}
.weather-today-summary__label {
    display: block;
    margin: 0 0 .3rem;
    font-size: 1.05rem;
}
.weather-today-summary__temperature {
    font-size: clamp(1.5rem, 3vw, 2.35rem);
    font-weight: 900;
    letter-spacing: -.04em;
}
.weather-today-summary__details {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}
.weather-today-summary .detail-tile { padding: .55rem .6rem; }

/* Hourly strip */
.weather-hourly__list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(7.8rem, 8.5vw, 9.5rem);
    align-items: stretch;
    gap: 0;
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #0a1020;

    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
    overscroll-behavior-inline: contain;
}

.weather-hourly__list::-webkit-scrollbar {
    height: .5rem;
}

.weather-hourly__list::-webkit-scrollbar-track {
    background: transparent;
}

.weather-hourly__list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--border-strong);
}

.weather-hour {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 3.5rem auto auto 1fr auto auto;
    justify-items: center;
    align-items: start;
    gap: .42rem;
    min-width: 0;
    min-height: 17.5rem;
    padding: .8rem .65rem .65rem;
    border-right: 1px solid rgb(0 0 0 / 28%);
    background: var(--sky-bg, var(--panel));
    text-align: center;
    transition: background-color .2s ease;
}
.weather-hour::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, rgb(255 255 255 / 3%), rgb(0 0 0 / 16%));
    pointer-events: none;
}
.weather-hour:last-child { border-right: 0; }
.weather-hour__time {
    width: 100%;
    color: var(--text);
    font-size: .88rem;
    font-weight: 800;
    white-space: nowrap;
}
.weather-hour__icon {
    display: grid;
    width: 100%;
    place-items: center;
    font-size: 2.25rem;
    line-height: 1;
}
.weather-hour__temperature {
    color: var(--text);
    font-size: 1.28rem;
    font-weight: 900;
    letter-spacing: -.03em;
    white-space: nowrap;
}
.weather-hour__feels {
    min-height: 1em;
    color: rgb(245 248 252 / 72%);
    font-size: .68rem;
    white-space: nowrap;
}
.weather-hour__rain,
.weather-hour__wind {
    display: block;
    width: 100%;
    font-size: .7rem;
    line-height: 1.35;
}
.weather-hour__rain {
    align-self: end;
    padding-top: .55rem;
    border-top: 1px solid rgb(255 255 255 / 12%);
    color: #eef5ff;
}
.weather-hour__wind { color: rgb(245 248 252 / 72%); }
.weather-hour__phase {
    align-self: end;
    width: 100%;
    padding-top: .45rem;
    border-top: 1px solid rgb(255 255 255 / 9%);
    color: rgb(245 248 252 / 62%);
    font-size: .61rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Exact sunrise/sunset marker inside the hour containing the event. */
.weather-hour__sun-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--marker-position, 50%);
    z-index: 3;
    width: 0;
    border-left: 2px solid rgb(255 209 102 / 92%);
    pointer-events: none;
}
.weather-hour__sun-marker::after {
    content: attr(title);
    position: absolute;
    top: 3.25rem;
    left: .3rem;
    width: max-content;
    max-width: 7rem;
    padding: .2rem .35rem;
    border-radius: .35rem;
    background: rgb(8 12 20 / 82%);
    color: #ffe59a;
    font-size: .58rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}
.weather-hour__sun-marker--sunset::after {
    top: 5rem;
}

/* Weekly detailed cards */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1rem;
}
.weather-card {
    display: flex;
    min-width: 0;
    min-height: 29rem;
    flex-direction: column;
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
}
.weather-card:first-child {
    border-color: var(--border-strong);
    background: var(--panel-strong);
}
.weather-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}
.weather-card__day {
    margin: 0;
    font-size: 1.3rem;
    text-transform: capitalize;
}
.weather-card__date {
    display: block;
    margin-top: .15rem;
    color: var(--muted);
    font-size: .82rem;
}
.weather-card__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    padding: 1.4rem 0;
}
.weather-card__icon {
    font-size: clamp(4.6rem, 7vw, 7rem);
    line-height: 1;
}
.weather-card__label {
    margin: .7rem 0 .4rem;
    font-size: 1.25rem;
}
.weather-card__temperature {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -.045em;
}

@media (max-width: 1000px) {
    .weather-today-summary { grid-template-columns: 1fr; }
    .weather-hourly__list { grid-auto-columns: 8rem; }
}
@media (max-width: 760px) {
    .weather-subsection__header {
        align-items: flex-start;
        flex-direction: column;
        gap: .2rem;
    }
    .weather-today-summary__details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .weather-hourly__list { grid-auto-columns: 7.5rem; }
    .weather-hour { min-height: 17rem; padding-inline: .55rem; }
    .weather-hour__sun-marker::after { display: none; }
}
@media (max-width: 430px) {
    .weather-today-summary__main { align-items: flex-start; }
    .weather-today-summary__icon { font-size: 3.4rem; }
    .weather-today-summary__temperature { font-size: 1.5rem; }
    .weather-hourly__list { grid-auto-columns: 7rem; }
}
