/* Hong Kong Weather App - Responsive styles */

:root {
  --bg: #0f1419;
  --bg-widget: rgba(26, 35, 50, 0.85);
  --bg-widget-solid: #1a2332;
  --bg-hero: rgba(15, 20, 25, 0.7);
  --bg-card: rgba(0, 0, 0, 0.25);
  --bg-radar: rgba(0, 0, 0, 0.3);
  --bg-legend: rgba(0, 0, 0, 0.25);
  --text: #e7e9ea;
  --text-muted: #8b98a5;
  --accent: #1d9bf0;
  --accent-dim: #1a8cd8;
  --border: rgba(255, 255, 255, 0.08);
  --success: #00ba7c;
  --warning: #f7931a;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.5);
  --glass: rgba(255, 255, 255, 0.05);
  --body-bg-overlay: linear-gradient(180deg, rgba(15, 20, 25, 0.92) 0%, rgba(15, 20, 25, 0.75) 100%);
  --title-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  --swatch-border: rgba(255, 255, 255, 0.2);
}

/* Light theme */
html[data-theme="light"] {
  --bg: #e8ecf0;
  --bg-widget: rgba(255, 255, 255, 0.9);
  --bg-widget-solid: #f0f4f8;
  --bg-hero: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.6);
  --bg-radar: rgba(255, 255, 255, 0.5);
  --bg-legend: rgba(255, 255, 255, 0.7);
  --text: #1a1f26;
  --text-muted: #52606d;
  --accent: #0d6efd;
  --accent-dim: #0a58ca;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.18);
  --glass: rgba(0, 0, 0, 0.04);
  --body-bg-overlay: linear-gradient(180deg, rgba(232, 236, 240, 0.92) 0%, rgba(232, 236, 240, 0.85) 100%);
  --title-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  --swatch-border: rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .radar-map .leaflet-control-zoom,
html[data-theme="light"] .radar-map .leaflet-control-attribution {
  background: var(--bg-widget);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="light"] .radar-map .leaflet-control-zoom a {
  color: var(--text);
  background: var(--bg-widget-solid);
}

html[data-theme="light"] .radar-map .leaflet-control-zoom a:hover {
  background: var(--border);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: var(--body-bg-overlay),
    url('https://images.unsplash.com/photo-1536599018102-9f803c140fc1?w=1920&q=80');
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
.header {
  position: relative;
  text-align: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--accent) 80%, transparent 100%);
  opacity: 0.8;
}

.header__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  text-shadow: var(--title-shadow);
}

.header__location {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.header__location span:first-child {
  margin-right: 0.35rem;
}

.header__updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.header-controls {
  position: absolute;
  top: 1rem;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

/* Hamburger: hidden on desktop, shown on mobile */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--text);
  background: var(--bg-widget);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s;
}

.hamburger:hover {
  background: var(--bg-widget-solid);
  border-color: var(--accent);
}

.hamburger:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hamburger__bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  border-radius: 1px;
}

.header-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.lang-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-widget);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s;
}

.lang-select:hover,
.lang-select:focus {
  background: var(--bg-widget-solid);
  border-color: var(--accent);
  outline: none;
}

.theme-toggle {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-widget);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-widget-solid);
  border-color: var(--accent);
}

.theme-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Widgets grid */
.widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.5rem 0;
}

@keyframes widget-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.widget {
  background: var(--bg-widget);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: widget-in 0.4s ease-out backwards;
}

.widget:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.widget--hero {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem;
  background: var(--bg-hero);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow), 0 0 0 1px var(--border), 0 0 60px rgba(29, 155, 240, 0.12);
}

html[data-theme="light"] .widget--hero {
  box-shadow: var(--shadow), 0 0 0 1px var(--border), 0 0 60px rgba(13, 110, 253, 0.08);
}

.widget--hero:hover {
  transform: none;
  box-shadow: var(--shadow-hover), 0 0 0 1px var(--border), 0 0 60px rgba(29, 155, 240, 0.18);
}

html[data-theme="light"] .widget--hero:hover {
  box-shadow: var(--shadow-hover), 0 0 0 1px var(--border), 0 0 60px rgba(13, 110, 253, 0.12);
}

.widget:nth-child(1) { animation-delay: 0s; }
.widget:nth-child(2) { animation-delay: 0.05s; }
.widget:nth-child(3) { animation-delay: 0.1s; }
.widget:nth-child(4) { animation-delay: 0.15s; }
.widget:nth-child(5) { animation-delay: 0.2s; }
.widget:nth-child(6) { animation-delay: 0.25s; }
.widget:nth-child(7) { animation-delay: 0.3s; }
.widget:nth-child(8) { animation-delay: 0.35s; }
.widget:nth-child(9) { animation-delay: 0.4s; }
.widget:nth-child(10) { animation-delay: 0.45s; }
.widget:nth-child(n+11) { animation-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .widget {
    animation: none;
  }
  .widget:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
}

