/* ====================================
   MOBILE-FIRST RESPONSIVE DESIGN
   Breakpoints: 320px (default), 600px, 768px, 1024px, 1200px
   ==================================== */

/* ========== CSS VARIABLES ========== */
:root {
    /* Colors */
    --bg-body: #0b131e;
    --bg-card: #151f2e;
    --bg-card-hover: #1c293d;
    --text-primary: #ffffff;
    --text-secondary: #9ca6b5;
    --accent-yellow: #f7b731;
    --accent-blue: #3867d6;
    --accent-red: #eb3b5a;
    --border-color: #2c3a50;

    /* Spacing (Mobile) */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;

    /* Typography (Mobile) */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-md: 1.125rem;   /* 18px */
    --font-size-lg: 1.25rem;    /* 20px */
    --font-size-xl: 1.5rem;     /* 24px */
    --font-size-2xl: 2rem;      /* 32px */
    --font-size-3xl: 2.5rem;    /* 40px */
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-blue);
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== CONTAINER & LAYOUT ========== */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.container > *:first-child {
    margin-top: 0;
}

.container > *:last-child {
    margin-bottom: var(--spacing-sm);
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
}

h1 {
    font-size: var(--font-size-xl);
}

h2 {
    font-size: var(--font-size-lg);
}

h3 {
    font-size: var(--font-size-md);
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

/* ========== HEADER (MOBILE) ========== */
header.top-bar {
    background: var(--bg-card);
    padding: var(--spacing-sm);
    margin: 0 0 var(--spacing-md) 0;
    border-radius: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.top-bar h1, .header-title {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
}

.header-title-text {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.header-title-text > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-title {
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
    color: var(--accent-yellow);
    padding-left: 5px;
}

.header-row-with-search {
    display: flex;
    gap: var(--spacing-sm);
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    order: 3;
    flex: 1 1 100%;
}

.header-controls {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-sm);
    width: auto;
}

/* Search */
.search-wrapper {
    position: relative;
    flex: 1;
}

.search-wrapper input {
    width: 100%;
    background: #0f1724;
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    height: 38px;
    box-sizing: border-box;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.autocomplete-results.visible {
    display: block;
}

.search-wrapper .result-item {
    padding: 10px 14px;
    display: block;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
}

.search-wrapper .result-item:hover {
    background: var(--bg-card-hover);
}

/* Model Selector */
.model-selector {
    display: flex;
    gap: 5px;
    background: #0f1724;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.model-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    color: var(--text-secondary);
    white-space: nowrap;
    height: 38px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.model-btn:hover {
    color: var(--text-primary);
    background: rgba(56, 103, 214, 0.1);
}

.model-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* Language Dropdown */
.dropdown {
    position: relative;
    flex-shrink: 0;
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
}

.dropdown-btn {
    background: #0f1724;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
    min-width: 60px;
    height: 38px;
    box-sizing: border-box;
}

.dropdown-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    min-width: 150px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.4);
    z-index: 1000;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 5px;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    display: block;
    font-size: var(--font-size-sm);
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: var(--bg-card-hover);
}

.dropdown-content.show {
    display: block;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    margin-left: var(--spacing-sm);
    margin-right: var(--spacing-sm);
}

/* ========== SECTIONS ========== */
section {
    margin-bottom: var(--spacing-lg);
    padding-left: 0;
    padding-right: 0;
}

/* Current Weather */
.section-current-weather .current-weather-card h2 {
    font-size: var(--font-size-md);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* Weather Background Images */
.current-weather-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.current-weather-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    pointer-events: none;
}

.current-weather-card > * {
    position: relative;
    z-index: 1;
}

.current-weather-card.bg-clear-day {
    background-image: url('/assets/images/weather-bg/clear-day.webp');
}

.current-weather-card.bg-clear-night {
    background-image: url('/assets/images/weather-bg/clear-night.webp');
}

.current-weather-card.bg-partly-cloudy-day {
    background-image: url('/assets/images/weather-bg/partly-cloudy-day.webp');
}

.current-weather-card.bg-partly-cloudy-night {
    background-image: url('/assets/images/weather-bg/partly-cloudy-night.webp');
}

.current-weather-card.bg-cloudy-day {
    background-image: url('/assets/images/weather-bg/cloudy-day.webp');
}

.current-weather-card.bg-cloudy-night {
    background-image: url('/assets/images/weather-bg/cloudy-night.webp');
}

.current-weather-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.weather-icon-large {
    font-size: 3rem;
    flex-shrink: 0;
}

.current-temp {
    font-size: var(--font-size-3xl);
    font-weight: bold;
    line-height: 1;
}

.current-desc {
    font-size: var(--font-size-md);
    margin-top: var(--spacing-xs);
    font-weight: 500;
}

.current-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-md);
}

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

