@import url('./tokens.css');

:root {
  color-scheme: dark;
  --bg: var(--sb-bg);
  --surface: var(--sb-surface);
  --text: var(--sb-ink);
  --muted: var(--sb-muted);
  --line: var(--sb-line);
  --blue: var(--sb-accent);
  --warm: var(--sb-warm);
  font: 16px/1.6 var(--sb-font);
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; scrollbar-color: var(--line) var(--bg); }
[hidden] { display: none !important; }
a { color: var(--blue); text-underline-offset: 4px; text-decoration-thickness: 1px; }
button, input, select { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sb-space-2);
  min-height: var(--sb-control-height);
  padding: 10px 16px;
  border: var(--sb-rule);
  border-radius: var(--sb-radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
:is(button, .button, input, select, summary, .tool-link, nav a) {
  transition: background-color var(--sb-duration) var(--sb-ease),
    border-color var(--sb-duration) var(--sb-ease), color var(--sb-duration) var(--sb-ease);
}
button:disabled { opacity: .55; cursor: default; }
button:active:not(:disabled), .button:active { background: var(--sb-selected); }
input, select {
  max-width: 100%;
  min-height: var(--sb-control-height);
  padding: 10px 12px;
  border: var(--sb-rule);
  border-radius: var(--sb-radius-control);
  background: var(--bg);
  color: var(--text);
  accent-color: var(--blue);
  caret-color: var(--blue);
}
input::placeholder { color: var(--muted); opacity: 1; }
:focus-visible { outline: var(--sb-focus); outline-offset: 3px; }
::selection { background: var(--blue); color: var(--bg); }
header.app-header, main.page, footer { max-width: 1160px; margin-inline: auto; padding-inline: 32px; }
header.app-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: var(--sb-rule);
}
.brand { font-size: 1.375rem; font-weight: 750; letter-spacing: -.03em; color: var(--text); text-decoration: none; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--sb-control-height);
  padding: 10px 16px;
  border-radius: var(--sb-radius-control);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
}
nav a[aria-current=page] { color: var(--blue); background: var(--surface); }
main.page { margin-block: 48px 80px; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 4.3vw, 3.5rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.1; margin: 0 0 16px; }
h2 { font-size: 1.375rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; margin: 0 0 20px; }
h3 { font-size: 1rem; font-weight: 650; line-height: 1.4; margin: 32px 0 8px; }
p { line-height: 1.6; max-width: 72ch; margin-block: 12px; }
.muted, small { color: var(--muted); }
small { font-size: .8125rem; line-height: 1.5; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.row > div { min-width: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.primary { background: var(--blue); color: var(--bg); border-color: transparent; }
.section { padding: 32px 0; border-top: var(--sb-rule); }
details { border-top: var(--sb-rule); padding: 12px 0; }
summary { display: list-item; cursor: pointer; min-height: var(--sb-control-height); padding-block: 10px; line-height: 1.5; font-size: .875rem; font-weight: 500; color: var(--blue); }
summary::marker { font-size: .75em; }
details > p { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .48fr); gap: 64px; }
.split > *, .split section { min-width: 0; }
.split > aside { padding-left: 32px; border-left: var(--sb-rule); }
.split > aside > .section:first-child { border-top: 0; }
.split > aside h2 { font-size: 1.0625rem; letter-spacing: -.01em; }
.weather-now { padding: 32px 0 40px; }
.condition { font-size: 1.5rem; font-weight: 500; line-height: 1.35; margin: 12px 0; }
.temperature { font-size: clamp(3.5rem, 7vw, 5.5rem); line-height: 1.05; letter-spacing: -.04em; font-weight: 550; font-variant-numeric: tabular-nums; }
#current-weather > .muted { font-size: .875rem; }
.forecast-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: var(--sb-rule); font-size: .9375rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.forecast-row > span { min-width: 0; overflow-wrap: anywhere; }
.forecast-row > span:first-child { font-weight: 600; }
.forecast-row > span:last-child { text-align: right; color: var(--muted); }
.forecast-row small { display: block; font-weight: 400; margin-top: 4px; }
.alert { background: #342b24; padding: 24px; border-radius: var(--sb-radius-panel); margin: 24px 0; color: #ffdfb1; }
.alert h2 { color: inherit; }
.alert details { border-color: #705c43; }
.alert summary { color: inherit; }
.measurements { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 20px; font-size: .875rem; }
.measurements dt, .measurements dd { padding-block: 12px; border-bottom: var(--sb-rule); }
.measurements dt { color: var(--muted); }
.measurements dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
#place-picker { padding: 24px 0; margin-top: 24px; border-block: var(--sb-rule); }
.search-form { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.search-form input { flex: 1; min-width: 200px; }
#place-picker > .muted { font-size: .8125rem; margin-bottom: 0; }
.results { display: flex; flex-direction: column; margin-top: 16px; }
.results:empty { display: none; }
.results button { justify-content: flex-start; text-align: left; border: 0; border-bottom: var(--sb-rule); border-radius: 0; padding: 16px 12px; background: none; }
.setting, .app-setting { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 0; border-bottom: var(--sb-rule); }
.setting > span, .app-setting > span { min-width: 0; font-size: .9375rem; font-weight: 500; }
.setting small { display: block; margin-top: 4px; max-width: 50ch; font-weight: 400; }
.setting select, .app-setting select { flex: 0 1 45%; width: 45%; min-width: 0; font-size: .875rem; }
.setting input[type=checkbox], .app-setting input[type=checkbox] { width: 24px; height: 24px; min-height: 24px; margin: 10px 0; flex-shrink: 0; }
.tool-link { display: block; padding: 20px 0; border-bottom: var(--sb-rule); font-size: .9375rem; font-weight: 600; text-decoration: none; }
.tool-link small { display: block; font-weight: 400; margin-top: 8px; }
footer { padding-block: 24px 40px; border-top: var(--sb-rule); color: var(--muted); font-size: .8125rem; }
footer a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 20px; }
footer p { margin-block: 12px 0; }
.legal { max-width: 824px !important; }
.legal li { line-height: 1.7; margin: 12px 0; }
.legal h2 { margin-top: 40px; }
.status { color: var(--warm); min-height: 1.5em; font-size: .875rem; }
.status:empty { display: none; }
.sponsor { border-top: var(--sb-rule); padding: 24px 0; }
.sponsor img { max-width: 100%; height: auto; }
#search-credit { font-size: .8125rem; margin-top: 40px; }
.app-settings-section { display: flex; width: 100%; justify-content: space-between; padding: 16px 0; text-align: left; background: none; border: 0; border-bottom: var(--sb-rule); border-radius: 0; }
.app-settings-section svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.section > div > button { margin: 8px 8px 8px 0; }
.settings-page > .muted { margin-bottom: 40px; }
.settings-page .section > p { font-size: .875rem; }
html[data-text-size=large] { font-size: 19px; }
@media (hover: hover) {
  button:hover:not(:disabled), .button:hover, nav a:hover { background: var(--sb-hover); }
  .primary:hover { background: #d2e9ff; }
  .tool-link:hover, summary:hover { color: var(--text); }
}
@media (min-width: 900px) {
  .settings-page > .section, .settings-page #additional-settings > .section { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); column-gap: 64px; align-items: start; }
  .settings-page .section > * { grid-column: 2; }
  .settings-page .section > h2 { grid-column: 1; grid-row: 1; margin-top: 12px; }
  .settings-page .section > h2 + * { grid-row: 1; }
  .settings-page .section > button, .settings-page .section > .button { justify-self: start; margin-top: 16px; }
  .settings-page .section > .setting:first-of-type { padding-top: 0; }
}
@media (max-width: 800px) {
  header.app-header, main.page, footer { padding-inline: 24px; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); gap: 32px; }
  .split > aside { padding-left: 24px; }
}
@media (max-width: 640px) {
  header.app-header, main.page, footer { padding-inline: 20px; }
  header.app-header { min-height: 80px; gap: 12px; flex-wrap: wrap; padding-block: 12px; }
  .brand { font-size: 1.125rem; }
  nav { gap: 0; }
  nav a { padding: 10px; font-size: .8125rem; }
  main.page { margin-block: 32px 48px; }
  h1 { font-size: clamp(2rem, 8vw, 2.75rem); }
  .row { align-items: flex-start; gap: 16px; }
  .row > div { flex: 1 1 100%; }
  #place-note { margin-bottom: 0; font-size: .875rem; }
  #place-picker { margin-top: 24px; }
  .search-form input { flex-basis: 100%; }
  .search-form button { flex: 1; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .split > aside { padding-left: 0; border-left: 0; }
  .split > aside > .section:first-child { border-top: var(--sb-rule); }
  .weather-now { padding-block: 32px; }
  .section { padding-block: 28px; }
  .setting, .app-setting { gap: 16px; }
  .forecast-row { gap: 12px; font-size: .875rem; }
}
@media (max-width: 360px) {
  header.app-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  header.app-header nav { width: 100%; justify-content: space-between; }
  .forecast-row { gap: 8px; }
}
