/* ==========================================================================
   OpenYardage · Kartenmodul fuer die Einzelbahn
   Gehoert zu public/js/holemap.js. Alles unter `.oyholemap` bzw. `.oymapbar`
   gescoped, damit die Datei unabhaengig von der Reihenfolge der <link>-
   Einbindung gewinnt und MapLibre nichts uebersteuert, was ihm nicht gehoert.
   Design-Tokens aus index.html mit Fallback, falls das Modul allein laeuft.
   ========================================================================== */

/* ---------- Kartenflaeche ---------- */
.oyholemap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: var(--card2, #fffdf7);
  border: 1px solid var(--line, #d8d1c0);
  border-radius: 3px;
  overflow: hidden;
}

/* MapLibre setzt die Leinwand absolut, der Container muss das tragen. */
.oyholemap .maplibregl-canvas-container,
.oyholemap .maplibregl-canvas {
  outline: none;
}
.oyholemap canvas { display: block; }

/* Quellenangabe: rechtlich vorgeschrieben, darum nur dezent, nie versteckt. */
.oyholemap .maplibregl-ctrl-bottom-right,
.oyholemap .maplibregl-ctrl-bottom-left {
  z-index: 3;
}
.oyholemap .maplibregl-ctrl-attrib {
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 9px;
  line-height: 1.5;
  background: rgba(255, 253, 247, .82);
  color: var(--mut, #6b6252);
  border-radius: 3px 0 0 0;
  padding: 1px 6px;
}
.oyholemap .maplibregl-ctrl-attrib a { color: var(--mut, #6b6252); }
.oyholemap .maplibregl-ctrl-attrib a:hover { color: var(--ink, #21251f); }
.oyholemap .maplibregl-ctrl-attrib-button {
  background-color: rgba(255, 253, 247, .82);
}

/* Bedienelemente, falls die Integration welche hinzufuegt. */
.oyholemap .maplibregl-ctrl-group {
  background: var(--card2, #fffdf7);
  border: 1px solid var(--line, #d8d1c0);
  box-shadow: none;
  border-radius: 3px;
}
.oyholemap .maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--line3, #eee8da);
}

/* Fehlt MapLibre, steht das hier statt einer leeren Flaeche. */
.oyholemap .oymapmiss,
.oymapmiss {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 160px;
  padding: 18px;
  text-align: center;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.8;
  color: var(--faint, #8a8170);
  background: var(--card, #faf7ef);
}

/* ---------- Umschaltleiste ---------- */
.oymapbar {
  font-family: var(--mono, 'Courier New', Courier, monospace);
  margin: 8px 0;
}

.oymapbar .oymaprow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.oymapbar .oymaplb {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--faint, #8a8170);
  flex-shrink: 0;
  margin-right: 2px;
}

.oymapbar .oymapbtn {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 5px 9px;
  border: 1px solid var(--line, #d8d1c0);
  border-radius: 3px;
  background: var(--card, #faf7ef);
  color: var(--faint, #8a8170);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.oymapbar .oymapbtn:hover {
  background: var(--card, #faf7ef);
  border-color: var(--line2, #c9c1ad);
  color: var(--ink2, #4a463c);
}
.oymapbar .oymapbtn:focus-visible {
  outline: 2px solid var(--green, #2f6b46);
  outline-offset: 1px;
}
/* Aktiv = Ink-Block nach den Design-Tokens */
.oymapbar .oymapbtn.on,
.oymapbar .oymapbtn.on:hover {
  background: var(--ink, #21251f);
  border-color: var(--ink, #21251f);
  color: #f5f1e6;
}

/* Hinweis nur im amtlichen Modus: dort fehlen drei Bundeslaender. */
.oymapbar .oymaphint {
  display: none;
  margin-top: 6px;
  max-width: 46em;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--faint, #8a8170);
}
.oymapbar[data-mode="amtlich"] .oymaphint { display: block; }

/* ---------- schmale Displays ---------- */
@media (max-width: 560px) {
  .oymapbar .oymaplb { display: none; }
  .oymapbar .oymapbtn { padding: 5px 8px; }
}

/* Der Umschalter ist ein Bedienelement, kein Book-Inhalt. Die Karte selbst
   bleibt im Druck stehen, sie ist Teil der Bahn. */
@media print {
  .oymapbar { display: none !important; }
  .oyholemap { border-color: var(--line2, #c9c1ad); }
  .oyholemap .maplibregl-ctrl-group { display: none !important; }
}
