/* Tempu stylesheet.
 *
 * One file, one cascade. Everything derives from the tokens at the top: six
 * type steps in two families, three inks on one paper, one hairline, one
 * accent that marks the current selection and nothing else.
 *
 * Order: tokens → base → layout primitives → components (header, buttons, day
 * strip, map, home, details, wind, search, footer). Each component carries its
 * own media queries; there is no responsive appendix.
 */

/* ===================================================================
 * Tokens
 * =================================================================== */

:root {
  --tempu-font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --tempu-font-sans: "Source Sans Pro", "Source Sans 3", system-ui, sans-serif;

  /* Six steps. Display and heading breathe with the viewport; the rest hold. */
  --tempu-text-display: clamp(2.75rem, 2rem + 2.5vw, 3.75rem);
  --tempu-text-heading: clamp(1.625rem, 1.3rem + 1.1vw, 2.125rem);
  --tempu-text-subhead: 1.25rem;
  --tempu-text-body: 1rem;
  --tempu-text-data: 0.9375rem;
  --tempu-text-caption: 0.8125rem;

  /* Three inks on one paper. Nine near-identical greys did this job before. */
  --tempu-paper: #fbfaf7;
  --tempu-surface: #ffffff;
  --tempu-ink: #1e211f;
  --tempu-ink-mid: #55605a;
  --tempu-ink-soft: #68716c; /* 4.8:1 on paper — the lightest ink allowed on text */
  --tempu-line: #e3e4df;
  --tempu-accent: #2dcc71;
  /* The rain blue the "No rain" panel has always used. 3.1:1 on paper — AA for
     large text, which is the only size it is ever set at. */
  --tempu-rain: #6193bc;
  --tempu-accent-tint: color-mix(in srgb, var(--tempu-accent) 14%, var(--tempu-surface));

  --tempu-gutter: clamp(1rem, 3vw, 2rem);
  --tempu-measure: 68ch;
  --search-input-ch: 42ch;
  --tempu-radius: 6px;
  --tempu-shadow: 0 1px 2px rgb(30 33 31 / 0.06), 0 10px 30px rgb(30 33 31 / 0.1);
  /* Home "Today in" card and details day columns share this lift. Two contact
     layers seat the card; the wide ambient one lifts it. */
  --tempu-card-shadow:
    0 1px 2px rgb(30 33 31 / 0.05),
    0 2px 6px rgb(30 33 31 / 0.04),
    0 12px 28px rgb(30 33 31 / 0.07);
  --tempu-slide: 360ms ease;
  /* The drawn height of a chart (chart.js HEIGHT plus its container's margin).
     The "No rain" panel matches it so the carousel never resizes. */
  --tempu-chart-height: 186px;
}

/* ===================================================================
 * Base
 * =================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color: var(--tempu-ink);
  background: var(--tempu-paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--tempu-font-sans);
  font-size: var(--tempu-text-body);
  line-height: 1.5;
  color: var(--tempu-ink);
  background: var(--tempu-paper);
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--tempu-font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--tempu-text-heading); }
h3 { font-size: var(--tempu-text-subhead); }

p {
  margin: 0;
}

a {
  color: var(--tempu-ink-mid);
  text-decoration: underline;
  text-decoration-color: var(--tempu-line);
  text-underline-offset: 0.15em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: var(--tempu-ink);
  text-decoration-color: currentColor;
}

img {
  max-inline-size: 100%;
  vertical-align: middle;
}

:focus-visible {
  outline: 2px solid var(--tempu-ink);
  outline-offset: 2px;
}

/* Small uppercase labels — municipality names, "Show", the day strip. */
.tempu-caption,
.chart-controls-label,
.district-parent,
.today-eyebrow,
.today-facts dt,
.day-details,
.legend-title,
.nav-header,
.wind-timeline label,
p#follow_us {
  font-size: var(--tempu-text-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tempu-ink-soft);
}

/* Figures that line up in columns. */
.tempu-data,
.today-temp,
.today-facts dd,
.tmp-summary-district,
.search-temp,
.temp-range,
.details-temp-high,
.details-temp-low,
.date,
.side.stats,
.wind-timeline output,
.legend {
  font-variant-numeric: tabular-nums;
}

