/* custom.css – eigene Overrides, bleibt bei Masterportal-Updates unangetastet */
.mouseHover .info {
  display: none !important;
}

/* für die Flaggen */
a[href*="/flags/"] .gfi-theme-images-image {
  width: auto !important;
  max-width: 100px !important;
  height: auto !important;
  margin: 0 !important;
}
/* Farbkaestchen im Baum vor Administrative-Grenzen-Layern (AL2-AL12).
   Ansatzpunkt ist die button-id "layer-checkbox-adminBoundaries_alN",
   die Masterportal pro Layer rendert (kein data-layer-id im DOM vorhanden). */
[id^="layer-checkbox-adminBoundaries_al"] .layer-tree-layer-label {
  /* Bootstrap setzt hier d-flex flex-column, wodurch das ::before als
     zusaetzliches Flex-Item in eine eigene Zeile rutscht. Fuer diese
     Labels auf Zeilen-Ausrichtung umstellen, damit Kaestchen + Text
     nebeneinander stehen. */
  flex-direction: row !important;
  align-items: center !important;
}
[id^="layer-checkbox-adminBoundaries_al"] .layer-tree-layer-label::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  flex-shrink: 0;
  /* Default-Farbe, falls mal ein neues AL-Level ohne eigene Farbregel
     dazukommt - wird unten pro Level ueberschrieben. */
  background-color: rgb(191,0,0);
}

/* Individuelle Farben je Verwaltungsebene - dieselbe 11-stufige Palette
   wie bei den MapServer outlineColor-Werten, damit Baum und Karte
   spaeter konsistent eingefaerbt werden koennen. */
#layer-checkbox-adminBoundaries_al2  .layer-tree-layer-label::before { background-color: rgb(191,0,0);   }
#layer-checkbox-adminBoundaries_al3  .layer-tree-layer-label::before { background-color: rgb(191,104,0); }
#layer-checkbox-adminBoundaries_al4  .layer-tree-layer-label::before { background-color: rgb(173,191,0); }
#layer-checkbox-adminBoundaries_al5  .layer-tree-layer-label::before { background-color: rgb(69,191,0);  }
#layer-checkbox-adminBoundaries_al6  .layer-tree-layer-label::before { background-color: rgb(0,191,34);  }
#layer-checkbox-adminBoundaries_al7  .layer-tree-layer-label::before { background-color: rgb(0,191,139); }
#layer-checkbox-adminBoundaries_al8  .layer-tree-layer-label::before { background-color: rgb(0,139,191); }
#layer-checkbox-adminBoundaries_al9  .layer-tree-layer-label::before { background-color: rgb(0,34,191);  }
#layer-checkbox-adminBoundaries_al10 .layer-tree-layer-label::before { background-color: rgb(69,0,191);  }
#layer-checkbox-adminBoundaries_al11 .layer-tree-layer-label::before { background-color: rgb(173,0,191); }
#layer-checkbox-adminBoundaries_al12 .layer-tree-layer-label::before { background-color: rgb(191,0,104); }

/* -------------------------------------------------------------------
   Kartengebundene Info-Box (bildschirmfest, position:fixed - bleibt
   beim Pan/Zoom immer an derselben Stelle, da ausserhalb von
   Masterportals eigenem Kartencontainer). Erzeugt via custom.js.
   V1 13.08.2026 wno
   V2 02.09.2026 wno "left" ist nur noch Fallback-Default fuer den
                      kurzen Moment vor dem ersten ResizeObserver-
                      Callback; die eigentliche Positionierung relativ
                      zum Themenbaum (#mp-menu-mainMenu) uebernimmt
                      jetzt custom.js dynamisch (Auf-/Zuklappen,
                      manuelles Verziehen per ResizeHandle).
   ------------------------------------------------------------------- */
#wno-info-box {
    position: fixed;
    top: 10px;
    left: 500px; /* Fallback, siehe custom.js */
    z-index: 2000;               /* ueber den OpenLayers-Controls (typ. z-index ~1000) */
    width: fit-content;          /* Breite folgt der laengsten Zeile statt fest 280px */
    max-width: 90vw;             /* Sicherheitsnetz gegen sehr lange Zeilen/schmale Fenster */
    white-space: nowrap;         /* keine Zeilenumbrueche innerhalb einer Zeile */
    padding: 8px 28px 8px 12px;  /* rechts Platz fuer den Schliessen-Button */
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #333;
    border-radius: 4px;
    font-family: sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;        /* Klicks/Drag auf der Karte darunter bleiben moeglich */
}

