/*
 * Leadpin Handleiding — gescoped CSS
 * Alle selectors zijn onder .lph-app om conflicten met het theme te voorkomen.
 */

.lph-app {
  --lph-blue: #1E6FB0;
  --lph-blue-dark: #154E7D;
  --lph-teal: #44B7A8;
  --lph-ink: #1a1f2b;
  --lph-muted: #6b7280;
  --lph-muted-light: #9ca3af;
  --lph-paper: #fdfdf9;
  --lph-paper-alt: #f6f5ef;
  --lph-line: #e5e4dc;
  --lph-tip-bg: #eff6ef;
  --lph-tip-border: #44B7A8;
  --lph-info-bg: #eff4fa;
  --lph-info-border: #1E6FB0;
  --lph-warn-bg: #fff4e0;
  --lph-warn-border: #d97706;
  --lph-error-bg: #fdecec;
  --lph-error-border: #dc2626;
  --lph-code-bg: #f3f2ec;
  --lph-hl: #fff3b8;
  --lph-sidebar-w: 280px;

  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--lph-ink);
  background: var(--lph-paper);
  border: 1px solid var(--lph-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 10px 30px rgba(0,0,0,0.03);
  display: grid;
  grid-template-columns: var(--lph-sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  height: var(--lph-height, 82vh);
  min-height: 600px;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
  margin: 24px 0;
}

/* Compact mode: sidebar als collapsible top-bar */
.lph-app.lph-mode-compact {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
}

.lph-app *,
.lph-app *::before,
.lph-app *::after {
  box-sizing: border-box;
}

/* ── Topbar ─────────────────────────────────────── */
.lph-topbar {
  grid-column: 1 / -1;
  background: rgba(253, 253, 249, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--lph-line);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.lph-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}
.lph-brand-icon {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}
.lph-brand-text {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--lph-blue);
  letter-spacing: -0.02em;
  line-height: 1;
}
.lph-brand-text span { color: var(--lph-teal); }
.lph-brand-sub {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  color: var(--lph-muted);
  font-weight: 400;
  margin-left: 6px;
}

.lph-searchbox {
  flex: 1;
  max-width: 460px;
  position: relative;
}
.lph-searchbox input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--lph-line);
  border-radius: 8px;
  background: var(--lph-paper-alt);
  color: var(--lph-ink);
  transition: all 0.15s ease;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
}
.lph-searchbox input:focus {
  outline: none;
  border-color: var(--lph-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 111, 176, 0.12);
}
.lph-searchbox svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lph-muted);
  pointer-events: none;
}
.lph-searchbox .lph-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--lph-muted);
  background: #fff;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--lph-line);
  pointer-events: none;
}

.lph-menu-toggle {
  display: none;
  background: var(--lph-paper-alt);
  border: 1px solid var(--lph-line);
  border-radius: 7px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.lph-menu-toggle svg { color: var(--lph-ink); }

/* ── Sidebar ───────────────────────────────────── */
.lph-sidebar {
  overflow-y: auto;
  padding: 22px 14px 30px 22px;
  border-right: 1px solid var(--lph-line);
  background: var(--lph-paper-alt);
  scrollbar-width: thin;
  scrollbar-color: var(--lph-line) transparent;
}
.lph-sidebar::-webkit-scrollbar { width: 6px; }
.lph-sidebar::-webkit-scrollbar-thumb { background: var(--lph-line); border-radius: 3px; }

.lph-sidebar h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--lph-muted);
  margin: 20px 0 8px 8px;
  padding: 0;
}
.lph-sidebar h4:first-child { margin-top: 0; }

.lph-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lph-sidebar li { margin: 0; padding: 0; }
.lph-sidebar a {
  display: block;
  padding: 6px 10px;
  margin: 1px 0;
  color: var(--lph-ink);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.4;
  border-radius: 5px;
  border-left: 2px solid transparent;
  transition: all 0.12s ease;
}
.lph-sidebar a:hover {
  background: rgba(30, 111, 176, 0.06);
  color: var(--lph-blue);
}
.lph-sidebar a.lph-active {
  background: rgba(30, 111, 176, 0.12);
  color: var(--lph-blue);
  border-left-color: var(--lph-blue);
  font-weight: 500;
}
.lph-sidebar .lph-num {
  display: inline-block;
  width: 22px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--lph-muted);
  margin-right: 4px;
}
.lph-sidebar a.lph-active .lph-num { color: var(--lph-blue); }

/* ── Main content ─────────────────────────────── */
.lph-main {
  overflow-y: auto;
  padding: 30px 44px 60px 44px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--lph-line) transparent;
}
.lph-main::-webkit-scrollbar { width: 8px; }
.lph-main::-webkit-scrollbar-thumb { background: var(--lph-line); border-radius: 4px; }

