/*
 * WeeWX Bootstrap Skin - Modern visual layer
 * ------------------------------------------------------------
 * Modern visual layer for the bootstrap-ng skin.
 * Target: Bootstrap 5, no jQuery. Navigation uses the native
 * Bootstrap 5 collapse component below the xl breakpoint.
 */

:root {
  --wx-bg: #f4f7fa;
  --wx-surface: #ffffff;
  --wx-surface-soft: #f9fbfc;
  --wx-text: #203040;
  --wx-muted: #6f7f8d;
  --wx-heading: #183b56;
  --wx-border: #e1e8ee;
  --wx-primary: #1769aa;
  --wx-primary-dark: #0f4d80;
  --wx-header-mid: #145b93;
  --wx-accent: #72d6ff;
  --wx-radius: 14px;
  --wx-shadow: 0 8px 28px rgba(30, 56, 78, 0.08);
  --wx-shadow-small: 0 4px 16px rgba(30, 56, 78, 0.06);
}

html {
  background: var(--wx-bg);
}

body {
  background: var(--wx-bg);
  color: var(--wx-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  padding-bottom: 24px;
}

a {
  color: var(--wx-primary);
  transition: color 0.15s ease, background-color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
}

a:hover,
a:focus {
  color: var(--wx-primary-dark);
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--wx-heading);
  font-family: Arial, Helvetica, sans-serif;
}

h3 {
  margin-top: 8px;
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 700;
}

h4 {
  font-size: 16px;
  font-weight: 700;
}

/* Navigation ------------------------------------------------- */
.wx-navbar {
  min-height: 56px;
  margin-bottom: 26px;
  padding-top: 0;
  padding-bottom: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, #0b3558 0%, #1769aa 100%);
  box-shadow: 0 6px 22px rgba(5, 38, 64, 0.18);
}

.wx-navbar .container {
  min-height: 56px;
}

.navbar-logo {
  height: 56px;
  margin-right: 12px;
  padding: 13px 0;
  line-height: 30px;
}

.navbar-logo img {
  display: block;
  width: auto;
  height: 30px;
  max-width: none;
}

.wx-navbar .navbar-nav .nav-link {
  padding: 18px 12px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.wx-navbar .navbar-nav .nav-link:hover,
.wx-navbar .navbar-nav .nav-link:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.wx-navbar .navbar-nav .nav-link.active,
.wx-navbar .navbar-nav .nav-link.active:hover,
.wx-navbar .navbar-nav .nav-link.active:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 -3px 0 var(--wx-accent);
}

.wx-navbar .navbar-toggler {
  margin-left: auto;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.wx-navbar .navbar-toggler:hover,
.wx-navbar .navbar-toggler:focus {
  background: rgba(255, 255, 255, 0.10);
  box-shadow: none;
}

/* About project logo ----------------------------------------- */
/* Main content ----------------------------------------------- */
.container > .row {
  margin-bottom: 2px;
}

.main {
  color: var(--wx-text);
}

.main p {
  margin-bottom: 11px;
}

.main hr,
.container > hr {
  border-top-color: var(--wx-border);
}

/* Last update ------------------------------------------------ */
.update-box {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--wx-border);
  border-radius: 10px;
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow-small);
  color: var(--wx-primary);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.update-box-label {
  font-weight: 700;
  color: var(--wx-primary);
}

.update-box-time {
  color: var(--wx-primary);
  font-weight: 700;
}

/* Gauge panel ------------------------------------------------ */
.container > .row > .col-md-4 > .row > .col-md-6 {
  padding-top: 10px;
  padding-bottom: 8px;
}

.container > .row > .col-md-4 > .row > .col-md-6 img {
  max-width: 100%;
  height: auto;
  padding: 8px;
  border: 1px solid #e8eef2;
  border-radius: 50%;
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow-small);
}

.container > .row > .col-md-4 > .row > .col-md-6 h5 {
  min-height: 30px;
  margin-top: 9px;
  margin-bottom: 6px;
  color: #506777;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

/* Current value boxes ---------------------------------------- */
.stats {
  margin-top: 8px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--wx-border);
  border-radius: var(--wx-radius);
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow);
}