.no-show,
.hidden {
  display: none;
}

/* Respect the reader's motion preference — the carousel and map both animate. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================================================================
 * Layout primitives (what remains of Bootstrap 2's grid)
 * =================================================================== */

.container-fluid {
  inline-size: 100%;
  max-inline-size: 72rem;
  padding-inline: var(--tempu-gutter);
  margin-inline: auto;
}

/* A 12-column track set; children opt in with .spanN. */
.row-fluid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--tempu-gutter);
}

.row-fluid > * {
  grid-column: span 12;
  min-inline-size: 0;
}

.span1  { grid-column: span 1; }
.span2  { grid-column: span 2; }
.span3  { grid-column: span 3; }
.span4  { grid-column: span 4; }
.span5  { grid-column: span 5; }
.span6  { grid-column: span 6; }
.span7  { grid-column: span 7; }
.span8  { grid-column: span 8; }
.span9  { grid-column: span 9; }
.span10 { grid-column: span 10; }
.span11 { grid-column: span 11; }
.span12 { grid-column: span 12; }

@media (max-width: 767px) {
  .row-fluid {
    grid-template-columns: minmax(0, 1fr);
  }
  .row-fluid > [class*="span"] {
    grid-column: span 1;
  }
}

/* Float utilities the templates still name. Inside the flex and grid
   containers below they are inert, which is the point. */
.pull-right { float: inline-end; }
.pull-left  { float: inline-start; }
.centered   { text-align: center; }

/* ===================================================================
 * Icons
 * =================================================================== */

/* Inline SVG sprite. Icons size with the text and take its colour. */
.icon {
  inline-size: 1em;
  block-size: 1em;
  vertical-align: -0.125em;
  flex: none;
}

/* The sprite only supplies <symbol> definitions; it must not render itself. */
.icon-sprite {
  display: none;
}

.icon-spinner.icon-spin {
  animation: tempu-spin 0.9s linear infinite;
}

@keyframes tempu-spin {
  to { rotate: 360deg; }
}

/* ===================================================================
 * Header
 * =================================================================== */

#nav-search {
  position: relative;
  z-index: 1030;
  background: var(--tempu-paper);
  border-bottom: 1px solid var(--tempu-line);
}

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  inline-size: 100%;
  padding: 0.6rem var(--tempu-gutter);
  min-block-size: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: none;
  text-decoration: none;
}

.logo-icon {
  inline-size: 2.5rem;
}

.logo-text {
  inline-size: 6rem;
}

/* The search form holds the input and every header control. Controls stay in
   the flex flow on the right; the input is centred on the navbar midline. */
.form-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  min-inline-size: 0;
}

#autocomplete_form .search-autocomplete-wrap {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
}

/* Sits inside the input's right end; invisible until search.js spins it. */
#spinner {
  position: relative;
  z-index: 1;
  margin-inline-start: -2rem;
  margin-inline-end: 0.85rem;
  color: var(--tempu-ink-soft);
  opacity: 0;
  transition: opacity 120ms ease;
}

input#id_name {
  font-family: inherit;
  font-size: var(--tempu-text-data);
  font-weight: 400;
  color: var(--tempu-ink);
  inline-size: min(var(--search-input-ch), 100%);
  padding-block: 0.5rem;
  padding-inline: 2.2rem 0.9rem;
  border: 1px solid var(--tempu-line);
  border-radius: 999px;
  background: var(--tempu-surface) no-repeat 0.8rem center / 1rem;
  /* Magnifier inlined, so the affordance costs no request. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368716c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  appearance: none;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input#id_name::placeholder {
  color: var(--tempu-ink-soft);
}

input#id_name:focus-visible {
  outline: none;
  border-color: var(--tempu-ink-mid);
  box-shadow: 0 0 0 3px rgb(45 204 113 / 0.2);
}

#spinner.icon-spin {
  opacity: 1;
}

/* Header controls, in reading order: This week / Today, then the map style,
   then settings — the markup lists them the other way round. */
