/* =============================================================================
   leaflet-chrome.css — generikus Leaflet UI-chrome témázása (attribution, zoom-bar,
   popup, távolság-skála, tile-pane) dark ÉS night témán. A Leaflet a DOM-ot maga
   rendereli (nem Razor-markup) → GLOBÁLIS. A világos kinézet a Leaflet saját alap-
   stílusából jön; itt csak a sötét/éjszakai kontrasztot állítjuk. Korábban app.css.
   NEM ide tartozik: a fleet-specifikus marker/popup (fleet-weather.css) és a
   .map-controls/.fleet-* (fleet-map.css).
   ============================================================================= */

/* ===== Leaflet attribution: discreet by default, full opacity on hover ===== */
.leaflet-control-attribution {
    font-size: 9px;
    line-height: 1.4;
    padding: 1px 5px;
    background: rgba(var(--nt-white-rgb), 0.55);
    color: rgba(29, 41, 57, 0.7);
    opacity: 0.55;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

    .leaflet-control-attribution:hover,
    .leaflet-control-attribution:focus-within {
        opacity: 1;
        background: var(--c-overlay-light);
    }

    .leaflet-control-attribution a {
        color: rgba(29, 41, 57, 0.85);
        text-decoration: none;
    }

        .leaflet-control-attribution a:hover {
            text-decoration: underline;
        }

html[data-theme="dark"] .leaflet-control-attribution {
    background: rgba(20, 24, 33, 0.5);
    color: rgba(229, 235, 245, 0.75);
}

    html[data-theme="dark"] .leaflet-control-attribution:hover,
    html[data-theme="dark"] .leaflet-control-attribution:focus-within {
        background: rgba(20, 24, 33, 0.88);
    }

    html[data-theme="dark"] .leaflet-control-attribution a {
        color: rgba(229, 235, 245, 0.9);
    }

/* Dark map container — prevents white flash before Dark Matter tiles load */
html[data-theme="dark"] .leaflet-container {
    background: #1a1a24;
}

/* ===== Leaflet zoom / bar controls in dark mode ===== */
html[data-theme="dark"] .leaflet-bar a,
html[data-theme="dark"] .leaflet-bar a:hover {
    background-color: var(--c-map-chrome);
    color: #e5ebf5;
    border-bottom-color: var(--c-map-chrome-border);
}

    html[data-theme="dark"] .leaflet-bar a:hover {
        background-color: #353c49;
    }

    html[data-theme="dark"] .leaflet-bar a.leaflet-disabled {
        background-color: #1f242e;
        color: #6b7280;
    }

html[data-theme="dark"] .leaflet-bar {
    border-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

/* ===== Leaflet popups in dark mode ===== */
html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip {
    background: var(--c-map-surface);
    color: #e5ebf5;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .leaflet-popup-content {
    color: #e5ebf5;
}

    html[data-theme="dark"] .leaflet-popup-content a {
        color: var(--primary-clr);
    }

html[data-theme="dark"] .leaflet-popup-close-button,
html[data-theme="dark"] .leaflet-popup-close-button:hover {
    color: #cbd5e1;
}

/* Térkép távolság-skála (nautech-scale). A világos kinézet a Leaflet alap
   .leaflet-control-scale-line stílusából jön; itt csak a sötét téma kontrasztját
   állítjuk, hogy a CARTO dark csempéken is olvasható maradjon. */
[data-theme="dark"] .nautech-scale .leaflet-control-scale-line {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-color: #bbb;
    text-shadow: 1px 1px #000;
}

/* ===== NIGHT theme map (red-shift palette) ===== */
/* Night uses the same CARTO Dark Matter basemap as dark (site.js treats night as dark for
   tiles). A warm tint on the tile pane ONLY warms the cold blue-grey basemap to the night
   identity and dims the glow. Scoped to .leaflet-tile-pane so markers (.leaflet-marker-pane),
   route polylines (.leaflet-overlay-pane) and controls stay untinted. */
:root[data-theme="night"] .leaflet-tile-pane {
    filter: brightness(0.75) saturate(0.7) sepia(0.3) hue-rotate(-20deg);
}

/* Prevent white flash before Dark Matter tiles load */
html[data-theme="night"] .leaflet-container {
    background: var(--list-bg);
}

html[data-theme="night"] .leaflet-bar a,
html[data-theme="night"] .leaflet-bar a:hover {
    background-color: var(--list-bg);
    color: var(--text-clr);
    border-bottom-color: var(--c-divider);
}

    html[data-theme="night"] .leaflet-bar a:hover {
        background-color: color-mix(in srgb, var(--primary-clr) 20%, var(--list-bg));
    }

    html[data-theme="night"] .leaflet-bar a.leaflet-disabled {
        background-color: var(--list-bg);
        color: var(--muted-clr);
    }

html[data-theme="night"] .leaflet-bar {
    border-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

html[data-theme="night"] .leaflet-popup-content-wrapper,
html[data-theme="night"] .leaflet-popup-tip {
    background: var(--list-bg);
    color: var(--text-clr);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.6);
}

html[data-theme="night"] .leaflet-popup-content,
html[data-theme="night"] .leaflet-popup-content a {
    color: var(--text-clr);
}

html[data-theme="night"] .leaflet-popup-close-button,
html[data-theme="night"] .leaflet-popup-close-button:hover {
    color: var(--muted-clr);
}

html[data-theme="night"] .leaflet-control-attribution {
    background: rgba(20, 0, 0, 0.85);
}

    html[data-theme="night"] .leaflet-control-attribution a {
        color: var(--text-clr);
    }

[data-theme="night"] .nautech-scale .leaflet-control-scale-line {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-color: #bbb;
    text-shadow: 1px 1px #000;
}