.stats_header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--wx-border);
  background: var(--wx-surface-soft);
}

.stats_header h4 {
  margin: 0;
  color: #24465f;
  font-size: 15px;
  font-weight: 700;
}

.stats .table {
  margin-bottom: 0;
  background: var(--wx-surface);
}

.stats .table > tbody > tr > td {
  padding: 9px 14px;
  border-top: 1px solid #edf2f5;
  vertical-align: middle;
}

.stats .table > tbody > tr:first-child > td {
  border-top: 0;
}

.stats .table-hover > tbody > tr:hover {
  background: #f7fbfd;
}

.stats_label {
  width: 59%;
  color: #5f7180;
}

.stats_data {
  color: var(--wx-heading);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

/* Time period navigation ------------------------------------- */
.wx-timespan-nav {
  display: inline-flex;
  flex-wrap: nowrap;
  padding: 5px;
  border: 1px solid var(--wx-border);
  border-radius: 12px;
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow-small);
}

.wx-timespan-nav .nav-link {
  padding: 8px 15px;
  border-radius: 9px;
  color: var(--wx-header-mid);
  font-weight: 600;
}

.wx-timespan-nav .nav-link:hover,
.wx-timespan-nav .nav-link:focus {
  color: var(--wx-header-mid);
  background: #edf6fb;
}

.wx-timespan-nav .nav-link.active,
.wx-timespan-nav .nav-link.active:hover,
.wx-timespan-nav .nav-link.active:focus {
  color: #ffffff;
  background: var(--wx-primary);
  box-shadow: 0 3px 10px rgba(23, 105, 170, 0.18);
}

/* WeeWX graph images ----------------------------------------- */
.main > .row > .col-md-6 {
  padding-bottom: 4px;
}

.main > .row > .col-md-6 > a {
  display: block;
  padding: 9px;
  overflow: hidden;
  border: 1px solid var(--wx-border);
  border-radius: var(--wx-radius);
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow);
}

.main > .row > .col-md-6 > a:hover,
.main > .row > .col-md-6 > a:focus {
  border-color: #c9dbe7;
  box-shadow: 0 10px 30px rgba(30, 56, 78, 0.12);
}

.main > .row > .col-md-6 > a > img.img-fluid {
  width: 100%;
  border-radius: 9px;
}

/* Generic content pages -------------------------------------- */
.main > img,
.main > p > img,
.main > a > img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.main > img {
  box-shadow: var(--wx-shadow-small);
}

.main table:not(.table) {
  width: 100%;
  margin: 12px 0 22px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--wx-border);
  border-radius: 10px;
  background: var(--wx-surface);
}

.main table:not(.table) th,
.main table:not(.table) td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f5;
  vertical-align: top;
}

.main table:not(.table) tr:last-child th,
.main table:not(.table) tr:last-child td {
  border-bottom: 0;
}

.main table:not(.table) th {
  color: #38566b;
  background: #f7fafc;
  font-weight: 700;
}

.table {
  color: var(--wx-text);
  background: var(--wx-surface);
}

.table > thead > tr > th {
  border-bottom-color: var(--wx-border);
  color: #38566b;
  background: #f7fafc;
}

.table > tbody > tr > td,
.table > tbody > tr > th {
  border-top-color: #edf2f5;
}

/* Footer ----------------------------------------------------- */
footer {
  padding: 4px 2px 16px;
  color: #7b8b97;
  font-size: 12px;
}

footer p {
  margin-bottom: 0;
}

footer a {
  color: #526f84;
}