.btn-group.settings          { order: 3; position: relative; }
.btn-group.weather-toggle    { order: 2; }
.btn-group.rain_temp_toggle  { order: 2; }

/* --- Autocomplete dropdown ---------------------------------------------- */

span.yourlabs-autocomplete {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  inline-size: max(100%, 20rem);
  max-block-size: 20rem;
  overflow: hidden auto;
  z-index: 1050;
  text-align: left;
  background: var(--tempu-surface);
  border: 1px solid var(--tempu-line);
  border-radius: var(--tempu-radius);
  box-shadow: var(--tempu-shadow);
}

span.yourlabs-autocomplete.open {
  display: block;
}

.autocomplete_item {
  display: block;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--tempu-line);
}

.autocomplete_item:last-child {
  border-bottom: 0;
}

.autocomplete_item.hilight,
.autocomplete_item:hover {
  background: var(--tempu-paper);
}

div.search-block {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
}

.weather-icon-search {
  font-size: 1.75rem;
  line-height: 1;
  text-align: center;
  color: var(--tempu-ink-mid);
}

.search-result-title {
  min-inline-size: 0;
}

.weather-info-search {
  min-inline-size: 0;
}

.search-temp,
.temp-range,
.tmp-summary-district {
  font-size: var(--tempu-text-data);
  color: var(--tempu-ink-mid);
  text-align: end;
  white-space: nowrap;
}

.search-temp .t-high,
.temp-range .t-high,
.tmp-summary-district .t-high {
  color: var(--tempu-ink);
  font-weight: 600;
}

a.location-search {
  font-weight: 600;
  color: var(--tempu-ink);
  text-decoration: none;
}

.place-suffix {
  font-size: var(--tempu-text-caption);
  color: var(--tempu-ink-soft);
  padding-inline-start: 0.3em;
}

p.place-parent {
  font-size: var(--tempu-text-caption);
  color: var(--tempu-ink-soft);
}

.yourlabs-autocomplete em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--tempu-accent);
  text-decoration-thickness: 2px;
}

/* --- Settings menu ------------------------------------------------------ */

a.btn.dropdown-toggle {
  font-size: 1.1rem;
  padding-inline: 0.7rem;
}

ul.dropdown-menu {
  display: none;
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.5rem);
  min-inline-size: 12rem;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  text-align: left;
  background: var(--tempu-surface);
  border: 1px solid var(--tempu-line);
  border-radius: var(--tempu-radius);
  box-shadow: var(--tempu-shadow);
}

.btn-group.open > .dropdown-menu {
  display: block;
}

ul.dropdown-menu li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1rem;
  font-size: var(--tempu-text-data);
  color: var(--tempu-ink);
}

ul.dropdown-menu li a {
  display: block;
  flex: 1;
  margin: -0.4rem -1rem;
  padding: 0.4rem 1rem;
  color: var(--tempu-ink);
  text-decoration: none;
}

ul.dropdown-menu li a:hover {
  background: var(--tempu-paper);
}

ul.dropdown-menu li.nav-header {
  padding-block: 0.5rem 0.2rem;
}

ul.dropdown-menu li.divider {
  padding: 0;
  margin-block: 0.3rem;
  border-top: 1px solid var(--tempu-line);
}

ul.dropdown-menu li.selected {
  font-weight: 600;
}

i.active-dot {
  display: inline-block;
  inline-size: 0.5em;
  block-size: 0.5em;
  border-radius: 50%;
  background: var(--tempu-accent);
  margin-inline-start: 0.6em;
}

/* Map options live in the menu only where the header has no room for them. */
ul.dropdown-menu .mob-map-opts,
ul.dropdown-menu #mob-week,
ul.dropdown-menu #mob-today,
ul.dropdown-menu #mob-temp,
ul.dropdown-menu #mob-rain {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --search-input-ch: 36ch;
  }
  .navbar-inner {
    min-block-size: 3.25rem;
    padding-block: 0.4rem;
  }
  input#id_name {
    inline-size: min(var(--search-input-ch), 100%);
  }
}

