/* Regels op maat — layout en schermonderdelen. Tokens en bouwstenen komen uit stijl.css. */

html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Kop ──────────────────────────────────────────────── */
.kop {
  flex: none; display: flex; align-items: center; gap: 24px;
  min-height: 56px; padding-block: 8px; padding-inline: 24px;
  border-bottom: 1px solid var(--lijn); background: var(--grond);
}
.kop-nav { margin-left: auto; display: flex; gap: 4px; }
.kop-nav a { text-decoration: none; color: var(--inkt-2); font-size: 14px; padding: 6px 10px; border-radius: 3px; }
.kop-nav a:hover { background: var(--grond-2); color: var(--inkt); }

/* ── Contextbalk ──────────────────────────────────────── */
.context {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-block: 7px; padding-inline: 24px; border-bottom: 1px solid var(--lijn); font-size: 13.5px;
}
.context[hidden] { display: none; }
.context-pil {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  padding: 3px 4px 3px 10px; background: var(--blad); box-shadow: var(--blad-schaduw); border-radius: 3px;
}
.context-pil b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pil-knop { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; color: var(--inkt-3); border-radius: 3px; cursor: pointer; }
.pil-knop:hover { background: var(--grond); color: var(--inkt); }
.weergave { margin-left: auto; display: inline-flex; border-bottom: 1px solid var(--lijn); }
.weergave-knop { border: 0; background: none; padding: 5px 10px; color: var(--inkt-2); cursor: pointer; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.weergave-knop[aria-pressed="true"] { color: var(--inkt); font-weight: 700; border-bottom-color: var(--inkt); }

/* ── Werkvlak: lijst links, kaart rechts ──────────────── */
.werkvlak { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); }
.lijst { overflow-y: auto; padding-block: 18px 0; padding-inline: 20px; display: flex; flex-direction: column; gap: 14px; outline: none; }
.kaartvlak { position: relative; border-left: 1px solid var(--lijn); min-height: 0; }
.kaart { position: absolute; inset: 0; background: oklch(97% 0.006 90); }

@media (max-width: 900px) {
  body { display: block; }
  .werkvlak { grid-template-columns: 1fr; }
  .kaartvlak { order: -1; height: 46vh; border-left: 0; border-bottom: 1px solid var(--lijn); }
  .lijst { overflow: visible; padding-inline: 16px; }
  .kop, .context { padding-inline: 16px; }
  .merk-sub { display: none; }
  .merk-tekst strong { white-space: nowrap; }
  .kop { gap: 12px; }
  .weergave { margin-left: 0; }
}

/* ── Zoeken ───────────────────────────────────────────── */
.zoek { position: relative; display: flex; flex-direction: column; gap: 8px; }
.start h1 { margin: 6px 0 6px; font-size: 22px; line-height: 1.25; }
.start p { margin: 0 0 6px; max-width: 60ch; }
.zoekveld { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 3px; color: var(--inkt-3); }
.zoekveld:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.zoekveld input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15.5px; color: var(--inkt); padding: 10px 0; }
.zoekveld input::placeholder { color: var(--inkt-3); }
.suggesties { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin: 4px 0 0; padding: 4px 0; list-style: none; box-shadow: var(--paneel-schaduw); }
.suggesties[hidden] { display: none; }
.suggesties li { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; cursor: pointer; }
.suggesties li[aria-selected="true"], .suggesties li:hover { background: var(--acc-zacht); }
.suggesties .tag { flex: none; }
.suggesties .sug-leeg { color: var(--inkt-3); cursor: default; }
.suggesties .sug-leeg:hover { background: none; }
.voorbeeld { margin: 0; font-size: 13px; }
.heeft-locatie .start, .heeft-locatie .voorbeeld { display: none; }

/* ── Resultaat ────────────────────────────────────────── */
.res-kop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.res-kop h1 { margin: 0; font-size: 20px; }
.groep { display: flex; flex-direction: column; gap: 8px; }
.groep > h2 { margin: 10px 0 0; }
.groep-uitleg { margin: -2px 0 2px; font-size: 13px; color: var(--inkt-3); }