#wno-info-box.wno-info-box--hidden {
    display: none;
}

#wno-info-box-close {
    position: absolute;
    top: 2px;
    right: 6px;
    cursor: pointer;
    pointer-events: auto;        /* Ausnahme von pointer-events:none der Box */
    font-weight: bold;
    color: #666;
}

#wno-info-box-close:hover {
    color: #000;
}

#wno-info-box-copyright a {
    pointer-events: auto;        /* Ausnahme von pointer-events:none der Box, siehe #wno-info-box-close */
    color: #06c;
}

#wno-info-box-copyright a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------------------
   Testweise: BBOX->JOSM (Button + Gummiband-Overlay).
   Button oben rechts, oberhalb der vertikalen Zoom/Orientierungs-
   Buttonleiste, damit er nicht mit dieser kollidiert.
   V1 29.08.2026 wno (testweise)
   ------------------------------------------------------------------- */
/* -------------------------------------------------------------------
   Testweise: BBOX-Editor-Flyout (Trigger-Icon + Hover-Menue).
   top:70px statt 10px, damit es nicht mit Browser-Erweiterungsleisten
   oder dem vorhandenen Werkzeug-Icon oben rechts kollidiert.
   V2 29.08.2026 wno (testweise, erweitert um Editor-Flyout)
   ------------------------------------------------------------------- */
#wno-bbox-menu {
    position: fixed;
    top: 20px;
    right: 65px;
    z-index: 2000;
}

#wno-bbox-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 41px;
    height: 41px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#wno-bbox-trigger img {
    display: block;
    width: 37px;
    height: 37px;
}

/* Kürzel (J/I/R) des zuletzt genutzten Editors, unten rechts am
   Trigger-Icon - leer/unsichtbar, solange noch nichts gemerkt wurde
   (siehe wnoUpdateLastEditorMarkers() in custom.js). */
.wno-bbox-trigger-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #a05a00;
    color: #fff;
    font-family: sans-serif;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

#wno-bbox-menu.wno-bbox-active #wno-bbox-trigger {
    background: rgba(255, 220, 150, 0.95);
    border-color: #a05a00;
}

#wno-bbox-flyout {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 0;
    right: 100%;
    margin-right: 6px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#wno-bbox-menu.wno-bbox-expanded #wno-bbox-flyout {
    display: flex;
}

#wno-bbox-flyout button {
    display: block;
    width: 100%;
    padding: 6px 14px;
    border: none;
    border-bottom: 1px solid #ddd;
    background: transparent;
    font-family: sans-serif;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

#wno-bbox-flyout button:last-child {
    border-bottom: none;
}

#wno-bbox-flyout button:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* zuletzt genutzter Editor im Flyout - dezente Hervorhebung, dieselbe
   Akzentfarbe wie der aktive Zeichenmodus (#a05a00). */
#wno-bbox-flyout button.wno-bbox-last-used {
    font-weight: bold;
    background: rgba(160, 90, 0, 0.10);
    border-left: 3px solid #a05a00;
    padding-left: 11px; /* 14px - 3px Rahmen, damit der Text nicht springt */
}

#wno-bbox-flyout button.wno-bbox-last-used:hover {
    background: rgba(160, 90, 0, 0.18);
}

/* JOSM nicht erreichbar (siehe wnoUpdateJosmButtonState() in custom.js) -
   button[disabled] uebernimmt bereits das Grundsaetzliche, hier nur
   fein nachjustiert: durchgestrichen als klareres Signal als reines
   Verblassen, kein Zeigefinger-Cursor, Hover-Effekt deaktiviert. */
#wno-bbox-flyout button.wno-bbox-unavailable {
    text-decoration: line-through;
    color: #999;
    cursor: not-allowed;
}

#wno-bbox-flyout button.wno-bbox-unavailable:hover {
    background: transparent;
}

#wno-bbox-overlay {
    position: fixed;
    display: none;
    z-index: 2001;
    border: 2px dashed #ff6a00;
    background: rgba(255, 106, 0, 0.15);
    pointer-events: none;
}