/* Responsive adjustments ------------------------------------ */
@media (max-width: 1199.98px) {
  .wx-navbar {
    margin-bottom: 18px;
  }

  .wx-navbar .navbar-collapse {
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .wx-navbar .navbar-nav {
    padding: 8px 0 10px;
  }

  .wx-navbar .navbar-nav .nav-link {
    padding: 10px 12px;
    font-size: 13px;
  }

  .wx-navbar .navbar-nav .nav-link.active {
    box-shadow: inset 3px 0 0 var(--wx-accent);
  }
}

@media (max-width: 991.98px) {
  .container > .row > .col-md-4 {
    margin-bottom: 16px;
  }

  .main {
    margin-top: 8px;
  }
}

@media (max-width: 767.98px) {
  body {
    font-size: 13px;
  }

  .container > .row > .col-md-4 > .row > .col-md-6 {
    width: 50%;
  }

  .wx-timespan-nav .nav-link {
    padding: 7px 11px;
    font-size: 12px;
  }

  .stats_data {
    white-space: normal;
  }

  .main > .row > .col-md-6 {
    margin-bottom: 14px;
  }
}

@media (max-width: 420px) {
  .container > .row > .col-md-4 > .row > .col-md-6 {
    padding-left: 6px;
    padding-right: 6px;
  }

  .stats .table > tbody > tr > td {
    padding: 8px 10px;
  }

  .wx-timespan-nav {
    display: flex;
    width: 100%;
  }

  .wx-timespan-nav .nav-item {
    flex: 1 1 25%;
    text-align: center;
  }

  .wx-timespan-nav .nav-link {
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* Media / embeds on content pages --------------------------- */
.wx-media-block {
  margin-bottom: 18px;
}

.wx-media-card {
  display: block;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--wx-border);
  border-radius: var(--wx-radius);
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow);
}

.wx-media-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto !important;
  border-radius: 10px;
}

.wx-media-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 600px;
  border: 0 !important;
  border-radius: 10px;
  background: #fff;
}

@media (max-width: 767px) {
  .wx-media-frame {
    min-height: 420px;
  }
}


/* Webcam: preserve source aspect ratio and never crop -------- */
.wx-webcam-card {
  width: 100%;
  max-width: 100%;
}

.wx-webcam-image {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto;
  object-fit: contain;
}


/* V7: blue page headings and gauge labels ------------------- */
.main > h3,
.main > h4 {
  color: var(--wx-primary) !important;
}

.container > .row > .col-md-4 > .row > .col-md-6 h5 {
  color: var(--wx-primary) !important;
}


/* V8: blue summary heading ---------------------------------- */
.stats_header h4 {
  color: var(--wx-primary) !important;
}


/* V10: use the mid blue from the navbar gradient ------------- */
.main > h3,
.main > h4,
.stats_header h4,
.container > .row > .col-md-4 > .row > .col-md-6 h5 {
  color: var(--wx-header-mid) !important;
}


/* V11: media must never be cropped --------------------------- */
.wx-media-block,
.wx-media-card,
.wx-webcam-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible !important;
}

.wx-media-card > img,
.wx-media-image,
.wx-webcam-image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain !important;
  object-position: center center;
  clip: auto !important;
}

.main .wx-media-block .row,
.main .wx-media-block,
.main .wx-media-card {
  overflow: visible !important;
}


/* V13: Impressum / Datenschutz ------------------------------ */
.legal-page {
  margin-bottom: 22px;
}

.legal-card {
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--wx-border);
  border-radius: var(--wx-radius);
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow-small);
}

.legal-card h4 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--wx-header-mid) !important;
}