.widget--wide {
  grid-column: 1 / -1;
}

.widget--warning {
  border-color: var(--warning);
  background: rgba(247, 147, 26, 0.08);
}

.widget__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.widget__emoji {
  margin-right: 0.25em;
}

.widget__desc,
.widget__placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Hero temp display */
.temp-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.temp-display__emoji {
  font-size: 4.5rem;
  line-height: 1;
}

.temp-display__value {
  font-size: 4rem;
  font-weight: 200;
}

.temp-display__unit {
  font-size: 2rem;
  color: var(--text-muted);
}

.feels-like {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.weather-overview {
  font-size: 1.1rem;
  margin-top: 0.75rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.today-forecast {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* High/Low */
.widget--hero .high-low {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 1rem 0;
  font-size: 1.1rem;
}

.high-low {
  display: flex;
  gap: 1.5rem;
}

.high-low__item {
  font-size: 1rem;
}

.high-low__item strong {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.35rem;
}

/* Forecast grid – one row of 9 on large screens */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.75rem;
}

.forecast-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid var(--border);
}

.forecast-card__emoji {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.forecast-card__day {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.forecast-card__temps {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.forecast-card__weather {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.forecast-card__wind {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Ferry widget */
.ferry-ais-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.ferry-ais-header .ferry-direction__title {
  margin-bottom: 0;
}
.ferry-widget-hide {
  flex-shrink: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.ferry-widget-hide:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.ferry-hidden-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card, rgba(255, 255, 255, 0.03));
}
.ferry-hidden-bar[hidden] {
  display: none !important;
}
.ferry-widget-show {
  flex-shrink: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
}
.ferry-widget-show:hover {
  background: var(--accent);
  color: var(--bg-widget, #fff);
}
.ferry-schedule-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card, rgba(255, 255, 255, 0.03));
}

.ferry-schedule-box:last-of-type {
  margin-bottom: 1.5rem;
}

.ferry-schedule-box__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.ferry-directions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1rem;
}

.ferry-directions-grid--three {
  grid-template-columns: 1fr;
}

@media (min-width: 500px) {
  .ferry-directions-grid--three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ferry-direction {
  margin-bottom: 0;
}

.ferry-directions-grid .ferry-direction:last-child {
  margin-bottom: 0;
}

.ferry-directions-grid .ferry-direction__title {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.ferry-directions-grid .ferry-countdown__value {
  font-size: 1.25rem;
}

.ferry-directions-grid .ferry-list {
  gap: 0.25rem 0.5rem;
}

.ferry-directions-grid .ferry-list li {
  font-size: 0.85rem;
}

.ferry-direction__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.ferry-route {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.ferry-countdown {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ferry-countdown__label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.ferry-countdown__value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.ferry-next {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.ferry-subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ferry-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.ferry-list li {
  font-size: 0.95rem;
  color: var(--text);
}

.ferry-ais {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ferry-ais-caption {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ferry-ais-map .ferry-ais-arrow {
  background: none !important;
  border: none !important;
}

.ferry-ais-map {
  width: 100%;
  height: 280px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-radar);
  margin-bottom: 0.5rem;
}

.ferry-ais-list {
  list-style: none;
  font-size: 0.875rem;
  color: var(--text);
}

.ferry-ais-list li {
  padding: 0.2rem 0;
}

.ferry-ais-popup {
  font-size: 0.875rem;
  line-height: 1.4;
}
.ferry-ais-popup strong { display: block; margin-bottom: 0.25rem; }

/* Stat values */
.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.stat-value__unit,
.stat-value__label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Air Quality bar and legend */
.air-bar {
  margin-top: 0.5rem;
}

.air-bar__track {
  height: 8px;
  border-radius: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  overflow: hidden;
}

.air-bar__fill {
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: 3px;
  transition: width 0.4s ease, background-color 0.3s ease;
}

.air-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.air-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.air-legend__item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.air-legend__item--good::before { background: #00c853; }
.air-legend__item--moderate::before { background: #ffeb3b; }
.air-legend__item--unhealthy::before { background: #ff9800; }
.air-legend__item--hazardous::before { background: #d32f2f; }

/* UV Index bar and legend */
.uv-bar {
  margin-top: 0.5rem;
}

.uv-bar__track {
  height: 8px;
  border-radius: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  overflow: hidden;
}

.uv-bar__fill {
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: 3px;
  transition: width 0.4s ease, background-color 0.3s ease;
}

.uv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.uv-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.uv-legend__item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.uv-legend__item--low::before { background: #00c853; }
.uv-legend__item--moderate::before { background: #ffeb3b; }
.uv-legend__item--high::before { background: #ff9800; }
.uv-legend__item--very-high::before { background: #f44336; }
.uv-legend__item--extreme::before { background: #7b1fa2; }

/* Humidity bar and legend */
.humidity-bar {
  margin-top: 0.5rem;
}

.humidity-bar__track {
  height: 8px;
  border-radius: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  overflow: hidden;
}

.humidity-bar__fill {
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: 3px;
  transition: width 0.4s ease, background-color 0.3s ease;
}

.humidity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.humidity-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.humidity-legend__item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Dry=blue, Comfortable=green, Moderate=yellow, Humid=orange, Very Humid=red */
.humidity-legend__item--dry::before { background: #2196f3; }
.humidity-legend__item--comfortable::before { background: #00c853; }
.humidity-legend__item--moderate::before { background: #ffeb3b; }
.humidity-legend__item--humid::before { background: #ff9800; }
.humidity-legend__item--very-humid::before { background: #f44336; }

/* Tides */
.tide-visual {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tide-bar {
  position: relative;
  width: 28px;
  height: 120px;
  border-radius: 6px;
  background: linear-gradient(to top, rgba(30, 64, 175, 0.5), rgba(59, 130, 246, 0.9));
  flex-shrink: 0;
}

.tide-bar__line {
  position: absolute;
  left: -4px;
  right: -4px;
  height: 2px;
  border-radius: 1px;
  pointer-events: none;
}

.tide-bar__line--sea {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.tide-bar__line--next {
  background: #fbbf24;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.tide-bar-legend {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tide-bar-legend__sea::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  vertical-align: middle;
  margin-right: 0.35rem;
}

.tide-bar-legend__next::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 2px;
  background: #fbbf24;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.tide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tide-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.tide-list .tide-time {
  color: var(--text);
}

.tide-list .tide-height {
  color: var(--text-muted);
}

/* Radar */
.radar-container {
  margin-top: 0.5rem;
}

.radar-map-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

.radar-map {
  flex: 0 0 auto;
  min-width: 0;
  height: 400px;
  min-height: 400px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-radar);
  z-index: 0;
}

.radar-legend {
  width: 100%;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-legend);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.radar-legend__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.radar-legend__list {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.radar-legend__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.radar-legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid var(--swatch-border);
}

.radar-map .leaflet-tile-pane {
  z-index: 1;
}

.radar-map .leaflet-overlay-pane {
  z-index: 2;
}

.radar-caption {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.radar-attribution {
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.radar-attribution a {
  color: var(--accent);
  text-decoration: none;
}

.radar-attribution a:hover {
  text-decoration: underline;
}

/* Sun / Moon */
.sun-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.sun-status__emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.sun-status__text {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: capitalize;
}

.sun-sky-strip {
  position: relative;
  height: 2rem;
  border-radius: 1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(
    90deg,
    #c2410c 0%,
    #ea580c 15%,
    #f97316 30%,
    #38bdf8 50%,
    #f97316 70%,
    #ea580c 85%,
    #c2410c 100%
  );
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .sun-sky-strip {
  background: linear-gradient(
    90deg,
    #b91c1c 0%,
    #dc2626 12%,
    #f97316 28%,
    #0ea5e9 50%,
    #f97316 72%,
    #dc2626 88%,
    #b91c1c 100%
  );
}

.sun-sky-strip__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition: left 0.4s ease-out;
}

.sun-moon {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sun-moon__item {
  display: flex;
  justify-content: space-between;
}

.sun-moon__label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Moon: phase + status + sky strip */
.moon-phase {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.moon-phase__emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.moon-phase__text {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: capitalize;
}

.moon-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.moon-status__emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.moon-status__text {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: capitalize;
}

.moon-sky-strip {
  position: relative;
  height: 2rem;
  border-radius: 1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(
    90deg,
    #1e1b4b 0%,
    #312e81 15%,
    #3730a3 35%,
    #1e3a5f 50%,
    #3730a3 65%,
    #312e81 85%,
    #1e1b4b 100%
  );
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .moon-sky-strip {
  background: linear-gradient(
    90deg,
    #1e3a5f 0%,
    #2563eb 25%,
    #3b82f6 50%,
    #2563eb 75%,
    #1e3a5f 100%
  );
}

.moon-sky-strip__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition: left 0.4s ease-out;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Mobile */
@media (max-width: 640px) {
  .app {
    padding: 0.75rem;
  }

  .header {
    padding: 1.5rem 0;
  }

  .header-controls {
    top: 0.5rem;
  }

  .hamburger {
    display: flex;
  }

  .header-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    flex-direction: column;
    align-items: stretch;
    min-width: 12rem;
    padding: 0.75rem;
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
  }

  .header-menu.is-open {
    display: flex;
  }

  .theme-toggle,
  .lang-select {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .header__title {
    font-size: 1.5rem;
  }

  .widgets {
    grid-template-columns: 1fr;
    padding: 1rem 0;
  }

  .temp-display__value {
    font-size: 3rem;
  }

  .temp-display__unit {
    font-size: 1.5rem;
  }

  .forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium screens: let forecast wrap into multiple rows instead of one */
@media (max-width: 900px) {
  .forecast-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
