/* ── Ubuntu/Vanilla Framework kleurvariabelen ───────────────── */
:root {
  --ubuntu-orange:    #E95420;
  --ubuntu-aubergine: #2C001E;
  --ubuntu-warmgrey:  #AEA79F;
  --ubuntu-coolblack: #111111;
  --nav-height: 3.5rem;
  --overlay-bg: rgba(44, 0, 30, 0.97);
}

[data-theme="dark"] {
  --bg-section:      #1a1a1a;
  --bg-section-alt:  #242424;
  --text-primary:    #e5e5e5;
  --text-muted:      #aaa;
  --card-bg:         #2a2a2a;
  --card-border:     #3a3a3a;
  --code-bg:         #1e1e1e;
}

[data-theme="light"] {
  --bg-section:      #ffffff;
  --bg-section-alt:  #f5f5f5;
  --text-primary:    #111111;
  --text-muted:      #666;
  --card-bg:         #ffffff;
  --card-border:     #e0e0e0;
  --code-bg:         #272822;
}

/* ── Basis ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-section);
  color: var(--text-primary);
  margin: 0;
  padding-top: var(--nav-height);
}

/* ── Ubuntu Start-knop ───────────────────────────────────────── */
.ubuntu-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: var(--ubuntu-orange);
  cursor: pointer;
  margin-right: .75rem;
  flex-shrink: 0;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(233,84,32,.4);
  position: relative;
  z-index: 1001;
}

.ubuntu-start-btn:hover {
  background: #d44016;
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(233,84,32,.55);
}

.ubuntu-start-btn:active { transform: scale(.96); }

.ubuntu-start-btn svg { display: block; }

/* ── Overlay (Ubuntu Dash) ───────────────────────────────────── */
.ubuntu-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.ubuntu-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.ubuntu-overlay__close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.ubuntu-overlay__close:hover { background: rgba(255,255,255,.15); }

.ubuntu-overlay__title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: .05em;
  margin-bottom: 2rem;
  text-align: center;
}

.ubuntu-overlay__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1rem;
  max-width: 820px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
  padding: .5rem;
}

.overlay-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .5rem;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  font-size: .8rem;
  font-weight: 400;
  transition: background .15s, transform .15s;
  cursor: pointer;
}

.overlay-item:hover {
  background: rgba(255,255,255,.1);
  transform: translateY(-3px);
  color: #fff;
}

.overlay-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
}

.overlay-icon svg { width: 100%; height: 100%; }

/* ── Navigatie ───────────────────────────────────────────────── */
.p-navigation.is-dark {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #2c001e !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.p-navigation__row { display: flex; align-items: center; }

.p-navigation__logo-link {
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  margin-right: 1.5rem;
}

.p-navigation__logo-link:hover { color: var(--ubuntu-orange); }

/* Desktop: nav altijd zichtbaar, toggleknoppen verborgen */
@media (min-width: 769px) {
  .p-navigation__nav { display: block !important; }
  .p-navigation__toggle--open,
  .p-navigation__toggle--close { display: none !important; }
  .p-navigation__items { display: flex; gap: 0; }
  .p-navigation__link { color: #fff !important; padding: .5rem 1rem; }
}

.p-navigation__link.is-selected {
  color: var(--ubuntu-orange) !important;
  border-bottom: 2px solid var(--ubuntu-orange);
}

/* ── Hero ────────────────────────────────────────────────────── */
.p-strip--hero {
  background: linear-gradient(135deg, #2C001E 0%, #1a0012 40%, #0d0008 100%);
  padding: 5rem 0 4rem;
  min-height: 420px;
  display: flex;
  align-items: center;
}

.p-strip--hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  font-weight: 300;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  color: var(--ubuntu-warmgrey);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-svg { max-width: 260px; opacity: .85; }

/* ── Protocol-overzichtgrid ──────────────────────────────────── */
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.protocol-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

.protocol-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
}

.protocol-card__link {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
}

.protocol-card__icon {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem;
}

.protocol-card__icon svg { width: 100%; height: 100%; }

.protocol-card__body { flex: 1; min-width: 0; }

.protocol-card__name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 .15rem;
}

.protocol-card__full {
  font-size: .75rem;
  color: var(--text-muted);
  margin: 0 0 .5rem;
}

.protocol-card__desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0 0 .75rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.protocol-card__tags { display: flex; flex-wrap: wrap; gap: .35rem; }

.protocol-tag {
  display: inline-block;
  font-size: .68rem;
  padding: .18rem .5rem;
  border-radius: 100px;
  border: 1px solid #ccc;
  color: #555;
  font-family: 'Ubuntu Mono', monospace;
}

/* ── Protocol-headersectie ───────────────────────────────────── */
.protocol-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.protocol-header__icon {
  flex-shrink: 0;
  width: 5rem;
  height: 5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem;
}

.protocol-header__icon svg { width: 100%; height: 100%; }

.protocol-header__info { flex: 1; }

.protocol-header__full {
  color: var(--text-muted);
  font-size: .9rem;
  margin: 0 0 .5rem;
}

.protocol-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.meta-item { white-space: nowrap; }

/* ── Tabs ────────────────────────────────────────────────────── */
.protocol-tabs-wrapper { margin-top: 1rem; }

.p-tabs__list {
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 0;
  flex-wrap: wrap;
}

.p-tabs__link.is-selected {
  color: var(--ubuntu-orange) !important;
  border-bottom-color: var(--ubuntu-orange) !important;
}

.tab-panel {
  padding: 1.5rem 0;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tab-panel__actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.bewerk-btn {
  font-size: .8rem;
  color: var(--ubuntu-orange) !important;
  border: 1px solid var(--ubuntu-orange) !important;
  border-radius: 6px !important;
  padding: .35rem .85rem !important;
  text-decoration: none;
  transition: background .15s;
}

.bewerk-btn:hover { background: rgba(233,84,32,.1) !important; }

/* ── Markdown-inhoud ─────────────────────────────────────────── */
.markdown-content h2 {
  font-size: 1.35rem;
  font-weight: 500;
  margin-top: 1.75rem;
  margin-bottom: .75rem;
  color: var(--text-primary);
}

.markdown-content h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 1.25rem;
  color: var(--text-primary);
}

.markdown-content p { line-height: 1.7; margin-bottom: .9rem; }

.markdown-content ul, .markdown-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-content li { margin-bottom: .35rem; line-height: 1.6; }

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: .88rem;
  overflow-x: auto;
  display: block;
}

