/* Bendforce-Standortkarte. Gehört zu karte.js. Lädt nichts von außen.
   Alles unter .bf-karte gescoped; main.css stylt button/section/p global,
   die nötigen Gegenregeln stehen unten. */

.bf-karte {
    --bf-accent: #00d5c6;
    --bf-accent-dark: #00a99d;
    --bf-text: #333;
    --bf-gray: #707070;
    --bf-line: #d3d3d3;
    --bf-land: #f4f4f4;
    position: relative;
    width: 100%;
    height: 520px;
    background: var(--bf-land);
    overflow: hidden;
    font-family: 'Noto Sans', sans-serif;
}

.bf-karte .maplibregl-map { font-family: 'Noto Sans', sans-serif; }   /* statt Helvetica aus maplibre-gl.css */

.bf-karte__map,
.bf-karte > .bf-karte__map.maplibregl-map {   /* maplibre-gl.css setzt position: relative */
    position: absolute;
    inset: 0;
}

/* Platzhalter / Rückfall ohne JS oder ohne WebGL */
.bf-karte__fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    text-align: center;
    color: var(--bf-gray);
    font-size: 16px;
    line-height: 24px;
    background:
        linear-gradient(90deg, rgba(0,0,0,.035) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(rgba(0,0,0,.035) 1px, transparent 1px) 0 0 / 40px 40px,
        var(--bf-land);
}
.bf-karte__fallback address {
    font-style: normal;
    color: var(--bf-text);
    font-weight: 700;
}
.bf-karte__fallback p {
    width: auto !important;          /* main.css: p { width: 60vw } */
    font-size: 16px;
    line-height: 24px;
    color: var(--bf-gray);
}
.bf-karte.is-ready .bf-karte__fallback { display: none; }
/* Statuszeile nur, solange karte.js lädt oder gescheitert ist (ohne JS: nur Adresse) */
.bf-karte:not(.is-loading):not(.is-failed) .bf-karte__status { display: none; }
.bf-karte.is-loading .bf-karte__fallback .bf-karte__status::after {
    content: '';
    display: inline-block;
    width: 10px; height: 10px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--bf-accent);
    animation: bf-karte-pulse 1s ease-in-out infinite alternate;
}
@keyframes bf-karte-pulse { from { opacity: .25 } to { opacity: 1 } }

/* Marker: türkiser Stift + Namensschild */
.bf-marker {
    position: relative;
    width: 36px;
    height: 48px;
    cursor: default;
}
.bf-marker svg { display: block; width: 36px; height: 48px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.bf-marker__label {
    position: absolute;
    left: 42px;
    top: 2px;
    white-space: nowrap;
    background: #fff;
    color: var(--bf-text);
    padding: 6px 10px 7px;
    border-left: 4px solid var(--bf-accent);
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    font-size: 14px;
    line-height: 18px;
    pointer-events: none;
}
.bf-marker__label strong { display: block; font-weight: 700; }
.bf-marker__label span { color: var(--bf-gray); font-size: 13px; }
.bf-marker:focus-visible { outline: 2px solid var(--bf-text); outline-offset: 2px; }

/* MapLibre-Bedienelemente im Seitenstil. main.css setzt für jedes <button>
   grauen Hintergrund, Padding und Radius 10px, das wird hier zurückgenommen. */
.bf-karte .maplibregl-ctrl-group {
    border-radius: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.bf-karte .maplibregl-ctrl-group button {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 0;
    background-color: #fff;
    font-size: 0;
    transition: background-color .3s;
}
.bf-karte .maplibregl-ctrl-group button + button { border-top: 1px solid var(--bf-line); }
.bf-karte .maplibregl-ctrl-group button:not(:disabled):hover { background-color: var(--bf-accent); }
.bf-karte .maplibregl-ctrl-group button:not(:disabled):hover .maplibregl-ctrl-icon { filter: brightness(0) invert(1); }
.bf-karte .maplibregl-ctrl-group button:focus-visible { box-shadow: inset 0 0 0 2px var(--bf-accent-dark); }
/* Zentrier-Knopf direkt unter Zoom, ein Block ohne Luecke: sonst schaut
   ein Strassenschild (B 3, mobil) halb zwischen den Knoepfen durch. */
.bf-karte .maplibregl-ctrl-top-right .bf-ctrl-home { margin-top: 0; border-top: 1px solid var(--bf-line); }
.bf-karte .bf-ctrl-home .maplibregl-ctrl-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Ccircle cx='14.5' cy='14.5' r='6' fill='none' stroke='%23333' stroke-width='2'/%3E%3Ccircle cx='14.5' cy='14.5' r='2' fill='%23333'/%3E%3Cpath d='M14.5 5v4M14.5 20v4M5 14.5h4M20 14.5h4' stroke='%23333' stroke-width='2'/%3E%3C/svg%3E");
}

/* Attribution: immer sichtbar, klein, in Seitenfarben */
.bf-karte .maplibregl-ctrl-attrib {
    background: rgba(255,255,255,.85);
    font-size: 11px;
    line-height: 16px;
    color: var(--bf-gray);
    padding: 1px 6px;
}
.bf-karte .maplibregl-ctrl-attrib a { color: var(--bf-gray); font-weight: 400; }
.bf-karte .maplibregl-ctrl-attrib a:hover { color: var(--bf-text); text-decoration: underline; }
.bf-karte .maplibregl-ctrl-scale {
    border-color: var(--bf-gray);
    color: var(--bf-gray);
    font-size: 10px;
    background: rgba(255,255,255,.75);
}

/* Hinweis "Strg + Scrollen" im Seitenstil */
.bf-karte .maplibregl-cooperative-gesture-screen {
    background: rgba(51,51,51,.55);
    color: #fff;
    font-family: 'Noto Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

@media (max-width: 750px) {
    .bf-karte { height: min(70vh, 440px); }
    .bf-marker__label { font-size: 13px; padding: 5px 8px 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .bf-karte.is-loading .bf-karte__fallback .bf-karte__status::after { animation: none; }
}

/* Abschnitt auf der Kontaktseite (_karte.php): links Adresse, rechts Karte */
.bf-anfahrt {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 2.2fr;
    gap: 40px;
    align-items: start;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}
.bf-anfahrt__text p { width: auto; font-size: 18px; line-height: 28px; margin-bottom: 18px; }
.bf-anfahrt__text address { font-style: normal; font-size: 20px; line-height: 28px; color: #333; margin-bottom: 18px; }
.bf-anfahrt__text strong { color: #333; }
/* main.css nimmt Abschnitten unter 1250px den Seitenrand (section { padding: 0 0 30px }),
   die anderen Inhalte halten 20px Abstand (.text, .full: calc(100vw - 40px)) */
@media (max-width: 1250px) {
    section#anfahrt { padding: 50px 20px 60px; }
}
@media (max-width: 1000px) {
    .bf-anfahrt { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 750px) {
    .bf-anfahrt__text p { font-size: 16px; line-height: 24px; }
}
