/* UX fase 2 (20/10/2026): navigatie en zoeken (assets/js/navigatie.js). Alles hier hangt aan body.ux-nav of
   aan elementen die navigatie.js alleen met UX_NAV maakt: zonder de schakelaar verandert er niets.
   Beweging: vensters vervagen met een kleine schaal (160 ms), het blad Meer schuift van onder (200 ms), dicht
   in 140 ms; met prefers-reduced-motion niets. */

/* ---- het menu per rol in de zijbalk ---- */
body.ux-nav #navalert { display: none; }          /* Meldingen staat nu als regel bovenaan het menu */
.ux-menu .ux-zoekbalk { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; margin: 0 0 12px; padding: 0 12px;
  border: 1px solid rgba(251, 248, 234, .16); border-radius: var(--r-s); background: rgba(251, 248, 234, .06);
  color: var(--on-chrome-2); font: inherit; font-size:var(--t-ml); text-align: left; cursor: pointer; }
.ux-menu .ux-zoekbalk:hover, .ux-menu .ux-zoekbalk:focus-visible { border-color: rgba(212, 175, 55, .6); color: var(--on-chrome); }
.ux-menu .ux-zoekbalk svg.ic { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ux-menu .ux-zoekbalk span { flex: 1; }
.ux-menu .ux-zoekbalk kbd, .ux-palet kbd { font-family: inherit; font-weight: 600; font-size:var(--t-xs); line-height: 1; padding: 3px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .75; }
@media (hover: none) { .ux-menu .ux-zoekbalk kbd { display: none; } }
.ux-menu a .na-n, .ux-sheet-lijst a .na-n { margin-left: auto; }
.ux-menu a .na-n[hidden] { display: none; }
.ux-menu a .ux-naam { overflow: hidden; text-overflow: ellipsis; }
.ux-menu details.ux-meer { margin: 0; }
.ux-menu details.ux-meer > summary { list-style: none; display: flex; align-items: center; cursor: pointer; border-radius: var(--r-s);
  min-height: 30px; padding-right: 8px; }
.ux-menu details.ux-meer > summary::-webkit-details-marker { display: none; }
.ux-menu details.ux-meer > summary::after { content: "›"; margin-left: auto; font-size:var(--t-l); letter-spacing: 0;
  transition: transform .16s var(--f2-ease); }
.ux-menu details.ux-meer[open] > summary::after { transform: rotate(90deg); }
.ux-menu details.ux-meer > summary:hover { color: var(--brand-2); }
@media (pointer: coarse) { .ux-menu details.ux-meer > summary { min-height: 44px; } .ux-menu .ux-zoekbalk { min-height: 46px; } }

/* de zoekknop in de kopband (gsm: links van de zwevende knop; pc: rechts) */
.ux-zoekknop { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); width: 44px; height: 44px; min-height: 0; padding: 0;
  display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid rgba(212, 175, 55, .45); background: transparent;
  color: var(--brand); cursor: pointer; }
.ux-zoekknop:hover, .ux-zoekknop:focus-visible { background: rgba(251, 248, 234, .1); }
.ux-zoekknop svg.ic { width: 22px; height: 22px; fill: currentColor; }
.ux-zoekknop[hidden] { display: none; }
@media (max-width: 760px) { .ux-zoekknop { right: calc(62px + env(safe-area-inset-right)); } body:not(.zweef-aan) .ux-zoekknop { right: 10px; } }
@media print { .ux-zoekknop, .ux-balk { display: none !important; } }

/* ---- de vensters: zoeken, Meer, aanpassen ---- */
.ux-venster { padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-l); background: var(--surface); color: var(--text-strong);
  box-shadow: var(--shadow-pop); max-width: calc(100vw - 24px); }
