/* Gitaar Toonladders – neemt tekstkleur en lettertype over van de site.
   Alleen de hals zelf (palissander, frets, noten) heeft vaste kleuren. */
.gtl {
  --gtl-accent: #c92a5a;
  --gtl-accent-fg: #ffffff;
  --gtl-wood: #3a2418;
  --gtl-wood-edge: #24150d;
  --gtl-fret: #cfc8b8;
  --gtl-nut: #efe6d1;
  --gtl-string: #bdb6a7;
  --gtl-inlay: #e6dcc4;
  --gtl-note: #f6efdf;
  --gtl-note-fg: #2a1810;
  --gtl-ghost: rgba(246, 239, 223, 0.16);
  --gtl-ghost-fg: rgba(246, 239, 223, 0.6);
  --gtl-line: color-mix(in srgb, currentColor 20%, transparent);
  --gtl-muted: color-mix(in srgb, currentColor 64%, transparent);
  --gtl-soft: color-mix(in srgb, currentColor 6%, transparent);
  --gtl-zone: color-mix(in srgb, var(--gtl-accent) 22%, transparent);

  --gtl-accent-text: var(--gtl-accent);
  color: var(--gtl-fg, inherit);
  font: inherit;
  display: grid;
  gap: 1.1rem;
  max-width: 100%;
  min-width: 0;
}
.gtl *, .gtl *::before, .gtl *::after { box-sizing: border-box; }

/* Kleurenschema's. "inherit" neemt de tekstkleur van de template over. */
.gtl[data-theme="dark"] {
  --gtl-fg: #f2ece6;
  --gtl-accent-text: color-mix(in srgb, var(--gtl-accent) 55%, #ffffff);
  color-scheme: dark;
}
.gtl[data-theme="light"] {
  --gtl-fg: #231c1e;
  --gtl-accent-text: color-mix(in srgb, var(--gtl-accent) 85%, #000000);
  color-scheme: light;
}
/* Template-stijlen op tekst neutraliseren (kleur, hoofdletters, letterafstand) */
.gtl[data-theme] :is(h3, p, span, label, b, i, button, li, select, option) { color: inherit; }
.gtl :is(label, button, span, p, b, i, li, h3) { text-transform: none; }
.gtl .gtl-label { text-transform: uppercase; }
.gtl[data-theme] :is(.gtl-label, .gtl-meta, .gtl-sublabel, .gtl-check, .gtl-tempo, .gtl-hint, .gtl-mini-head span, .gtl-mini-head i, .gtl-degrees span) { color: var(--gtl-muted); }
.gtl[data-theme] .gtl-degrees li.is-root span { color: inherit; }
.gtl[data-theme="dark"] .gtl-select option { background: #1c1a1f; color: #f2ece6; }
.gtl[data-theme] .gtl-chip[aria-pressed="true"],
.gtl[data-theme] .gtl-play,
.gtl[data-theme] .gtl-degrees li.is-root { color: var(--gtl-accent-fg); }

/* Bedieningselementen */
.gtl-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem 1.5rem;
  align-items: start;
}
.gtl-field { display: grid; gap: 0.4rem; min-width: 0; }
.gtl-field--wide { grid-column: 1 / -1; }
.gtl-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gtl-muted);
}
.gtl-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.gtl-chip {
  font: inherit;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  min-width: 2.6rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--gtl-line);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.gtl-chip:hover { background: var(--gtl-soft); border-color: color-mix(in srgb, currentColor 40%, transparent); }
.gtl-chip[aria-pressed="true"] {
  background: var(--gtl-accent);
  border-color: var(--gtl-accent);
  color: var(--gtl-accent-fg);
  font-weight: 600;
}
.gtl-seg { gap: 0; }
.gtl-seg .gtl-chip { border-radius: 0; margin-left: -1px; }
.gtl-seg .gtl-chip:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.gtl-seg .gtl-chip:last-child { border-radius: 0 6px 6px 0; }
.gtl-seg .gtl-chip[aria-pressed="true"] { position: relative; z-index: 1; }

.gtl-select {
  font: inherit;
  font-size: 0.95rem;
  color: inherit;
  background: transparent;
  border: 1px solid var(--gtl-line);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  width: 100%;
  max-width: 22rem;
}
.gtl-select option { color: initial; background: initial; }
.gtl-check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; color: var(--gtl-muted); cursor: pointer; }
.gtl-check input { accent-color: var(--gtl-accent); }

/* Ligging laag/hoog */
.gtl-oct { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.15rem; }
.gtl-sublabel { font-size: 0.85rem; color: var(--gtl-muted); }
.gtl-seg--sm .gtl-chip { font-size: 0.85rem; padding: 0.28rem 0.7rem; min-width: 0; }
.gtl-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.gtl-chip:disabled:hover { background: transparent; border-color: var(--gtl-line); }
.gtl-mini-head i { font-style: normal; font-weight: 400; color: var(--gtl-muted); }

