/* weather.css - Specific styling for the modern weather dashboard */

/* Ensure interactive UI elements sit cleanly above the shared rain animation canvas */
.hero-main,
.quick-stats,
.weather-tabs,
.forecast-grid,
.chart-wrapper,
.almanac-row {
    position: relative;
    z-index: var(--z-content);
}

/* === Hero Section === */
.hero-main {
    display: flex;
    justify-content: center;
    gap: 20vw;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 24px;
    margin-bottom: 24px;
}

html.dark-mode .hero-main {
    border-color: #444;
}

.hero-temp-group {
    cursor: pointer;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .hero-temp-group:hover {
        transform: scale(1.03);
    }
}

.hero-temp-group h1 {
    font-size: 5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    letter-spacing: -2px;
    color: #16a34a;
    /* standard theme green */
}

html.dark-mode .hero-temp-group h1 {
    color: #4ade80;
}

.hero-temp-group h1 .unit {
    font-size: 0.5em;
    font-weight: 500;
    vertical-align: top;
    color: #666;
    letter-spacing: normal;
}

html.dark-mode .hero-temp-group h1 .unit {
    color: #aaa;
}

.feels-like {
    font-size: 1.2rem;
    color: #666;
    margin: 8px 0 0 0;
}

html.dark-mode .feels-like {
    color: #aaa;
}

.hero-condition {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.condition-icon {
    /* A subtle, continuous bobbing animation brings life to the primary weather icon */
    font-size: 4.5rem;
    line-height: 1;
    margin-bottom: 8px;
    animation: weather-bob 4s ease-in-out infinite;
    will-change: transform;
    /* Performance: offloads animation to GPU */
}

.weather-transition-arrow {
    font-size: 0.5em;
    vertical-align: middle;
    opacity: 0.5;
    padding: 0 4px;
}

@keyframes weather-bob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.condition-desc {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.last-updated {
    font-size: 0.9rem;
    color: #666;
    margin: 4px 0 0 0;
}

html.dark-mode .last-updated {
    color: #aaa;
}

.hero-alert {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 8px 0 4px 0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    -webkit-tap-highlight-color: transparent;
}

html.dark-mode .hero-alert {
    background: #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

/* === Upcoming / Active Alerts Banner ===
   Server-computed alerts (snow, storm, wind, frost, aurora) rendered below the hero
   condition block. Each alert type gets a distinct left-border accent colour so they
   are visually scannable at a glance. The container is hidden when there are no alerts. */
.upcoming-alerts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0 16px 0;
}

.upcoming-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #ef4444;
    background: #fef2f2;
    font-size: 0.875rem;
    line-height: 1.4;
}

.upcoming-alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    line-height: 1.3;
}