.markdown-content th, .markdown-content td {
  border: 1px solid var(--card-border);
  padding: .55rem .85rem;
  text-align: left;
}

.markdown-content th {
  background: rgba(0,0,0,.05);
  font-weight: 600;
}

[data-theme="dark"] .markdown-content th { background: rgba(255,255,255,.06); }

.markdown-content code:not([class*="language-"]) {
  font-family: 'Ubuntu Mono', monospace;
  font-size: .88em;
  background: rgba(0,0,0,.07);
  border-radius: 4px;
  padding: .1em .35em;
  color: var(--ubuntu-orange);
}

[data-theme="dark"] .markdown-content code:not([class*="language-"]) {
  background: rgba(255,255,255,.1);
}

.markdown-content pre {
  border-radius: 8px;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
}

.markdown-content pre code {
  font-family: 'Ubuntu Mono', 'Fira Code', 'Courier New', monospace;
  font-size: .85rem;
  line-height: 1.6;
}

/* ── Secties afwisselen ──────────────────────────────────────── */
.protocol-section { padding: 3rem 0; }
.protocol-section.p-strip--light { background: var(--bg-section-alt); }
.protocol-section:not(.p-strip--light) { background: var(--bg-section); }

/* ── Vergelijkingstabel ──────────────────────────────────────── */
#vergelijking table { width: 100%; }

#vergelijking td, #vergelijking th {
  white-space: nowrap;
  font-size: .82rem;
}

#vergelijking td code {
  font-family: 'Ubuntu Mono', monospace;
  font-size: .8rem;
  background: rgba(0,0,0,.06);
  padding: .1em .3em;
  border-radius: 3px;
}

/* ── Protocollen-intro ───────────────────────────────────────── */
.protocol-intro { max-width: 560px; margin: .5rem auto 1.5rem; }

/* ── Footer ──────────────────────────────────────────────────── */
.p-footer { padding: 2.5rem 0; }

/* ── Responsief ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .protocol-header { flex-direction: column; }

  .protocol-header__icon {
    width: 3.5rem;
    height: 3.5rem;
  }

  .protocol-grid { grid-template-columns: 1fr; }

  .ubuntu-overlay__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .p-strip--hero { padding: 3rem 0 2.5rem; }

  .hero-subtitle { font-size: .95rem; }

  /* Hamburgerknoppen zichtbaar op mobiel */
  .p-navigation__toggle--open {
    display: flex !important;
    align-items: center;
    color: #fff;
    font-size: 1.4rem;
    text-decoration: none;
    padding: .2rem .5rem;
    cursor: pointer;
  }
  .p-navigation__toggle--close { display: none !important; }

  .p-navigation__nav {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #2c001e !important;
    padding: 1rem 1.5rem;
    display: none !important;
    z-index: 999;
    box-shadow: 0 6px 20px rgba(0,0,0,.5);
  }

  .p-navigation__nav.is-open {
    display: block !important;
  }

  .p-navigation__items {
    flex-direction: column !important;
    display: flex !important;
    gap: 0;
  }

  .p-navigation__item {
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .p-navigation__link {
    color: #fff !important;
    display: block !important;
    padding: .75rem 0 !important;
    font-size: 1rem;
    text-decoration: none;
  }

  .p-navigation__link:hover { color: var(--ubuntu-orange) !important; }

  .markdown-content table { font-size: .78rem; }
}

@media (max-width: 480px) {
  .ubuntu-overlay__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Toegankelijkheid: focusstijlen ──────────────────────────── */
:focus-visible {
  outline: 3px solid var(--ubuntu-orange);
  outline-offset: 2px;
}