/* Boekenplank — donkergroene wand, houten planken, boekruggen als tabbladen */

:root {
  --wand: #1c2926;
  --wand-2: #253632;
  --lijn: #3a4f49;
  --tekst: #e9eeea;
  --dempt: #a3b5ad;
  --hout-licht: #b98a56;
  --hout: #8f6238;
  --hout-donker: #5f3d21;
  --messing: #e0ad4f;
  --gevaar: #f0a08a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--wand);
  color: var(--tekst);
  font: 16px/1.55 var(--sans);
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--messing);
  outline-offset: 2px;
}
h1 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; line-height: 1.2; margin: 0; }
.dempt { color: var(--dempt); }
.verborgen { position: absolute; left: -9999px; }

/* ---------- Kop: boekruggen op een plank ---------- */

.kop {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 2rem;
  padding: 1rem 1.5rem 0;
  margin-bottom: 12px;
  background: var(--wand-2);
}
.kop::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -12px;
  height: 12px;
  background: linear-gradient(var(--hout-licht), var(--hout) 55%, var(--hout-donker));
  box-shadow: 0 6px 12px rgba(0, 0, 0, .4);
}
.merk {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  text-decoration: none;
  padding-bottom: .7rem;
}
.planken {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
}
.rug {
  display: block;
  min-width: 5.5rem;
  padding: .75rem 1.1rem .5rem;
  text-align: center;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.05rem;
  border-radius: 5px 5px 0 0;
  background: var(--rug, #6a3b2b);
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, .25), inset 0 3px 0 rgba(255, 255, 255, .08);
}
.rug:nth-child(4n+1) { --rug: #6a3b2b; }
.rug:nth-child(4n+2) { --rug: #2f4f63; }
.rug:nth-child(4n+3) { --rug: #5d3345; }
.rug:nth-child(4n+4) { --rug: #4b5c2e; }
.rug:hover { transform: translateY(-3px); }
.rug.actief {
  padding-top: 1.3rem;
  box-shadow: inset 0 4px 0 var(--messing), inset -3px 0 0 rgba(0, 0, 0, .25);
}
.gebruiker {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  padding-bottom: .7rem;
  font-size: .95rem;
  color: var(--dempt);
}
.gebruiker a:hover { color: var(--tekst); }

/* ---------- Subbalk ---------- */

.subbalk {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}
.subnav { display: flex; gap: 1.4rem; }
.subnav a {
  text-decoration: none;
  color: var(--dempt);
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--tekst); }
.subnav a[aria-current="page"] { color: var(--tekst); border-bottom-color: var(--messing); }
.zoek { display: flex; gap: .5rem; flex: 1 1 22rem; max-width: 32rem; }
.zoek input { flex: 1; }

/* ---------- Formulierelementen ---------- */

input, select {
  font: inherit;
  color: var(--tekst);
  background: var(--wand-2);
  border: 1px solid var(--lijn);
  border-radius: 4px;
  padding: .5rem .7rem;
}
input::placeholder { color: var(--dempt); }
.knop {
  display: inline-block;
  font: inherit;
  color: var(--tekst);
  background: transparent;
  border: 1px solid var(--lijn);
  border-radius: 4px;
  padding: .5rem 1rem;
  text-decoration: none;
  cursor: pointer;
}
.knop:hover { background: var(--wand-2); }
.knop.primair { background: var(--messing); border-color: var(--messing); color: #2a1d08; font-weight: 600; }
.knop.primair:hover { background: #ecc073; }
.knop.gevaar { color: var(--gevaar); border-color: #6b3c33; }
.knop small { opacity: .75; margin-left: .35rem; font-size: .8em; font-weight: 400; }

/* ---------- Pagina ---------- */

main { max-width: 1240px; margin: 0 auto; padding: 1.5rem; }
.melding {
  padding: .7rem 1rem;
  margin-bottom: 1rem;
  background: var(--wand-2);
  border-left: 4px solid var(--messing);
}
.melding.success { border-left-color: #7fc99a; }

.werkbalk {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.werkbalk p { margin: .2rem 0 0; }
.sorteer { display: flex; align-items: center; gap: .6rem; color: var(--dempt); }

.labels { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.labels a, .labels li > span {
  display: inline-block;
  border: 1px solid var(--lijn);
  border-radius: 999px;
  padding: .15rem .8rem;
  font-size: .9rem;
  text-decoration: none;
}
.labels a:hover { background: var(--wand-2); }
.filters li { display: flex; gap: .4rem; align-items: center; }
.filters li > span { background: var(--wand-2); }
.filters li > a { border: 0; padding: 0; color: var(--dempt); text-decoration: underline; }

/* ---------- Plank met boeken ---------- */

.plank {
  height: 12px;
  margin: 0 -.75rem;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 11px),
    linear-gradient(var(--hout-licht), var(--hout) 55%, var(--hout-donker));
  box-shadow: 0 6px 10px rgba(0, 0, 0, .35);
}
.plank-rij {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  column-gap: 0;
  row-gap: 2.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.boek { padding: 0 .75rem 1rem; min-width: 0; }
.kaft {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 250px;
  text-decoration: none;
}
.kaft img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 1px 3px 3px 1px;
  box-shadow: 3px 0 8px rgba(0, 0, 0, .5);
}
.geen-kaft {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78%;
  height: 88%;
  padding: .7rem;
  overflow: hidden;
  text-align: center;
  font-family: var(--serif);
  font-size: .95rem;
  background: linear-gradient(135deg, #3b5a52, #2a403a);
  border-radius: 1px 3px 3px 1px;
  box-shadow: inset 4px 0 0 rgba(0, 0, 0, .25), 3px 0 8px rgba(0, 0, 0, .5);
}
.titel {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: .8rem;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.titel:hover, .auteur a:hover { text-decoration: underline; }
.auteur {
  margin: .2rem 0 0;
  color: var(--dempt);
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auteur a { text-decoration: none; }

.paginas { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: center; margin-top: 2.5rem; }
.leeg { text-align: center; padding: 4rem 1rem; }
.leeg h1 { margin-bottom: 1rem; }

/* ---------- Boekdetail ---------- */

.detail {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 2.5rem;
  align-items: start;
}
.detail-kaft .plank { margin: 0 -1rem; }
.detail-kaft { padding: 0 1rem; }
.detail-kaft .kaft { height: auto; max-height: 520px; }
.detail-kaft .kaft a { display: flex; align-items: flex-end; justify-content: center; max-height: 520px; }
.detail-kaft .kaft img { max-height: 520px; }
.auteurregel { font-size: 1.15rem; margin: .4rem 0 1.4rem; color: var(--dempt); }
.auteurregel a { text-decoration: none; }
.auteurregel a:hover { text-decoration: underline; }
.downloads { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.8rem; }
.beschrijving { max-width: 65ch; font-family: var(--serif); font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.8rem; }
.beschrijving p { margin: 0 0 .9em; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.4rem; margin: 0 0 1.5rem; }
.meta dt { color: var(--dempt); }
.meta dd { margin: 0; }
.meta a { text-decoration-color: var(--dempt); }

/* ---------- Auteurs / series / labels ---------- */

.namenlijst { columns: 260px; column-gap: 2rem; list-style: none; margin: 0; padding: 0; }
.namenlijst li { break-inside: avoid; padding: .3rem 0; border-bottom: 1px solid var(--lijn); display: flex; justify-content: space-between; gap: 1rem; }
.namenlijst a { text-decoration: none; }
.namenlijst a:hover { text-decoration: underline; }
.namenlijst li[hidden] { display: none; }

/* ---------- Inloggen, registreren, gebruikers ---------- */

.formulier { max-width: 24rem; margin: 2rem auto; }
.formulier h1 { margin-bottom: 1.5rem; }
.formulier label { display: block; margin-bottom: 1rem; color: var(--dempt); }
.formulier input { display: block; width: 100%; margin-top: .3rem; color: var(--tekst); }
.formulier .knop { margin-top: .3rem; }

.tabel-wrap { overflow-x: auto; }
.tabel { width: 100%; border-collapse: collapse; }
.tabel th { text-align: left; color: var(--dempt); font-weight: 400; }
.tabel th, .tabel td { padding: .7rem .8rem; border-bottom: 1px solid var(--lijn); }
.tabel .acties { display: flex; gap: .5rem; justify-content: flex-end; }
.tabel .acties form { margin: 0; }

/* ---------- Kleine schermen ---------- */

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; gap: 1.5rem; }
  .detail-kaft { max-width: 280px; }
  .kop { padding: .8rem 1rem 0; gap: 0 1rem; }
  .gebruiker { order: 2; }
  .planken { order: 3; flex-basis: 100%; }
  main { padding: 1rem; }
  .plank-rij { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .kaft { height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .rug:hover { transform: none; }
}

/* ---------- Online lezer ---------- */

.lezer-pagina { height: 100%; }
html:has(.lezer-pagina) { height: 100%; }
.lezer-pagina[data-thema="licht"] { --wand: #f4f5f2; --wand-2: #e6e9e4; --lijn: #c5cbc4; --tekst: #1d2321; --dempt: #5b6863; color-scheme: light; }
.lezer-pagina { background: var(--wand); color: var(--tekst); }
#lezer { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.lezer-balk {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem; background: var(--wand-2); border-bottom: 1px solid var(--lijn);
}
.lezer-titel { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.lezer-titel strong, .lezer-titel span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lezer-titel strong { font-family: var(--serif); }
.lezer-titel span { font-size: .85rem; }
.lezer-knoppen { display: flex; gap: .4rem; }
.lezer-knoppen .knop { padding: .35rem .7rem; }
.lezer-hoofd { position: relative; flex: 1; display: flex; justify-content: space-between; min-height: 0; }
#viewer { flex: 1 1 auto; max-width: 46rem; min-width: 0; margin: 0 auto; padding: 1rem 0; }
.blader {
  flex: 0 0 3.5rem; border: 0; background: transparent; color: var(--dempt);
  font-size: 2.5rem; cursor: pointer;
}
.blader:hover { color: var(--tekst); background: var(--wand-2); }
#status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 2rem; text-align: center; color: var(--dempt); pointer-events: none; }
#status[hidden] { display: none; }
.lezer-inhoud {
  position: absolute; z-index: 2; top: 0; bottom: 0; left: 0; width: min(24rem, 90%);
  overflow-y: auto; padding: 1rem 1.2rem; background: var(--wand-2); border-right: 1px solid var(--lijn);
  box-shadow: 6px 0 16px rgba(0, 0, 0, .35);
}
.lezer-inhoud[hidden] { display: none; }
.lezer-inhoud h2 { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 .8rem; }
.lezer-inhoud ol { list-style: none; margin: 0; padding: 0; }
.lezer-inhoud a { display: block; padding: .35rem 0; text-decoration: none; border-bottom: 1px solid var(--lijn); }
.lezer-inhoud a:hover { text-decoration: underline; }
.lezer-voet { padding: .3rem 1rem; text-align: center; color: var(--dempt); font-size: .85rem; min-height: 1.9rem; }

@media (max-width: 720px) {
  .lezer-balk { flex-wrap: wrap; gap: .5rem; }
  .lezer-titel { flex-basis: calc(100% - 7.5rem); order: 1; }
  .lezer-knoppen { order: 3; flex-basis: 100%; }
  .blader { flex-basis: 1.8rem; font-size: 1.8rem; }
  #viewer { padding: .5rem 0; }
}
