/*
 * apis.uz weather city page
 * Typography, layout, colours, and responsive behavior live in this file.
 * The page uses Apple San Francisco automatically on Apple devices and the
 * operating system's native sans-serif font elsewhere.
 */

:root {
    --weather-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
    --weather-text: #111827;
    --weather-muted: #6b7280;
    --weather-surface: #ffffff;
    --weather-page: #f5f5f5;
    --weather-border: #ddd;
    --weather-primary: #2563eb;
    --weather-primary-hover: #1d4ed8;
    --weather-focus: #93c5fd;
    --weather-note: #dc2626;
    --weather-arrow: #16a34a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background: var(--weather-page);
    color: var(--weather-text);
    font-family: var(--weather-font);
    font-size: 19px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--weather-focus);
    outline-offset: 2px;
}

.top-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 16px;
    font-size: 17px;
}

.top-links a {
    color: var(--weather-primary);
    font-weight: 600;
    text-decoration: none;
}

.top-links a:hover {
    color: var(--weather-primary-hover);
    text-decoration: underline;
}

.title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    color: var(--weather-text);
    font-size: clamp(30px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.18;
}

.regions-toggle {
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: var(--weather-primary);
    color: #fff;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.regions-toggle:hover {
    background: var(--weather-primary-hover);
}

.weather-source-title {
    margin: 0 0 0 auto;
    color: #374151;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.region {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--weather-border);
    border-radius: 8px;
    background: var(--weather-surface);
}

.region-direct-hidden {
    display: none;
}

.city {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 7px;
    background: #fafafa;
    color: var(--weather-text);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.city:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
}

.city.center {
    min-width: 100px;
    border: 2px solid #333;
    font-weight: 800;
    text-align: center;
}