.ux-venster::backdrop { background: color-mix(in srgb, var(--p-inkt) 45%, transparent); }
.ux-venster[open] { animation: ux-in .16s var(--f2-ease); }
.ux-venster[open]::backdrop { animation: ux-scrim .16s ease-out; }
.ux-venster.ux-dicht { animation: ux-uit .14s ease-in forwards; }
@keyframes ux-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
@keyframes ux-uit { to { opacity: 0; transform: translateY(-4px) scale(.99); } }
@keyframes ux-scrim { from { opacity: 0; } }
.ux-venster h2 { font-family: var(--f2-serif); font-size:var(--t-xl); margin: 0; }

/* zoeken (Ctrl+K) */
.ux-palet { width: min(640px, calc(100vw - 24px)); margin-top: 12vh; }
.ux-p-veld { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.ux-p-veld > svg.ic { width: 22px; height: 22px; fill: var(--text-3); flex: none; }
.ux-p-veld input { flex: 1; min-width: 0; height: 56px; border: 0; background: transparent; font-family: inherit; font-weight: 500; font-size:var(--t-l); color: var(--text-strong);
  outline: none; box-shadow: none; padding: 0; }
.ux-p-veld input::-webkit-search-cancel-button { display: none; }
.ux-palet .ux-p-veld input, .ux-palet .ux-p-veld input:focus, .ux-palet .ux-p-veld input:focus-visible { border: 0; outline: none; box-shadow: none !important; background: transparent; border-radius: 0; }
/* (de algemene focusring van theo-fase2.css staat met !important; hier toont de lijn onder het veld de focus) */
.ux-palet .ux-p-veld:focus-within { box-shadow: inset 0 -2px 0 var(--brand); }
.ux-p-sluit { min-height: 32px; padding: 2px 10px; font-size:var(--t-s); border-radius: 6px; }
.ux-p-lijst { max-height: min(56vh, 520px); overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.ux-p-groep { font-size:var(--t-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
.ux-p-optie { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px; border-radius: var(--r-s); cursor: pointer; }
.ux-p-optie > svg.ic { width: 20px; height: 20px; fill: var(--text-2); flex: none; }
.ux-p-optie.ux-p-orakel > svg.ic { fill: none; color: var(--brand-ink); }
.ux-p-wat { flex: 1; min-width: 0; }
.ux-p-wat > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-p-wat small { display: block; color: var(--text-3); font-size:var(--t-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-p-optie mark { background: none; color: var(--brand-ink); font-weight: 800; }
.ux-p-optie[aria-selected="true"] { background: var(--surface-3); }
.ux-p-optie[aria-selected="true"]::after { content: "↵"; color: var(--text-3); font-size:var(--t-m); }
.ux-p-leeg { padding: 18px 12px; color: var(--text-3); }
.ux-p-voet { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); font-size:var(--t-xs); color: var(--text-3); }
@media (hover: none) { .ux-p-voet { display: none; } }
@media (max-width: 600px) {
  .ux-palet { margin: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .ux-palet[open] { display: flex; flex-direction: column; }
  .ux-p-veld { padding-top: env(safe-area-inset-top); }
  .ux-p-lijst { flex: 1; max-height: none; }
}

/* Meer: een blad van onder (gsm), het hele menu */
.ux-sheet { width: min(560px, 100vw); max-width: 100vw; max-height: 88dvh; margin: auto auto 0; border-radius: 22px 22px 0 0; border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom); }
.ux-sheet[open] { display: flex; flex-direction: column; animation: ux-op .2s var(--f2-ease); }
.ux-sheet.ux-dicht { animation: ux-neer .14s ease-in forwards; }
@keyframes ux-op { from { transform: translateY(100%); } }
@keyframes ux-neer { to { transform: translateY(100%); } }
.ux-sheet-kop { position: relative; display: flex; align-items: center; gap: 8px; padding: 18px 12px 8px 18px; }
.ux-sheet-kop h2 { flex: 1; }
.ux-greep { position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-strong); }
.ux-sheet-kop button { min-height: 44px; }
.ux-sheet-kop .ux-sluit { width: 44px; padding: 0; display: inline-grid; place-items: center; }
.ux-sheet-kop button svg.ic { width: 20px; height: 20px; fill: currentColor; }
.ux-sheet-lijst { overflow-y: auto; padding: 0 12px 8px; overscroll-behavior: contain; }
.ux-sheet-lijst .ux-zoekbalk { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 4px 0 8px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); color: var(--text-2); font: inherit; text-align: left; }
.ux-sheet-lijst .ux-zoekbalk svg.ic { width: 20px; height: 20px; fill: currentColor; }
.ux-sheet-lijst .ux-zoekbalk span { flex: 1; }
.ux-sheet-lijst .ux-zoekbalk kbd { display: none; }
.ux-sheet-lijst .sec { margin: 14px 8px 2px; font-size:var(--t-xs); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); }
.ux-sheet-lijst a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: var(--r-s);
  color: var(--text-strong); text-decoration: none; font-weight: 500; }
.ux-sheet-lijst a svg.ic { width: 20px; height: 20px; fill: var(--text-2); flex: none; }
.ux-sheet-lijst a.active { background: var(--brand); font-weight: 700; }
.ux-sheet-lijst a:active { background: var(--surface-3); }
.ux-sheet-lijst a .na-n[hidden] { display: none; }
.ux-sheet-lijst details.ux-meer > summary { list-style: none; display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.ux-sheet-lijst details.ux-meer > summary::-webkit-details-marker { display: none; }
.ux-sheet-lijst details.ux-meer > summary::after { content: "›"; margin-left: auto; font-size:var(--t-xl); letter-spacing: 0; transition: transform .16s var(--f2-ease); }
.ux-sheet-lijst details.ux-meer[open] > summary::after { transform: rotate(90deg); }
.ux-sheet-voet { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 18px 14px; border-top: 1px solid var(--line); font-size:var(--t-m); }
.ux-sheet-voet a { color: var(--text-2); min-height: 44px; display: inline-flex; align-items: center; }
.ux-sheet-voet .ux-uitlog { margin-left: auto; min-height: 44px; }
.ux-sheet-voet .ux-uitlog svg.ic { width: 18px; height: 18px; fill: currentColor; }

/* de onderbalk aanpassen: kies vier schermen */
.ux-aanpassen-venster { width: min(520px, calc(100vw - 24px)); max-height: min(86dvh, 760px); }
.ux-aanpassen-venster[open] { display: flex; flex-direction: column; }
.ux-a-kop { padding: 18px 20px 6px; }
.ux-a-kop p { margin: 6px 0 0; color: var(--text-2); font-size:var(--t-ml); }
.ux-a-lijst { overflow-y: auto; padding: 4px 12px; overscroll-behavior: contain; }
.ux-a-groep { font-size:var(--t-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 10px 8px 2px; }
.ux-a-keuze { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 10px; margin: 2px 0; border: 1px solid transparent;
  border-radius: var(--r-s); background: transparent; color: var(--text-strong); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.ux-a-keuze svg.ic { width: 20px; height: 20px; fill: var(--text-2); flex: none; }
.ux-a-keuze span:first-of-type { flex: 1; }
.ux-a-keuze:hover { background: var(--surface-3); }
.ux-a-keuze[aria-pressed="true"] { background: var(--surface-3); border-color: var(--brand); font-weight: 700; }
.ux-a-n { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size:var(--t-m);
  border: 1px dashed var(--line-strong); color: transparent; font-variant-numeric: tabular-nums; }
.ux-a-keuze[aria-pressed="true"] .ux-a-n { background: var(--brand); border: 0; color: var(--p-inkt); }
.ux-a-tel { margin: 6px 20px 0; }
.ux-a-knoppen { display: flex; align-items: center; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); margin-top: 8px; }
.ux-a-knoppen .spacer { flex: 1; }
.ux-a-knoppen button { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .ux-venster[open], .ux-venster[open]::backdrop, .ux-venster.ux-dicht, .ux-sheet[open], .ux-sheet.ux-dicht { animation: none !important; }
  .ux-menu details.ux-meer > summary::after, .ux-sheet-lijst details.ux-meer > summary::after { transition: none; }
}
