/* Погода на полях (public/weather.php). Главный образ — «поле»: нижний край шапки повторяет кривую температуры за сутки. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wx-hero { position: relative; background: linear-gradient(180deg, var(--navy) 0%, #2A2F5C 100%); color: #fff; padding-top: clamp(36px, 6vw, 64px); }
.wx-hero__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; }
.wx-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: .4em; }
.wx-hero__when { margin: 0; color: #D9DBEE; max-width: 46ch; }
.wx-offline { margin: 16px 0 0; max-width: 52ch; padding: 12px 16px; border-radius: var(--radius-s); background: rgba(255, 255, 255, .1); color: #fff; font-size: .95rem; }
.wx-now { text-align: right; }
.wx-now__t { margin: 0; font-family: var(--font); font-weight: 800; font-size: clamp(4.2rem, 11vw, 8rem); line-height: .9; letter-spacing: -.03em; }
.wx-now__t span { font-size: .38em; font-weight: 700; color: var(--orange-2); margin-left: .08em; vertical-align: .95em; letter-spacing: 0; }
.wx-now__sub { margin: 10px 0 0; color: #D9DBEE; font-size: .95rem; line-height: 1.5; }
.wx-now.is-stale .wx-now__t { color: #B9BCD6; }

.wx-land { position: relative; height: clamp(120px, 15vw, 190px); margin-top: clamp(8px, 2vw, 20px); }
.wx-land svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wx-land__ground { fill: var(--cream); }
.wx-land__line { fill: none; stroke: var(--orange); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.wx-land__mark { position: absolute; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; font-size: .85rem; font-weight: 700; color: #fff; }
.wx-land__mark::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--navy); }
.wx-land__mark--min::after { bottom: -12px; }
.wx-land__ends { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }

.wx-body { background: var(--cream); padding-top: 8px; }
.wx-h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin: 40px 0 16px; }
.wx-body .container > .wx-h2:first-child { margin-top: 12px; }

.wx-hints { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.wx-hint { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start; background: #fff; border-radius: var(--radius-s); padding: 16px 18px; box-shadow: var(--shadow-s); }
.wx-hint__icon { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1rem; }
.wx-hint b { color: var(--navy); font-size: 1.05rem; }
.wx-hint span:last-child { color: var(--text); font-size: .95rem; line-height: 1.45; }
.wx-hint--good .wx-hint__icon { background: var(--green); }
.wx-hint--warn .wx-hint__icon { background: var(--orange-d); }
.wx-hint--frost .wx-hint__icon { background: #2F6FA8; }
.wx-hint--info .wx-hint__icon { background: #E3EEF8; }
.wx-hint--none .wx-hint__icon { background: #B8B2A8; }

/* фитофтороз по методу Смита: календарь по дням архива станции */
.wx-smith__about { max-width: 78ch; margin: 0 0 10px; color: var(--text); line-height: 1.5; }
.wx-smith__sum { margin: 0 0 12px; color: var(--navy); }
.wx-smith__legend { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; color: var(--muted); }
.wx-smith__legend li { display: flex; align-items: center; gap: 6px; }
.wx-smith__legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.wx-smith { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.wx-smith__month { background: #fff; border-radius: var(--radius-s); padding: 14px 16px; box-shadow: var(--shadow-s); }
.wx-smith__month h3 { margin: 0 0 8px; font-size: 1rem; color: var(--navy); }
.wx-smith__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wx-smith__wd { font-size: .72rem; color: var(--muted); text-align: center; }
.wx-smith__day { aspect-ratio: 1; display: grid; place-items: center; border: 0; border-radius: 6px; font: 700 .82rem var(--font); color: var(--navy); background: transparent; padding: 0; cursor: default; }
button.wx-smith__day { cursor: pointer; }
.wx-smith__day.is-empty { color: #C9C3B8; font-weight: 400; }
.wx-smith__day.is-low, .wx-smith__legend .is-low { background: #DCEFD9; }
.wx-smith__day.is-ok, .wx-smith__legend .is-ok { background: #FFD9A8; }
.wx-smith__day.is-period, .wx-smith__legend .is-period { background: #D9483B; color: #fff; }
.wx-smith__day.is-none, .wx-smith__legend .is-none { background: #ECE8E1; color: #8A8478; }
.wx-smith__info { margin: 10px 0 0; color: var(--navy); font-size: .92rem; min-height: 1.4em; }

.wx-readings { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius-s); overflow: hidden; box-shadow: var(--shadow-s); }
.wx-readings > div { background: #fff; padding: 16px 18px; }
.wx-readings dt { color: var(--muted); font-size: .88rem; }
.wx-readings dd { margin: 2px 0 0; font-weight: 800; color: var(--navy); font-size: 1.45rem; line-height: 1.25; }
.wx-readings dd small { display: block; font-weight: 600; font-size: .85rem; color: var(--muted); }
.wx-readings.is-stale dd { color: #5B5E7A; }
.wx-note { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }

.wx-charts-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.wx-charts-head .wx-h2 { margin: 0; }
.wx-period { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow-s); }
.wx-period button { border: 0; background: transparent; font: inherit; font-weight: 800; color: var(--navy); padding: .45em 1.1em; border-radius: 999px; cursor: pointer; }
.wx-period button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.wx-period button:focus-visible, .wx-table summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.wx-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wx-chart { margin: 0; background: #fff; border-radius: var(--radius-s); padding: 16px 18px 10px; box-shadow: var(--shadow-s); }
.wx-chart[data-chart="temp"] { grid-column: 1 / -1; }
.wx-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 6px; }
.wx-chart figcaption b { color: var(--navy); }
.wx-chart figcaption span { color: var(--muted); font-size: .85rem; }
.wx-chart__plot { position: relative; height: 190px; }
.wx-chart[data-chart="temp"] .wx-chart__plot { height: 230px; }
.wx-chart__plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wx-chart__plot text { font-family: var(--font); font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.wx-chart__plot .end { fill: var(--navy); font-weight: 800; font-size: 13px; }
.wx-chart__empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .95rem; text-align: center; }
.wx-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--navy); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .85rem; line-height: 1.35; white-space: nowrap; transform: translate(-50%, -100%); }
.wx-tip b { font-weight: 800; }

.wx-table { margin-top: 14px; }
.wx-table summary { cursor: pointer; font-weight: 800; color: var(--green); display: inline-block; padding: 4px 0; }
.wx-table__wrap { overflow-x: auto; background: #fff; border-radius: var(--radius-s); margin-top: 10px; box-shadow: var(--shadow-s); }
.wx-table table, .wx-records table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
.wx-table caption { text-align: left; padding: 12px 14px 4px; font-weight: 800; color: var(--navy); }
.wx-table th, .wx-table td { padding: 6px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.wx-table th[scope="row"], .wx-table thead th:first-child { text-align: left; }
.wx-table thead th { color: var(--muted); font-weight: 700; }

.wx-records { background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-s); overflow-x: auto; }
.wx-records th, .wx-records td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.wx-records tbody tr:last-child > * { border-bottom: 0; }
.wx-records thead th { color: var(--muted); font-weight: 700; font-size: .88rem; }
.wx-records tbody th { color: var(--navy); font-weight: 800; }
.wx-records td { font-weight: 800; color: var(--navy); font-size: 1.05rem; white-space: nowrap; }
.wx-records td small { display: block; font-weight: 600; color: var(--muted); font-size: .8rem; white-space: normal; }

.wx-source { margin: 32px 0 0; color: var(--muted); font-size: .9rem; max-width: 72ch; }

@media (max-width: 900px) {
  .wx-readings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wx-hero__in { grid-template-columns: 1fr; }
  .wx-now { text-align: left; }
  .wx-land__mark { font-size: .75rem; }
  .wx-land__mark--min { font-size: 0; }  /* на узком экране подпись минимума наезжает на кривую — остаётся точка, минимум есть в подсказке ниже */
  .wx-records th, .wx-records td { padding: 10px 10px; }
  .wx-readings dd { font-size: 1.25rem; }
}

/* Легенда графика ветра и роза ветров */
.wx-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.wx-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-left: 6px; }
.wx-chart[data-chart="rose"] .wx-chart__plot { height: auto; min-height: 200px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-bottom: 8px; }
.wx-chart__plot svg.wx-rose { flex: none; width: 200px; height: 200px; overflow: visible; }
.wx-rose path { cursor: default; }
.wx-rose__text { margin: 0; color: var(--text); font-size: .95rem; line-height: 1.5; flex: 1 1 180px; max-width: 32ch; }
