/* Help-modal — issue #260
   Stijl-aanpak: pure CSS, gebruikt bestaande --bureau-* variabelen uit bureau.css.
   Geen Tailwind / geen extra dependencies. */

/* ---------- topbar-knop ---------- */
.help-trigger {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--bureau-wit);
  width: 28px;
  height: 28px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  line-height: 1;
  transition: background 0.15s;
}
.help-trigger:hover, .help-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

/* ---------- modal ---------- */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 20px;
}
.help-modal[hidden] {
  display: none !important;
}
.help-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}
.help-modal__panel {
  position: relative;
  background: var(--bureau-wit);
  border-radius: var(--bureau-radius-lg, 10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: min(1100px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.help-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bureau-blauw-700);
  color: var(--bureau-wit);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.help-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.help-modal__close {
  background: transparent;
  border: 0;
  color: var(--bureau-wit);
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  cursor: pointer;
  line-height: 1;
}
.help-modal__close:hover,
.help-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: 2px solid rgba(255, 255, 255, 0.4);
}
.help-modal__body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.help-modal__toc {
  border-right: 1px solid var(--bureau-grijs-300);
  background: var(--bureau-blauw-050, #f7f9fc);
  overflow-y: auto;
  padding: 16px 0;
  font-size: 13px;
}
.help-modal__toc h3 {
  margin: 16px 16px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--bureau-grijs-700, #475569);
}
.help-modal__toc h3:first-child {
  margin-top: 4px;
}
.help-modal__toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.help-modal__toc a {
  display: block;
  padding: 6px 16px;
  color: var(--bureau-blauw-700);
  text-decoration: none;
  border-left: 3px solid transparent;
  line-height: 1.4;
}
.help-modal__toc a:hover,
.help-modal__toc a:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  outline: none;
}
.help-modal__toc a[aria-current="page"] {
  background: rgba(0, 0, 0, 0.06);
  border-left-color: var(--bureau-blauw-500);
  font-weight: 600;
}
.help-modal__toc a.help-modal__toc-context::after {
  content: " ★";
  color: var(--bureau-blauw-500);
}
.help-modal__content {
  overflow-y: auto;
  padding: 24px 32px;
  font-size: 15px;
  line-height: 1.6;
  color: #0f172a;
}
.help-modal__content:focus {
  outline: none;
}
.help-modal__content h1 {
  font-size: 22px;
  margin: 0 0 16px;
  color: var(--bureau-blauw-700);
}
.help-modal__content h2 {
  font-size: 18px;
  margin: 28px 0 10px;
  color: var(--bureau-blauw-700);
}
.help-modal__content h3 {
  font-size: 15px;
  margin: 20px 0 6px;
}
.help-modal__content p {
  margin: 0 0 12px;
}
.help-modal__content ul, .help-modal__content ol {
  margin: 0 0 14px;
  padding-left: 24px;
}
.help-modal__content li {
  margin-bottom: 4px;
}
.help-modal__content table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0 18px;
  font-size: 14px;
}
.help-modal__content th, .help-modal__content td {
  border: 1px solid var(--bureau-grijs-300);
  padding: 6px 10px;
  text-align: left;
}
.help-modal__content th {
  background: var(--bureau-blauw-050, #f7f9fc);
}
.help-modal__content code {
  background: var(--bureau-grijs-100, #f1f5f9);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 90%;
}
.help-modal__content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.45;
}
.help-modal__content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}
.help-modal__content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--bureau-grijs-300);
  margin: 8px 0;
}
.help-modal__content a {
  color: var(--bureau-blauw-500);
}
.help-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  font-size: 12px;
  color: var(--bureau-grijs-500, #64748b);
  background: var(--bureau-grijs-100, #f1f5f9);
  border-top: 1px solid var(--bureau-grijs-300);
}
.help-modal__deeplink {
  color: var(--bureau-blauw-500);
  text-decoration: none;
  font-weight: 600;
}
.help-modal__deeplink:hover {
  text-decoration: underline;
}

/* Mobiel: stack TOC bovenop content */
@media (max-width: 720px) {
  .help-modal { padding: 0; }
  .help-modal__panel { max-height: 100vh; height: 100vh; border-radius: 0; }
  .help-modal__body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .help-modal__toc {
    border-right: 0;
    border-bottom: 1px solid var(--bureau-grijs-300);
    max-height: 40vh;
  }
}

/* ---------- fallback-pagina ---------- */
.help-fallback__layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}
.help-fallback__toc h3 {
  margin: 16px 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--bureau-grijs-700, #475569);
}
.help-fallback__toc ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.help-fallback__toc a {
  display: block;
  padding: 4px 8px;
  text-decoration: none;
  color: var(--bureau-blauw-700);
  border-radius: 4px;
}
.help-fallback__toc a:hover {
  background: var(--bureau-grijs-100, #f1f5f9);
}
.help-fallback__toc a[aria-current="page"] {
  background: var(--bureau-blauw-050, #f7f9fc);
  font-weight: 600;
}
@media (max-width: 720px) {
  .help-fallback__layout { grid-template-columns: 1fr; }
}