.stat-item strong {
    color: var(--text-primary);
    font-size: var(--font-size-base);
    margin-top: 4px;
}

/* Forecast Strip */
.section-forecast {
    margin-bottom: var(--spacing-lg);
}

/* Desktop forecast - hidden on mobile */
.desktop-forecast {
    display: none !important;
}

/* Mobile forecast - shown on mobile */
.mobile-forecast {
    display: block;
}

.forecast-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.forecast-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    width: 100%;
}

.forecast-strip::-webkit-scrollbar {
    display: none;
}

.day-card {
    background: #0f1724;
    border: 1px solid var(--border-color);
    min-width: 80px;
    padding: 8px;
    border-radius: 10px;
    text-align: center;
    flex: 0 0 auto;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.day-card:hover {
    background: var(--bg-card-hover);
}

.day-card.active {
    border-color: var(--accent-yellow);
}

.day-name {
    font-weight: bold;
    font-size: var(--font-size-xs);
    margin-bottom: 2px;
}

.day-icon {
    font-size: 1.5rem;
    margin: 4px 0;
}

.day-temps {
    font-size: var(--font-size-xs);
}

.day-temps .max {
    font-weight: bold;
}

.day-temps .min {
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Mobile Day Items */
.mobile-day-item {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: var(--spacing-sm);
    margin-left: var(--spacing-sm);
    margin-right: var(--spacing-sm);
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    cursor: pointer;
    gap: var(--spacing-sm);
    transition: background 0.2s;
}

.mobile-day-header:hover {
    background: var(--bg-card-hover);
}

.mobile-day-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.mobile-day-name {
    font-weight: bold;
    font-size: var(--font-size-sm);
}

.mobile-day-date {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.mobile-day-center {
    flex-shrink: 0;
}

.mobile-day-icon {
    font-size: 2rem;
}

.mobile-day-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.mobile-day-max {
    font-weight: bold;
    font-size: var(--font-size-lg);
}

.mobile-day-min {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.mobile-expand-arrow {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.mobile-day-item.active .mobile-expand-arrow {
    transform: rotate(180deg);
}

.mobile-day-charts {
    padding: var(--spacing-md) 4px;
    border-top: 1px solid var(--border-color);
    display: none;
}

.mobile-day-item.active .mobile-day-charts {
    display: block;
}

.mobile-day-charts .chart-controls {
    margin-bottom: var(--spacing-md);
    padding-left: 8px;
    padding-right: 8px;
}

.mobile-day-charts .chart-container {
    margin-top: var(--spacing-sm);
}

/* Charts Section - Hidden on mobile */
.section-charts {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-md) 4px;
    margin-top: calc(var(--spacing-lg) * -1);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 1;
    display: none;
}

.chart-controls {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
    padding-bottom: 5px;
    padding-left: 12px;
    padding-right: 12px;
    scrollbar-width: none;
}

.chart-controls::-webkit-scrollbar {
    display: none;
}

.chart-tab {
    background: #0f1724;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.chart-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.chart-tab.active {
    background: var(--accent-yellow);
    color: #000;
    border-color: var(--accent-yellow);
}

.chart-container {
    width: 100%;
    height: 250px;
    position: relative;
}

/* Weather Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

.detail-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-left: var(--spacing-sm);
    margin-right: var(--spacing-sm);
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

.detail-title {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    display: block;
    margin-bottom: var(--spacing-sm);
}

.detail-value {
    font-size: var(--font-size-2xl);
    font-weight: bold;
    line-height: 1.2;
}

.detail-unit {
    font-size: var(--font-size-md);
    font-weight: normal;
    color: var(--text-secondary);
    margin-left: 5px;
}

.detail-sub {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

/* Wind Card */
.wind-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wind-speed-main {
    font-size: var(--font-size-2xl);
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1.2;
}

.wind-unit {
    font-size: var(--font-size-md);
    font-weight: normal;
    color: var(--text-secondary);
    margin-left: 5px;
}

.wind-compass-new {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.wind-direction-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    transform-origin: center;
    transition: transform 0.3s ease;
}

.wind-direction-dot::after {
    content: '';
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 4px rgba(255, 255, 255, 0.6);
}

.compass-n {
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    font-weight: bold;
    color: var(--text-secondary);
}

/* Astro Section */
.section-astro {
    margin-top: var(--spacing-xl);
}

.astro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.astro-card {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    padding: var(--spacing-md);
}

.astro-card h2 {
    font-size: var(--font-size-md);
    font-weight: 500;
    z-index: 2;
    margin: 0;
}

.astro-card.sun-bg {
    background: linear-gradient(135deg, #151f2e 0%, #2a2a1a 100%);
}

.astro-card.moon-bg {
    background: linear-gradient(135deg, #151f2e 0%, #1a1a2a 100%);
}

.astro-widget-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    position: relative;
    padding-top: var(--spacing-lg);
}

.astro-arc-track {
    width: 180px;
    height: 90px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-bottom: none;
    border-radius: 90px 90px 0 0;
    position: relative;
    overflow: visible;
}

.astro-dot-wrapper {
    position: absolute;
    bottom: 0;
    left: 90px;
    width: 0;
    height: 0;
    transition: transform 1s ease-out;
}

.astro-dot {
    position: absolute;
    top: -90px;
    left: -5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.astro-dot.sun-style {
    background: var(--accent-yellow);
    box-shadow: 0 0 10px var(--accent-yellow), 0 0 4px rgba(255, 255, 255, 0.9);
}

.astro-dot.moon-style {
    background: #bdc3c7;
    box-shadow: 0 0 10px #bdc3c7, 0 0 4px rgba(255, 255, 255, 0.9);
}

.astro-horizon-line {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
}

.astro-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 8px;
    margin-top: 8px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.astro-labels span {
    display: block;
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

.astro-labels strong {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.astro-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 60px;
    margin-top: auto;
}

.astro-footer strong {
    color: var(--text-primary);
}

.astro-footer-moon {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    height: 80px;
    margin-top: auto;
}

.moon-icon-large {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
}

.moon-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.moon-phase-row {
    font-size: var(--font-size-sm);
    line-height: 1.2;
}

.moon-phase-row .label {
    display: block;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}

.moon-phase-row .value {
    display: block;
    font-weight: bold;
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

/* Nearby Cities */
.section-nearby {
    margin-top: var(--spacing-xl);
}

.nearby-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

.nearby-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: var(--spacing-md);
    margin-left: var(--spacing-sm);
    margin-right: var(--spacing-sm);
    transition: 0.2s;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.nearby-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
}

.nearby-item span {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    margin-top: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    font-size: var(--font-size-sm);
}

/* ========== MEDIA QUERIES ========== */

/* Small phones and up (375px) */
@media (min-width: 375px) {
    .day-card {
        min-width: 90px;
        padding: 14px 10px;
    }

    .day-icon {
        font-size: 1.75rem;
    }
}

/* Large phones (600px+) */
@media (min-width: 600px) {
    :root {
        --spacing-sm: 16px;
        --spacing-md: 20px;
        --spacing-lg: 24px;
        --spacing-xl: 32px;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    header.top-bar {
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: var(--spacing-md);
        margin-left: 0;
        margin-right: 0;
        border-radius: 12px;
    }

    section {
        padding-left: 0;
        padding-right: 0;
    }

    .card {
        margin-left: 0;
        margin-right: 0;
    }

    h3 {
        padding-left: 0;
        padding-right: 0;
    }

    .nearby-item {
        margin-left: 0;
        margin-right: 0;
    }

    .detail-card {
        margin-left: 0;
        margin-right: 0;
    }

    /* Desktop header layout */
    .header-title {
        flex: 0 0 auto;
        flex-direction: row;
        font-size: var(--font-size-xl);
        order: 1;
    }

    .header-title-text {
        flex: 0 0 auto;
    }

    .header-row-with-search {
        flex: 1 1 auto;
        order: 2;
    }

    .site-title {
        font-size: var(--font-size-xl);
    }

    .top-bar h1 {
        font-size: var(--font-size-xl);
    }

    /* Move dropdown to the right on desktop */
    .dropdown {
        order: 3;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .dropdown-btn {
        width: auto;
        padding: 10px 14px;
        font-size: var(--font-size-sm);
    }

    .header-controls {
        flex-direction: row;
        gap: var(--spacing-md);
        width: auto;
    }

    .search-wrapper {
        flex: 1 1 300px;
        max-width: 400px;
    }

    .model-selector {
        flex: 0 0 auto;
    }

    .model-btn {
        padding: 8px 16px;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .nearby-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .day-card {
        min-width: 100px;
        padding: 15px 12px;
    }

    .day-icon {
        font-size: 2rem;
    }

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

/* Tablets (768px+) */
@media (min-width: 768px) {
    :root {
        --font-size-xl: 1.75rem;
        --font-size-2xl: 2.5rem;
        --font-size-3xl: 3rem;
    }

    .container {
        max-width: 1200px;
        padding: 0 var(--spacing-lg);
    }

    header.top-bar {
        flex-wrap: nowrap;
    }

    .top-bar h1 {
        font-size: var(--font-size-xl);
    }

    /* Show desktop forecast, hide mobile forecast */
    .desktop-forecast {
        display: flex !important;
    }

    .mobile-forecast {
        display: none !important;
    }

    /* Make cards fill width evenly */
    .forecast-strip {
        overflow-x: visible;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 12px;
    }

    .day-card {
        flex: 1 1 0;
        min-width: 0;
    }

    /* Show charts section on desktop */
    .section-charts {
        display: block;
    }

    .chart-container {
        height: 300px;
    }

    .day-card {
        height: 130px;
    }

    .details-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .nearby-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    :root {
        --spacing-xl: 40px;
    }

    .container {
        max-width: 1400px;
    }

    /* Create 3-column top section grid ONLY for city weather page */
    body:has(.section-current-weather) .container {
        display: grid;
        grid-template-columns: 1.2fr 1fr 1fr;
        gap: 0 var(--spacing-lg);
    }

    body:has(.section-current-weather) header.top-bar {
        grid-column: 1 / -1;
    }

    /* Top row: Current weather (position astro section to create 3-col layout) */
    body:has(.section-current-weather) .section-current-weather {
        grid-row: 2;
        grid-column: 1;
    }

    /* Astro section on same row as current weather */
    body:has(.section-current-weather) .section-astro {
        grid-row: 2;
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1.2fr 1fr 1fr;
        gap: 0 var(--spacing-lg);
        margin-top: 0;
    }

    /* Hide astro heading on desktop (it's in top row) */
    body:has(.section-current-weather) .section-astro > h3 {
        display: none;
    }

    /* Use display: contents to make sun/moon direct children of section-astro grid */
    body:has(.section-current-weather) .section-astro .astro-grid {
        display: contents;
    }

    /* Place sun and moon in columns 2 and 3 */
    body:has(.section-current-weather) .astro-card.sun-bg {
        grid-column: 2;
    }

    body:has(.section-current-weather) .astro-card.moon-bg {
        grid-column: 3;
    }

    /* Ensure forecast comes after the top row */
    body:has(.section-current-weather) .section-forecast {
        grid-row: 3;
    }

    /* Other sections span all columns */
    body:has(.section-current-weather) .section-forecast,
    body:has(.section-current-weather) .section-charts,
    body:has(.section-current-weather) .section-details,
    body:has(.section-current-weather) .section-nearby,
    body:has(.section-current-weather) footer {
        grid-column: 1 / -1;
    }

    .details-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--spacing-lg);
    }

    .nearby-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .chart-container {
        height: 350px;
    }

    .astro-arc-track {
        width: 220px;
        height: 110px;
        border-radius: 110px 110px 0 0;
    }

    .astro-dot-wrapper {
        left: 110px;
    }

    .astro-dot {
        top: -110px;
    }

    .moon-icon-large {
        width: 80px;
        height: 80px;
    }

    .astro-footer {
        height: 80px;
    }

    .weather-icon-large {
        font-size: 4rem;
    }

    .current-temp {
        font-size: 4rem;
    }

    .current-desc {
        font-size: 1.2rem;
    }
}
/* Updated Fri Dec 26 22:03:09 CET 2025 */