@media (max-width: 480px) {
  :root {
    --search-input-ch: 30ch;
  }
  .logo-icon {
    inline-size: 2rem;
  }
  .logo-text {
    display: none;
  }
  .form-search {
    gap: 0.4rem;
  }
  input#id_name {
    inline-size: min(var(--search-input-ch), 100%);
  }
  span.btn-group.weather-toggle {
    display: none;
  }
  ul.dropdown-menu .mob-map-opts,
  ul.dropdown-menu #mob-week,
  ul.dropdown-menu #mob-today,
  ul.dropdown-menu #mob-temp,
  ul.dropdown-menu #mob-rain {
    display: flex;
  }
}

/* ===================================================================
 * Buttons
 * =================================================================== */

.btn-group {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
}

.btn-group > .btn + .btn {
  margin-inline-start: -1px; /* collapse the shared border */
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  font-family: inherit;
  font-size: var(--tempu-text-data);
  line-height: 1.2;
  color: var(--tempu-ink-mid);
  text-decoration: none;
  background: var(--tempu-surface);
  border: 1px solid var(--tempu-line);
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.btn:hover {
  color: var(--tempu-ink);
  background: var(--tempu-paper);
}

/* Round the ends of a group, not each button, so it reads as one control. */
.btn-group > .btn:first-child {
  border-start-start-radius: var(--tempu-radius);
  border-end-start-radius: var(--tempu-radius);
}

.btn-group > .btn:last-child {
  border-start-end-radius: var(--tempu-radius);
  border-end-end-radius: var(--tempu-radius);
}

/* Settings is a lone button whose sibling is the menu, so :last-child
   never matches and only the start corners were rounded. */
.btn-group.settings > .btn.dropdown-toggle {
  border-radius: var(--tempu-radius);
}

/* The one job of the accent: the current selection. */
.btn-group > .btn.active {
  position: relative;
  z-index: 1;
  color: var(--tempu-ink);
  background: var(--tempu-surface);
  box-shadow: inset 0 -2px 0 var(--tempu-accent);
}

/* Icon glyphs have different advance widths; equal columns even the toggles. */
#centered-collapse .btn-group,
span.centered .btn-group {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(3rem, 1fr);
}

.btn i[class^="tempu-"] {
  font-size: 1.2em;
}

/* A word where the other toggles use a glyph: the sun icon already means
   temperature in this group, so a second sun would say nothing. */
.btn-label {
  font-size: var(--tempu-text-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}

/* ===================================================================
 * Day strip
 * =================================================================== */

#choices {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--tempu-paper);
  border-bottom: 1px solid var(--tempu-line);
}

#choices::-webkit-scrollbar { display: none; }

.forecast {
  flex: 1 0 auto;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: var(--tempu-text-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tempu-ink-soft);
  cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color 120ms ease, box-shadow 120ms ease;
}

.forecast:hover {
  color: var(--tempu-ink);
  box-shadow: inset 0 -2px 0 var(--tempu-line);
}

.forecast.highlighted {
  color: var(--tempu-ink);
  box-shadow: inset 0 -2px 0 var(--tempu-accent);
}

@media (max-width: 480px) {
  .forecast {
    padding: 0.6rem 0.4rem;
  }
}

/* ===================================================================
 * Map
 * =================================================================== */

#map {
  z-index: 0;
  inline-size: 100%;
  block-size: clamp(22rem, 52vh, 32rem);
  border-bottom: 1px solid var(--tempu-line);
  /* Sits the map slightly above the paper underneath. */
  box-shadow:
    0 1px 2px rgb(30 33 31 / 0.04),
    0 4px 12px rgb(30 33 31 / 0.06);
}

#map.details_map {
  block-size: 20rem;
}

.leaflet-container {
  font-family: var(--tempu-font-sans);
}

/* The legend. */
.legend {
  padding: 0.5rem 0.65rem;
  font-size: var(--tempu-text-caption);
  line-height: 1.35;
  color: var(--tempu-ink-mid);
  background: rgb(255 255 255 / 0.92);
  border: 1px solid var(--tempu-line);
  border-radius: var(--tempu-radius);
  box-shadow: 0 1px 3px rgb(30 33 31 / 0.08);
}