/* Kop */
.gtl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--gtl-line);
}
.gtl-titles { min-width: 0; }
.gtl .gtl-title { color: inherit; font-family: inherit; }
.gtl-title { margin: 0; font-size: 1.35rem; line-height: 1.2; text-wrap: balance; }
.gtl-meta { margin: 0.2rem 0 0; color: var(--gtl-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.gtl-degrees { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.gtl-degrees li {
  display: grid;
  justify-items: center;
  min-width: 2.5rem;
  padding: 0.3rem 0.35rem 0.25rem;
  border-radius: 6px;
  background: var(--gtl-soft);
}
.gtl-degrees b { font-size: 1rem; }
.gtl-degrees span { font-size: 0.72rem; color: var(--gtl-muted); font-variant-numeric: tabular-nums; }
.gtl-degrees li.is-root { background: var(--gtl-accent); color: var(--gtl-accent-fg); }
.gtl-degrees li.is-root span { color: inherit; opacity: 0.85; }

/* Hals */
.gtl-neck {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  min-width: 0;
}
.gtl-svg { display: block; width: 100%; min-width: 760px; height: auto; font-family: inherit; }
.gtl-wood { fill: var(--gtl-wood); stroke: var(--gtl-wood-edge); stroke-width: 2; }
.gtl-zone { fill: var(--gtl-zone); }
.gtl-fret { stroke: var(--gtl-fret); stroke-width: 2.5; }
.gtl-nut { fill: var(--gtl-nut); }
.gtl-string { stroke: var(--gtl-string); }
.gtl-inlay { fill: var(--gtl-inlay); opacity: 0.55; }
.gtl-sname { fill: currentColor; opacity: 0.7; font-size: 13px; font-weight: 600; }
.gtl-fnum { fill: currentColor; opacity: 0.45; font-size: 11px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.gtl-fnum.is-mark { opacity: 0.85; font-weight: 600; }

.gtl-note { cursor: pointer; outline: none; }
.gtl-note circle {
  fill: var(--gtl-note);
  stroke: var(--gtl-wood-edge);
  stroke-width: 1.5;
  transition: transform 0.12s ease-out;
  transform-box: fill-box;
  transform-origin: center;
}
.gtl-note text {
  fill: var(--gtl-note-fg);
  font-size: 11.5px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}
.gtl-note.is-root circle { fill: var(--gtl-accent); }
.gtl-note.is-root text { fill: var(--gtl-accent-fg); }
.gtl-note.is-ghost { cursor: default; }
.gtl-note.is-ghost circle { fill: var(--gtl-ghost); stroke: none; }
.gtl-note.is-ghost text { fill: var(--gtl-ghost-fg); font-size: 9px; font-weight: 600; }
.gtl-note.is-ghost.is-root circle { fill: color-mix(in srgb, var(--gtl-accent) 45%, transparent); }
.gtl-note.is-ghost.is-root text { fill: #fff; }
.gtl-note:not(.is-ghost):hover circle { transform: scale(1.1); }
.gtl-note:focus-visible circle { stroke: #fff; stroke-width: 3; }
.gtl-note.is-playing circle { transform: scale(1.25); stroke: #fff; stroke-width: 3; }

/* Overzicht: alle 5 posities */
.gtl-overview { display: grid; gap: 0.5rem; min-width: 0; padding-top: 0.9rem; border-top: 1px solid var(--gtl-line); }
.gtl-mini-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.3rem;
}
.gtl-mini {
  font: inherit;
  color: inherit;
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 0.55rem 0.55rem 0.4rem;
  border: 1px solid var(--gtl-line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
  transition: border-color 0.12s, background-color 0.12s;
}
.gtl-mini:hover { background: var(--gtl-soft); }
.gtl-mini[aria-pressed="true"] { border-color: var(--gtl-accent); box-shadow: inset 0 0 0 1px var(--gtl-accent); }
.gtl-mini-head { display: grid; gap: 0.05rem; font-size: 0.85rem; line-height: 1.3; }
.gtl-mini-head b { white-space: nowrap; }
.gtl-mini-head span { color: var(--gtl-muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.gtl-mini[aria-pressed="true"] .gtl-mini-head b { color: var(--gtl-accent-text); }
.gtl-mini-svg { display: block; width: 100%; height: auto; max-height: 150px; }
.gtl-mini .gtl-note { cursor: inherit; }
.gtl-mini .gtl-fnum { font-size: 9px; }
.gtl-mini:focus-visible { outline: 2px solid var(--gtl-accent); outline-offset: 2px; }

/* Voet */
.gtl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; }
.gtl-play {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--gtl-accent);
  background: var(--gtl-accent);
  color: var(--gtl-accent-fg);
  cursor: pointer;
}
.gtl-play:disabled { opacity: 0.45; cursor: not-allowed; }
.gtl-tempo { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--gtl-muted); }
.gtl-tempo input { accent-color: var(--gtl-accent); width: 8rem; }
.gtl-bpm { font-variant-numeric: tabular-nums; min-width: 4.5em; }
.gtl-hint { font-size: 0.82rem; color: var(--gtl-muted); }

.gtl-chip:focus-visible, .gtl-play:focus-visible, .gtl-select:focus-visible, .gtl-check input:focus-visible, .gtl-tempo input:focus-visible {
  outline: 2px solid var(--gtl-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .gtl-chip, .gtl-note circle { transition: none; }
}
