:root {
    --weather-ink: #0d0d0d;
    --weather-muted: #6b7280;
    --weather-border: #e2e2e2;
    --weather-bg: #f7f5f0;
    --weather-red: #c8102e;
    --weather-white: #fff;
    --weather-sans: 'Noto Sans Devanagari', 'Source Sans 3', sans-serif;
}

.weather-width {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: #111;
    color: #fff;
    font: 13px var(--weather-sans);
}

.topbar-inner,
.topbar-left,
.topbar-right,
.cat-nav-inner,
.nav-left,
.nav-right {
    display: flex;
    align-items: center;
}

.topbar-inner {
    justify-content: space-between;
    gap: 20px;
}

.topbar-left {
    flex-wrap: wrap;
    gap: 16px;
}

.topbar-left span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-right {
    gap: 12px;
}

.topbar-right a {
    color: #fff;
    text-decoration: none;
    transition: color .2s ease;
}

.topbar-right a:hover {
    color: #ffcc00;
}

.topbar-weather-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    text-decoration: none;
    transition: color .2s ease;
}

.topbar-weather-link:hover,
.topbar-weather-link:focus-visible {
    color: #ffcc00;
}

.topbar-weather-link:focus-visible {
    outline: 2px solid #ffcc00;
    outline-offset: 3px;
}

.logo-area {
    min-height: 120px;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.cat-nav {
    position: sticky;
    z-index: 999;
    top: 0;
    background: #d60000;
}

.cat-nav-inner {
    min-height: 62px;
    justify-content: space-between;
    gap: 16px;
}

.menu-toggle,
.search-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #d60000;
    cursor: pointer;
    font-size: 17px;
}

.menu-toggle:hover,
.search-toggle:hover {
    background: #111;
    color: #fff;
}

.nav-menu {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    scrollbar-width: thin;
}

.nav-menu li {
    flex: 0 0 auto;
}

