﻿/* ===================== ABOUT FLEX LAYOUT ===================== */
.page-container {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
}
/* ==========================================================================
   TEMA GENERALE
   ========================================================================== */

:root {
    color-scheme: dark light;
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --card-bg: #1e293b;
    --border-subtle: #334155;
    --accent: #93c5fd;
    --accent-soft: rgba(147,197,253,0.15);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --danger: #fca5a5;
}

body.light-mode {
    --bg: #f8fafc;
    --bg-elevated: #fff;
    --card-bg: #fff;
    --border-subtle: #cbd5e1;
    --accent: #4a9fe5;
    --accent-soft: rgba(74,159,229,0.14);
    --text-main: #1e293b;
    --text-muted: #475569;
    --danger: #ef4444;
    background: linear-gradient(180deg, #f0f4f8 0%, #f8fafc 100%);
    color: var(--text-main);
}

body.light-mode .top-bar {
    background: linear-gradient(to right, rgba(255,255,255,0.92), rgba(248,250,252,0.92));
    border-bottom: 1px solid #cbd5e1;
}

body.light-mode .main-nav a {
    color: var(--text-muted);
}
body.light-mode .main-nav a:hover {
    color: #4a9fe5;
    background: #e8f1fb;
}
body.light-mode .card-grid .hike-card {
    background: linear-gradient(135deg, #e3eef9 0%, #cde0f3 100%);
    border: 1px solid #9ec5e8;
    box-shadow: 0 4px 16px rgba(74,159,229,0.14);
}
body.light-mode .hike-card-title a {
    color: var(--text-main);
}
body.light-mode .hike-card-title a:hover {
    color: #4a9fe5;
}
body.light-mode .hike-card-meta {
    color: var(--text-muted);
}
body.light-mode .hike-card-desc {
    color: #334155;
}
body.light-mode .detail-meta-item {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}
body.light-mode .detail-gallery img {
    border: 1px solid #cbd5e1;
}
body.light-mode .badge {
    background: #dceaf7;
    color: #3b82b8;
    border: 1px solid #9ec5e8;
}
body.light-mode .badge-soft {
    background: #e0e7ef;
    color: #64748b;
    border-color: #cbd5e1;
}
body.light-mode .footer {
    border-top: 1px solid #cbd5e1;
}
body.light-mode .footer-inner {
    color: #64748b;
}
body.light-mode .footer-inner a {
    color: #64748b;
}
body.light-mode .footer-inner a:hover {
    color: #4a9fe5;
}
body.light-mode .leaflet-container {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}
body.light-mode .leaflet-popup-content-wrapper,
body.light-mode .leaflet-popup-tip {
    background: #fff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1;
}
body.light-mode .leaflet-popup-content a {
    color: #3b82b8;
}
body.light-mode .leaflet-popup-content a:hover {
    color: #4a9fe5;
}
body.light-mode .leaflet-control-zoom a {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}
body.light-mode .leaflet-control-zoom a:hover {
    background: #dceaf7 !important;
}
body.light-mode .leaflet-control-attribution {
    background: rgba(248,250,252,0.8) !important;
    color: #64748b !important;
}

/* ── Light-mode: search panel ── */
body.light-mode .search-mode {
    border-color: #cbd5e1;
    background: rgba(241,245,249,0.5);
}
body.light-mode .search-mode--active {
    border-color: #4a9fe5;
    background: rgba(227,238,249,0.55);
    box-shadow: 0 0 0 1px rgba(74,159,229,0.15), 0 4px 20px rgba(74,159,229,0.08);
}
body.light-mode .search-mode-radio {
    color: #475569;
}
body.light-mode .search-mode--active .search-mode-radio {
    color: #1e293b;
}
body.light-mode .search-mode-radio input[type="radio"] {
    border-color: #94a3b8;
    background: #fff;
}
body.light-mode .search-mode-radio input[type="radio"]:checked {
    border-color: #4a9fe5;
    background: #fff;
}
body.light-mode .search-mode-radio input[type="radio"]:checked::after {
    background: #4a9fe5;
}

/* ── Light-mode: pulsante Cerca ── */
body.light-mode .btn {
    background: linear-gradient(135deg, #5ba8e5, #3b82b8);
    box-shadow: 0 4px 14px rgba(74,159,229,0.25);
}
body.light-mode .btn:hover, body.light-mode .btn:focus {
    background: linear-gradient(135deg, #7bbdf0, #5ba8e5);
    box-shadow: 0 6px 20px rgba(74,159,229,0.35);
}
body.light-mode .btn:active {
    box-shadow: 0 2px 8px rgba(74,159,229,0.2);
}


*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Skip-to-content link (accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 999;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: #022c22;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
    top: 0;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    color: var(--text-main);
}

/* ==========================================================================
   NAVBAR / HEADER
   ========================================================================== */

.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(16px);
    background: linear-gradient(to right, rgba(15,23,42,0.92), rgba(2,6,23,0.92));
    border-bottom: 1px solid rgba(148,163,184,0.2);
}

.top-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.7rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: var(--text-main);
    text-decoration: none;
}

.main-nav a {
    margin-left: 1rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.25rem 0.4rem;
    border-radius: 999px;
}

    .main-nav a:hover {
        color: #93c5fd;
        background: rgba(30,41,59,0.7);
    }

/* Breadcrumb */

.breadcrumb {
    max-width: 1100px;
    margin: 0.4rem auto 0;
    padding: 0 1.2rem;
    font-size: 0.8rem;
}

    .breadcrumb a {
        color: var(--text-muted);
        text-decoration: none;
    }

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

/* ==========================================================================
   LAYOUT PAGINA
   ========================================================================== */

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.2rem;
}

/* Titoli */

.page-title {
    font-size: 1.9rem;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: var(--text-muted);
}

/* Sezioni generiche */

.section {
    margin-bottom: 1.4rem;
}

/* ==========================================================================
   CARD ESCURSIONI
   ========================================================================== */

/* Mostra sempre 4 colonne su desktop, così 8 card sono sempre 2 righe */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.hike-card {
    background: linear-gradient(135deg, #1e293b 0%, #253348 100%);
    border-radius: 1.1rem;
    overflow: hidden;
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.25);
    transition: box-shadow 0.18s, transform 0.12s;
}
.hike-card:hover {
    box-shadow: 0 12px 32px rgba(147,197,253,0.12), 0 0 0 1px #93c5fd;
    transform: translateY(-2px) scale(1.01);
}

    .hike-card picture {
        display: block;
    }

    .hike-card img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        display: block;
    }

