/* Weather dashboard. Builds on the shared tools theme (body.tool): navy/black
   surfaces, blue borders, gold focus accents. Scoped to .wx. */
.wx { --wx-card: linear-gradient(135deg, #0d1730 0%, #080c16 75%); --wx-tile: rgba(90,162,255,.06); --wx-line: rgba(90,162,255,.22); }
.wx .card { margin-bottom: 0; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.wx .card:hover { border-color: rgba(90,162,255,.45); }
.wx h2 { margin: 0 0 .9rem; font-size: 1.05rem; letter-spacing: .01em; }
.wx { display: flex; flex-direction: column; gap: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wx-eyebrow { color: #7ec4ff; text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 600; }

/* Focus */
.wx button:focus-visible, .wx input:focus-visible, .wx a:focus-visible, .wx [tabindex]:focus-visible, .wx summary:focus-visible { outline: 2px solid var(--gold, #e0b24a); outline-offset: 2px; }

/* Buttons (override the global gradient button for the small controls) */
body.tool .wx button.wx-btn { padding: .55rem .9rem; font-size: .88rem; border-radius: 10px; white-space: nowrap; }
body.tool .wx button.wx-btn.btn-secondary[aria-pressed="true"] { border-color: var(--gold, #e0b24a); color: var(--gold, #e0b24a); background: rgba(224,178,74,.1); }
body.tool .wx button.wx-btn:hover { transform: translateY(-1px); }
.wx-seg { display: inline-flex; border: 1px solid var(--wx-line); border-radius: 10px; overflow: hidden; }
body.tool .wx button.wx-seg-btn { padding: .5rem .85rem; font-size: .85rem; border: 0; border-radius: 0; background: rgba(90,162,255,.06); color: #cfe0ff; box-shadow: none; font-weight: 600; }
body.tool .wx button.wx-seg-btn + button.wx-seg-btn { border-left: 1px solid var(--wx-line); }
body.tool .wx button.wx-seg-btn:hover { background: rgba(90,162,255,.18); box-shadow: none; }
body.tool .wx button.wx-seg-btn[aria-pressed="true"] { background: linear-gradient(135deg, #5aa2ff, #2f6bff); color: #fff; }
body.tool .wx button.wx-round { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1.4rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; background: rgba(90,162,255,.1); border: 1px solid var(--wx-line); box-shadow: none; }
body.tool .wx button.wx-round:hover:not(:disabled) { border-color: #7ec4ff; background: rgba(90,162,255,.22); box-shadow: none; }
body.tool .wx button:disabled { opacity: .35; cursor: default; }

/* Location bar */
.wx-top-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.wx-loc-name { font-size: 1.7rem !important; margin: .1rem 0 .15rem !important; font-weight: 800; line-height: 1.15; }
.wx-updated { color: var(--muted); font-size: .82rem; min-height: 1.1em; }
.wx-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.wx-search { display: flex; gap: .6rem; margin-top: 1rem; }
.wx-search input { flex: 1; min-width: 0; }
.wx-results { list-style: none; margin: .5rem 0 0; padding: .3rem; border: 1px solid var(--wx-line); border-radius: 12px; background: #0a1224; max-height: 300px; overflow: auto; }
.wx-results[hidden], .wx-favs-wrap[hidden] { display: none; }
.wx-results button { display: block; width: 100%; text-align: left; padding: .6rem .75rem; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--text); font-weight: 500; }
body.tool .wx .wx-results button:hover, body.tool .wx .wx-results button:focus-visible { background: rgba(90,162,255,.18); box-shadow: none; }
.wx-results .sub { color: var(--muted); font-size: .8rem; margin-left: .4rem; }
.wx-results .none { padding: .6rem .75rem; color: var(--muted); font-size: .9rem; }
.wx-favs-wrap { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: .9rem; }
.wx-favs { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.wx-favs li { display: inline-flex; border: 1px solid var(--wx-line); border-radius: 999px; background: var(--wx-tile); overflow: hidden; }
.wx-favs li.on { border-color: var(--gold, #e0b24a); }
body.tool .wx .wx-favs button { padding: .35rem .75rem; font-size: .83rem; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); font-weight: 500; }
body.tool .wx .wx-favs button:hover { background: rgba(90,162,255,.2); box-shadow: none; }
body.tool .wx .wx-favs button.rm { padding: .35rem .6rem; color: var(--muted); border-left: 1px solid var(--wx-line); }
.wx-status { margin-top: .8rem; font-size: .88rem; color: var(--muted); }
.wx-status:empty { display: none; }
.wx-status.err { color: #ffb4b4; border: 1px solid rgba(255,107,107,.45); background: rgba(255,107,107,.08); padding: .6rem .8rem; border-radius: 10px; }
.wx-status.warn { color: var(--gold, #e0b24a); border: 1px solid rgba(224,178,74,.4); background: rgba(224,178,74,.07); padding: .6rem .8rem; border-radius: 10px; }

/* Rows */
.wx-row1 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.1rem; }
.wx-row3 { display: grid; grid-template-columns: minmax(0, 13fr) minmax(0, 7fr); gap: 1.1rem; align-items: start; }
.wx-side { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.wx-card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .9rem; flex-wrap: wrap; }
.wx-card-head h2 { margin: 0; }

/* Icons */
.wx-ico { width: 44px; height: 44px; display: block; flex: none; }

/* Current */
.wx-now { display: flex; align-items: center; gap: 1rem; }
.wx-now-icon .wx-ico { width: 96px; height: 96px; filter: drop-shadow(0 4px 14px rgba(90,162,255,.25)); }
.wx-temp { font-size: 3.6rem; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -.02em; }
.wx-desc { font-size: 1.1rem; font-weight: 600; margin-top: .25rem; }
.wx-feels { color: var(--muted); font-size: .9rem; margin-top: .1rem; }
.wx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 1.1rem 0 0; }
.wx-stat { background: var(--wx-tile); border: 1px solid var(--wx-line); border-radius: 12px; padding: .65rem .8rem; }
.wx-stat dt { color: #7ec4ff; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; font-weight: 600; }
.wx-stat dd { margin: .15rem 0 0; font-size: 1.1rem; font-weight: 700; color: #fff; }
.wx-stat dd small { color: var(--muted); font-weight: 500; font-size: .76rem; margin-left: .25rem; }
.wx-arrow { display: inline-block; width: .9em; height: .9em; vertical-align: -.1em; margin-right: .25rem; }

/* Hourly */
.wx-hourly { min-width: 0; }
.wx-hscroll { display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x proximity; padding: .2rem .1rem .8rem; margin: 0; list-style: none; scrollbar-width: thin; scrollbar-color: #2f4a80 transparent; border-radius: 10px; }
.wx-hour { flex: 0 0 82px; scroll-snap-align: start; text-align: center; background: var(--wx-tile); border: 1px solid var(--wx-line); border-radius: 12px; padding: .7rem .4rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; transition: border-color .15s, transform .15s, background .15s; }
.wx-hour:hover { border-color: #5aa2ff; transform: translateY(-2px); background: rgba(90,162,255,.12); }
.wx-hour.now { border-color: var(--gold, #e0b24a); background: rgba(224,178,74,.08); }
.wx-hour .t { color: var(--muted); font-size: .78rem; font-weight: 600; }
.wx-hour .v { font-size: 1.15rem; font-weight: 700; color: #fff; }
.wx-pop { display: inline-flex; align-items: center; gap: .15rem; font-size: .76rem; color: #8fc2ff; font-weight: 600; }
.wx-pop .wx-ico { width: 13px; height: 13px; }

/* Daily */
.wx-daily { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .7rem; }
.wx-day { background: var(--wx-tile); border: 1px solid var(--wx-line); border-radius: 12px; padding: .9rem .5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .35rem; transition: border-color .15s, transform .15s, background .15s; }
.wx-day:hover { border-color: #5aa2ff; transform: translateY(-3px); background: rgba(90,162,255,.12); }
.wx-day.today { border-color: var(--gold, #e0b24a); }
.wx-day .lbl, .wx-day .meta { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.wx-day .d { font-weight: 700; color: #fff; }
.wx-day .dt { color: var(--muted); font-size: .76rem; }
.wx-day .wx-ico { width: 52px; height: 52px; margin: .2rem 0; }
.wx-day .cond { color: var(--muted); font-size: .76rem; min-height: 2.2em; line-height: 1.15; display: flex; align-items: center; }
.wx-day .hl { font-weight: 700; color: #fff; }
.wx-day .hl .lo { color: var(--muted); font-weight: 500; }

/* Map */
.wx-map { position: relative; height: 560px; border: 1px solid var(--edge, #1c2f55); border-radius: 12px; overflow: hidden; background: #0a1020; }
.wx-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wx-credit { margin-top: .5rem; color: var(--muted); font-size: .74rem; text-align: right; }

/* Sun & Moon */
.wx-sunrow { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.wx-sun-meta { margin-top: .6rem; color: var(--muted); font-size: .85rem; }
.wx-moon { display: flex; align-items: center; gap: .9rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid rgba(255,255,255,.08); }
.wx-moon svg { width: 52px; height: 52px; flex: none; }
.wx-moon .n { font-weight: 700; color: #fff; }
.wx-moon .s { color: var(--muted); font-size: .84rem; }

/* Alerts */
.wx-ok { display: flex; gap: .7rem; align-items: center; padding: .8rem; border-radius: 12px; border: 1px solid rgba(47,191,113,.4); background: rgba(47,191,113,.08); color: #9ff0c8; font-size: .92rem; }
.wx-note { padding: .8rem; border-radius: 12px; border: 1px solid var(--wx-line); background: var(--wx-tile); color: var(--muted); font-size: .9rem; }
.wx-note.err { border-color: rgba(255,107,107,.45); color: #ffb4b4; background: rgba(255,107,107,.07); }
.wx-alert { border: 1px solid var(--wx-line); border-left-width: 4px; border-radius: 12px; background: var(--wx-tile); padding: .7rem .8rem; margin-bottom: .6rem; }
.wx-alert:last-child { margin-bottom: 0; }
.wx-alert.sev-Extreme, .wx-alert.sev-Severe { border-left-color: #ff6b6b; }
.wx-alert.sev-Moderate { border-left-color: #f4a24a; }
.wx-alert.sev-Minor, .wx-alert.sev-Unknown { border-left-color: #f4c150; }
.wx-alert .ev { font-weight: 700; color: #fff; }
.wx-alert .meta { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.wx-alert details { margin-top: .5rem; }
.wx-alert summary { cursor: pointer; color: #7ec4ff; font-size: .85rem; font-weight: 600; }
.wx-alert .body { margin-top: .5rem; font-size: .84rem; line-height: 1.45; white-space: pre-wrap; max-height: 260px; overflow: auto; color: #d6e0f2; }

/* Loading skeleton */
[aria-busy="true"] .wx-temp, [aria-busy="true"] .wx-stat dd, [aria-busy="true"] .wx-desc, [aria-busy="true"] .wx-feels { color: transparent; border-radius: 6px; background: linear-gradient(90deg, rgba(90,162,255,.08), rgba(90,162,255,.2), rgba(90,162,255,.08)); background-size: 200% 100%; animation: wx-shimmer 1.3s linear infinite; }
.wx-skel { height: 70px; border-radius: 12px; background: linear-gradient(90deg, rgba(90,162,255,.06), rgba(90,162,255,.16), rgba(90,162,255,.06)); background-size: 200% 100%; animation: wx-shimmer 1.3s linear infinite; }
.wx-hscroll .wx-skel, .wx-daily .wx-skel { height: 130px; flex: 0 0 82px; }
@keyframes wx-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.wx-fail { color: #ffb4b4; padding: .8rem; border: 1px dashed rgba(255,107,107,.45); border-radius: 12px; font-size: .9rem; grid-column: 1 / -1; }

/* Responsive */
@media (max-width: 1000px) {
    .wx-row1, .wx-row3 { grid-template-columns: minmax(0, 1fr); }
    .wx-daily { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .wx-map { height: 480px; }
    .wx-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 700px) {
    .wx-side { grid-template-columns: minmax(0, 1fr); }
    .wx-daily { grid-template-columns: minmax(0, 1fr); }
    .wx-day { flex-direction: row; text-align: left; padding: .6rem .9rem; gap: .8rem; }
    .wx-day .lbl { flex: 0 0 64px; align-items: flex-start; }
    .wx-day .wx-ico { width: 40px; height: 40px; margin: 0; }
    .wx-day .cond { flex: 1; min-height: 0; }
    .wx-day .meta { align-items: flex-end; }
    .wx-top-main { align-items: flex-start; }
    .wx-loc-name { font-size: 1.4rem !important; }
    .wx-search { flex-direction: column; }
    .wx-temp { font-size: 3rem; }
    .wx-now-icon .wx-ico { width: 72px; height: 72px; }
    .wx-map { height: 400px; }
}
@media (prefers-reduced-motion: reduce) {
    .wx *, .wx .card { transition: none !important; animation: none !important; }
    .wx-hscroll { scroll-behavior: auto; }
}

/* Hourly card fills the row height beside Current Conditions */
.wx-hourly { display: flex; flex-direction: column; }
.wx-hscroll { flex: 1; align-items: stretch; padding-bottom: .9rem; }
.wx-hour { justify-content: space-evenly; }
.wx-hour .wx-ico { width: 48px; height: 48px; }
.wx-day .wx-pop .wx-ico, .wx-hour .wx-pop .wx-ico { width: 13px; height: 13px; margin: 0; }
@media (max-width: 1000px) { .wx-hscroll { flex: none; } }