/* Per-type accent colours */
.upcoming-alert-snow   { background: #eff6ff; border-left-color: #3b82f6; }
.upcoming-alert-storm  { background: #fdf4ff; border-left-color: #a855f7; }
.upcoming-alert-wind   { background: #fff7ed; border-left-color: #f97316; }
.upcoming-alert-frost  { background: #f0fdfa; border-left-color: #0d9488; }
.upcoming-alert-aurora { background: #f5f3ff; border-left-color: #7c3aed; }

html.dark-mode .upcoming-alert-item   { background: rgba(239, 68, 68, 0.1);    border-left-color: #ef4444; }
html.dark-mode .upcoming-alert-snow   { background: rgba(59, 130, 246, 0.12);  border-left-color: #3b82f6; }
html.dark-mode .upcoming-alert-storm  { background: rgba(168, 85, 247, 0.12);  border-left-color: #a855f7; }
html.dark-mode .upcoming-alert-wind   { background: rgba(249, 115, 22, 0.12);  border-left-color: #f97316; }
html.dark-mode .upcoming-alert-frost  { background: rgba(13, 148, 136, 0.12);  border-left-color: #0d9488; }
html.dark-mode .upcoming-alert-aurora { background: rgba(124, 58, 237, 0.12);  border-left-color: #7c3aed; }

/* === Quick Stats Grid === */
.quick-stats {
    display: grid;
    /* Narrow minmax threshold guarantees at least two columns side-by-side on small mobile screens */
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.stat-badge {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: #f9fafb;
    /* Extra right padding guarantees text doesn't overlap the pinned top-right arrow */
    padding: 6px 20px 6px 8px;
    border-radius: 8px;
    gap: 8px;
}

html.dark-mode .stat-badge {
    background: #30363d;
}

.stat-icon {
    font-size: 1.8rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
}

.stat-val .unit,
.almanac-metrics .unit {
    font-size: 0.75em;
    font-weight: 500;
    color: #666;
}

html.dark-mode .stat-val .unit,
html.dark-mode .almanac-metrics .unit {
    color: #aaa;
}

.stat-lbl {
    font-size: 0.85rem;
    color: #666;
}

html.dark-mode .stat-lbl {
    color: #aaa;
}

/* 
 * Clickable Badge Interactive Styling
 * Provides a subtle vertical lift and shadow to indicate to users that these stat badges deep-link to charts.
 */
.clickable-badge {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .clickable-badge:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    }

    html.dark-mode .clickable-badge:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Accessibility focus states for interactive elements */
.hero-temp-group:focus-visible,
.clickable-badge:focus-visible,
.forecast-card.clickable-day:focus-visible,
.almanac-row.clickable-row:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

html.dark-mode .hero-temp-group:focus-visible,
html.dark-mode .clickable-badge:focus-visible,
html.dark-mode .forecast-card.clickable-day:focus-visible,
html.dark-mode .almanac-row.clickable-row:focus-visible {
    outline-color: #4ade80;
}

.trend-arrow {
    font-size: 0.65em;
    margin-left: 6px;
    display: inline-block;
}

/* Small top-right trend arrows */
.stat-badge .trend-arrow {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
    font-size: 0.7em;
    line-height: 1;
    opacity: 0.9;
    z-index: 1;
    pointer-events: auto;
    cursor: help;
    user-select: none;
}

html.dark-mode .stat-badge .trend-arrow {
    opacity: 1;
}

/* Trend arrows are specifically color-coordinated to exactly match their respective emojis */
#trend-temp {
    color: inherit;
    font-size: 0.5em;
    vertical-align: middle;
    margin: 0 4px 0 8px;
}

#trend-wind,
#trend-gust {
    color: #94a3b8; /* Slate light blue formatting for 💨 parameter */
}

#trend-rain {
    color: #3b82f6; /* Blue for 🌧️ */
}

#trend-rain-week {
    color: #a855f7; /* Purple for umbrella ☔ */
}

#trend-uv {
    color: #f59e0b; /* Amber for ☀️ */
}

#trend-humidity,
#trend-dew-point {
    color: #0ea5e9; /* Sky blue for 💧 and 💦 */
}

#trend-wet-bulb {
    color: #ef4444; /* Red for thermometer 🌡️ */
}

#trend-pressure {
    color: #10b981; /* Green for trending 📈 */
}

#trend-pollen {
    color: #ec4899; /* Pink for 🌸 */
}

/* === Weather Tabs (Segmented Control) === */
.weather-tabs {
    display: flex;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

html.dark-mode .weather-tabs {
    background: #21262d;
    border: 1px solid #444;
}

.weather-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

html.dark-mode .weather-tab {
    color: #9ca3af;
}

.weather-tab:hover {
    color: #1f2937;
}

html.dark-mode .weather-tab:hover {
    color: #f3f4f6;
}

.weather-tab.active {
    background: #ffffff;
    color: #16a34a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html.dark-mode .weather-tab.active {
    background: #30363d;
    color: #4ade80;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === Forecast Grids === */
.forecast-grid {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    /* Avoid scrollbar overlay */
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
}

.forecast-card {
    flex: 1 1 0;
    max-width: 95px;
    min-width: 45px;
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    scroll-snap-align: start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
}

.forecast-card.is-night {
    background: #e5e7eb;
}

html.dark-mode .forecast-card {
    background: #30363d;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

html.dark-mode .forecast-card.is-night {
    background: #21262d;
}

.forecast-day {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
}

html.dark-mode .forecast-day {
    color: #f3f4f6;
}

.forecast-icon {
    font-size: 2.2rem;
    margin: 2px 0;
}

.forecast-rain {
    font-size: 0.8rem;
    color: #2563eb;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-height: 18px;
}

html.dark-mode .forecast-rain {
    color: #60a5fa;
}

/* Almanac rain slot — overrides the base .forecast-rain layout for the almanac card style.
   Only opacity is set inline (it is data-driven). */
.almanac-rain-slot {
    cursor: help;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    margin: 4px 0;
    padding: 4px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

.forecast-temps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.95rem;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    width: 100%;
}

.forecast-extra {
    display: none;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 8px;
    margin-top: 6px;
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
}

html.dark-mode .forecast-extra {
    border-color: rgba(255, 255, 255, 0.1);
}

.forecast-extra.show {
    display: flex;
}

.forecast-extra-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.forecast-extra-lbl {
    color: #666;
    font-weight: 500;
    font-size: 0.85em;
    opacity: 0.8;
}

html.dark-mode .forecast-extra-lbl {
    color: #aaa;
}

/* Widened slightly to accommodate larger, more legible metric values (e.g. Feels Like, Gust) without breaking lines */
.forecast-card.expanded {
    max-width: 80px;
    min-width: 65px;
}

/* Weekly almanac cards are wider than daily expanded cards to accommodate the date range label (e.g. "27 Apr–3 May") */
.almanac-weekly-card {
    min-width: 78px;
    max-width: 110px;
}

/* Fix vertical alignment: reserve a fixed height for the date label so that the
   temperature range bar starts at the same position across all weekly cards,
   even when a label wraps to two lines on narrow screens. */
#weekly-almanac-container .forecast-day {
    min-height: 2.6em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* On desktop, give almanac cards more breathing room — scoped to the almanac containers so
   hourly/daily forecast card sizing is unaffected */
@media (min-width: 768px) {
    #almanac-container .forecast-card.expanded {
        min-width: 90px;
        max-width: 120px;
    }

    #weekly-almanac-container .almanac-weekly-card {
        min-width: 105px;
        max-width: 150px;
    }
}

.forecast-card.clickable-day {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, outline 0.2s;
}

@media (hover: hover) {
    .forecast-card.clickable-day:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    }

    html.dark-mode .forecast-card.clickable-day:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
}

.forecast-card.active-day {
    /* Highlights the selected day/hour actively driving the chart view below it */
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background: #eff6ff;
}

html.dark-mode .forecast-card.active-day {
    background: rgba(59, 130, 246, 0.15);
}

.forecast-alert {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 1rem;
    cursor: pointer;
    z-index: 2;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    animation: pulse-alert 2.5s infinite;
    -webkit-tap-highlight-color: transparent;
}

html.dark-mode .forecast-alert {
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.1));
}

@keyframes pulse-alert {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Daily Forecast Temperature Range Bars */
.temp-range-track {
    height: 36px;
    width: 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    margin: 4px 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

html.dark-mode .temp-range-track {
    background: rgba(255, 255, 255, 0.08);
}

.temp-range-fill {
    width: 100%;
    border-radius: 4px;
    min-height: 4px;
    transition: height 0.3s ease;
}

/* Hourly Forecast Temperature Bars */
.hourly-temp-track {
    height: 36px;
    width: 4px;
    /* Narrower track to look like a subtle guide line rather than a gauge */
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    margin: 2px 0;
    position: relative;
}

html.dark-mode .hourly-temp-track {
    background: rgba(255, 255, 255, 0.08);
}

/* Render the temperature as a point on a vertical scale rather than a volume fill */
.hourly-temp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(50%);
    transition: bottom 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

html.dark-mode .hourly-temp-dot {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Wind Speed & Gust Range Bars */
.wind-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    position: relative;
    margin-top: 2px;
}

html.dark-mode .wind-bar-track {
    background: rgba(255, 255, 255, 0.08);
}

.wind-bar-speed {
    height: 100%;
    position: absolute;
    left: 0;
    background: #3b82f6;
    border-radius: 2px;
    z-index: 2;
    transition: width 0.3s ease;
}

.wind-bar-gust {
    height: 100%;
    position: absolute;
    left: 0;
    background: rgba(59, 130, 246, 0.4);
    border-radius: 2px;
    z-index: 1;
    transition: width 0.3s ease;
}

#weather-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: #ef4444;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: var(--z-banner);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    line-height: 1.5;
    white-space: nowrap;
}

#weather-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

html.dark-mode #weather-toast {
    background: #dc2626;
}

.subtle-toggle-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}