.legal-card address {
  margin-bottom: 0;
  line-height: 1.65;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-note {
  color: var(--wx-muted);
  font-size: 12px;
}

@media (max-width: 767px) {
  .legal-card {
    padding: 16px;
  }
}


/* V14: legal footer alignment and colour --------------------- */
footer {
  text-align: right;
}

footer p {
  text-align: right;
}

footer a,
footer a:visited {
  color: var(--wx-header-mid) !important;
}

footer a:hover,
footer a:focus {
  color: var(--wx-primary-dark) !important;
  text-decoration: none;
}



/* bootstrap-ng V2: explicit Bootstrap 5 navigation styling ----------------
 * These rules are intentionally specific. The test URL previously served the
 * Bootstrap 3 version of modern.css, so a browser cache can otherwise leave
 * the Bootstrap 5 markup with Bootstrap default colours/layout.
 */
.wx-navbar.navbar {
  background: linear-gradient(135deg, #0b3558 0%, #1769aa 100%) !important;
}

.wx-navbar.navbar .navbar-nav .nav-link,
.wx-navbar.navbar .navbar-nav .nav-link:visited {
  color: rgba(255, 255, 255, 0.84) !important;
}

.wx-navbar.navbar .navbar-nav .nav-link:hover,
.wx-navbar.navbar .navbar-nav .nav-link:focus {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.wx-navbar.navbar .navbar-nav .nav-link.active,
.wx-navbar.navbar .navbar-nav .nav-link.active:hover,
.wx-navbar.navbar .navbar-nav .nav-link.active:focus {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.15) !important;
}

.wx-timespan-nav.nav {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  width: auto;
}

.wx-timespan-nav.nav .nav-item {
  flex: 0 0 auto;
}

.wx-timespan-nav.nav .nav-link,
.wx-timespan-nav.nav .nav-link:visited {
  color: var(--wx-header-mid) !important;
  background-color: transparent !important;
}

.wx-timespan-nav.nav .nav-link:hover,
.wx-timespan-nav.nav .nav-link:focus {
  color: var(--wx-header-mid) !important;
  background-color: #edf6fb !important;
}

.wx-timespan-nav.nav .nav-link.active,
.wx-timespan-nav.nav .nav-link.active:hover,
.wx-timespan-nav.nav .nav-link.active:focus {
  color: #ffffff !important;
  background-color: var(--wx-primary) !important;
}

@media (max-width: 420px) {
  .wx-timespan-nav.nav {
    display: flex !important;
    width: 100%;
  }

  .wx-timespan-nav.nav .nav-item {
    flex: 1 1 25%;
  }
}

/* V4.1: Webcam and radioactivity graphs at 60% on large screens ---- */
@media (min-width: 1200px) {
  .wx-webcam-card,
  .wx-geiger-card {
    width: 60% !important;
    max-width: 60% !important;
    margin-left: 0;
    margin-right: auto;
  }
}

/* V4.3/V4.6: radar at 60% on large screens ------------------- */
@media (min-width: 1200px) {
  .wx-radar-card {
    width: 60% !important;
    max-width: 60% !important;
    margin-left: 0;
    margin-right: auto;
  }
}

/* V4.6: landscape photos in about use the same maximum width
 * as the radioactivity images, without changing aspect ratio. */
.wx-about-photo-landscape {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto !important;
}

@media (min-width: 1200px) {
  .wx-about-photo-landscape {
    width: 60%;
    max-width: 60%;
    margin-left: 0;
    margin-right: auto;
  }
}

/* V4.4: forecast table - stable columns and centred cell content -------- */
@media (min-width: 768px) {
  .fc_table > .legend > table,
  .fc_table > .summary > table,
  .fc_table > .period > table {
    width: 100% !important;
    table-layout: fixed !important;
  }

  .fc_table .col-date      { width: 9% !important;  min-width: 0 !important; }
  .fc_table .col-outlook   { width: 8% !important;  min-width: 0 !important; }
  .fc_table .col-temp      { width: 6% !important;  min-width: 0 !important; }
  .fc_table .col-humidity  { width: 7% !important;  min-width: 0 !important; }
  .fc_table .col-wind      { width: 11% !important; min-width: 0 !important; }
  .fc_table .col-tides     { width: 10% !important; min-width: 0 !important; }
  .fc_table .col-sun       { width: 11% !important; min-width: 0 !important; }
  .fc_table .col-moon      { width: 11% !important; min-width: 0 !important; }
  .fc_table .col-moonphase { width: 8% !important;  min-width: 0 !important; }
  .fc_table .col-pop       { width: 10% !important; min-width: 0 !important; }
  .fc_table .col-precip    { width: 10% !important; min-width: 0 !important; }
  .fc_table .col-obvis     { width: 9% !important;  min-width: 0 !important; }
}

.fc_table > .legend > table > tbody > tr > td,
.fc_table > .summary > table > tbody > tr > td,
.fc_table > .period > table > tbody > tr > td {
  vertical-align: middle !important;
  text-align: center;
}

.fc_table > .summary > table > tbody > tr > td.col-date,
.fc_table > .period > table > tbody > tr > td.col-date {
  text-align: left;
}

.fc_table .legend-img,
.fc_table .outlook-img,
.fc_table .pop-img,
.fc_table .precip-img,
.fc_table .obvis-img {
  vertical-align: middle;
}

/* V4.6: history matrices - centre values within their cells --- */
.wx-history-table table th,
.wx-history-table table td {
  vertical-align: middle !important;
  text-align: center !important;
}

.wx-history-table table th:first-child,
.wx-history-table table td:first-child {
  text-align: left !important;
}

/* V4.7: more space below time-period navigation -------------- */
.wx-timespan-nav {
  margin-bottom: 5mm;
}

/* V4.9: astronomy page --------------------------------------- */
.wx-astronomy-page {
  padding-bottom: 8px;
}

.wx-astro-intro {
  max-width: 900px;
  margin-bottom: 24px;
  color: #212529;
}

.wx-astro-intro-text,
.wx-astro-updated {
  display: block;
}

.wx-astro-intro-text {
  margin-bottom: 3mm;
}

.wx-astro-grid {
  margin-bottom: 4px;
}

.wx-astro-grid-bottom {
  margin-top: 4px;
}

.wx-astro-card {
  margin-bottom: 20px;
  padding: 22px 24px;
  border: 1px solid var(--wx-border);
  border-radius: var(--wx-radius);
  background: var(--wx-surface);
  box-shadow: var(--wx-shadow-small);
}

.wx-astro-card h4 {
  margin-top: 0;
  margin-bottom: 18px;
  color: var(--wx-header-mid) !important;
}

.wx-moon-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.wx-moon-disc {
  position: relative;
  width: 176px;
  height: 176px;
  overflow: hidden;
  border: 1px solid #b9c7d2;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, rgba(125, 130, 132, .24) 0 7%, transparent 8%),
    radial-gradient(circle at 62% 43%, rgba(125, 130, 132, .18) 0 5%, transparent 6%),
    radial-gradient(circle at 45% 70%, rgba(125, 130, 132, .15) 0 8%, transparent 9%),
    #f2f1df;
  box-shadow: 0 8px 22px rgba(14, 39, 61, .16);
}

.wx-moon-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #101820;
}

.wx-moon-phase-0::after { transform: translateX(0); }
.wx-moon-phase-1::after { transform: translateX(-24%); }
.wx-moon-phase-2::after { left: 0; right: 50%; border-radius: 88px 0 0 88px; transform: none; }
.wx-moon-phase-3::after { transform: translateX(-88%); }
.wx-moon-phase-4::after { display: none; }
.wx-moon-phase-5::after { transform: translateX(88%); }
.wx-moon-phase-6::after { left: 50%; right: 0; border-radius: 0 88px 88px 0; transform: none; }
.wx-moon-phase-7::after { transform: translateX(24%); }

.wx-moon-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wx-moon-caption strong {
  color: var(--wx-header-mid);
  font-size: 1.08rem;
}

.wx-moon-caption span {
  color: var(--wx-muted);
}

.wx-astro-values {
  margin: 0;
}

.wx-astro-values > div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f4;
}

