/* Zing Mee — "avondlicht op steen". Eén stylesheet, design tokens bovenaan. */

:root {
  --ink:        #1F2430;
  --paper:      #FAFAF7;
  --stone:      #8B8F98;
  --line:       #E4E2DA;
  --amber:      #B8860B;
  --amber-deep: #8f6a09;
  --amber-soft: #F5EDD8;
  --card:       #FFFFFF;
  --danger:     #A33A2E;

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Source Serif 4", Georgia, serif;
  --font-ui:      "Inter", system-ui, sans-serif;

  --radius: 10px;
  --ease: cubic-bezier(.25,.8,.25,1);
  --dur: 320ms;
  --lied-grootte: 1.25rem;
}

[data-thema="nacht"] {
  --ink:   #E8E6DF;
  --paper: #14161C;
  --stone: #8B8F98;
  --line:  #2A2E38;
  --amber: #D9A62E;
  --amber-deep: #E5BC55;
  --amber-soft: #2A2410;
  --card:  #1B1E26;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--amber-deep); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 3px; }

.omslag { max-width: 44rem; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; }
.omslag--breed { max-width: 64rem; }

/* ---------- UI-elementen ---------- */

.knop {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .65rem 1.1rem;
  cursor: pointer;
  transition: transform 120ms var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  touch-action: manipulation;
}
.knop:active { transform: scale(.97); }
.knop--primair { background: var(--amber); border-color: var(--amber); color: #fff; }
[data-thema="nacht"] .knop--primair { color: #14161C; }
.knop--stil { background: none; border-color: transparent; color: var(--stone); }
.knop--gevaar { color: var(--danger); border-color: var(--danger); background: none; }
.knop:disabled { opacity: .45; cursor: default; }

.veld { display: block; margin-bottom: 1rem; font-family: var(--font-ui); }
.veld > span { display: block; font-size: .85rem; font-weight: 600; color: var(--stone); margin-bottom: .3rem; }
input[type="text"], input[type="email"], input[type="date"], input[type="url"], select, textarea {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .6rem .75rem;
  width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9rem; min-height: 16rem; }

.kaart {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.melding {
  font-family: var(--font-ui);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--ink);
  padding: .75rem 1rem;
  margin: 1rem 0;
}
.melding--fout { background: color-mix(in srgb, var(--danger) 12%, var(--paper)); }

.chip {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .6rem;
  border-radius: 99px;
  background: var(--amber-soft);
  color: var(--amber-deep);
}
.chip--live { background: var(--amber); color: #fff; animation: adem 2.4s ease-in-out infinite; }
@keyframes adem { 50% { opacity: .75; } }

/* ---------- Liedweergave ---------- */

.lied-kop { margin: 1.5rem 0 1.75rem; }
.lied-kop h1 { font-size: calc(var(--lied-grootte) * 1.5); margin-bottom: .15em; }
.lied-kop .lied-meta { font-family: var(--font-ui); font-size: .85rem; color: var(--stone); }

.lied {
  font-size: var(--lied-grootte);
  line-height: 1.75;
}
.sectie { margin-bottom: 1.6em; }
.sectie--chorus { padding-left: 1em; border-left: 3px solid var(--amber-soft); }
.sectie--bridge { padding-left: 1em; border-left: 3px solid var(--line); }
.sectie-label {
  font-family: var(--font-ui);
  font-size: .7em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: .5em;
}
.lied-regel { min-height: 1em; }
.lied-wit { height: 1em; }
.lied-opmerking { font-family: var(--font-ui); font-size: .8em; font-style: italic; color: var(--stone); margin: .3em 0; }

/* Akkoorden boven de tekst: elke [akkoord]tekst-eenheid is een inline-block paar. */
.lied-regel--akkoorden { margin-bottom: .35em; }
.paar { display: inline-block; vertical-align: bottom; white-space: pre-wrap; }
.akkoord {
  display: block;
  font-family: var(--font-ui);
  font-size: .72em;
  font-weight: 700;
  color: var(--amber-deep);
  min-height: 1.2em;
  line-height: 1.2;
}
.tekst { display: block; }

.lied-voettekst {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: .75rem;
  color: var(--stone);
}

/* Liedwissel: adempauze, dan binnenvloeien. */
.wissel-uit { animation: wissel-uit 280ms var(--ease) forwards; }
.wissel-in { animation: wissel-in 420ms var(--ease); }
@keyframes wissel-uit { to { opacity: 0; transform: translateY(-10px); } }
@keyframes wissel-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  .wissel-uit, .wissel-in { animation: none; }
  .chip--live { animation: none; }
}

/* ---------- Volg-balk en instellingen ---------- */

.werkbalk {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  padding: .6rem 0;
  font-family: var(--font-ui);
}
.werkbalk .ruimte { flex: 1; }

.terug-naar-live {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(6rem);
  transition: transform var(--dur) var(--ease);
  z-index: 20;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.terug-naar-live.zichtbaar { transform: translateX(-50%) translateY(0); }

.paneel {
  position: fixed;
  inset: auto 0 0 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.25rem 1.25rem 2rem;
  transform: translateY(105%);
  transition: transform var(--dur) var(--ease);
  z-index: 30;
  font-family: var(--font-ui);
  max-width: 44rem;
  margin: 0 auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,.15);
}
.paneel.open { transform: translateY(0); }
.paneel-rij { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.paneel-rij > span { font-weight: 600; }
.stapper { display: flex; align-items: center; gap: .25rem; }
.stapper output { min-width: 3.5rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stapper .knop { padding: .4rem .9rem; font-size: 1.1rem; }

/* ---------- Voorzanger ---------- */

.leiden-hoofdknop {
  width: 100%;
  font-size: 1.6rem;
  padding: 2.2rem 1rem;
  margin: .5rem 0;
}
.leiden-rij { display: flex; gap: .5rem; }
.leiden-rij .knop { flex: 1; padding: 1.2rem .5rem; font-size: 1.05rem; }
.setlijst { list-style: none; margin: 1rem 0; padding: 0; font-family: var(--font-ui); }
.setlijst li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .8rem;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
}
.setlijst li:hover { background: var(--card); border-color: var(--line); }
.setlijst li.actief { background: var(--amber-soft); border-color: var(--amber); font-weight: 700; }
.setlijst .nr { color: var(--stone); font-variant-numeric: tabular-nums; min-width: 1.6rem; }
.setlijst .noot { margin-left: auto; font-size: .8rem; color: var(--stone); font-style: italic; }

.vergrendel-scherm {
  position: fixed; inset: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; font-family: var(--font-ui);
}
.vergrendel-scherm[hidden] { display: none; }

/* ---------- Beheer ---------- */

.tabbladen { display: flex; gap: .25rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; font-family: var(--font-ui); border-bottom: 1px solid var(--line); }
.tabbladen button {
  font: inherit; font-weight: 600; color: var(--stone);
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: .6rem .9rem; cursor: pointer;
}
.tabbladen button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--amber); }

.tabel { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: .95rem; }
.tabel th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--stone); padding: .5rem .6rem; }
.tabel td { padding: .55rem .6rem; border-top: 1px solid var(--line); }
.tabel tr:hover td { background: color-mix(in srgb, var(--amber-soft) 40%, transparent); }
.tabel .acties { text-align: right; white-space: nowrap; }