/* ── Hero ───────────────────────────────────────── */
.lph-hero {
  padding: 8px 0 40px 0;
  border-bottom: 1px solid var(--lph-line);
  margin-bottom: 32px;
}
.lph-hero-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--lph-teal);
  margin-bottom: 14px;
}
.lph-hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--lph-ink);
  margin: 0 0 16px 0;
  padding: 0;
}
.lph-hero h1 em {
  font-style: italic;
  color: var(--lph-blue);
  font-weight: 400;
}
.lph-hero p {
  font-size: 17px;
  color: var(--lph-muted);
  max-width: 580px;
  line-height: 1.5;
  margin: 0;
}
.lph-hero-meta {
  display: flex;
  gap: 20px;
  margin-top: 22px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--lph-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-wrap: wrap;
}
.lph-hero-meta span { display: flex; align-items: center; gap: 6px; }
.lph-hero-meta span::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--lph-teal);
  border-radius: 50%;
}

/* ── Typography ────────────────────────────────── */
.lph-app h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--lph-ink);
  margin: 56px 0 16px 0;
  padding-top: 16px;
  scroll-margin-top: 20px;
  position: relative;
}
.lph-app h2 .lph-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--lph-teal);
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lph-app h2:hover .lph-anchor { opacity: 1; }
.lph-anchor {
  position: absolute;
  left: -24px;
  top: 58%;
  transform: translateY(-30%);
  color: var(--lph-muted-light);
  text-decoration: none;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}
.lph-anchor:hover { color: var(--lph-blue); }
.lph-app h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  color: var(--lph-ink);
  margin: 32px 0 10px 0;
  padding: 0;
  scroll-margin-top: 20px;
}
.lph-app h4 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--lph-blue);
  margin: 24px 0 8px 0;
  padding: 0;
}
.lph-main p {
  margin: 0 0 12px 0;
  padding: 0;
}
.lph-main p.lph-lead {
  font-size: 17px;
  color: var(--lph-muted);
  line-height: 1.55;
}
.lph-main ul, .lph-main ol {
  margin: 0 0 14px 22px;
  padding: 0;
}
.lph-main li { margin-bottom: 4px; }
.lph-main a {
  color: var(--lph-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.lph-main a:hover { color: var(--lph-blue-dark); }
.lph-main strong {
  font-weight: 600;
  color: var(--lph-ink);
}

/* ── Steps ─────────────────────────────────────── */
.lph-steps {
  counter-reset: lph-step;
  margin: 18px 0 22px 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.lph-steps li {
  counter-increment: lph-step;
  padding: 12px 14px 12px 52px !important;
  margin: 0 0 8px 0 !important;
  background: var(--lph-paper-alt);
  border-radius: 7px;
  border-left: 3px solid var(--lph-blue);
  position: relative;
  list-style: none;
}
.lph-steps li::before {
  content: counter(lph-step);
  position: absolute;
  left: 14px;
  top: 11px;
  width: 26px;
  height: 26px;
  background: var(--lph-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 12px;
}

/* ── Button visual ─────────────────────────────── */
.lph-btn {
  display: inline-block;
  padding: 2px 9px;
  background: var(--lph-blue);
  color: #fff !important;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: 5px;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(21, 78, 125, 0.25);
  vertical-align: baseline;
  margin: 0 2px;
  white-space: nowrap;
  line-height: 1.5;
}
.lph-btn.lph-secondary {
  background: var(--lph-paper-alt);
  color: var(--lph-ink) !important;
  border: 1px solid var(--lph-line);
  box-shadow: none;
}

/* ── Callouts ──────────────────────────────────── */
.lph-callout {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 4px solid;
  border-radius: 6px;
  position: relative;
}
.lph-callout-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.lph-callout-label::before { font-size: 13px; }
.lph-callout.lph-tip {
  background: var(--lph-tip-bg);
  border-color: var(--lph-tip-border);
}
.lph-callout.lph-tip .lph-callout-label { color: #2d7a6c; }
.lph-callout.lph-tip .lph-callout-label::before { content: '✓'; }
.lph-callout.lph-info {
  background: var(--lph-info-bg);
  border-color: var(--lph-info-border);
}
.lph-callout.lph-info .lph-callout-label { color: var(--lph-blue-dark); }
.lph-callout.lph-info .lph-callout-label::before { content: 'ℹ'; }
.lph-callout.lph-warn {
  background: var(--lph-warn-bg);
  border-color: var(--lph-warn-border);
}
.lph-callout.lph-warn .lph-callout-label { color: #92540a; }
.lph-callout.lph-warn .lph-callout-label::before { content: '⚠'; }
.lph-callout.lph-error {
  background: var(--lph-error-bg);
  border-color: var(--lph-error-border);
}
.lph-callout.lph-error .lph-callout-label { color: #a11d1d; }
.lph-callout.lph-error .lph-callout-label::before { content: '✗'; }
.lph-callout p { margin: 0 !important; }
.lph-callout p + p { margin-top: 7px !important; }

/* ── Tables ────────────────────────────────────── */
.lph-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px 0;
  font-size: 13.5px;
  background: #fff;
  border: 1px solid var(--lph-line);
  border-radius: 7px;
  overflow: hidden;
}
.lph-main th {
  background: var(--lph-paper-alt);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--lph-ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--lph-line);
}
.lph-main td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--lph-line);
  vertical-align: top;
}
.lph-main tr:last-child td { border-bottom: none; }
.lph-main tr:nth-child(even) td { background: var(--lph-paper-alt); }

/* ── Example / voorbeeld ─────────────────────── */
.lph-example {
  background: var(--lph-code-bg);
  border: 1px solid var(--lph-line);
  border-radius: 7px;
  padding: 16px 20px;
  margin: 14px 0 18px 0;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--lph-ink);
  font-style: italic;
  position: relative;
}
.lph-example::before {
  content: 'VOORBEELD';
  position: absolute;
  top: -8px;
  left: 14px;
  background: var(--lph-paper);
  padding: 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--lph-muted);
  font-style: normal;
  font-weight: 500;
}
.lph-example p { margin-bottom: 8px !important; }
.lph-example p:last-child { margin-bottom: 0 !important; }

.lph-main code.lph-inline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  background: var(--lph-code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--lph-blue-dark);
  white-space: nowrap;
}
.lph-shortcode {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  background: #1a1f2b;
  color: #e7e9f0;
  padding: 12px 16px;
  border-radius: 7px;
  margin: 10px 0 16px 0;
  user-select: all;
  cursor: copy;
  position: relative;
}
.lph-shortcode::after {
  content: 'kopieer';
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 9px;
  color: var(--lph-muted-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Kbd ───────────────────────────────────────── */
.lph-main kbd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  background: var(--lph-paper-alt);
  border: 1px solid var(--lph-line);
  border-radius: 3px;
  padding: 2px 5px;
  color: var(--lph-ink);
  box-shadow: 0 1px 0 var(--lph-line);
}

/* ── Checklist ─────────────────────────────────── */
.lph-checklist {
  list-style: none !important;
  margin: 18px 0 !important;
  padding: 0 !important;
}
.lph-checklist li {
  padding: 9px 0 9px 32px !important;
  margin: 0 !important;
  border-bottom: 1px dashed var(--lph-line);
  position: relative;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.lph-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--lph-muted-light);
  border-radius: 4px;
  background: #fff;
  transition: all 0.15s;
}
.lph-checklist li.lph-done {
  color: var(--lph-muted);
  text-decoration: line-through;
  text-decoration-color: var(--lph-muted-light);
}
.lph-checklist li.lph-done::before {
  background: var(--lph-teal);
  border-color: var(--lph-teal);
}
.lph-checklist li.lph-done::after {
  content: '✓';
  position: absolute;
  left: 3px;
  top: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}