.cat-nav .nav-menu li a {
    display: block;
    padding: 8px 12px;
    border: 1px solid #d60000;
    border-radius: 6px;
    background: #d60000;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.cat-nav .nav-menu li a:hover,
.cat-nav .nav-menu li.active a {
    border-color: #fff;
    background: #fff;
    color: #d60000;
}

.header-search {
    position: relative;
}

.search-toggle {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.search-box {
    position: absolute;
    z-index: 5;
    top: 52px;
    right: 0;
    width: min(280px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.search-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-box form {
    display: flex;
}

.search-box input {
    min-width: 0;
    flex: 1;
    padding: 12px;
    border: 0;
    color: #111;
    font: 14px var(--weather-sans);
}

.search-box button {
    width: 48px;
    border: 0;
    background: #d60000;
    color: #fff;
    cursor: pointer;
}

.sidebar-overlay {
    position: fixed;
    z-index: 9998;
    display: block;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, .5);
}

.sidebar-overlay[hidden] {
    display: none;
}

.news-sidebar {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: min(320px, 88vw);
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    box-shadow: 5px 0 25px rgba(0, 0, 0, .15);
    transform: translateX(-105%);
    transition: transform .25s ease;
}

.news-sidebar.active {
    transform: translateX(0);
}

.sidebar-top {
    display: flex;
    height: 70px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #d60000;
    color: #fff;
}

.sidebar-top h2 {
    margin: 0;
    font-size: 22px;
}

.sidebar-top button {
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
    font-size: 26px;
}

.sidebar-content {
    padding: 20px;
}

.sidebar-section h3 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    color: #d60000;
    font-size: 17px;
}

.sidebar-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-section li {
    margin-bottom: 6px;
}

.sidebar-section li a {
    display: block;
    padding: 9px 10px;
    border-radius: 6px;
    color: #222;
    text-decoration: none;
}

.sidebar-section li a:hover {
    background: #f5f5f5;
    color: #d60000;
}

.weather-page {
    min-height: calc(100vh - 260px);
    padding: 26px 0 64px;
    background: var(--weather-bg);
    color: var(--weather-ink);
    font-family: var(--weather-sans);
}

.weather-page section {
    padding: 0;
}

.weather-breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 25px;
    color: var(--weather-muted);
    font-size: 13px;
}

.weather-breadcrumb a {
    color: var(--weather-red);
    text-decoration: none;
}

.weather-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.weather-eyebrow {
    margin: 0 0 7px;
    color: var(--weather-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.weather-heading h1 {
    margin: 0;
    font: 900 clamp(28px, 4vw, 42px)/1.2 'Playfair Display', var(--weather-sans);
}

.weather-intro {
    max-width: 720px;
    margin: 12px 0 0;
    color: #555;
    font-size: 15px;
    line-height: 1.8;
}

.weather-heading__actions {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.weather-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 12px;
}

.weather-status > span:first-child {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e3a323;
}

.weather-status.is-current > span:first-child {
    background: #20834b;
}

.weather-status.is-stale > span:first-child {
    background: #d97706;
}

.weather-status.is-error > span:first-child {
    background: var(--weather-red);
}

.weather-refresh {
    padding: 10px 14px;
    border: 0;
    border-radius: 4px;
    background: var(--weather-red);
    color: var(--weather-white);
    font: 700 13px var(--weather-sans);
    cursor: pointer;
}

.weather-refresh:hover {
    background: #a00d24;
}

.weather-refresh:focus-visible,
.weather-units button:focus-visible,
.cat-nav a:focus-visible,
.cat-nav button:focus-visible,
.news-sidebar a:focus-visible,
.sidebar-top button:focus-visible,
.weather-more a:focus-visible {
    outline: 3px solid #1b65a7;
    outline-offset: 3px;
}

.weather-refresh:disabled {
    opacity: .65;
    cursor: wait;
}

.weather-alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-left: 4px solid var(--weather-red);
    background: #fff1f2;
    color: #79202d;
    font-size: 14px;
}

.weather-page .weather-history {
    margin-top: 26px;
    padding: 22px;
    border: 1px solid var(--weather-border);
    border-radius: 8px;
    background: var(--weather-white);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .04);
}

.weather-day--history {
    background: #fafafa;
}

.weather-day__range {
    margin: 7px 0 0;
    color: #555;
    font-size: 12px;
}

.weather-current {
    overflow: hidden;
    border: 1px solid var(--weather-border);
    border-radius: 8px;
    background: var(--weather-white);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}

.weather-page .weather-forecast {
    margin-top: 26px;
    padding: 22px;
    border: 1px solid var(--weather-border);
    border-radius: 8px;
    background: var(--weather-white);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .04);
}

.weather-forecast__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.weather-forecast__heading h2 {
    margin: 0;
    font: 700 22px/1.35 'Playfair Display', var(--weather-sans);
}

.weather-forecast__heading > span {
    color: var(--weather-muted);
    font: 600 12px 'Source Sans 3', sans-serif;
}

.weather-forecast__status {
    margin: 0;
    color: var(--weather-muted);
    font-size: 13px;
}

.weather-forecast__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.weather-day {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--weather-border);
    border-radius: 6px;
    background: #fffdfa;
    text-align: center;
}

.weather-day h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.weather-day__icon {
    width: 56px;
    height: 56px;
    margin: 5px auto;
    object-fit: contain;
}

.weather-day__condition {
    min-height: 24px;
    margin: 0 0 8px;
    color: #555;
    font-size: 13px;
}

.weather-day__temperatures {
    margin: 0;
    font: 700 19px 'Source Sans 3', var(--weather-sans);
}

.weather-day__rain {
    margin: 7px 0 0;
    color: var(--weather-muted);
    font-size: 12px;
}