.city.selected {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

.toggle-btn {
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.toggle-btn:hover {
    background: #374151;
}

.towns {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.towns.open {
    display: flex;
}

.coord-modal-backdrop {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.coord-modal-backdrop.open {
    display: flex;
}

.coord-modal {
    width: min(500px, 100%);
    padding: 16px;
    border-radius: 10px;
    background: var(--weather-surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.coord-modal-title {
    margin: 0 0 12px;
    color: var(--weather-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

#coordText {
    width: 100%;
    height: 130px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    color: var(--weather-text);
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    line-height: 1.4;
}

.coord-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.coord-actions button {
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

.copy-btn {
    background: var(--weather-primary);
    color: #fff;
}

.copy-btn:hover {
    background: var(--weather-primary-hover);
}

.close-btn {
    background: #e5e7eb;
    color: #111827;
}

.close-btn:hover {
    background: #d1d5db;
}

.weather-row,
.weather-chart-row,
.daily-weather-row {
    border: 1px solid var(--weather-border);
    border-radius: 14px;
    background: var(--weather-surface);
}

.weather-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 24px;
    padding: 16px;
}

.weather-icon {
    width: 100px;
    height: 100px;
    flex: 0 0 auto;
    object-fit: contain;
}

.weather-temp {
    min-width: 95px;
    color: #374151;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.weather-temp-note {
    color: var(--weather-note);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
}

.weather-temp-note .temp-note-arrows {
    margin-right: 0.18em;
    color: var(--weather-arrow);
}

.weather-details,
.weather-extra-details,
.weather-hour-details {
    display: grid;
    grid-template-columns: auto auto;
    gap: 6px 18px;
    align-items: center;
    font-size: 18px;
}

.weather-extra-details,
.weather-hour-details {
    padding-left: 18px;
    border-left: 1px solid #e5e7eb;
}

.weather-label,
.weather-extra-title {
    color: var(--weather-muted);
    font-weight: 600;
}

.weather-value,
.weather-extra-value {
    color: var(--weather-text);
    font-weight: 700;
    white-space: nowrap;
}

.weather-chart-row,
.daily-weather-row {
    margin-top: 14px;
    padding: 16px;
}

.weather-chart-title,
.daily-weather-title {
    margin: 0 0 12px;
    color: var(--weather-text);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.3;
}

.weather-chart-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    cursor: grab;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.weather-chart-scroll:active {
    cursor: grabbing;
}

#hourlyTempCanvas {
    display: block;
    height: 190px;
}

.weather-items-row,
.hourly-weather-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 14px;
    padding-bottom: 8px;
    cursor: grab;
    scroll-behavior: smooth;
    touch-action: pan-x;
    user-select: none;
    -webkit-overflow-scrolling: touch;
}

.weather-items-row:active,
.hourly-weather-row:active {
    cursor: grabbing;
}

.weather-hour-item {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 18px;
    min-width: max-content;
    padding: 16px;
    border: 1px solid var(--weather-border);
    border-radius: 14px;
    background: var(--weather-surface);
}

.weather-hour-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.weather-hour-time {
    margin-bottom: 2px;
    color: #dc2626;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
}

.weather-hour-temp {
    color: #374151;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.weather-hour-icon {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.daily-weather-list {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 12px;
}

.daily-weather-item {
    display: flex;
    min-height: 150px;
    padding: 12px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s ease;
}

.daily-weather-item:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

.daily-weather-item-selected {
    border-color: #f5b400;
    background: #fff7db;
}

.daily-weather-day {
    color: #374151;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.daily-weather-icon {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.daily-weather-temp {
    color: var(--weather-text);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.seo-text {
    max-width: 860px;
    margin-top: 22px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: var(--weather-surface);
}

.seo-text-title {
    margin: 0 0 10px;
    color: var(--weather-text);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.seo-text-copy {
    margin: 0;
    color: #374151;
    font-size: 19px;
    line-height: 1.65;
}

.seo-text-copy + .seo-text-copy {
    margin-top: 12px;
}

/*
 * Larger type scale for the weather page.
 * It keeps the native Apple/system font, but compensates for its smaller visual
 * size compared with the old Arial design. The airport-height note is purposely
 * more prominent because it explains where the temperature is measured.
 */

/*
 * Readability adjustment for the native system font.
 * San Francisco and other system fonts can look optically smaller than Arial
 * at the same CSS pixel size, so ordinary interface text is one pixel larger.
 */

@media (max-width: 900px) {
    .daily-weather-list {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 8px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .daily-weather-item {
        min-width: 110px;
        flex: 0 0 110px;
    }
}

@media (max-width: 720px) {
    body {
        padding: 14px;
    }

    .weather-source-title {
        width: 100%;
        margin-left: 0;
        font-size: 18px;
    }

    .weather-row {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 14px;
    }

    .weather-icon {
        width: 76px;
        height: 76px;
    }

    .weather-temp {
        min-width: 0;
        font-size: 32px;
    }

    .weather-temp-note {
        width: 100%;
    }

    .weather-details,
    .weather-extra-details {
        width: 100%;
    }

    .weather-extra-details {
        padding-top: 12px;
        padding-left: 0;
        border-top: 1px solid #e5e7eb;
        border-left: 0;
    }

    .seo-text {
        padding: 16px;
    }
}


/*
 * Airport-height note: inline again, without a box, border, background,
 * full-width expansion, or any change to the hourly chart.
 */
.weather-temp-note {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.28em;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--weather-note);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
    white-space: nowrap;
}

.weather-temp-note .temp-note-arrows {
    flex: 0 0 auto;
    margin-right: 0;
    color: var(--weather-arrow);
    font-size: 1em;
    font-weight: 900;
    letter-spacing: -0.08em;
}

.weather-temp-note .temp-note-text {
    min-width: 0;
}

@media (max-width: 720px) {
    .weather-temp-note {
        width: auto;
        font-size: 19px;
        white-space: normal;
    }
}
.sherdor-cloud-art {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 42px auto 28px;
    padding: 0 16px;
}

.sherdor-cloud-art img {
    display: block;
    width: min(260px, 62vw);
    height: auto;
    opacity: 0.88;
    object-fit: contain;
}
@media (max-width: 600px) {
    .sherdor-cloud-art {
        margin-top: 30px;
        margin-bottom: 20px;
    }

    .sherdor-cloud-art img {
        width: min(180px, 58vw);
        opacity: 0.82;
    }
}