.wx-astro-values > div:last-child {
  border-bottom: 0;
}

.wx-astro-values dt {
  font-weight: 600;
  color: #355166;
}

.wx-astro-values dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wx-astro-values-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 34px;
}

.wx-astro-table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.wx-astro-table th,
.wx-astro-table td {
  padding: 9px 10px;
  border-color: #e8eef2;
  vertical-align: middle;
}

.wx-astro-table thead th {
  color: #355166;
  font-weight: 600;
}

.wx-astro-note,
.wx-astro-source {
  color: var(--wx-muted);
}

.wx-astro-source {
  margin-top: 6px;
  font-size: .9rem;
}

@media (max-width: 767px) {
  .wx-astro-card {
    padding: 18px;
  }

  .wx-moon-disc {
    width: 150px;
    height: 150px;
  }

  .wx-astro-values > div,
  .wx-astro-values-2col {
    grid-template-columns: 1fr;
  }

  .wx-astro-values dd {
    text-align: left;
  }
}

/* V4.13: footer AI credit left, existing footer content right -------- */
.wx-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: initial;
}

.wx-footer .wx-footer-ai {
  margin: 0;
  color: var(--wx-text);
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
}

.wx-footer .wx-footer-meta {
  margin: 0;
  font-size: 12px;
  text-align: right;
}