.subtle-toggle-btn:active {
    opacity: 0.5;
}

html.dark-mode .subtle-toggle-btn {
    color: #aaa;
}

@media (hover: hover) {
    .subtle-toggle-btn:hover {
        color: #1f2937;
    }

    html.dark-mode .subtle-toggle-btn:hover {
        color: #f3f4f6;
    }
}

.toggle-btn {
    display: block;
    padding: 8px 24px;
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #444;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background-color: #f3f4f6;
}

html.dark-mode .toggle-btn {
    border-color: #444;
    color: #c9d1d9;
}

html.dark-mode .toggle-btn:hover {
    background-color: #30363d;
}

/* Chart Wrapper Placeholder */
.chart-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
}

/* === Historical Almanac Data === */
.almanac-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.almanac-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
}

html.dark-mode .almanac-row {
    background: #30363d;
}

.almanac-date {
    font-weight: 600;
    width: 75px;
    flex-shrink: 0;
}

/* CSS Grid mathematically locks columns to equal fractional widths regardless of the varying text lengths inside */
.almanac-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1;
    gap: 8px 4px;
    color: #666;
    font-size: 0.9rem;
    padding: 0 10px;
}

html.dark-mode .almanac-metrics {
    color: #aaa;
}

.almanac-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@media (min-width: 900px) {
    .almanac-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px 12px;
    }
}