.sleep-item { cursor: grab; }
.sleep-item.sleept { opacity: .4; }

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: 1.5rem;
  max-width: 40rem;
  width: calc(100vw - 2rem);
}
dialog::backdrop { background: rgba(20, 22, 28, .5); }

/* ---------- Publiekspagina ---------- */

.publiek-kop {
  text-align: center;
  font-family: var(--font-ui);
  padding: 1.25rem 0 .5rem;
}
.publiek-kop .merk { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .02em; }
.publiek-lied { text-align: center; padding: 1rem 0 2rem; }
.publiek-lied h1 { font-size: 1.9rem; }
.publiek-lied .lied { text-align: center; }
.publiek-voetnoot {
  text-align: center; font-family: var(--font-ui); font-size: .8rem; color: var(--stone);
  padding: 2rem 1rem 3rem; border-top: 1px solid var(--line);
}
.publiek-voetnoot a { display: inline-block; margin: .25rem .6rem; }

.stedenlijst { list-style: none; padding: 0; font-family: var(--font-ui); }
.stedenlijst li { margin-bottom: .5rem; }
.stedenlijst a {
  display: flex; align-items: center; gap: .75rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; color: var(--ink); font-weight: 600;
}
.stedenlijst a:hover { border-color: var(--amber); text-decoration: none; }
.stedenlijst .chip { margin-left: auto; }

.rustig { color: var(--stone); font-family: var(--font-ui); font-size: .9rem; }
.gecentreerd { text-align: center; }
.verborgen { display: none !important; }

@media (min-width: 700px) {
  body { font-size: 18px; }
  .leiden-hoofdknop { font-size: 1.8rem; }
}