.legend i {
  float: left;
  inline-size: 0.8rem;
  block-size: 0.8rem;
  margin: 0.2rem 0.5rem 0 0;
  border-radius: 2px;
}

.legend-title {
  margin-block-end: 0.25rem;
  text-align: center;
}

.legend-switch {
  display: none;
}

/* Wind arrows. Rotation and opacity are set per marker by wind.js. */
.wind-arrow-wrap {
  background: none;
  border: 0;
}

.wind-arrow {
  /* wind.js sets --wind-size from the speed. */
  font-size: var(--wind-size, 16px);
  line-height: var(--wind-size, 16px);
  color: var(--tempu-ink);
  text-align: center;
  transition: opacity 150ms ease;
}

/* Details-page marker: weather glyph scaled to the highlighted area.
   --weather-size comes from details.js (same idea as wind.js --wind-size). */
.leaflet-div-icon.icon-for-map {
  background: none;
  border: 0;
}

.icon-for-map-weather {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  font-size: var(--weather-size, 40px);
  line-height: 1;
  color: var(--tempu-ink);
}

.icon-for-map a {
  color: var(--tempu-ink);
  text-decoration: none;
}

div.leaflet-popup-content-wrapper {
  border-radius: var(--tempu-radius);
  box-shadow: var(--tempu-shadow);
}

/* Fade + 6px lift. Leaflet already toggles opacity via .leaflet-fade-anim;
   the extra translate is the only addition. Independent of transform, so
   it does not fight Leaflet's zoom animation on the pane. */
.leaflet-fade-anim .leaflet-popup {
  opacity: 0;
  translate: 0 6px;
  transition: opacity 180ms ease, translate 180ms ease;
}

.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
  opacity: 1;
  translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .leaflet-fade-anim .leaflet-popup {
    translate: none;
    transition: none;
  }
}

.leaflet-popup-content {
  display: flex;
  align-items: stretch;
  gap: 20px;
}

.popup-weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 0 0 auto;
  gap: 10px;
}

.leaflet-popup-content .climacon {
  display: block;
  font-size: 2.5rem;
  line-height: 1;
  block-size: 1em;
}

.popup-weather-label {
  /* Pin to the bottom so it shares a row with .desc > a. */
  margin-block-start: auto;
  font-size: 0.8125rem;
  line-height: 1.2;
  max-inline-size: 6.5rem;
}

.desc {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-inline-size: 0;
}

.popup-place {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

div.desc b {
  font-family: var(--tempu-font-serif);
  font-weight: 500;
  font-size: var(--tempu-text-subhead);
  line-height: 1.15;
}

.popup-temp,
.popup-rain {
  color: var(--tempu-ink-mid);
  line-height: 1.2;
}

div.desc a {
  margin-block-start: auto;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 767px) {
  #map {
    block-size: clamp(18rem, 48vh, 26rem);
  }
  #map.details_map {
    block-size: 14rem;
  }
  div.leaflet-control-attribution.leaflet-control {
    display: none;
  }
}

@media (max-width: 480px) {
  div.leaflet-control-zoom.leaflet-bar.leaflet-control {
    display: none;
  }
  .legend {
    padding: 0.35rem 0.4rem;
  }
  .legend i {
    inline-size: 0.5rem;
  }
}

/* ===================================================================
 * Home — the two columns under the map
 *
 * The municipalities are the page's substance and take the wide column; the
 * card is the answer to "what is it doing right now" and takes the narrow one.
 * Card first in the markup, so a phone gets today's weather before the list
 * without the grid having to reorder anything.
 * =================================================================== */

.home-grid {
  display: grid;
  gap: var(--tempu-gutter);
  padding-block: 2rem 0;
}

@media (min-width: 900px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr) 21rem;
    align-items: start;
  }
  .today-card  { grid-column: 2; grid-row: 1; position: sticky; top: 1.5rem; }
  .capitals    { grid-column: 1; grid-row: 1; }
  /* 20% of the list column becomes gap toward the card. */
  .capital-list {
    max-inline-size: 80%;
  }
}

/* --- Card chrome --------------------------------------------------------
 * Shared by the home "Today in" card and each details day column. Layout and
 * padding stay with the component; only the paper, edge and lift live here.
 */

