/* Weather on Any Date — Native Explorer styles (light theme matching Climate Explorer) */

.wotd-interactive-shell {
  max-width: 1180px;
  margin: 1.5rem auto 2rem;
}

.wotd-interactive-shell [hidden] {
  display: none !important;
}

/* Search & controls card */
.wotd-controls-card {
  background: #f6f9fb;
  border: 1px solid #d5e0e8;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.wotd-controls-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(240px, 2fr) minmax(170px, 1fr);
  gap: 1rem;
  align-items: start;
}

.wotd-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.wotd-field label {
  font-weight: 600;
  font-size: 0.92rem;
  color: #162432;
}

.wotd-field .form-control,
.wotd-field .form-select {
  font: inherit;
  font-size: max(1rem, 1em);
  min-height: 44px;
  border-color: #708090;
  color: #162432;
  background-color: #ffffff;
}

.wotd-hint {
  font-size: 0.82rem;
  color: #425466;
  line-height: 1.35;
}

.wotd-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #dce5ec;
}

.wotd-step-buttons,
.wotd-unit-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.wotd-unit-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #324455;
  margin-inline-end: 0.2rem;
}

.wotd-unit-btn {
  border: 1px solid #8ea2b3;
  background: #ffffff;
  color: #162432;
  font-weight: 600;
}

.wotd-unit-btn.is-active {
  background: #126a78;
  border-color: #126a78;
  color: #ffffff;
}

/* Loading & error status banner */
.wotd-loading-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: #eef6f8;
  border: 1px solid #b8d8df;
  color: #0e4c56;
  font-size: 0.94rem;
}

.wotd-loading-banner.is-error {
  background: #fdf2f2;
  border-color: #e6b8b8;
  color: #7c1f1f;
}

/* Main day summary card */
.wotd-summary-card {
  background: #ffffff;
  border: 1px solid #d5e0e8;
  border-top: 4px solid #126a78;
  border-radius: 12px;
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(18, 42, 66, 0.04);
}

.wotd-summary-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem 1.25rem;
  margin-bottom: 1.1rem;
}

.wotd-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #0e5a66;
  overflow-wrap: anywhere;
}

.wotd-summary-header h3 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
  color: #102030;
}

.wotd-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wotd-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.wotd-metric-box {
  background: #f8fbfc;
  border: 1px solid #dce6ec;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.wotd-metric-max {
  border-left: 4px solid #ae5225;
}

.wotd-metric-min {
  border-left: 4px solid #126a78;
}

.wotd-metric-prcp {
  border-left: 4px solid #2b6cb0;
}

.wotd-metric-snow {
  border-left: 4px solid #5c6f84;
}

.wotd-metric-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #425466;
  margin-bottom: 0.25rem;
}

.wotd-metric-value {
  display: block;
  font-size: 1.08rem;
  font-weight: 700;
  color: #102030;
  overflow-wrap: anywhere;
}

.wotd-narrative {
  font-size: 1rem;
  line-height: 1.55;
  color: #1d2d3d;
  margin: 0 0 0.9rem;
}

.wotd-deep-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #e7edf2;
  font-size: 0.9rem;
  color: #324455;
}

.wotd-deep-links a {
  font-weight: 600;
  color: #0e5a66;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Global map */
.wotd-map-section {
  background: #ffffff;
  border: 1px solid #d5e0e8;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
}

.wotd-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.wotd-section-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.wotd-map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.wotd-basemap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.wotd-map-controls .btn-outline-secondary {
  background: #ffffff;
  color: #374151;
  border-color: #d1d5db;
}

.wotd-map-controls .btn-outline-secondary:hover {
  background: #f3f4f6;
  color: #111827;
}

.wotd-map-wrap {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #c9d8e3;
  background: #e6f1f7;
}

#wotd-world-map {
  display: block;
  width: 100%;
  height: 460px;
  position: relative;
}

.wotd-maplibre-popup .maplibregl-popup-content {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #102030;
  box-shadow: 0 4px 14px rgba(16, 32, 48, 0.16);
  border: 1px solid #cbd5e1;
}

.wotd-maplibre-popup .maplibregl-popup-tip {
  border-top-color: #ffffff;
}

@media (max-width: 640px) {
  #wotd-world-map {
    height: 350px;
  }
}

.wotd-map-caption {
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
  color: #425466;
}

/* Plotly chart figures */
.wotd-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  margin-bottom: 1.5rem;
}

.wotd-chart-figure {
  background: #ffffff;
  border: 1px solid #d5e0e8;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.wotd-chart-figure h3 {
  margin: 0 0 0.6rem;
  font-size: 1.18rem;
}

.wotd-plot-canvas {
  width: 100%;
  max-width: 100%;
  min-height: 360px;
  min-width: 0;
  overflow: hidden;
}