.doc { display: flex; flex-direction: column; }
.doc.open { border-top: 3px solid var(--acc); }
.doc-kop {
  display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left;
  padding: 13px 18px 12px; border: 0; background: none; cursor: pointer; color: inherit;
}
.doc-kop:hover .doc-titel { color: var(--acc); }
.doc-titelrij { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.doc-titel { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.28; }
.doc-chevron { color: var(--inkt-3); margin-top: 3px; transition: transform .15s; }
.doc.open .doc-chevron { transform: rotate(180deg); }
.doc-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--inkt-2); }
.doc-meta .mono { font-size: 11.5px; color: var(--inkt-3); }
.doc-chips { min-height: 22px; }
.doc.open .doc-chips { display: none; }   /* in de body staan ze als filter */
.doc-body { border-top: 1px solid var(--lijn-2); padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.doc-body[hidden] { display: none; }
.filter { display: flex; flex-direction: column; gap: 6px; }
.filter-uitleg { font-size: 12.5px; color: var(--inkt-3); }

/* Structuur van het document */
.sectie { display: flex; flex-direction: column; }
.sectie > .sectie-kop { margin: 10px 0 2px; }
.sectie .sectie { padding-left: 12px; }
.sectie .sectie > .sectie-kop { margin-top: 6px; }
details.sectie > summary { cursor: pointer; list-style-position: outside; }
.sectie-kop .label { font-size: 10.5px; }
.sectie-titel { font-family: var(--serif); font-size: 14.5px; color: var(--inkt-2); }

.art { border-top: 1px solid var(--lijn-2); }
.art-kop {
  display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer; padding: 7px 0; color: inherit;
}
.art-kop:hover .art-titel { color: var(--acc); }
.art-pijl { color: var(--inkt-3); margin-top: 4px; transition: transform .12s; flex: none; }
.art.open .art-pijl { transform: rotate(90deg); }
.art-dot { width: 8px; height: 8px; border-radius: 2px; margin-top: 7px; flex: none; background: transparent; border: 1px dashed var(--lijn); }
.art-titel { flex: 1; font-family: var(--serif); font-size: 15.5px; line-height: 1.4; }
.art-titel .art-nr { font-weight: 600; }
.art-onderwerp { font-size: 11.5px; color: var(--inkt-3); white-space: nowrap; margin-top: 3px; }
.art.open .art-titel { font-weight: 600; }
.art-inhoud { padding: 2px 0 12px 22px; display: flex; flex-direction: column; gap: 6px; }
.art-inhoud[hidden] { display: none; }
.lid { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px; }
.lid-nr { font: 500 12px/1 var(--mono); color: var(--inkt-3); padding-top: 6px; }
.lid ocd-regeltekst, .lid .platte-tekst { font-family: var(--serif); font-size: 16px; line-height: 1.6; color: var(--inkt); }
.platte-tekst p { margin: 0 0 .6em; }
.art-voet { font-size: 12.5px; }

.meer { align-self: flex-start; }
.laden { color: var(--inkt-3); font-style: italic; padding: 6px 0; }
.fout { color: var(--no); background: var(--no-bg); padding: 8px 12px; border-radius: 3px; font-size: 13.5px; }

.voet { margin-top: auto; padding-block: 18px 22px; border-top: 1px solid var(--lijn); font-size: 12.5px; }
.voet p { margin: 0 0 8px; max-width: 72ch; }

/* ── Kaart ────────────────────────────────────────────── */
.kaartknoppen { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.kk-groep { display: flex; flex-direction: column; gap: 1px; }
.kk {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: var(--blad); border: 0; box-shadow: var(--blad-schaduw); border-radius: 3px; color: var(--inkt-2); font-size: 18px;
}
.kk:hover { color: var(--inkt); }
.kk:disabled { opacity: .45; cursor: default; }
.kaart-legenda { position: absolute; left: 14px; bottom: 30px; z-index: 5; display: flex; flex-direction: column; gap: 5px; padding: 9px 12px; font-size: 12.5px; }
.kaart-legenda[hidden] { display: none; }
.kaart-legenda > span { display: flex; gap: 8px; align-items: center; }
.kaart-legenda i { width: 14px; height: 14px; display: block; flex: none; }
.lg-perceel { border: 2px solid var(--acc); background: color-mix(in oklch, var(--acc) 14%, transparent); }
.lg-punt { border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 2px var(--blad); transform: scale(.7); }
.kaart-bron { position: absolute; right: 0; bottom: 0; z-index: 5; font-size: 11px; padding: 2px 8px; background: color-mix(in oklch, var(--blad) 85%, transparent); color: var(--inkt-3); }
.kaart-bron a { color: inherit; }
.ol-viewport { cursor: crosshair; }
.ol-zoom, .ol-rotate, .ol-attribution { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kaart .onderkaart canvas { filter: invert(.9) hue-rotate(180deg) brightness(.95) contrast(.9); }
}

/* Aanvullende regels (voorbescherming) binnen het document waar ze bij horen */
.tag-aanvullend { color: var(--at); border-color: color-mix(in oklch, var(--at) 40%, var(--lijn)); text-transform: none; font-family: var(--sans); font-size: 11.5px; }
.deel { display: flex; flex-direction: column; }
.deel + .deel { margin-top: 14px; }
.deel-kop { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin: 4px 0 2px; background: var(--grond); border-radius: 3px; }
.deel-aanvullend > .deel-kop { background: var(--at-bg); }
.deel-aanvullend > .deel-kop .label { color: var(--at); }
.deel-titel { font-family: var(--serif); font-size: 15.5px; font-weight: 600; color: var(--inkt); text-decoration: none; }
.deel-titel:hover { color: var(--acc); text-decoration: underline; }
.deel-uitleg { font-size: 12.5px; color: var(--inkt-2); }