.today-card,
.data_column {
  background: var(--tempu-surface);
  border: 1px solid var(--tempu-line);
  border-radius: var(--tempu-radius);
  box-shadow: var(--tempu-card-shadow);
}

/* --- Today's card ------------------------------------------------------- */

.today-card {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  padding: 1.4rem 1.5rem 1.5rem;
}

.today-card > * {
  grid-column: 1;
}

.today-card .weather-icon-big {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
  justify-self: end;
  font-size: 3.25rem;
  line-height: 1;
  color: var(--tempu-ink-mid);
}

.today-place {
  font-family: var(--tempu-font-serif);
  font-size: var(--tempu-text-heading);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.today-date {
  margin-block-start: 0.15rem;
  font-size: var(--tempu-text-data);
  color: var(--tempu-ink-soft);
}

.today-temp {
  grid-column: 1 / -1;
  margin-block-start: 0.9rem;
  font-family: var(--tempu-font-serif);
  font-size: clamp(2.25rem, 1.7rem + 1.2vw, 2.75rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.today-summary {
  grid-column: 1 / -1;
  margin-block-start: 0.6rem;
  color: var(--tempu-ink-mid);
}

.today-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1rem;
  margin: 1.1rem 0 0;
  padding-block-start: 1rem;
  border-top: 1px solid var(--tempu-line);
}

.today-facts > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.today-facts dt {
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.today-facts dd {
  margin: 0;
  font-size: var(--tempu-text-data);
  color: var(--tempu-ink);
  white-space: nowrap;
}

.wind_dir {
  display: inline-flex;
  /* Templates supply --wind-bearing (meteorological degrees minus 90, so a
     right-pointing arrow at 0deg faces north). */
  rotate: var(--wind-bearing, 0deg);
  color: var(--tempu-ink-soft);
}

@media (max-width: 480px) {
  .today-card {
    padding-inline: 1.1rem;
  }
  .today-facts {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===================================================================
 * Home — the municipalities
 * =================================================================== */

.capitals h1 {
  margin-block-end: 0.75rem;
}

.capital-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.district-block {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.9rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--tempu-line);
}

.district-block:last-child,
.capital-list:not(.capital-list) .district-block:last-child {
  border-bottom: 0;
}

.weather-icon-capitals {
  font-size: 1.6rem;
  line-height: 1;
  text-align: center;
  color: var(--tempu-ink-mid);
}

.District-Title {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  line-height: 1.25;
}

a.location-home {
  font-family: var(--tempu-font-serif);
  font-size: var(--tempu-text-subhead);
  font-weight: 500;
  color: var(--tempu-ink);
  text-decoration: none;
}

a.location-home:hover {
  text-decoration: underline;
  text-decoration-color: var(--tempu-accent);
  text-decoration-thickness: 2px;
}

/* Shown in place of the map when the database has no forecasts yet. */
.no-data-notice {
  max-inline-size: var(--tempu-measure);
  margin-block: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--tempu-line);
  border-radius: var(--tempu-radius);
  background: var(--tempu-surface);
}

.no-data-notice p {
  margin-block-start: 0.5rem;
  color: var(--tempu-ink-mid);
}

@media (max-width: 480px) {
  .district-parent {
    display: none;
  }
}

/* ===================================================================
 * Details page
 * =================================================================== */

#details-location {
  margin-block: 1.5rem 1.25rem;
}

#details-sublocation {
  display: block;
  margin-block-start: 0.25rem;
  font-family: var(--tempu-font-sans);
  font-size: var(--tempu-text-data);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--tempu-ink-soft);
}

/* Five equal columns. */
@media (min-width: 768px) {
  .container-fluid.details > .row-fluid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.25rem;
  }
  .container-fluid.details > .row-fluid > .data_column {
    grid-column: auto;
  }
}

.data_column {
  min-inline-size: 0;
  padding: 0.9rem 1rem 1rem;
}

.day_of_week {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block-end: 0.4rem;
  border-bottom: 1px solid var(--tempu-line);
  transition: border-color 120ms ease;
}