.almanac-temps {
    display: flex;
    gap: 12px;
    min-width: 60px;
    justify-content: flex-end;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.almanac-hi {
    font-weight: 700;
    color: #1f2937;
}

html.dark-mode .almanac-hi {
    color: #f3f4f6;
}

.almanac-lo {
    color: #6b7280;
}

html.dark-mode .almanac-lo {
    color: #9ca3af;
}

.almanac-row.clickable-row {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, outline 0.2s;
}

@media (hover: hover) {
    .almanac-row.clickable-row:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    }

    html.dark-mode .almanac-row.clickable-row:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
}

/* === Seasonal Outlook Tab ===
   Month navigation pills sit above the daily detail cards, letting the user step
   through each month of the 7-month ensemble window without scrolling. They deliberately
   reuse the .weather-tabs visual language (same background, active highlight, font weight)
   but at a smaller scale so they feel like a sub-control rather than a primary nav. */

/* Card section headings — consistent 18px font size for all major sections */
.card-heading {
  font-size: 18px;
  margin: 0;
}

.seasonal-month-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0 8px 0;
}

.seasonal-month-pill {
    flex: 1 1 auto;
    min-width: 84px;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

html.dark-mode .seasonal-month-pill {
    color: #9ca3af;
    background: #21262d;
}

.seasonal-month-pill:hover {
    color: #1f2937;
    background: #e5e7eb;
}

html.dark-mode .seasonal-month-pill:hover {
    color: #f3f4f6;
    background: #30363d;
}

.seasonal-month-pill.active {
    background: #ffffff;
    color: #16a34a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

html.dark-mode .seasonal-month-pill.active {
    background: #30363d;
    color: #4ade80;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Widen seasonal weekly/monthly cards slightly — they show a date range label that
   needs a bit more room than the 45-95px used by hourly/daily forecast cards. */
.seasonal-card {
    min-width: 82px;
    max-width: 110px;
}

/* Low-confidence badge — shown when weather_code_agreement < 40% for a period. 
   Uses muted text rather than a warning color to avoid alarming the user; uncertainty
   at 6+ weeks out is normal, not exceptional. */
.seasonal-low-confidence {
    font-size: 0.72rem;
    color: var(--color-faint, #888);
    font-style: italic;
    margin-top: 2px;
    text-align: center;
    line-height: 1.2;
}

.seasonal-no-frost {
    font-size: 0.82rem;
    color: var(--color-faint, #888);
    font-style: italic;
    text-align: center;
    padding: 8px 12px;
    margin-top: 4px;
}

.almanac-row.active-row {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background: #eff6ff;
}

html.dark-mode .almanac-row.active-row {
    background: rgba(59, 130, 246, 0.15);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .hero-main {
        flex-direction: row;
        gap: 24px;
    }

    .hero-temp-group h1 {
        font-size: 4rem;
    }

    .condition-icon {
        font-size: 3.5rem;
    }

    .hero-condition {
        text-align: center;
    }

    .forecast-grid {
        justify-content: flex-start;
        /* Prevent left-side clipping when scrollable */
        gap: 6px;
        /* Reduce the space between cards on mobile */
    }

    .forecast-card {
        flex: 0 0 42px;
        /* Ultra-narrow cards on mobile */
        padding: 8px 2px;
        /* Minimal padding */
    }

    .forecast-card.expanded {
        flex: 0 0 68px;
        min-width: 68px;
        padding: 8px 2px;
    }

    .forecast-extra {
        font-size: 0.9rem;
    }

    .forecast-day {
        font-size: 0.8rem;
    }

    .forecast-icon {
        font-size: 1.6rem;
        margin: 0;
    }

    .forecast-rain {
        font-size: 0.65rem;
        gap: 2px;
    }

    .forecast-temps {
        font-size: 0.8rem;
        gap: 1px;
    }
}

@media (max-width: 480px) {
    .almanac-row {
        padding: 10px 12px;
    }
}

/* === AI Weather Summary Card === */
.ai-summary-card {
    border-left: 3px solid #16a34a;
    transition: opacity 0.3s ease, border-left-color 0.3s ease;
}

html.dark-mode .ai-summary-card {
    border-left-color: #4ade80;
}

.ai-summary-card.stale {
    border-left-color: #9ca3af;
}

html.dark-mode .ai-summary-card.stale {
    border-left-color: #6b7280;
}

/* Red border when one or more WMO weather alerts are active in the next 24 hours */
.ai-summary-card.has-alert {
    border-left-color: #ef4444;
}

html.dark-mode .ai-summary-card.has-alert {
    border-left-color: #dc2626;
}

.ai-summary-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-summary-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-summary-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-summary-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #16a34a;
}

html.dark-mode .ai-summary-label {
    color: #4ade80;
}

.ai-summary-para {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #374151;
    white-space: pre-line;
    /* Renders newlines from per-sentence AI output */
}

html.dark-mode .ai-summary-para {
    color: #d1d5db;
}

.ai-summary-meta {
    margin: 8px 0 0 0;
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: right;
}

html.dark-mode .ai-summary-meta {
    color: #6b7280;
}
/* Data Freshness Indicator Pills */
.freshness-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(243, 244, 246, 0.8);
    /* -webkit- prefix required for iOS Safari */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #4b5563;
}
html.dark-mode .freshness-pill {
    background-color: rgba(31, 41, 55, 0.4);
    border-color: #374151;
    color: #9ca3af;
}

.freshness-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.freshness-dot.status-green { background-color: #16a34a; box-shadow: 0 0 4px #16a34a; }
.freshness-dot.status-amber { background-color: #f59e0b; box-shadow: 0 0 4px #f59e0b; }
.freshness-dot.status-red { background-color: #dc2626; box-shadow: 0 0 4px #dc2626; }

