/* ═══════════════════════════════════════════════════════
   Nomade Educatie — Hamburger & Mobile Overlay Menu
   ═══════════════════════════════════════════════════════ */

/* ─── Hamburger — hidden on desktop ─── */

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  padding: 6px;
  margin-left: 14px;
  flex-shrink: 0;
  z-index: 1001;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle .icon-close { display: none; }
.menu-toggle.active .icon-hamburger { display: none; }
.menu-toggle.active .icon-close { display: block; }

/* ─── Mobile overlay — hidden on desktop ─── */

.mobile-overlay {
  display: none;
}

/* ══════════════════════════════════════════
   ≤ 1200px  — mobile / tablet mode
   ══════════════════════════════════════════ */

@media (max-width: 1200px) {

  /* Hide desktop nav */
  .nav-links  { display: none; }
  .megamenu   { display: none !important; }
  .megamenu-trigger::after { display: none; }

  /* Push Bestellen right, hamburger sits after it */
  .nav-right  { margin-left: auto; }
  .menu-toggle { display: flex; }

  /* Smaller CTA on mobile / tablet */
  .btn--contact {
    padding: 0.38rem 1rem;
    font-size: 0.82rem;
    border-width: 1.5px;
  }

  /* Frosted header always visible */
  .site-header {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  /* ─── Full-page overlay ─── */

  .mobile-overlay {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #fefefe;
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }

  .mobile-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* ─── Links container — matches header horizontal padding ─── */

  .mobile-overlay__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: calc(var(--header-height) + 16px) clamp(16px, 4vw, 40px) 40px;
  }

  /* ─── Accordion sections ─── */

  .mobile-accordion {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }

  .mobile-accordion:first-child {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
  }

  .mobile-accordion__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    font-weight: var(--fw-bold);
    font-family: inherit;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  a.mobile-accordion__trigger--link {
    text-decoration: none;
  }

  .mobile-accordion__chevron {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0.4;
  }

  .mobile-accordion.active .mobile-accordion__chevron {
    transform: rotate(180deg);
    opacity: 0.7;
  }

  /* Smooth expand / collapse via grid-template-rows */
  .mobile-accordion__content {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
  }

  .mobile-accordion__content > * {
    min-height: 0;
    overflow: hidden;
  }

  .mobile-accordion.active .mobile-accordion__content {
    grid-template-rows: 1fr;
  }

  /* ─── Book card grid (2 columns, mobile default) ─── */

  .mobile-megamenu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 8px 0 16px;
  }

  .mobile-megamenu-grid .megamenu__card-image {
    border-radius: 8px;
  }

  .mobile-megamenu-grid .megamenu__card img {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
  }

  .mobile-megamenu-grid .megamenu__card-label {
    font-size: 0.75rem;
    padding: 8px 10px;
  }

  /* ─── Link groups ─── */

  .mobile-link-groups {
    padding: 4px 0 12px;
    width: 100%;
  }

  .mobile-link-group + .mobile-link-group {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }

  .mobile-link-group h5 {
    font-size: 0.78rem;
    font-weight: var(--fw-bold);
    color: var(--color-text);
    margin: 0 0 6px 0;
    letter-spacing: 0.02em;
  }

  .mobile-link-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mobile-link-group li + li {
    margin-top: 5px;
  }

  .mobile-link-group a {
    text-decoration: none;
    font-size: 0.84rem;
    color: #555;
    transition: color 0.2s ease;
  }

  .mobile-link-group a:hover {
    color: #03788d;
  }

  .mobile-link-group a.link--soon {
    opacity: 0.4;
    text-decoration: line-through;
    pointer-events: none;
    cursor: default;
  }

  .mobile-link-group span.link--soon {
    opacity: 0.5;
    font-size: 0.84rem;
    color: #555;
    font-style: italic;
  }

  /* Sidebar groups within lesmethoden — no dividers */
  .mobile-link-groups--sidebar .mobile-link-group + .mobile-link-group {
    border-top: none;
    margin-top: 14px;
    padding-top: 0;
  }
}

/* ═══════════════════════════════════════════════════════
   Tablet  (769px – 1200px)
   ═══════════════════════════════════════════════════════ */

@media (min-width: 769px) and (max-width: 1200px) {

  .mobile-overlay__links {
    max-width: none;
  }

  /* ── Lesmethoden: cards left, sidebar right ── */

  .mobile-accordion__content-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 32px;
    align-items: start;
  }

  .mobile-megamenu-grid {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1.5vw, 14px);
    max-width: 380px;
    padding: 12px 0 16px;
  }

  .mobile-accordion__content-inner .mobile-link-groups--sidebar {
    grid-column: 2;
    grid-row: 1;
    padding-top: 12px;
  }

  .mobile-link-groups--sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-link-groups--sidebar .mobile-link-group + .mobile-link-group {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  /* ── Other sections: horizontal columns on tablet ── */

  .mobile-link-groups:not(.mobile-link-groups--sidebar) {
    display: grid;
    gap: 24px;
    padding-top: 8px;
  }

  .mobile-link-groups--cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-link-groups--cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .mobile-link-groups:not(.mobile-link-groups--sidebar) .mobile-link-group + .mobile-link-group {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}

/* ═══════════════════════════════════════════════════════
   Mobile  (≤ 768px) — stacked layout
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Stack all link groups vertically */
  .mobile-link-groups {
    display: flex !important;
    flex-direction: column;
    grid-template-columns: unset !important;
  }

  .mobile-accordion__content-inner {
    display: block;
  }
}

/* ─── Small phones (≤ 480px) ─── */

@media (max-width: 480px) {

  .mobile-overlay__links {
    padding-left: 16px;
    padding-right: 16px;
  }

  .btn--contact {
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
  }
}