/**
 * home.css — homepage-only styles (premium UI upgrade). Loaded only by
 * index.html, right after styles.css. Every rule reuses existing --* design
 * tokens from styles.css:root — no new palette, no new fonts, no new radii.
 */

/* ---------------- Micro-animations ---------------- */
@keyframes tw-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tw-fade-up { animation: tw-fade-up 0.4s ease both; }

@keyframes tw-gauge-fill {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
.tw-gauge-animate { animation: tw-gauge-fill 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ---------------- Hero: compass / ring / badges ---------------- */
.hero-extras-row { display: flex; align-items: center; gap: 18px; margin: 14px 0; flex-wrap: wrap; }
.hero-humidity-ring-wrap { position: relative; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-humidity-ring-value { position: absolute; font-size: 13px; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; }
.hero-humidity-ring-label { font-size: 10px; color: var(--text-mute); text-align: center; margin-top: 2px; }
.hero-humidity-ring-col { display: flex; flex-direction: column; align-items: center; }
.tw-wind-compass-col { display: flex; flex-direction: column; align-items: center; }
.tw-wind-compass-label { font-size: 10px; color: var(--text-mute); margin-top: 2px; text-align: center; }
.hero-aqi-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px;
  font-size: 12.5px; font-weight: 700; color: #fff;
}
.hero-pressure-trend { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; }
.hero-pressure-trend .tw-icon { width: 13px; height: 13px; }
.hero-pressure-trend.rising { color: var(--vivid-orange); }
.hero-pressure-trend.falling { color: var(--accent); }

/* ---------------- Hourly: sparkline / precip bar / storm overlay / detail panel ---------------- */
.hourly-temp-sparkline { width: 100%; height: 64px; margin-bottom: 4px; }
.hourly-temp-sparkline svg { width: 100%; height: 100%; display: block; }
.hour-precip-track { width: 100%; height: 4px; border-radius: 100px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.hour-precip-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--rain)); border-radius: 100px; }
.hour-storm-badge { position: absolute; top: 6px; right: 6px; color: var(--vivid-orange); }
.hour-storm-badge .tw-icon { width: 13px; height: 13px; }
.hour-card { position: relative; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.hour-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(20,24,31,0.08); }
.hour-card.now { box-shadow: 0 0 0 3px var(--accent-dim), 0 8px 20px rgba(37,99,235,0.25); }
.hour-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.hourly-detail-panel {
  display: none; margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2);
}
.hourly-detail-panel.open { display: block; }
.hourly-detail-time { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.hourly-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.hourly-detail-stat { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.hourly-detail-stat .tw-icon { width: 14px; height: 14px; color: var(--accent); margin-bottom: 2px; }
.hourly-detail-label { color: var(--text-mute); font-size: 11px; }
.hourly-detail-value { font-weight: 700; font-size: 13.5px; }

/* ---------------- 7-day card hover ---------------- */
.day-card-details { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.day-card-details:hover, .day-card-details:focus-within { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20,24,31,0.09); }
.day-card-expanded-row { display: flex; justify-content: space-between; }

/* ---------------- AQI extras ---------------- */
.aqi-primary-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 100px;
  font-size: 12px; font-weight: 700; background: var(--bg-2); color: var(--text-dim);
}
.aqi-side-gauge { display: flex; justify-content: center; margin: 6px 0 10px; }

/* ---------------- Sun & Moon graphics ---------------- */
.sun-arc-wrap, .moon-graphic-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; }
.sun-arc-wrap svg, .moon-graphic-wrap svg { max-width: 100%; }
.sunmoon-graphics-row { display: flex; align-items: flex-start; justify-content: space-around; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.moon-graphic-label { font-size: 11px; color: var(--text-mute); margin-top: 4px; text-align: center; }

/* ---------------- Weather Timeline chart ---------------- */
.timeline-chart-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); padding: 20px; margin-top: 16px; position: relative;
}
.timeline-chart-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.timeline-legend-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--bg-2); font-size: 12px; font-weight: 600;
  color: var(--text-dim); cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.timeline-legend-chip .timeline-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.timeline-legend-chip.active { background: var(--card); border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow); }
.timeline-legend-chip:not(.active) { opacity: 0.55; }
.timeline-chart-wrap { position: relative; width: 100%; }
.tw-timeline-svg { width: 100%; height: 200px; display: block; }
.tw-timeline-svg polyline, .tw-timeline-svg circle { transition: opacity 0.15s ease; }
.timeline-tooltip {
  display: none; position: absolute; z-index: 5; background: var(--text); color: #fff; padding: 8px 12px;
  border-radius: var(--radius-sm); font-size: 11.5px; pointer-events: none; box-shadow: var(--shadow); min-width: 140px;
}
.timeline-tooltip-date { font-weight: 700; margin-bottom: 4px; }
.timeline-tooltip-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.timeline-tooltip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.timeline-daylength-row { display: flex; gap: 4px; margin-top: 14px; }
.timeline-daylength-col { flex: 1; min-width: 0; }
.timeline-daylength-col.is-today .timeline-daylength-track { border-color: var(--accent); }
.timeline-daylength-track { position: relative; height: 8px; border-radius: 100px; background: var(--bg-2); border: 1px solid transparent; overflow: hidden; }
.timeline-daylength-fill { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--amber), var(--w-sunny)); border-radius: 100px; }
.timeline-daylength-label { font-size: 9.5px; color: var(--text-mute); text-align: center; margin-top: 4px; white-space: nowrap; }

/* ---------------- Map gallery ---------------- */
.map-gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.map-gallery-card {
  display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.map-gallery-card:not(.coming-soon):hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(20,24,31,0.1); }
.map-gallery-card.coming-soon { cursor: default; opacity: 0.6; }
.map-gallery-visual { height: 84px; display: flex; align-items: center; justify-content: center; }
.map-gallery-visual .tw-icon { width: 28px; height: 28px; color: #fff; }
.map-gallery-title { font-size: 13px; font-weight: 700; padding: 10px 12px 2px; color: var(--text); }
.map-gallery-badge { font-size: 10px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.4px; }
.map-gallery-caption { font-size: 11px; color: var(--text-mute); padding: 0 12px 12px; line-height: 1.4; }

/* ---------------- Nearby cities ---------------- */
.nearby-city-card {
  display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 16px; box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nearby-city-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20,24,31,0.09); }
.nearby-city-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nearby-city-name { font-size: 14px; font-weight: 700; color: var(--text); }
.nearby-city-dist { font-size: 10.5px; color: var(--text-mute); white-space: nowrap; }
.nearby-city-temp { font-size: 24px; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; margin: 6px 0 2px; }
.nearby-city-cond { font-size: 12px; color: var(--text-mute); margin-bottom: 10px; }
.nearby-city-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.nearby-city-stats span { display: inline-flex; align-items: center; gap: 4px; }
.nearby-city-stats .tw-icon { width: 12px; height: 12px; }
.nearby-city-trend { margin-left: auto; }

/* ---------------- Weather Insights card ---------------- */
.insights-card-icon-row .suggestion-icon { flex-shrink: 0; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .map-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .map-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-extras-row { gap: 12px; }
  .sunmoon-graphics-row { flex-wrap: wrap; }
  .tw-timeline-svg { height: 170px; }
}
@media (max-width: 480px) {
  .map-gallery-grid { grid-template-columns: 1fr 1fr; }
  .hourly-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline-daylength-label { writing-mode: vertical-rl; text-orientation: mixed; white-space: normal; }
}
