/*
|--------------------------------------------------------------------------
| Blue Green Weather
|--------------------------------------------------------------------------
*/

:root {
    --blue-dark: #075985;
    --blue-deep: #064f77;
    --blue-main: #0284c7;
    --blue-medium: #0ea5e9;
    --blue-light: #38bdf8;
    --green: #20b983;
    --background: #edf6fa;
    --text: #163247;
    --muted: #61798a;
    --border: #d5e8f2;
    --white: #fff;
    --shadow: 0 7px 22px rgba(8, 82, 120, .08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

img {
    max-width: 100%;
}

a {
    color: var(--blue-main);
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Header */

.site-header {
    background: linear-gradient(115deg, var(--blue-dark), var(--blue-main), var(--blue-light));
    color: var(--white);
}

.header-inner {
    width: min(1180px, calc(100% - 28px));
    min-height: 112px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo img {
    display: block;
    width: auto;
    max-width: 118px;
    max-height: 82px;
}

.header-tagline {
    min-width: 0;
}

.header-tagline strong {
    display: block;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.1;
}

.header-tagline p {
    margin: 6px 0 0;
    color: rgba(255,255,255,.9);
}

.header-language {
    margin-left: auto;
}

.header-language select {
    max-width: 210px;
    padding: 9px 34px 9px 11px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 8px;
    background: rgba(255,255,255,.97);
    color: var(--text);
    font-size: .94rem;
}

/* Navigation */

.main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(90deg, var(--blue-deep), var(--blue-dark));
    box-shadow: 0 3px 10px rgba(0,0,0,.1);
}

.main-nav-inner {
    width: min(1180px, calc(100% - 28px));
    min-height: 50px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    overflow: visible;
}

.home-button {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background .2s ease, transform .2s ease;
}

.home-button svg {
    width: 25px;
    height: 25px;
    display: block;
}

.home-button:hover {
    color: white;
    background: rgba(255,255,255,.13);
    transform: translateY(-1px);
}

.nav-link {
    flex-shrink: 0;
    padding: 14px 13px;
    color: rgba(255,255,255,.94);
    text-decoration: none;
    font-weight: 600;
    font-size: .94rem;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,.08);
}



/* Navigation search */

.nav-search {
    position: relative;
    flex: 0 1 330px;
    min-width: 220px;
    margin-left: auto;
    padding-left: 16px;
}

.nav-search-box {
    position: relative;
}

.nav-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    width: 19px;
    height: 19px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.nav-search-input {
    width: 100%;
    height: 36px;
    padding: 7px 12px 7px 37px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 9px;
    outline: none;
    background: rgba(255,255,255,.98);
    color: var(--text);
    font: inherit;
    font-size: .91rem;
}

.nav-search-input:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(56,189,248,.2);
}

.nav-search-results {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    width: min(390px, calc(100vw - 28px));
    max-height: 360px;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(8,82,120,.18);
    z-index: 300;
}

.nav-search-result {
    display: block;
    padding: 10px 13px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid #e7f0f5;
}

.nav-search-result:last-child {
    border-bottom: 0;
}

.nav-search-result strong,
.nav-search-result span {
    display: block;
}

.nav-search-result strong {
    color: var(--blue-dark);
    font-size: .94rem;
}

.nav-search-result span {
    margin-top: 2px;
    color: var(--muted);
    font-size: .79rem;
}

.nav-search-result:hover,
.nav-search-result.active {
    background: #eff8fc;
    color: var(--text);
}

.nav-search-empty {
    padding: 12px 13px;
    color: var(--muted);
    font-size: .88rem;
}


/* Main */

.page-container {
    width: min(1180px, calc(100% - 28px));
    margin: 28px auto 48px;
}

.content-card {
    padding: clamp(20px, 3vw, 34px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.content-card h1 {
    margin-top: 0;
    color: var(--blue-dark);
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    line-height: 1.15;
}

.content-card h2 {
    margin-top: 30px;
    color: var(--blue-deep);
}

.breadcrumbs {
    margin-bottom: 19px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    color: var(--muted);
    font-size: .91rem;
}

.breadcrumbs a {
    text-decoration: none;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.location-card {
    display: flex;
    min-height: 72px;
    padding: 16px;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    background: #f8fcfe;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.location-card:hover {
    color: var(--blue-dark);
    border-color: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(8,82,120,.09);
}

/* Forecast tabs */

.forecast-tabs {
    display: flex;
    gap: 8px;
    margin: 18px 0 24px;
    overflow-x: auto;
}

.forecast-tabs a {
    flex-shrink: 0;
    padding: 10px 17px;
    border-radius: 8px;
    background: #e3f4fb;
    color: var(--blue-dark);
    text-decoration: none;
    font-weight: 700;
}

.forecast-tabs a:hover,
.forecast-tabs a.active {
    background: var(--blue-main);
    color: white;
}

/* Current weather */

.current-weather {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 22px;
    align-items: center;
    padding: 25px;
    margin: 22px 0 28px;
    color: white;
    background: linear-gradient(120deg, var(--blue-dark), var(--blue-main), var(--blue-light));
    border-radius: 16px;
}

.weather-location {
    font-size: 1.4rem;
    font-weight: 700;
}

.weather-date {
    opacity: .88;
    margin-top: 2px;
}

.weather-temp {
    margin-top: 12px;
    font-size: clamp(2.6rem, 8vw, 4.7rem);
    font-weight: 700;
    line-height: 1;
}

.weather-description {
    margin-top: 7px;
    font-size: 1.08rem;
}

.current-weather-icon {
    width: 115px;
    height: 115px;
    object-fit: contain;
}

.weather-details {
    justify-self: end;
    min-width: 190px;
    padding: 15px 18px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 11px;
}

.weather-details div + div {
    margin-top: 8px;
}

/* Tables */

.weather-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 11px;
}

.weather-table {
    width: 100%;
    min-width: 670px;
    border-collapse: collapse;
}

.weather-table th,
.weather-table td {
    padding: 11px 12px;
    text-align: center;
    border-bottom: 1px solid #e4eef3;
    white-space: nowrap;
}

.weather-table th {
    background: var(--blue-dark);
    color: white;
    font-weight: 700;
}

.weather-table tbody tr:nth-child(even) {
    background: #f0f9fd;
}

.weather-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-weather-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
    margin: auto;
}

/* Daily cards */

.daily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.daily-card {
    padding: 16px 12px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f8fcfe;
}

.daily-card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 10px auto;
}

.daily-temp {
    margin: 8px 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.forecast-note,
.weather-message {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 9px;
    background: #eff8fc;
    color: var(--muted);
}

.error-card {
    text-align: center;
    padding-block: 70px;
}

.error-card h1 {
    margin-bottom: 0;
    font-size: clamp(4rem, 12vw, 8rem);
}

.button-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 18px;
    border-radius: 8px;
    color: white;
    background: var(--blue-main);
    text-decoration: none;
}

.button-link:hover {
    color: white;
    background: var(--blue-dark);
}

/* Footer */

.site-footer {
    margin-top: 45px;
    padding: 28px 0;
    background: var(--blue-deep);
    color: rgba(255,255,255,.9);
}

.footer-inner {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 28px;
}

.site-footer p {
    margin: 5px 0;
}

.site-footer a {
    color: white;
}

.footer-meta {
    text-align: right;
}

/* Mobile */

@media (max-width: 760px) {
    .main-nav-inner {
        flex-wrap: wrap;
        overflow-x: visible;
        padding: 4px 0 8px;
    }

    .nav-search {
        order: 20;
        flex: 1 0 100%;
        width: 100%;
        min-width: 0;
        padding: 4px 0 0;
        margin-left: 0;
    }

    .nav-search-input {
        height: 38px;
    }

    .nav-search-results {
        left: 0;
        right: auto;
        width: 100%;
    }

    .header-inner {
        min-height: 92px;
        gap: 12px;
    }

    .header-logo img {
        max-width: 78px;
        max-height: 62px;
    }

    .header-tagline strong {
        font-size: 1.22rem;
    }

    .header-tagline p {
        font-size: .82rem;
    }

    .header-language select {
        max-width: 120px;
        font-size: .84rem;
    }

    .page-container {
        width: min(100% - 18px, 1180px);
        margin-top: 16px;
    }

    .content-card {
        padding: 17px 14px;
    }

    .current-weather {
        grid-template-columns: 1fr auto;
        gap: 10px;
        padding: 18px;
    }

    .current-weather-icon {
        width: 82px;
        height: 82px;
    }

    .weather-details {
        grid-column: 1 / -1;
        justify-self: stretch;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 7px;
        text-align: center;
    }

    .weather-details div + div {
        margin-top: 0;
    }

    .weather-text-column {
        display: none;
    }

    .weather-table {
        min-width: 500px;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-meta {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .header-tagline p {
        display: none;
    }

    .header-language {
        margin-left: auto;
    }

    .header-language select {
        width: 98px;
    }

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

    .location-card {
        min-height: 64px;
        padding: 12px;
        font-size: .91rem;
    }

    .weather-details {
        grid-template-columns: 1fr;
        text-align: left;
    }
}