.hike-card-body {
    padding: 0.9rem 1rem 0.2rem;
    flex: 1;
}

.hike-card-title {
    font-size: 1rem;
    margin: 0 0 0.15rem;
}

    .hike-card-title a {
        color: var(--text-main);
        text-decoration: none;
    }

        .hike-card-title a:hover {
            color: var(--accent);
        }

.hike-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.hike-card-desc {
    font-size: 0.85rem;
    color: #e5e7eb;
}

.hike-card-footer {
    padding: 0.4rem 1rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   DETTAGLIO ESCURSIONE
   ========================================================================== */

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.4rem;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    font-size: 0.85rem;
}

.detail-meta-item {
    padding: 0.6rem 0.7rem;
    border-radius: 0.7rem;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.35);
}

.detail-gallery img {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(148,163,184,0.45);
}

.detail-carousel {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,0.45);
    background: rgba(15,23,42,0.65);
}

.detail-carousel-track {
    position: relative;
    min-height: 320px;
}

.detail-carousel-slide {
    display: none;
}

.detail-carousel-slide.is-active {
    display: block;
}

.detail-carousel-slide img {
    width: 100%;
    height: 440px;
    object-fit: cover;
    display: block;
    border: 0;
    border-radius: 0;
}

.detail-carousel-slide picture {
    display: block;
}

.detail-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.45);
    background: rgba(2,6,23,0.72);
    color: #f8fafc;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