.day_of_week .date {
  font-size: var(--tempu-text-caption);
  color: var(--tempu-ink-soft);
}

.highlighted .day_of_week,
.highlighted .day-details {
  color: var(--tempu-ink);
}

.highlighted .day_of_week {
  box-shadow: inset 0 -2px 0 var(--tempu-accent);
}

/* Icon over the summary on the left; high stacked on low on the right. */
.details-icon {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 0.9rem 0.5rem;
}

.details-weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  min-inline-size: 0;
  flex: 0 1 auto;
  max-inline-size: 8rem;
}

.details-weather > .climacon {
  font-size: 2.25rem;
  line-height: 1;
  color: var(--tempu-ink-mid);
}

.weather-text {
  min-block-size: 2.6em;
  font-size: var(--tempu-text-data);
  line-height: 1.3;
  color: var(--tempu-ink-mid);
}

.details-temps {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex: 0 0 auto;
}

.details-temp-high {
  font-family: var(--tempu-font-serif);
  font-size: calc(var(--tempu-text-heading) * 0.8);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.details-temp-low {
  font-family: var(--tempu-font-serif);
  font-size: calc(var(--tempu-text-subhead) * 0.8);
  color: var(--tempu-ink-soft);
}

/* --- Charts ---------------------------------------------------------- */

.carousel {
  overflow: hidden;
  /* The browser keeps vertical scrolling; horizontal movement comes to the
     carousel's pointer handlers as a swipe. */
  touch-action: pan-y;
}

.carousel-track {
  display: flex;
  transition: transform var(--tempu-slide);
}

/* While a finger is down the track follows it directly; easing toward a
   position the gesture has already moved past reads as lag. */
.carousel-track.is-dragging {
  transition: none;
}

.carousel-track > * {
  flex: 0 0 100%;
  min-inline-size: 0;
  align-content: start;
  overflow: hidden;
}

.carousel:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

text.graph-temperatures,
text.graph-rain,
text.graph-uv,
text.graph-x-labels {
  font-family: var(--tempu-font-sans);
  font-size: 11px;
  fill: var(--tempu-ink-mid);
}

text.graph-x-labels {
  fill: var(--tempu-ink-soft);
}

text.graph-icons {
  font-family: Tempu-Info;
  font-size: 16px;
  fill: var(--tempu-ink-mid);
}

/* Labels sit over a gradient whose lightness spans the whole range; a halo
   in the page paper keeps them legible over any band. */
text.graph-uv,
text.graph-temperatures,
text.graph-rain {
  paint-order: stroke;
  stroke: var(--tempu-paper);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* One bar per three-hour reading; the fill comes from each series' ramp. */
.temp-bar,
.rain-bar,
.uv-bar {
  stroke: rgb(255 255 255 / 0.55);
  stroke-width: 1;
}

.now-marker {
  fill: var(--tempu-accent);
  opacity: 0.7;
}

text.graph-now {
  fill: var(--tempu-ink);
  font-size: 9px;
  letter-spacing: 0.06em;
}

/* --- Stats slide ------------------------------------------------------ */

.side.stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding-block: 0.5rem;
  font-size: var(--tempu-text-data);
}

.side.stats .other-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.side.stats p,
.side.stats .sun-updown-details {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1.4;
}

.details-humidity p {
  justify-content: flex-end;
}

.side.stats .other-details p,
.side.stats .sun-updown-details {
  justify-content: flex-start;
}

.side.stats .other-details .wind-icon,
.side.stats .other-details .rain-icon,
.side.stats .other-details .uv-icon,
.side.stats .other-details .sun-up-down {
  flex: 0 0 1.25em;
  display: inline-flex;
  justify-content: center;
  margin-inline-end: auto;
  color: var(--tempu-ink-soft);
}

.side.stats i[class^="tempu-"] {
  color: var(--tempu-ink-soft);
}

.humidity-title,
.uv-band {
  color: var(--tempu-ink-soft);
}

.humidity-value {
  font-size: var(--tempu-text-subhead);
}

.details-humidity {
  padding-block-end: 0.3rem;
  border-bottom: 1px solid var(--tempu-line);
}

.uv-value {
  color: var(--tempu-ink-mid);
}

/* --- Rain slide: the "No rain" panel -----------------------------------
 * Shown on days whose readings never reach the trace threshold, in place of a
 * chart that would be a flat line at zero. "NO" carries the answer, "RAIN" the
 * subject, and the umbrella says it once more without words.
 */

span.percent_box {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0 0.5rem;
  /* Matches the chart it replaces, so the carousel never changes height. */
  block-size: var(--tempu-chart-height);
}

span.rain-value.rain_chance {
  font-family: var(--tempu-font-serif);
  font-size: var(--tempu-text-heading);
  color: var(--tempu-rain);
  line-height: 1;
  letter-spacing: -0.02em;
}

span.rain-value.rain_chance h4 {
  margin-block-start: 0.4rem;
  font-family: var(--tempu-font-sans);
  font-size: var(--tempu-text-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tempu-ink-soft);
}

#brolley_icon i.tempu-rainfall {
  font-size: 3rem;
  color: var(--tempu-ink-soft);
}

