/* ColourLex – Globus-Seite. Nutzt nur die Tokens aus style.css (:root). */

/* ---------- Layout: Globus links, Panel rechts (unter 900 px untereinander) ---------- */
.globe-section {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
  padding-top: var(--s5);
  overflow-x: hidden;
  overflow-x: clip;
}

.globe-main,
.globe-panel {
  min-width: 0;
}

/* ---------- Umschalter ---------- */
.globe-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.toggle[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.toggle:focus-visible {
  outline: 2px solid var(--ultramarine);
  outline-offset: 2px;
}

/* ---------- Globus-Feld ---------- */
.globe-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 72vh;
  background: var(--night);
  border-radius: 12px;
  overflow: hidden;
}

/* MapLibre-Karte: fuellt die Buehne; ausserhalb der Kugel scheint das Nachtblau der Buehne durch */
.globe-stage #globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.globe-stage .maplibregl-canvas {
  outline: none;
}

.globe-stage .maplibregl-canvas:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ultramarine);
}

/* Quellenangabe (OpenFreeMap, OpenMapTiles, OpenStreetMap) bleibt sichtbar, aber dezent */
.globe-stage .maplibregl-ctrl-attrib {
  background: rgba(233, 225, 210, 0.82);
  font: 400 11px/1.4 Inter, sans-serif;
  color: var(--ink-2);
}

.globe-stage .maplibregl-ctrl-attrib a {
  color: var(--ink-2);
}

.globe-nogl {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--paper);
  font: 400 15px/1.5 Inter, sans-serif;
}

/* Vorschaubilder ab Zoom 12 (HTML-Marker): Pigment rund, Gemaelde eckig mit Rand */
.globe-thumb {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #3a2f28;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

.globe-thumb.is-painting {
  border-color: #d0412a;
  border-radius: 3px;
}

.globe-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.globe-thumb:hover,
.globe-thumb:focus-visible {
  outline: 2px solid #c7922b;
  outline-offset: 1px;
}

.globe-tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -140%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

.globe-tip[hidden] {
  display: none;
}

/* ---------- Panel ---------- */
.globe-panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

@media (min-width: 900px) {
  .globe-panel {
    position: sticky;
    top: 80px;
  }
}

.panel-hint {
  color: var(--ink-2);
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot,
.legend-square {
  flex: none;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.legend-dot {
  border-radius: 50%;
}

.legend-square {
  background: var(--vermilion);
}

.legend-painting {
  background: var(--vermilion);
}

/* Karte nach Klick auf einen Punkt */
.globe-card-img {
  width: 100%;
  aspect-ratio: 400 / 284;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.globe-card h2 {
  margin: 16px 0 8px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.globe-card .eyebrow {
  margin-bottom: 12px;
}

.globe-card-note {
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- Liste aller Orte ---------- */
.globe-list {
  padding-top: var(--s5);
  padding-bottom: 64px;
}

.globe-list h2 {
  margin-bottom: var(--s3);
}

.place-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
}

.place-row {
  break-inside: avoid;
}

.place-btn {
  display: block;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.place-btn:hover {
  color: var(--vermilion);
}

.place-btn:focus-visible {
  outline: 2px solid var(--ultramarine);
  outline-offset: 2px;
}

.place-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}

.place-items a {
  color: var(--vermilion);
  text-decoration: none;
}

.place-items a:hover {
  text-decoration: underline;
}

.place-items .is-painting {
  font-style: italic;
}

/* ---------- Mobil ---------- */
@media (max-width: 899px) {
  .globe-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 599px) {
  .place-list {
    grid-template-columns: 1fr;
  }

  .globe-panel {
    padding: 16px;
  }
}

/* ===== Zoom-Knoepfe, Haufen-Liste ===== */
.zoom-group { display: inline-flex; gap: 4px; margin-left: auto; }
.zoom-btn { min-width: 40px; justify-content: center; font-size: 18px; line-height: 1; padding: 6px 10px; }
.globe-hint { font: 400 13px/1.5 Inter, sans-serif; color: var(--ink-2); margin: 0 0 12px; }
.cluster-title { font-family: Fraunces, serif; font-weight: 300; font-size: 1.6rem; margin: 4px 0 8px; }
.cluster-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 52vh; overflow-y: auto; }
.cluster-item { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; text-align: left; font: 500 13px/1.3 Inter, sans-serif; color: var(--ink); overflow: hidden; }
.cluster-item img { display: block; width: 100%; aspect-ratio: 400/284; object-fit: cover; }
.cluster-item span { padding: 0 8px; }
.cluster-item small { display: block; color: var(--ink-2); font-weight: 400; }
.cluster-item:hover, .cluster-item:focus-visible { border-color: var(--ink); outline: none; }
@media (max-width: 900px) { .cluster-list { grid-template-columns: repeat(3, 1fr); max-height: none; } }
@media (max-width: 480px) { .cluster-list { grid-template-columns: 1fr 1fr; } }
