/* ==========================================================================
   OpenYardage · Tee-Auswahl (Migrations-Plan Abschnitt 4 B)
   Gehoert zu public/js/tees.js. Alles unter `.teebar` gescoped, damit die
   Datei unabhaengig von der Reihenfolge der <link>-Einbindung gewinnt.
   Design-Tokens aus index.html mit Fallback, falls das Modul allein laeuft.
   ========================================================================== */

.teebar {
  --tee-white: #fffdf7;
  --tee-yellow: #e0c94f;
  --tee-blue: #3e7ea6;
  --tee-red: #b23a2e;
  --tee-other: #b8ae98;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  margin: 8px 0;
}

/* ---------- Umschalter-Zeile ---------- */
.teebar .teerow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.teebar .teelb {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--faint, #8a8170);
  flex-shrink: 0;
  margin-right: 2px;
}

.teebar .teebtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  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;
}
.teebar .teebtn:hover {
  border-color: var(--line2, #c9c1ad);
  color: var(--ink2, #4a463c);
}
.teebar .teebtn:focus-visible {
  outline: 2px solid var(--green, #2f6b46);
  outline-offset: 1px;
}
/* Aktiv = Ink-Block nach den Design-Tokens */
.teebar .teebtn.on {
  background: var(--ink, #21251f);
  border-color: var(--ink, #21251f);
  color: #f5f1e6;
}
.teebar .teebtn.on:hover {
  border-color: var(--ink, #21251f);
  color: #f5f1e6;
}
.teebar .teebtn .tl {
  font-weight: 700;
  color: var(--mut, #6b6252);
}
.teebar .teebtn.on .tl { color: #cfc9ba; }

/* ---------- Farbpunkt: zeigt die echte Tee-Farbe ---------- */
.teebar .teedot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--faint, #8a8170);
  flex-shrink: 0;
  display: inline-block;
  background: var(--tee-other);
}
.teebar .teedot.white { background: var(--tee-white); }
.teebar .teedot.yellow { background: var(--tee-yellow); }
.teebar .teedot.blue { background: var(--tee-blue); }
.teebar .teedot.red { background: var(--tee-red); }
.teebar .teedot.other { background: var(--tee-other); }

/* ---------- CR / Slope (gibt es in OSM nicht) ---------- */
.teebar details.teecr {
  margin-top: 6px;
  border: 1px solid var(--line, #d8d1c0);
  border-radius: 3px;
  background: var(--card, #faf7ef);
  padding: 0;
}
.teebar details.teecr > summary {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--faint, #8a8170);
  padding: 7px 12px;
  cursor: pointer;
  user-select: none;
}
.teebar details.teecr[open] > summary {
  border-bottom: 1px dashed var(--line3, #eee8da);
}
.teebar .teecrrow {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  flex-wrap: wrap;
}
.teebar .teecrrow:last-child { padding-bottom: 10px; }
.teebar .teecrrow b {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--mut, #6b6252);
  width: 66px;
  flex-shrink: 0;
}
.teebar .teecrrow .tk {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--faint, #8a8170);
}
.teebar input.teein {
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-style: normal;
  font-size: 12px;
  color: var(--ink, #21251f);
  border: 1px solid var(--line, #d8d1c0);
  border-radius: 3px;
  background: var(--card2, #fffdf7);
  padding: 4px 7px;
  width: 62px;
}
.teebar input.teein.slope { width: 52px; }
.teebar input.teein:focus {
  outline: none;
  border-color: var(--green, #2f6b46);
}

/* ---------- schmale Displays ---------- */
@media (max-width: 560px) {
  .teebar .teebtn .tn { display: none; }
  .teebar .teecrrow b { width: 100%; }
}

/* Der Umschalter ist ein Editor-Bedienelement, kein Book-Inhalt. */
@media print {
  .teebar { display: none !important; }
}