@media (max-width: 767px) {
  .wx-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .wx-footer .wx-footer-meta {
    text-align: left;
  }
}

/* V4.14: compact daily sums and extremes in gauge column ----- */
.wx-today-stats {
  margin-top: 18px;
}

.wx-today-stats .stats_time {
  white-space: nowrap;
  color: var(--wx-muted);
  font-size: 0.9em;
}


/* V4.16/V4.18: compact gauge column and integrated daily statistics ---- */
@media (min-width: 768px) {
  .container > .row > .col-md-4 > .row > .col-md-6 img {
    width: 80%;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
  }

  .container > .row > .col-md-4 > .row > .col-md-6 {
    padding-top: 6px;
    padding-bottom: 4px;
  }

  .container > .row > .col-md-4 > .row > .col-md-6 h5 {
    margin-top: 6px;
    margin-bottom: 4px;
  }
}

.wx-stats-subheader {
  border-top: 1px solid var(--wx-border);
}

/* V4.17/V4.18: clean forecast metadata and plugin timestamp ----- */
.wx-forecast-intro {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: #212529;
}

.wx-forecast-updated {
  margin-top: 3mm;
  margin-bottom: 5mm;
  color: #212529;
}

.fc_table .sources {
  display: none !important;
}

/* V4.21: astronomy layout - calm, balanced blocks ------------ */
.wx-astro-layout-row {
  margin-bottom: 24px;
}

.wx-astro-layout-row:last-of-type {
  margin-bottom: 4px;
}

.wx-astro-layout-row > [class*="col-"] {
  display: flex;
}

.wx-astro-layout-row .wx-astro-card {
  width: 100%;
  margin-bottom: 0;
}

.wx-astro-day-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--wx-border);
}

.wx-astro-day-heading h4 {
  margin-bottom: 0;
}

.wx-astro-day-heading span {
  color: var(--wx-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wx-astro-day-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.wx-astro-day-section h5,
.wx-astro-twilight h5 {
  margin: 0 0 10px;
  color: #355166;
  font-size: 1rem;
  font-weight: 600;
}

.wx-astro-values-compact > div {
  grid-template-columns: minmax(105px, 1fr) auto;
  gap: 12px;
  padding: 6px 0;
}

.wx-astro-twilight {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--wx-border);
}

.wx-astro-twilight-table th,
.wx-astro-twilight-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.wx-astro-twilight-table th:nth-child(2),
.wx-astro-twilight-table th:nth-child(3),
.wx-astro-twilight-table td:nth-child(2),
.wx-astro-twilight-table td:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 991px) {
  .wx-astro-day-columns {
    gap: 20px;
  }
}

@media (max-width: 575px) {
  .wx-astro-layout-row {
    margin-bottom: 18px;
  }

  .wx-astro-day-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .wx-astro-day-columns {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}


/* V4.22: consistent vertical rhythm on content pages ---------- */
.main > h3 {
  margin-top: 8px;
  margin-bottom: 10px;
  line-height: 1.3;
}

.main > h4 {
  margin-top: 24px;
  margin-bottom: 10px;
  line-height: 1.35;
}

.main > h3 + h4 {
  margin-top: 0;
}

.main > h3 + p,
.main > h4 + p {
  margin-top: 0;
}

.main > p {
  margin-bottom: 9px;
}

/* About page: keep captions visually attached to their image. */
.wx-about-media {
  margin-top: 14px;
  margin-bottom: 20px;
}

.wx-about-media img {
  display: block;
  margin: 0;
}

.wx-about-caption {
  margin: 5px 0 0 !important;
  line-height: 1.45;
}

.wx-about-media-no-caption {
  margin-bottom: 24px;
}

/* Specialised cards manage their own heading rhythm. */
.wx-astro-card h4,
.legal-card h4,
.stats_header h4,
.wx-stats-subheader h4 {
  margin-top: 0;
}


.wx-about-banner {
  margin: 18px 0 16px;
}

.wx-about-banner img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wx-about-hardware-logo {
  display: block;
  margin: 0 0 12px;
}
