* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: url('../../images/sfondo_meteo.svg') no-repeat center center fixed;
    background-size: cover;
}

/* ── Top bar ── */
.top-bar {
    background: #444;
    padding: 6px 14px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.top-bar a { color: #ccc; text-decoration: none; font-size: 0.88em; }
.top-bar a:hover { color: #fff; }

/* ── Page header ── */
.page-header {
    background: #9acd9a;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.page-header h1 { font-size: 1.6em; }

/* ── Disclaimer banner ── */
.disclaimer-banner {
    background: #fff3cd;
    color: #664d03;
    font-weight: bold;
    font-size: 0.85em;
    padding: 8px 14px;
    border-top: 1px solid #ffe69c;
    border-bottom: 1px solid #ffe69c;
    flex-shrink: 0;
}
.disclaimer-banner p { margin: 2px 0; }

/* ── Main layout (sidebar + map) ── */
.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    width: 145px;
    flex-shrink: 0;
    padding: 10px;
    background-color: #d9e6d2;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar select {
    width: 100%;
    font-size: 13px;
    padding: 4px;
}

.archive-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.archive-row label {
    font-size: 11px;
    color: #444;
}

.archive-row input[type="date"] {
    width: 100%;
    font-size: 12px;
    padding: 3px;
}

.today-btn {
    width: 100%;
    font-size: 12px;
    padding: 4px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #888;
    border-radius: 3px;
}

.map-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.responsive-image {
    flex: 1;
    min-height: 0;
    max-width: 100%;
    object-fit: contain;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 6px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.75);
}

.control-button {
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #888;
    border-radius: 3px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
    }

    .main-content {
        flex-direction: column;
        overflow: visible;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 6px 8px;
        gap: 8px;
        overflow-y: visible;
        flex-shrink: 0;
    }

    .sidebar select {
        flex: 1;
        font-size: 16px;
        padding: 6px;
    }

    .archive-row {
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    .archive-row label { display: none; }

    .archive-row input[type="date"] {
        font-size: 14px;
        width: auto;
        padding: 5px 3px;
    }

    .today-btn {
        font-size: 13px;
        padding: 6px 8px;
        white-space: nowrap;
        width: auto;
    }

    .map-container {
        flex: none;
        overflow: visible;
    }

    .controls {
        order: 1;
    }

    .responsive-image {
        order: 2;
        flex: none;
        width: 100%;
        height: auto;
        max-height: 65svh;
        max-height: 65vh;
    }

    .control-button {
        flex: 1;
        padding: 12px 8px;
        font-size: 15px;
    }
}