/* ── Toast ─────────────────────────────────────── */
.lph-toast {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: var(--lph-ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
}
.lph-toast.lph-show { opacity: 1; transform: translateY(0); }

/* ── No results ─────────────────────────────── */
.lph-no-results {
  display: none;
  padding: 40px 0;
  text-align: center;
  color: var(--lph-muted);
  font-style: italic;
}
.lph-no-results.lph-show { display: block; }

/* ── Search highlight ──────────────────────── */
.lph-main mark {
  background: var(--lph-hl);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* ── Sidebar overlay (mobile) ───────────────── */
.lph-sidebar-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 20;
}
.lph-sidebar-overlay.lph-show { display: block; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .lph-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .lph-menu-toggle { display: flex; }
  .lph-sidebar {
    position: absolute;
    top: 61px;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background: var(--lph-paper);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 30;
    border-right: 1px solid var(--lph-line);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  }
  .lph-sidebar.lph-open { transform: translateX(0); }
  .lph-main { padding: 24px 24px 50px 24px; }
  .lph-hero { padding-top: 8px; }
  .lph-hero h1 { font-size: 32px; }
  .lph-hero p { font-size: 15px; }
  .lph-app h2 { font-size: 24px; }
  .lph-app h3 { font-size: 18px; }
  .lph-searchbox .lph-hint { display: none; }
  .lph-brand-sub { display: none; }
}

@media (max-width: 520px) {
  .lph-topbar { padding: 10px 14px; gap: 10px; }
  .lph-main { padding: 20px 18px 40px 18px; }
  .lph-hero h1 { font-size: 26px; }
}