.detail-carousel-nav--prev {
    left: 0.8rem;
}

.detail-carousel-nav--next {
    right: 0.8rem;
}

.detail-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.detail-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 0;
    background: rgba(148,163,184,0.45);
    cursor: pointer;
    padding: 0;
}

.detail-carousel-dot.is-active {
    background: var(--accent);
}

body.light-mode .detail-carousel {
    background: #ffffff;
    border-color: #cbd5e1;
}

body.light-mode .detail-carousel-nav {
    background: rgba(255,255,255,0.88);
    color: #0f172a;
    border-color: #cbd5e1;
}

/* ==========================================================================
   FORM DI RICERCA / FILTRI
   ========================================================================== */

/* Modalità di ricerca mutuamente esclusiva */
.search-mode {
    position: relative;
    z-index: 1;
    border: 2px solid #1e293b;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.15rem;
    opacity: 0.4;
    background: rgba(15, 23, 42, 0.35);
    transition: opacity 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.search-mode--active {
    opacity: 1;
    z-index: 10;
    border-color: #6366f1;
    background: rgba(30, 41, 59, 0.55);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15), 0 4px 20px rgba(99, 102, 241, 0.08);
}

.search-mode-header {
    margin-bottom: 0.85rem;
}

.search-mode-radio {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    color: #cbd5e1;
    transition: color 0.2s;
}

.search-mode--active .search-mode-radio {
    color: #f1f5f9;
}

.search-mode-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25em;
    height: 1.25em;
    border: 2px solid #475569;
    border-radius: 50%;
    background: #0f172a;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.search-mode-radio input[type="radio"]:checked {
    border-color: #6366f1;
    background: #0f172a;
}

.search-mode-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.55em;
    height: 0.55em;
    border-radius: 50%;
    background: #818cf8;
}

.search-mode-body {
    padding-left: 1.9rem;
}

.search-mode:not(.search-mode--active) .search-mode-body {
    pointer-events: none;
    filter: grayscale(0.3);
}

/* Riga principale dei filtri */
.form-row--wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 1.5rem;
    align-items: flex-end;
    margin-bottom: 0;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 140px;
}

.form-field--wide {
    flex: 2 1 280px;
}

.form-field--inline {
    flex: 1 1 260px;
}

.form-field--buttons {
    align-self: flex-end;
}

/* Autocomplete dropdown */
.autocomplete-wrap {
    position: relative;
    z-index: 200;
}

.autocomplete-list {
    display: none;
    position: absolute !important;
    z-index: 200;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.autocomplete-item {
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #f1f5f9;
    border-bottom: 1px solid #334155;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item--active {
    background: #334155;
}

.autocomplete-prov {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Label + aiuto */

.form-field label,
.filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.1rem;
}

.field-help {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Input testo */

.input-text {
    border-radius: 10px;
    border: 1px solid #374151;
    padding: 0.65rem 1rem;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-text:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-text::placeholder {
    color: #64748b;
}

/* Select */

.input-select {
    border-radius: 10px;
    border: 1px solid #374151;
    background: #0f172a;
    color: #f1f5f9;
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 0.85rem center;
    background-size: 12px 8px;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-select:hover {
    border-color: #475569;
}

.input-select--compact {
    font-size: 0.85rem;
    padding: 0.45rem 2.2rem 0.45rem 0.8rem;
}

/* Riga compatta per filtri avanzati (es. difficoltà + ordinamento) */

.filter-row-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.4rem;
    margin-bottom: 1.1rem;
}

.filter-field {
    flex: 1 1 180px;
}

/* Label con pillola */

.field-label-with-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.field-label-main {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.field-icon {
    font-size: 0.9rem;
    opacity: 0.85;
}

.field-pill {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5);
    color: #9ca3af;
    background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.6));
}

/* Chip-style filters */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-main);
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

    .chip:hover {
        background: var(--accent-soft);
        border-color: var(--accent);
        transform: translateY(-1px);
    }

