/* Sidebar layout — sticky, sectioned, search bovenaan, hamburger op mobile.
   Sidebar gebruikt eigen --sidebar-* vars (zie style.css) zodat 'ie z'n
   eigen donkere look behoudt los van het page-theme — typisch voor docs-sites. */

body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.mm-sidebar {
  grid-column: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border-right: 1px solid var(--sidebar-border);
  padding: 1rem .75rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-border) transparent;
}

.mm-sidebar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  font-weight: 700;
  color: #f8fafc;
  padding: .35rem .35rem 1rem;
  font-size: 1rem;
}

.mm-sidebar-brand:hover { text-decoration: none; }

.mm-brand-mm {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

/* Search */
.mm-sidebar-search {
  position: relative;
  margin-bottom: 1rem;
}

.mm-sidebar-search-input {
  width: 100%;
  padding: .45rem .65rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  color: var(--sidebar-fg);
  font: inherit;
  font-size: .85rem;
  outline: none;
}

.mm-sidebar-search-input::placeholder { color: var(--sidebar-muted); }
.mm-sidebar-search-input:focus { border-color: #a5b4fc; }

/* Search-results popover (gepositioneerd via attach.js) */
.mm-sidebar-results {
  position: fixed;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  max-height: 60vh;
  min-width: 22rem;
  overflow-y: auto;
  z-index: 1000;
  padding: .35rem;
}

.mm-sidebar-result {
  display: block;
  padding: .5rem .75rem;
  border-radius: 6px;
  text-decoration: none;
  color: #cbd5e1;
  font-size: .85rem;
  line-height: 1.4;
}

.mm-sidebar-result:hover,
.mm-sidebar-result[data-highlight="1"] {
  background: rgba(165, 180, 252, .15);
  color: #f8fafc;
  text-decoration: none;
}

.mm-sidebar-result-label   { font-weight: 600; color: #f8fafc; }
.mm-sidebar-result-summary { color: #94a3b8; font-size: .8rem; margin-top: 2px; }
.mm-sidebar-result-group {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(148,163,184,.15);
  color: #94a3b8;
  font-size: .7rem;
  margin-left: .5rem;
  vertical-align: middle;
}
.mm-sidebar-result mark {
  background: rgba(165, 180, 252, .3);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.mm-sidebar-result-empty { padding: .85rem 1rem; color: #94a3b8; font-size: .85rem; }

/* Groups */
.mm-sidebar-group { margin-bottom: 1rem; }

.mm-sidebar-group-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #cbd5e1;          /* hoog contrast op donkere sidebar */
  padding: .35rem .5rem;
  font-weight: 700;
  opacity: .7;
}

.mm-sidebar-list { list-style: none; margin: 0; padding: 0; }

.mm-sidebar-list a {
  display: block;
  padding: .35rem .65rem;
  margin: 1px 0;
  text-decoration: none;
  color: var(--sidebar-fg);
  font-size: .87rem;
  border-radius: 5px;
  transition: background-color 80ms, color 80ms;
}

.mm-sidebar-list a:hover {
  background: rgba(255, 255, 255, .06);
  color: #f8fafc;
  text-decoration: none;
}

.mm-sidebar-list a.is-active {
  background: rgba(165, 180, 252, .2);
  color: #f8fafc;
  font-weight: 600;
}

/* ── Content ─────────────────────────────────────────────────────────────── */

/* Header bovenin de content (sticky) */
.mm-content-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 2.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(6px);
}

.mm-content-header-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.mm-content-header-crumb {
  font: 600 .95rem/1.2 system-ui;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mm-content-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.mm-theme-select {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font: inherit;
  font-size: .85rem;
  color: var(--text);
}
.mm-theme-select .mm-select-display,
.mm-theme-select select {
  min-width: 8rem;
}
.mm-theme-icon { font-size: 1rem; line-height: 1; }

@media (max-width: 600px) {
  .mm-theme-icon { display: none; }
  .mm-theme-select .mm-select-display,
  .mm-theme-select select { min-width: 6.5rem; }
}

.mm-content {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
}

.mm-content-inner {
  flex: 1;
  width: 100%;
  padding: 2rem 2.5rem 3rem;     /* full-width, geen max-width centrering */
}

.mm-content-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2.5rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.mm-footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.mm-footer-grid p { margin: 0; color: var(--text-muted); }

.mm-footer-phpinfo {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font: .75rem/1.4 var(--font-mono);
  text-decoration: none;
}
.mm-footer-phpinfo:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.mm-footer-phpinfo::before {
  content: 'ⓘ';
  font-style: normal;
  font-family: var(--font);
  font-size: .9rem;
  opacity: .7;
}

/* ── Hamburger toggle (mobile) ───────────────────────────────────────────── */

.mm-side-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  width: 40px;
  height: 40px;
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  padding: 9px 8px;
  cursor: pointer;
}

.mm-side-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--sidebar-fg);
  margin: 4px 0;
  border-radius: 1px;
  transition: transform 200ms, opacity 200ms;
}

body[data-sidebar="open"] .mm-side-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body[data-sidebar="open"] .mm-side-toggle span:nth-child(2) { opacity: 0; }
body[data-sidebar="open"] .mm-side-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mm-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 999;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .mm-side-toggle { display: block; }
  .mm-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 80vw;
    max-width: 320px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 220ms ease-out;
    padding-top: 4rem;
  }
  body[data-sidebar="open"] .mm-sidebar { transform: translateX(0); }
  body[data-sidebar="open"] .mm-sidebar-backdrop { display: block; }
  .mm-content-inner { padding: 4rem 1.25rem 3rem; }
}
