/* Weather Forecast — scoped styles, built on the site's design tokens
   (site.css :root variables). */

/* Fill the content-section's inner width (which already aligns to the nav
   bar's max width), so the cards span edge-to-edge with the navigation. */
.wx-wrap {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 4rem;
}

.wx-app {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wx-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.wx-h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin: 0; }
.wx-h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin: 0 0 1rem; }

.wx-muted { color: var(--text-sub); font-size: 0.95rem; line-height: 1.6; margin: 0; }
.wx-error { color: #FF8080; font-size: 0.95rem; line-height: 1.6; margin: 0; }

.wx-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }

.wx-input {
    flex: 1 1 10rem;
    font-family: var(--mono); font-size: 0.9rem;
    color: var(--text); background: var(--bg); border: 1px solid var(--border-lit);
    border-radius: 9px; padding: 0.65rem 0.8rem;
}
.wx-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wx-btn {
    font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
    padding: 0.6rem 1.1rem; border-radius: 9px; cursor: pointer;
    border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.wx-btn-sm { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.wx-btn-blue { background: var(--accent); color: #06122e; border-color: var(--accent); }
.wx-btn-blue:hover { background: #7d99ff; }
.wx-btn-ghost { background: transparent; color: var(--text-sub); border-color: var(--border-lit); }
.wx-btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.wx-status { margin-top: 0.75rem; font-size: 0.85rem; min-height: 1rem; }

/* Location header */
.wx-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Inline condition-icon glyphs */
.wx-ico { display: inline-flex; flex: none; line-height: 0; }
.wx-ico svg { width: 100%; height: 100%; display: block; }
.wx-ico-md { width: 2.2rem; height: 2.2rem; }
.wx-ico-lg { width: 2.4rem; height: 2.4rem; }
.wx-ico-xl { width: 4.2rem; height: 4.2rem; }

/* Current conditions hero */
.wx-current-main { display: flex; align-items: center; gap: 1rem; margin-top: 1.1rem; }
.wx-current-body { display: flex; flex-direction: column; }
.wx-current-temp { font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--text); }
.wx-current-cond { font-size: 1rem; color: var(--text-sub); margin-top: 0.25rem; }
.wx-current-meta { margin-top: 1rem; font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); }

/* 7-day forecast: horizontal carousel */
.wx-daily-scroll { overflow-x: auto; padding-bottom: 0.25rem; }
.wx-daily-row { display: flex; gap: 0.6rem; }
.wx-day-card {
    flex: none; width: 6.5rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 0.85rem 0.5rem;
}
/* Reserve two lines so labels that wrap (e.g. "This Afternoon") don't push
   the icon/temps/precip down relative to single-line cards. */
.wx-day-label {
    font-size: 0.82rem; font-weight: 700; color: var(--text);
    line-height: 1.2; text-align: center;
    min-height: 2.4em; display: flex; align-items: center; justify-content: center;
}
.wx-day-temps { display: flex; gap: 0.4rem; font-family: var(--mono); font-size: 0.9rem; }
.wx-day-high { color: var(--text); font-weight: 600; }
.wx-day-low { color: var(--text-faint); }
.wx-day-precip { font-size: 0.72rem; color: var(--accent); min-height: 1em; }

/* Last 6 & next 6 hours: one column, one row per hour */
.wx-hourly-list { display: flex; flex-direction: column; gap: 0.5rem; }
.wx-hour-row {
    display: flex; align-items: center; gap: 0.9rem; text-align: left;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 0.65rem 0.9rem;
}
.wx-hour-row.is-past { opacity: 0.62; }
.wx-hour-row.is-now { border-color: var(--accent); background: var(--accent-soft); }
.wx-hour-time { flex: 0 0 4rem; font-family: var(--mono); font-size: 0.85rem; color: var(--text-sub); }
.wx-hour-row.is-now .wx-hour-time { color: var(--accent); font-weight: 600; }
.wx-hour-temp { flex: 0 0 3rem; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.wx-hour-precip { flex: 0 0 4.6rem; font-size: 0.78rem; color: var(--accent); }
.wx-hour-short {
    flex: 1 1 auto; min-width: 0;
    font-size: 0.82rem; color: var(--text-sub); line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Radar player */
.wx-radar-stage { max-width: 34rem; }
.wx-radar-img {
    display: block; width: 100%; max-width: 100%; height: auto;
    border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.wx-radar-controls {
    display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
    max-width: 34rem; margin-top: 0.8rem;
}
.wx-radar-play { min-width: 4.5rem; text-align: center; }
.wx-radar-scrub { flex: 1 1 8rem; min-width: 6rem; accent-color: var(--accent); cursor: pointer; }
.wx-radar-speed { display: flex; align-items: center; gap: 0.5rem; }
.wx-radar-speed-label { font-size: 0.8rem; color: var(--text-sub); }
.wx-seg { display: inline-flex; border: 1px solid var(--border-lit); border-radius: 8px; overflow: hidden; }
.wx-seg-btn {
    font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
    padding: 0.35rem 0.7rem; background: transparent; color: var(--text-sub);
    border: none; border-right: 1px solid var(--border-lit); cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.wx-seg-btn:last-child { border-right: none; }
.wx-seg-btn:hover { color: var(--text); background: var(--bg-hover); }
.wx-seg-btn.is-on { color: #06122e; background: var(--accent); }
.wx-radar-note { margin-top: 0.75rem; font-size: 0.8rem; }

.wx-attrib { margin: 0.25rem 0 0; font-size: 0.78rem; color: var(--text-faint); line-height: 1.6; }
.wx-attrib a { color: var(--text-sub); }
.wx-attrib a:hover { color: var(--text); }

@media (max-width: 560px) {
    .wx-card { padding: 1.15rem; }
    .wx-row .wx-btn { flex: 1 1 auto; }

    .wx-hour-row { flex-wrap: wrap; gap: 0.4rem 0.75rem; }
    .wx-hour-time { flex: 0 0 auto; }
    .wx-hour-temp { flex: 0 0 auto; }
    .wx-hour-precip { flex: 0 0 auto; }
    .wx-hour-short {
        flex: 1 1 100%;
        white-space: normal; overflow: visible; text-overflow: clip;
    }
}