.chip--active {
    background: #93c5fd;
    border-color: #93c5fd;
    color: #0f172a;
}

/* Pulsanti uniformati blu */

.btn {
    border-radius: 999px;
    border: none;
    padding: 0.7rem 1.8rem;
    font-size: 0.95rem;
    cursor: pointer;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(99,102,241,0.25);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:hover, .btn:focus {
    background: linear-gradient(135deg, #a5b4fc, #818cf8);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

/* ==========================================================================
   PAGINAZIONE
   ========================================================================== */

.pagination {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.pagination-link {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-main);
    background: var(--bg-elevated);
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

    .pagination-link:hover {
        background: var(--accent-soft);
        border-color: var(--accent);
        color: var(--accent);
    }

.pagination-info {
    color: var(--text-muted);
}
.track-downloads {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Variante “secondaria” del bottone, più sobria */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

    .btn-secondary:hover {
        background: var(--accent-soft);
        border-color: var(--accent);
        transform: translateY(-1px);
    }

/* ==========================================================================
   MAPPA ESCURSIONI
   ========================================================================== */

/* Contenitore mappa più alto e ben visibile */
#map,
.map-frame {
    width: 100%;
    height: 72vh; /* ⬅ mappa alta */
    max-height: 800px; /* limite sensato su schermi grandi */
    border-radius: 12px;
    margin-top: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(147,197,253,0.08), 0 8px 24px rgba(15,23,42,0.3);
    border: 1px solid rgba(148,163,184,0.3);
}

/* Fix compatibilità Leaflet con tema scuro */
.leaflet-container {
    background: #1e293b !important;
    font-size: 1rem;
}

/* Popup */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #0f172a !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(148,163,184,0.4);
}

/* Link dentro i popup (titolo escursione) */
.leaflet-popup-content a {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 500;
}

    .leaflet-popup-content a:hover {
        color: #bdd5f7;
    }

/* Controlli zoom */
.leaflet-control-zoom a {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid rgba(148,163,184,0.3) !important;
}

    .leaflet-control-zoom a:hover {
        background: #334155 !important;
    }

/* Attribution */
.leaflet-control-attribution {
    background: rgba(15,23,42,0.8) !important;
    color: #cbd5e1 !important;
}

/* ==========================================================================
   BADGE / PICCOLI ELEMENTI
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(147,197,253,0.35);
}

.badge-soft {
    background: rgba(148,163,184,0.15);
    color: var(--text-muted);
    border-color: rgba(148,163,184,0.6);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */


html, body {
    height: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.page-container {
    flex: 1 0 auto;
}
.footer {
    border-top: 1px solid rgba(148,163,184,0.2);
    margin-top: 2rem;
    flex-shrink: 0;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.7rem 1.2rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-inner a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-inner a:hover {
    color: #93c5fd;
}
.footer-sep {
    margin: 0 0.5rem;
    color: #64748b;
    font-size: 1.1em;
}
.footer-social {
    display: flex;
    gap: 0.6rem;
}
.footer-social a {
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .top-bar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .main-nav {
        display: flex;
        flex-wrap: wrap;
    }

    .card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* mappa un po' più bassa su mobile, ma comunque comoda */
    #map,
    .map-frame {
        height: 65vh;
    }

    .filter-row-compact {
        flex-direction: column;
    }
}

/* ==========================================================================
   HAMBURGER MENU (≤ 500px)
   ========================================================================== */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}
/* Animazione X quando aperto */
.hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
    opacity: 0;
}
.hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 500px) {
    .hamburger {
        display: flex;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0.5rem 0;
    }
    .main-nav.is-open {
        display: flex;
    }
    .main-nav a {
        margin-left: 0;
        padding: 0.6rem 1rem;
        border-radius: 0;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border-subtle);
    }
    .main-nav a:last-of-type {
        border-bottom: none;
    }
    .main-nav #toggle-darkmode {
        margin: 0.4rem 1rem;
        align-self: flex-start;
    }

    .top-bar-inner {
        flex-wrap: wrap;
    }
}