/* --- Slide controls ---------------------------------------------------- */

/* Per-column toggles: phones only, where one column is on screen at a time. */
span.centered {
  display: none;
  margin-block-start: 0.5rem;
}

#centered-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-block-start: 1rem;
}

@media (max-width: 767px) {
  .container-fluid.details > .row-fluid {
    gap: 2rem;
  }
  span.centered {
    display: block;
  }
  #centered-collapse {
    display: none;
  }
}

/* ===================================================================
 * Wind page
 * =================================================================== */

.wind-timeline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-inline-size: 72rem;
  margin-inline: auto;
  padding: 0.75rem var(--tempu-gutter);
}

.wind-timeline input[type="range"] {
  flex: 1 1 auto;
  min-inline-size: 0;
  accent-color: var(--tempu-ink);
}

.wind-timeline output {
  min-inline-size: 14ch;
  font-size: var(--tempu-text-data);
  color: var(--tempu-ink-mid);
}

/* ===================================================================
 * Search results, 404, 500
 * =================================================================== */

.container-fluid > h3,
.container-fluid > .span6 > h3,
.container-fluid > .span12 > h3 {
  margin-block: 1.5rem 0.5rem;
}

.container-fluid > .span4,
.container-fluid > .span12 {
  padding-block: 0.4rem;
  color: var(--tempu-ink-mid);
}

.container-fluid > .span4 {
  border-bottom: 1px solid var(--tempu-line);
}

.container-fluid > .span4 > a {
  font-weight: 600;
  color: var(--tempu-ink);
  text-decoration: none;
}

/* ===================================================================
 * Footer
 * =================================================================== */

.bottom-block {
  margin-block-start: 0;
}

.about-us {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  /* Space from the hairline down to the Catalpa mark — the visual "credits" block. */
  padding-block: 40px 0.5rem;
  border-top: 1px solid var(--tempu-line);
}

.about-us p {
  margin: 0;
}

#our-logo img {
  display: block;
  inline-size: 5.5rem;
  block-size: auto;
  opacity: 0.82;
}

p#follow_us {
  margin-block-start: 0.35rem;
}

p#social-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-block-start: 0.15rem;
}

#social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  border: 1px solid var(--tempu-line);
  border-radius: 50%;
  color: var(--tempu-ink-soft);
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}

#social-links .icon {
  inline-size: 0.85rem;
  block-size: 0.85rem;
}

#social-links a:hover {
  color: var(--tempu-ink);
  border-color: var(--tempu-ink-soft);
}

.credits {
  padding: 0.75rem var(--tempu-gutter) 1.5rem;
  text-align: center;
  font-size: var(--tempu-text-caption);
  line-height: 1.6;
  color: var(--tempu-ink-soft);
  text-wrap: balance;
}

/* The licence asks for a legible credit, not a loud one: links read as part of
   the sentence until they are pointed at. */
.credits a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--tempu-line);
  text-underline-offset: 0.15em;
}

.credits a:hover {
  color: var(--tempu-ink);
  text-decoration-color: currentColor;
}

.credits a {
  color: var(--tempu-ink-mid);
}