.weather-current__main {
    display: flex;
    min-height: 258px;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 30px clamp(22px, 5vw, 58px);
    background: linear-gradient(115deg, #fff 0%, #fff 54%, #f5eee2 100%);
}

.weather-current__place h2 {
    margin: 0;
    font: 700 clamp(24px, 3vw, 32px) var(--weather-sans);
}

.weather-observed {
    margin: 8px 0 0;
    color: var(--weather-muted);
    font-size: 13px;
}

.weather-current__reading {
    position: relative;
    min-width: 210px;
    padding-left: 82px;
}

.weather-icon {
    position: absolute;
    top: 12px;
    left: 0;
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.weather-temperature {
    font: 700 clamp(54px, 7vw, 76px)/1 'Source Sans 3', sans-serif;
    letter-spacing: -3px;
}

.weather-degree {
    font-size: .55em;
    vertical-align: top;
}

.weather-condition {
    margin: 8px 0 0;
    font-size: 17px;
    font-weight: 700;
}

.weather-feels {
    margin: 4px 0 10px;
    color: var(--weather-muted);
    font-size: 13px;
}

.weather-units {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--weather-border);
    border-radius: 4px;
}

.weather-units button {
    min-width: 42px;
    padding: 5px 9px;
    border: 0;
    background: #fff;
    color: var(--weather-muted);
    font: 700 12px 'Source Sans 3', sans-serif;
    cursor: pointer;
}

.weather-units button + button {
    border-left: 1px solid var(--weather-border);
}

.weather-units button[aria-pressed="true"] {
    background: var(--weather-ink);
    color: #fff;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--weather-border);
}

.weather-detail {
    display: flex;
    min-height: 95px;
    align-items: center;
    gap: 13px;
    padding: 17px 24px;
    border-right: 1px solid var(--weather-border);
    border-bottom: 1px solid var(--weather-border);
}

.weather-detail:nth-child(3n) {
    border-right: 0;
}

.weather-detail:nth-last-child(-n+3) {
    border-bottom: 0;
}

.weather-detail__icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 50%;
    background: #f8ecee;
    color: var(--weather-red);
}

.weather-detail p {
    margin: 0 0 4px;
    color: var(--weather-muted);
    font-size: 12px;
}

.weather-detail strong {
    font: 700 16px 'Source Sans 3', var(--weather-sans);
}

.weather-footnote {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #e8dfd1;
    border-radius: 5px;
    background: #fbf8f2;
    color: #5e5548;
    font-size: 12px;
    line-height: 1.75;
}

.weather-footnote > i {
    margin-top: 3px;
    color: var(--weather-red);
}

.weather-footnote p {
    margin: 0;
}

.weather-footnote a {
    color: #9c172d;
    font-weight: 700;
}

.weather-more {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.weather-more a {
    display: flex;
    min-height: 70px;
    align-items: center;
    gap: 13px;
    padding: 13px 16px;
    border: 1px solid var(--weather-border);
    border-radius: 5px;
    background: #fff;
    color: var(--weather-ink);
    text-decoration: none;
}

.weather-more a > i:first-child {
    color: var(--weather-red);
    font-size: 19px;
}

.weather-more a > i:last-child {
    margin-left: auto;
    color: var(--weather-muted);
}

.weather-more strong,
.weather-more small {
    display: block;
}

.weather-more strong {
    font-size: 14px;
}

.weather-more small {
    margin-top: 3px;
    color: var(--weather-muted);
    font-size: 12px;
}

@media (max-width: 680px) {
    .topbar-inner {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .topbar-left {
        width: 100%;
        justify-content: center;
        gap: 10px;
        font-size: 11px;
    }

    .topbar-right {
        justify-content: center;
    }

    .cat-nav-inner {
        gap: 8px;
    }

    .nav-menu {
        gap: 4px;
    }

    .cat-nav .nav-menu li a {
        padding: 8px 10px;
        font-size: 12px;
    }

    .menu-toggle,
    .search-toggle {
        width: 38px;
        height: 38px;
    }

    .weather-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .weather-heading__actions {
        width: 100%;
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
    }

    .weather-current__main {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
        padding: 24px 20px;
    }

    .weather-current__reading {
        padding-left: 76px;
    }

    .weather-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .weather-detail,
    .weather-detail:nth-child(3n) {
        border-right: 1px solid var(--weather-border);
    }

    .weather-detail:nth-child(2n) {
        border-right: 0;
    }

    .weather-detail:nth-last-child(-n+3) {
        border-bottom: 1px solid var(--weather-border);
    }

    .weather-detail:nth-last-child(-n+2) {
        border-bottom: 0;
    }

    .weather-more {
        grid-template-columns: 1fr;
    }

    .weather-page .weather-forecast,
    .weather-page .weather-history {
        padding: 18px;
    }

    .weather-forecast__grid {
        grid-template-columns: 1fr;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