.wotd-chart-status {
  margin: 0.4rem 0 0.25rem;
  font-size: 0.86rem;
  color: #324455;
}

.wotd-chart-figure figcaption {
  margin: 0;
  font-size: 0.88rem;
  color: #425466;
}

/* Extremes responsive table (modern-web-guidance: responsive-table) */
.wotd-extremes-section {
  background: #ffffff;
  border: 1px solid #d5e0e8;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
}

.wotd-extremes-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.wotd-table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(520px, 80vh);
  container-type: inline-size;
}

#wotd-extremes-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

#wotd-extremes-table caption {
  caption-side: top;
  text-align: left;
  padding: 0.25rem 0 0.65rem;
  color: #425466;
  font-size: 0.9rem;
}

#wotd-extremes-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: #f3f7f8;
}

#wotd-extremes-table th,
#wotd-extremes-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #ccd6dd;
  text-align: left;
  vertical-align: top;
}

#wotd-extremes-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: #ffffff;
  font-weight: 600;
  color: #102030;
}

.wotd-date-jump {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #0e5a66;
  text-decoration: underline;
  cursor: pointer;
}

.wotd-date-jump:hover {
  color: #093d45;
}

@container (width < 520px) {
  #wotd-extremes-table,
  #wotd-extremes-table thead,
  #wotd-extremes-table tbody,
  #wotd-extremes-table tr,
  #wotd-extremes-table th,
  #wotd-extremes-table td {
    display: block;
    width: 100%;
  }

  #wotd-extremes-table thead {
    display: none;
  }

  #wotd-extremes-table tbody tr {
    margin-block-end: 0.85rem;
    border: 1px solid #d5e0e8;
    border-radius: 8px;
    overflow: hidden;
  }

  #wotd-extremes-table tbody th {
    position: static;
    background: #f3f7f8;
    border-bottom: 1px solid #dce5ec;
  }

  #wotd-extremes-table td:nth-child(2)::before {
    content: "Recorded value: ";
    font-weight: 600;
    color: #425466;
  }

  #wotd-extremes-table td:nth-child(3)::before {
    content: "Date: ";
    font-weight: 600;
    color: #425466;
  }
}

/* Memorable global days grid */
.wotd-presets-section {
  max-width: 1180px;
  margin: 2rem auto;
}

.wotd-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.wotd-preset-card {
  background: #ffffff;
  border: 1px solid #d5e0e8;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wotd-preset-meta {
  font-size: 0.84rem;
  color: #425466;
}

.wotd-preset-tag {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e6f3f5;
  color: #0e5a66;
  font-weight: 600;
}

.wotd-preset-card h3 {
  margin: 0;
  font-size: 1.08rem;
  color: #102030;
}

.wotd-preset-stats {
  margin: 0;
  font-size: 0.9rem;
  color: #162432;
}

.wotd-preset-actions {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.wotd-preset-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0e5a66;
}

/* Keyboard focus and accessible touch target sizes */
#wotd-app:focus-visible,
#wotd-app:focus {
  outline: 3px solid #0b57d0;
  outline-offset: 4px;
  border-radius: 10px;
}

.wotd-interactive-shell :is(button, a, input, select, [tabindex="0"]):focus-visible,
.wotd-presets-section :is(button, a):focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}

.wotd-interactive-shell button,
.wotd-presets-section button {
  min-height: 36px;
}

@media (pointer: coarse) {
  .wotd-field .form-control,
  .wotd-field .form-select,
  .wotd-interactive-shell button,
  .wotd-presets-section button {
    min-height: 48px;
  }
}

@media (max-width: 820px) {
  .wotd-controls-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .wotd-controls-card,
  .wotd-summary-card,
  .wotd-map-section,
  .wotd-chart-figure,
  .wotd-extremes-section {
    padding: 0.9rem;
  }
}

/* Shared Weather on This Day edition switcher tabs */
.wotd-region-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 1rem;
  padding: 0.45rem;
  background: #f1f5f9;
  border: 1px solid #d5e0e8;
  border-radius: 12px;
}

.wotd-region-tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #162432;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  line-height: 1.25;
}

.wotd-region-tab.is-active,
.wotd-region-tab[aria-current="page"] {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.wotd-region-tab:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}

.wotd-region-soon {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: #e2e8f0;
  border: 1px dashed #94a3b8;
}

@media (hover: hover) {
  .wotd-region-tab:not([aria-current="page"]):hover {
    background: #e0f2fe;
    border-color: #0369a1;
    color: #0c4a6e;
  }
}

@media (max-width: 768px) {
  .wotd-region-tabs {
    border-radius: 10px;
  }
  .wotd-region-tab,
  .wotd-region-soon {
    border-radius: 10px;
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
  }
}
