/**
 * Frontend Styles for Document Manager
 * NVK-style design: colors, fonts, and layout matching nvk.nl
 */

/* ===========================================
   NVK DESIGN TOKENS (matching theme)
   =========================================== */
.dm-frontend-wrapper {
    --dm-primary: #0080c9;
    --dm-secondary: #00a182;
    --dm-tertiary: #522582;
    --dm-accent: #c8057f;
    --dm-white: #fff;
    --dm-bg: #f2f2f2;
    --dm-text: #333;
    --dm-text-light: #666;
    --dm-border: #e0e0e0;
    --dm-radius: 1.2rem;
    --dm-radius-s: 0.6rem;
    --dm-shadow-s: 0 2px 8px rgba(0, 0, 0, 0.08);
    --dm-shadow-m: 0 4px 20px rgba(0, 0, 0, 0.1);
    --dm-font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --dm-font-heading: 'Rubik', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --dm-header-offset: 123px; /* topbar (40px) + header (80px) + border (3px) */
}

/* ===========================================
   TABLES (compact, nog duidelijk herkenbaar)
   =========================================== */
.wp-block-table,
.dm-document-content table {
    width: 100%;
    margin: 1.2em 0;
    border-collapse: collapse;
    font-size: 0.94em;
}

.wp-block-table {
    overflow-x: auto;
    display: block;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th,
.dm-document-content table td,
.dm-document-content table th {
    padding: 5px 8px;
    border: 1px solid var(--dm-border, #e0e0e0);
    text-align: left;
    font-family: var(--dm-font-body, sans-serif);
    vertical-align: top;
    line-height: 1.45;
}

/* Paragrafen in tabel-cellen — tight kerning: geen dubbele bovenmarges,
   geen bottom-margin op de laatste paragraaf, zodat een cel met meerdere
   <p>'s niet onnodig hoog wordt. */
.dm-document-content table td p,
.dm-document-content table th p,
.wp-block-table td p,
.wp-block-table th p {
    margin: 0 0 0.25em 0;
    line-height: 1.4;
}
.dm-document-content table td p:last-child,
.dm-document-content table th p:last-child,
.wp-block-table td p:last-child,
.wp-block-table th p:last-child {
    margin-bottom: 0;
}
.dm-document-content table td ul,
.dm-document-content table td ol {
    margin: 0.15em 0;
    padding-left: 1.2rem;
}

.wp-block-table tr:nth-child(even),
.dm-document-content table tr:nth-child(even) {
    background-color: #fafafa;
}

.wp-block-table tr:hover,
.dm-document-content table tr:hover {
    background-color: #f2eefa;
}

.wp-block-table th,
.dm-document-content table th {
    background-color: #f0f0f0;
    color: var(--dm-tertiary, #522582);
    font-weight: 600;
    font-family: var(--dm-font-heading, sans-serif);
    border-bottom: 2px solid #d8d8d8;
}

/* Opt-out voor tabellen waar de eerste rij géén header is.
   Redacteur kan een wrapper-figure of <table> de class
   `dm-no-header` geven; de paarse header-styling wordt dan
   teruggezet naar normale cell-styling. Werkt op zowel <th>
   als (per ongeluk gemarkeerde) eerste rijen. */
.dm-document-content .dm-no-header table th,
.dm-document-content table.dm-no-header th,
.dm-document-content .dm-no-header table tr:first-child td,
.dm-document-content table.dm-no-header tr:first-child td {
    background-color: transparent;
    color: inherit;
    font-weight: normal;
    font-family: inherit;
    border-bottom: 1px solid var(--dm-border, #e0e0e0);
}

/* "Behoud eigen kleuren" voor tabellen met functionele kleurcodering
   (bv. Hypoglycemie-tabel 3 met 3 kleuren). De default striping/hover/
   header-styling wordt teruggezet zodat inline of class-based kleuren
   op rijen/cellen onaangetast doorkomen.
   Gebruik: <table class="dm-keep-colors"> of een wrapper-element. */
.dm-document-content .dm-keep-colors table tr,
.dm-document-content table.dm-keep-colors tr,
.dm-document-content .dm-keep-colors table tr:nth-child(even),
.dm-document-content table.dm-keep-colors tr:nth-child(even),
.dm-document-content .dm-keep-colors table tr:hover,
.dm-document-content table.dm-keep-colors tr:hover {
    background-color: inherit; /* respecteer inline background-color */
}
.dm-document-content .dm-keep-colors table th,
.dm-document-content table.dm-keep-colors th {
    background-color: inherit; /* geen automatisch paars */
    color: inherit;
}

/* Tabel-bijschrift (titel direct vóór een tabel, vaak beginnend met
   "Tabel N." of "Figuur N.") en tabel-voetnoot (paragraaf direct ná
   de tabel, vaak met "*"). Worden door frontend.js automatisch
   gedetecteerd; redacteurs kunnen de class ook handmatig zetten.
   Effect: compacter, cursief, lichter — visueel "bij de tabel". */
.dm-document-content p.dm-table-caption {
    margin: 1em 0 0.1em;   /* dicht op de tabel die volgt */
    font-style: italic;
    font-size: 0.92em;
    color: var(--dm-text-light, #555);
    line-height: 1.4;
}
.dm-document-content p.dm-table-footnote {
    margin: 0.1em 0 1em;   /* dicht op de tabel die voorafgaat */
    font-style: italic;
    font-size: 0.88em;
    color: var(--dm-text-light, #555);
    line-height: 1.4;
}

/* ===========================================
   IMAGES
   =========================================== */
.wp-block-image {
    margin: 1.5em 0;
    text-align: center;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--dm-radius-s, 0.6rem);
    box-shadow: var(--dm-shadow-s, 0 2px 8px rgba(0, 0, 0, 0.08));
}

.wp-block-image figcaption {
    margin-top: 0.5em;
    font-size: 0.9em;
    color: var(--dm-text-light, #666);
    font-style: italic;
    font-family: var(--dm-font-body, sans-serif);
}

/* ===========================================
   DOCUMENT CONTENT
   =========================================== */
.dm-document-content {
    font-family: var(--dm-font-body, sans-serif);
    font-size: 16px;
    line-height: 1.8;
    color: var(--dm-text, #333);
}

.dm-document-content h1,
.dm-document-content h2,
.dm-document-content h3,
.dm-document-content h4,
.dm-document-content h5 {
    margin: 1.5em 0 0.5em 0;
    font-weight: 700;
    font-family: var(--dm-font-heading, sans-serif);
    color: var(--dm-tertiary, #522582);
}

.dm-document-content h2 {
    font-size: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dm-border, #e0e0e0);
    margin-top: 2rem;
}

.dm-document-content h3 {
    font-size: 1.25rem;
}

.dm-document-content p {
    margin: 0 0 0.7em 0;
    line-height: 1.55;
}

/* Twee opeenvolgende paragrafen krijgen geen dubbele tussenruimte:
   het eerste-kind-na-paragraaf zou anders top-margin er bovenop stapelen. */
.dm-document-content p + p {
    margin-top: 0;
}

.dm-document-content ul,
.dm-document-content ol {
    margin: 0.6em 0;
    padding-left: 2rem;
    line-height: 1.55;
}

.dm-document-content li {
    margin: 0.15em 0;
}

/* Headings vlak na een paragraaf staan iets dichter op de tekst,
   zodat er geen onnodige witruimte tussen de afsluitende zin en het
   volgende kopje komt. */
.dm-document-content p + h2,
.dm-document-content p + h3,
.dm-document-content ul + h3,
.dm-document-content ol + h3 {
    margin-top: 1.1em;
}

/* Externe links — subtiel pijltje achter de tekst zodat de lezer ziet
   dat een klik naar buiten leidt (target=_blank wordt door frontend.js
   gezet). Geen pijltje als de link in een knop/badge zit. */
.dm-document-content a.dm-external-link::after {
    content: " \2197"; /* ↗ */
    font-size: 0.85em;
    color: currentColor;
    opacity: 0.55;
    margin-left: 1px;
}

.dm-document-content blockquote {
    border-left: 4px solid var(--dm-primary, #0080c9);
    padding: 1rem 1.5rem;
    margin: 1.5em 0;
    background: rgba(0, 128, 201, 0.04);
    border-radius: 0 var(--dm-radius-s, 0.6rem) var(--dm-radius-s, 0.6rem) 0;
    color: var(--dm-text-light, #666);
    font-style: italic;
}

.dm-document-content a {
    color: var(--dm-primary, #0080c9);
    text-decoration: underline;
    text-decoration-color: rgba(0, 128, 201, 0.3);
    text-underline-offset: 2px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.dm-document-content a:hover {
    color: var(--dm-tertiary, #522582);
    text-decoration-color: var(--dm-tertiary, #522582);
}

/* ===========================================
   RESPONSIVE TABLES
   =========================================== */
@media screen and (max-width: 768px) {
    .wp-block-table {
        font-size: 14px;
    }

    .wp-block-table td,
    .wp-block-table th {
        padding: 8px 10px;
    }
}

/* ===================================
   FRONTEND DOCUMENT VIEWER
   =================================== */

/* Main wrapper */
.dm-frontend-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--dm-bg, #f2f2f2);
    max-width: 1600px;
    margin: 0 auto;
}

/* ===========================================
   SIDEBAR
   =========================================== */
.dm-frontend-sidebar {
    width: 320px;
    background: #fff;
    color: #333;
    border-right: 1px solid #ececec;
    position: sticky;
    top: var(--dm-header-offset, 123px);
    height: calc(100vh - var(--dm-header-offset, 123px));
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.dm-sidebar-header {
    padding: 20px 20px 14px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.dm-sidebar-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--dm-font-heading, sans-serif);
    color: #333;
    line-height: 1.4;
    letter-spacing: 0.005em;
}

/* Search */
.dm-search-container {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    position: relative;
    background: #fff;
}

.dm-search-input {
    width: 100%;
    padding: 8px 34px 8px 14px;
    border: 1px solid #dcdcdc;
    background: #fafafa;
    color: #333;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--dm-font-body, sans-serif);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dm-search-input::placeholder {
    color: #999;
}

.dm-search-input:focus {
    outline: none;
    background: #fff;
    border-color: #b0b0b0;
    box-shadow: none;
}

.dm-search-clear {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.dm-search-clear:hover {
    color: #333;
}

.dm-search-clear .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Search Results */
.dm-search-results {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding: 8px 16px 12px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.dm-search-result-item {
    margin: 3px 0;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.dm-search-result-item:hover {
    background: #f5f5f5;
    border-left-color: var(--dm-tertiary, #522582);
}

.dm-search-result-link,
.dm-search-result-link * {
    cursor: pointer;
}

.dm-search-result-link {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 9px 12px;
    background: transparent;
    border-radius: 4px;
}

.dm-search-result-title {
    font-weight: 600;
    font-size: 14px;
    font-family: var(--dm-font-heading, sans-serif);
    margin-bottom: 3px;
    display: block;
    color: #222;
}

.dm-search-result-parent {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    display: block;
}

.dm-search-result-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.dm-search-highlight {
    background: rgba(82, 37, 130, 0.15);
    padding: 1px 3px;
    border-radius: 2px;
    color: inherit;
    font-weight: 600;
}

.dm-search-results-header {
    padding: 8px 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--dm-font-body, sans-serif);
    border-bottom: 1px solid #eee;
    margin-bottom: 6px;
}

.dm-search-result-number {
    color: var(--dm-tertiary, #522582);
    font-weight: 700;
    font-size: 13px;
    margin-right: 4px;
    font-family: var(--dm-font-heading, sans-serif);
}

.dm-search-result-current {
    background: #f5f0fb !important;
    border-left-color: var(--dm-tertiary, #522582) !important;
}

.dm-search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-family: var(--dm-font-body, sans-serif);
}

/* Content highlight when scrolling to search term */
.dm-content-highlight {
    background: rgba(200, 5, 127, 0.25);
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 0 0 3px rgba(200, 5, 127, 0.15);
    transition: background 0.6s ease, box-shadow 0.6s ease;
}

.dm-content-highlight-fade {
    background: transparent;
    box-shadow: 0 0 0 3px transparent;
}

/* Persistent active-query banner (shows after navigating from a search result) */
.dm-active-query-bar {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    background: #1f1f1f;
    color: #fff;
    padding: 10px 12px 10px 16px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-family: var(--dm-font-body, sans-serif);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 40px);
}

.dm-active-query-label {
    line-height: 1.2;
}

.dm-active-query-close {
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dm-active-query-close:hover,
.dm-active-query-close:focus {
    background: rgba(255, 255, 255, 0.24);
    outline: none;
}

/* ===========================================
   TABLE OF CONTENTS
   =========================================== */
.dm-toc-nav {
    padding: 16px 12px;
}

.dm-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dm-toc-chapter-item {
    margin: 4px 0;
}

/* Chapter row: link + toggle button side by side */
.dm-toc-chapter-row {
    display: flex;
    align-items: center;
}

.dm-toc-chapter-row > .dm-toc-link {
    flex: 1;
    min-width: 0;
    display: block;
    padding: 10px 8px 10px 14px;
    color: #333;
    text-decoration: none;
    border-radius: var(--dm-radius-s, 0.6rem) 0 0 var(--dm-radius-s, 0.6rem);
    font-weight: 600;
    font-size: 14px;
    font-family: var(--dm-font-heading, sans-serif);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-toc-chapter-row > .dm-toc-link:hover {
    background: #f5f5f5;
    border-left-color: var(--dm-tertiary, #522582);
    color: #222;
}

.dm-toc-chapter-item.active > .dm-toc-chapter-row > .dm-toc-link,
.dm-toc-chapter-item.is-open > .dm-toc-chapter-row > .dm-toc-link {
    border-left-color: var(--dm-tertiary, #522582);
}

.dm-toc-chapter-item.active > .dm-toc-chapter-row > .dm-toc-link {
    background: #f5f0fb;
    color: #222;
}

/* Toggle button */
.dm-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: none;
    border: none;
    border-radius: var(--dm-radius-s, 0.6rem);
    color: #999;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 4px;
}

.dm-toc-toggle:hover {
    background: #f5f5f5;
    color: #555;
}

.dm-toc-toggle-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-90deg);
}

.dm-toc-chapter-item.is-open .dm-toc-toggle-icon {
    transform: rotate(0deg);
}

/* Sublist: collapsed by default, open when is-open */
.dm-toc-sublist {
    list-style: none;
    margin: 0 0 0 12px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
}

.dm-toc-chapter-item.is-open > .dm-toc-sublist {
    max-height: 2000px;
    opacity: 1;
    margin-top: 2px;
    margin-bottom: 2px;
}

.dm-toc-paragraph-item {
    margin: 2px 0;
}

.dm-toc-paragraph-item .dm-toc-link {
    display: block;
    padding: 8px 14px;
    color: #555;
    text-decoration: none;
    border-radius: var(--dm-radius-s, 0.6rem);
    font-size: 13px;
    font-family: var(--dm-font-body, sans-serif);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.dm-toc-paragraph-item .dm-toc-link:hover {
    background: #f5f5f5;
    color: #222;
    border-left-color: var(--dm-tertiary, #522582);
}

.dm-toc-paragraph-item.active .dm-toc-link {
    background: #f5f0fb;
    color: #222;
    border-left-color: var(--dm-tertiary, #522582);
}

/* ===========================================
   MAIN CONTENT AREA
   =========================================== */
.dm-frontend-main {
    flex: 1;
    background: var(--dm-white, #fff);
    min-width: 0;
}

.dm-document-article {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 40px;
}

/* ===========================================
   DOCUMENT HEADER
   =========================================== */
.dm-document-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--dm-border, #e0e0e0);
}

.dm-document-title {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--dm-font-heading, sans-serif);
    color: var(--dm-tertiary, #522582);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.dm-breadcrumb {
    font-size: 14px;
    font-family: var(--dm-font-body, sans-serif);
    color: var(--dm-text-light, #666);
}

.dm-breadcrumb a {
    color: var(--dm-primary, #0080c9);
    text-decoration: none;
    transition: color 0.2s;
}

.dm-breadcrumb a:hover {
    color: var(--dm-tertiary, #522582);
    text-decoration: underline;
}

.dm-breadcrumb-sep {
    margin: 0 8px;
    color: #bbb;
}

.dm-breadcrumb-current {
    color: var(--dm-text, #333);
    font-weight: 500;
}

/* ===========================================
   CHILD SECTIONS
   =========================================== */
.dm-child-sections {
    margin: 40px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-left: 0;
}

.dm-child-sections-title {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--dm-font-heading, sans-serif);
    color: var(--dm-tertiary, #522582);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--dm-border, #e0e0e0);
    text-transform: none;
    letter-spacing: normal;
}

.dm-child-sections-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.dm-child-section-item {
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.dm-child-section-item:last-child {
    border-bottom: 0;
}

.dm-child-section-link {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    gap: 10px;
    box-shadow: none;
}

.dm-child-section-link:hover {
    background: #f7f4fc;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.dm-child-section-number {
    display: inline-block;
    min-width: 28px;
    text-align: right;
    background: transparent;
    color: var(--dm-text-light, #888);
    border-radius: 0;
    font-weight: 500;
    font-size: 13px;
    font-family: var(--dm-font-body, sans-serif);
    flex-shrink: 0;
    height: auto;
    width: auto;
    line-height: 1.5;
}

.dm-child-section-title {
    color: var(--dm-text, #333);
    font-weight: 500;
    font-size: 15px;
    font-family: var(--dm-font-body, sans-serif);
}

.dm-child-section-link:hover .dm-child-section-title {
    color: var(--dm-tertiary, #522582);
}

/* Niveau-differentiatie:
   - Book-landing: lijst van hoofdstukken — iets prominenter (grotere titel)
   - Chapter-page: lijst van paragrafen — iets ingesprongen zodat je voelt dat
     je een niveau dieper zit */
body.single-dm_document .dm-child-sections {
    margin-left: 0;
}

.dm-child-sections.dm-child-sections-paragraphs {
    margin-left: 16px;
    padding-left: 16px;
    border-left: 2px solid #ececec;
}

.dm-child-sections-paragraphs .dm-child-sections-title {
    font-size: 1rem;
    color: var(--dm-text-light, #666);
}

.dm-child-sections-paragraphs .dm-child-section-title {
    font-size: 14px;
}

/* ===========================================
   PREV / NEXT NAVIGATION (compact, subtiel)
   =========================================== */
.dm-document-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--dm-border, #e0e0e0);
}

.dm-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 4px;
    text-decoration: none;
    color: var(--dm-text, #333);
    transition: color 0.15s ease, background 0.15s ease;
    flex: 0 1 auto;
    max-width: 48%;
}

.dm-nav-link:hover {
    background: #f5f5f5;
    color: var(--dm-tertiary, #522582);
    box-shadow: none;
    transform: none;
}

.dm-nav-prev:hover,
.dm-nav-next:hover {
    transform: none;
}

.dm-nav-next {
    margin-left: auto;
    text-align: right;
}

.dm-nav-arrow {
    font-size: 16px;
    color: var(--dm-text-light, #888);
    transition: color 0.15s;
    flex-shrink: 0;
}

.dm-nav-link:hover .dm-nav-arrow {
    color: var(--dm-tertiary, #522582);
}

.dm-nav-label {
    display: inline;
    min-width: 0;
}

/* Kleine "Vorige"/"Volgende" label is nu overbodig: verberg voor rust */
.dm-nav-label-small {
    display: none;
}

.dm-nav-label-title {
    font-weight: 500;
    font-size: 14px;
    font-family: var(--dm-font-body, sans-serif);
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 260px;
    vertical-align: middle;
}

.dm-nav-link:hover .dm-nav-label-title {
    color: inherit;
}

/* ===========================================
   SIDEBAR FOOTER (PDF-link)
   =========================================== */
.dm-sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid #ececec;
}

.dm-sidebar-pdf-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid #e5dcf2;
    border-radius: 8px;
    color: var(--dm-tertiary, #522582);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--dm-font-body, sans-serif);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dm-sidebar-pdf-link:hover,
.dm-sidebar-pdf-link:focus {
    background: #f5f0fb;
    border-color: var(--dm-tertiary, #522582);
    outline: none;
}

.dm-sidebar-pdf-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
}

/* ===========================================
   SCROLLBAR (sidebar)
   =========================================== */
.dm-frontend-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dm-frontend-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.dm-frontend-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.dm-frontend-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ===========================================
   MOBIELE TOC-DRAWER
   ===========================================
   - Knop "Inhoud van werkboek" verschijnt onder ~960px.
   - Sidebar wordt off-canvas drawer met backdrop.
*/
/* ---- Mobiele toolbar (Inhoud-knop + zoekveld) ----------------------
   Compacte sticky bar onder de site-header, alleen op tablet/mobiel.
   Vervangt de oude full-width drawer-toggle die te dominant was. */
.dm-mobile-toolbar {
    display: none;
    position: sticky;
    top: var(--dm-header-offset, 123px);
    z-index: 60;
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border-bottom: 1px solid #ececec;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    align-items: center;
    gap: 0.5rem;
}

.dm-mobile-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.85rem;
    min-height: 44px;
    background: #f4f1fa;
    border: 1px solid #e0d8ee;
    border-radius: 999px;
    color: #1f1b3a;
    font-family: var(--dm-font-heading, sans-serif);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
    flex-shrink: 0;
}

.dm-mobile-toolbar-btn:hover,
.dm-mobile-toolbar-btn:focus-visible {
    background: #ebe4f7;
    border-color: #c8b8e2;
    outline: none;
}

.dm-mobile-toolbar-btn .dashicons {
    color: #5b2a86;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.dm-mobile-toolbar-search {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    min-height: 44px;
    background: #fafafa;
    border: 1px solid #dcdcdc;
    border-radius: 999px;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.dm-mobile-toolbar-search:focus-within {
    background: #fff;
    border-color: #5b2a86;
    box-shadow: 0 0 0 3px rgba(91, 42, 134, 0.15);
}

.dm-mobile-toolbar-search .dashicons {
    color: #8a86a0;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dm-mobile-search-input {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: transparent;
    color: #1f1b3a;
    font-size: 0.95rem;
    font-family: var(--dm-font-body, sans-serif);
    padding: 0;
    min-width: 0;
}

.dm-mobile-search-input:focus {
    outline: none;
}

.dm-mobile-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* ---- Mobiele sticky bottom-nav (vorige / inhoud / volgende) -------- */
.dm-mobile-bottom-nav {
    display: none; /* alleen op mobiel zichtbaar */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70;
    background: #fff;
    border-top: 1px solid #ece9f4;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    padding: 0.4rem 0.6rem calc(0.4rem + env(safe-area-inset-bottom, 0));
    align-items: stretch;
    justify-content: space-between;
    gap: 0.4rem;
}

.dm-mobile-bottom-nav-link,
.dm-mobile-bottom-nav-toc {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 48px;
    padding: 0 0.4rem;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: #1f1b3a;
    font-family: var(--dm-font-heading, sans-serif);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dm-mobile-bottom-nav-link:hover,
.dm-mobile-bottom-nav-link:focus-visible,
.dm-mobile-bottom-nav-toc:hover,
.dm-mobile-bottom-nav-toc:focus-visible {
    background: rgba(91, 42, 134, 0.08);
    color: #5b2a86;
    outline: none;
}

.dm-mobile-bottom-nav-toc {
    background: #f4f1fa;
    color: #5b2a86;
    flex: 1.2 1 0;
}

.dm-mobile-bottom-nav-toc .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.dm-mobile-bottom-nav-arrow {
    font-size: 1.05rem;
    line-height: 1;
}

.dm-mobile-bottom-nav-disabled {
    color: #c8c4d6;
    cursor: default;
    pointer-events: none;
}

.dm-mobile-bottom-nav-disabled:hover {
    background: transparent;
    color: #c8c4d6;
}

.dm-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 70;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.dm-sidebar-backdrop.is-visible {
    display: block;
    opacity: 1;
}

.dm-sidebar-close {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: #5d5b6b;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.dm-sidebar-close:hover,
.dm-sidebar-close:focus-visible {
    background: #f3f0fa;
    color: #5b2a86;
    outline: none;
}

.dm-sidebar-close .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media screen and (max-width: 1024px) {
    .dm-frontend-sidebar {
        width: 280px;
    }

    .dm-document-article {
        padding: 32px 24px;
    }

    .dm-document-title {
        font-size: 1.8rem;
    }
}

@media screen and (max-width: 960px) {
    /* Mobiele toolbar zichtbaar maken */
    .dm-mobile-toolbar {
        display: flex;
        /* Sluit naadloos op de header aan: de blauwe accent-rand die
           normaliter onder de header staat, verhuist naar onder de
           toolbar zodat header + toolbar als één blok ogen. */
        border-top: 0;
        border-bottom: 3px solid var(--nvk-primary, #0080c9);
    }

    /* Op mobiel laten we de header-accent zelf verdwijnen — de toolbar
       neemt 'm over (zie regel hierboven). De theme-CSS laadt na deze
       plugin-CSS, dus we hebben !important nodig om te winnen van
       `.nvk-header { border-bottom: 3px solid var(--nvk-primary); }`. */
    .nvk-header {
        border-bottom-width: 0 !important;
    }

    /* Mobiele sticky bottom-nav (vorige / inhoud / volgende) zichtbaar */
    .dm-mobile-bottom-nav {
        display: flex;
    }

    /* Voorkom dat de sticky bottom-bar de laatste content bedekt */
    .dm-document-content,
    .dm-document-article {
        padding-bottom: 88px;
    }

    /* De inline prev/next-nav onder het artikel is overbodig op mobiel
       (de sticky bottom-bar dekt 'm al). Verberg om duplicaat te
       vermijden. */
    .dm-document-nav {
        display: none;
    }

    /* De zoek-container in de sidebar wordt overbodig — de toolbar
       biedt al een altijd-zichtbaar zoekveld dat live mirrort. */
    .dm-search-container {
        display: none;
    }

    .dm-frontend-wrapper {
        flex-direction: column;
    }

    /* Sidebar wordt off-canvas */
    .dm-frontend-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: min(360px, 88vw);
        max-width: 88vw;
        z-index: 80;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
        border-right: 1px solid #ececec;
    }

    .dm-frontend-sidebar.is-open {
        transform: translateX(0);
    }

    .dm-sidebar-close {
        display: inline-flex;
    }

    /* Voldoende padding boven de eerste header zodat het kruisje vrij zweeft */
    .dm-sidebar-header {
        padding-right: 64px;
    }

    /* Voorkom achtergrond-scrollen wanneer drawer open is */
    body.dm-sidebar-open {
        overflow: hidden;
    }
}

@media screen and (max-width: 768px) {
    .dm-document-article {
        padding: 24px 16px;
    }

    .dm-document-title {
        font-size: 1.6rem;
    }

    .dm-child-sections {
        padding: 20px;
    }

    .dm-child-sections-list {
        grid-template-columns: 1fr;
    }

    .dm-document-nav {
        flex-direction: column;
    }

    .dm-nav-link {
        max-width: none;
    }

    /* Lange URL's en code-strings niet uit het scherm laten lopen */
    .dm-document-content {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Tabellen scrollen horizontaal i.p.v. de pagina te breken */
    .dm-document-content > table,
    .dm-document-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===========================================
   WP ADMIN BAR OFFSET
   =========================================== */
body.admin-bar .dm-frontend-sidebar {
    top: calc(var(--dm-header-offset, 123px) + 32px);
    height: calc(100vh - var(--dm-header-offset, 123px) - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .dm-frontend-sidebar {
        top: calc(var(--dm-header-offset, 123px) + 46px);
        height: calc(100vh - var(--dm-header-offset, 123px) - 46px);
    }
}

/* ===========================================
   FULL CHAPTER VIEW
   =========================================== */
.dm-full-chapter-toolbar {
    margin-bottom: 1.5rem;
}

.dm-full-chapter-back {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--dm-primary, #0080c9);
    text-decoration: none;
}

.dm-full-chapter-back:hover {
    text-decoration: underline;
}

.dm-full-chapter-toc {
    position: sticky;
    top: 1rem;
    float: right;
    width: 260px;
    margin: 0 0 1.5rem 2rem;
    padding: 1rem 1.25rem;
    background: var(--dm-white, #fff);
    border: 1px solid #e0e0e0;
    border-radius: 0.6rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    z-index: 5;
}

.dm-full-chapter-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
}

.dm-full-chapter-toc-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin: 0;
    font-weight: 600;
}

.dm-full-chapter-toc-hide {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: #888;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.dm-full-chapter-toc-hide:hover,
.dm-full-chapter-toc-hide:focus-visible {
    background: #f3f0fa;
    color: #5b2a86;
    outline: none;
}

.dm-full-chapter-toc-hide .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* "Toon inhoudsopgave hoofdstuk"-knop — verschijnt zodra het paneel
   verborgen is. Drijvende knop rechtsboven, op de plaats waar het
   paneel zou staan. */
.dm-full-chapter-toc-show {
    position: sticky;
    top: 1rem;
    float: right;
    width: 44px;
    height: 44px;
    margin: 0 0 1rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    color: #5b2a86;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    z-index: 5;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dm-full-chapter-toc-show:hover,
.dm-full-chapter-toc-show:focus-visible {
    background: #faf8ff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
    outline: none;
}

.dm-full-chapter-toc-show[hidden] {
    display: none;
}

.dm-full-chapter-toc-show .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.dm-full-chapter-toc[hidden] {
    display: none;
}

.dm-full-chapter-toc-list {
    list-style: decimal;
    padding-left: 1.25rem;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.dm-full-chapter-toc-list li {
    margin-bottom: 0.35rem;
}

.dm-full-chapter-toc-list a {
    color: var(--dm-text, #333);
    text-decoration: none;
}

.dm-full-chapter-toc-list a:hover,
.dm-full-chapter-toc-list a:focus {
    color: var(--dm-primary, #0080c9);
}

.dm-full-chapter-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
    scroll-margin-top: 1.5rem;
}

.dm-full-chapter-section-title {
    margin: 0 0 1rem 0;
    color: var(--dm-tertiary, #522582);
}

.dm-full-chapter-cta {
    margin: 2rem 0;
}

.dm-btn-full-chapter {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--dm-white, #fff);
    color: var(--dm-primary, #0080c9);
    border: 1px solid var(--dm-primary, #0080c9);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
}

.dm-btn-full-chapter:hover,
.dm-btn-full-chapter:focus {
    background: var(--dm-primary, #0080c9);
    color: #fff;
}

@media screen and (max-width: 900px) {
    .dm-full-chapter-toc {
        position: static;
        float: none;
        width: auto;
        margin: 0 0 1.5rem 0;
    }
    .dm-full-chapter-toc-show {
        position: fixed;
        bottom: 96px; /* boven de mobiele bottom-nav (vorige/inhoud/volgende) */
        right: 14px;
        top: auto;
        float: none;
        margin: 0;
    }
}

/* ===========================================
   WERKBOEK LANDINGSPAGINA — HERO / COVER
   =========================================== */
.dm-book-hero {
    position: relative;
    margin: 0 0 32px 0;
    padding: 40px 44px;
    background: #f5f2fb; /* effen lichtpaars i.p.v. verloop */
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
}

.dm-book-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.dm-book-hero-decor {
    display: none; /* geen decoratieve cirkels — effen blok */
}

.dm-book-hero-decor::before {
    content: '';
    position: absolute;
    top: 120px;
    left: 80px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 128, 201, 0.14) 0%, rgba(0, 128, 201, 0) 70%);
}

.dm-book-hero-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dm-tertiary, #522582);
    background: rgba(82, 37, 130, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.dm-book-hero-title {
    font-family: var(--dm-font-heading, sans-serif);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dm-tertiary, #522582);
    margin: 0 0 16px 0;
}

.dm-book-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 20px;
    color: #555;
    font-size: 14px;
}

.dm-book-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dm-book-hero-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    color: var(--dm-primary, #0080c9);
}

.dm-book-hero-authors {
    margin: 20px 0 24px 0;
}

.dm-book-hero-authors-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 8px;
}

.dm-book-hero-authors-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dm-book-hero-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 999px;
    font-size: 14px;
    color: #333;
}

.dm-book-hero-author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dm-tertiary, #522582), var(--dm-primary, #0080c9));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--dm-font-heading, sans-serif);
    letter-spacing: 0.04em;
}

.dm-book-hero-author-name {
    white-space: nowrap;
}

.dm-book-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.dm-book-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--dm-font-body, sans-serif);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.dm-book-hero-cta .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
}

.dm-book-hero-cta-primary {
    background: var(--dm-tertiary, #522582);
    color: #fff;
}

.dm-book-hero-cta-primary:hover,
.dm-book-hero-cta-primary:focus {
    background: #3f1b68;
    color: #fff;
}

.dm-book-hero-cta-secondary {
    background: #fff;
    color: var(--dm-tertiary, #522582);
    border-color: #e5dcf2;
}

.dm-book-hero-cta-secondary:hover,
.dm-book-hero-cta-secondary:focus {
    background: #f5f0fb;
    border-color: var(--dm-tertiary, #522582);
}

/* Responsive hero */
@media screen and (max-width: 768px) {
    .dm-book-hero {
        padding: 28px 24px;
    }
    .dm-book-hero-title {
        font-size: 1.8rem;
    }
    .dm-book-hero-decor {
        display: none;
    }
}

/* Oude .dm-book-meta (backwards-compatible) */
.dm-book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    padding: 0.75rem 0;
    margin: 0 0 1.5rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.92rem;
    color: #555;
}

.dm-book-meta-item strong {
    color: #222;
    margin-right: 0.25rem;
    font-weight: 600;
}

.dm-book-intro {
    margin-bottom: 2rem;
    font-size: 1.02rem;
    line-height: 1.6;
}

.dm-book-toc {
    margin-top: 2rem;
}

.dm-book-toc-title {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: var(--dm-tertiary, #522582);
}

.dm-book-toc-empty {
    color: #777;
    font-style: italic;
}

.dm-book-toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dm-book-toc-chapter {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.dm-book-toc-chapter[open],
.dm-book-toc-chapter:hover {
    border-color: var(--dm-primary, #0080c9);
}

.dm-book-toc-chapter-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 500;
}

.dm-book-toc-chapter-summary::-webkit-details-marker {
    display: none;
}

.dm-book-toc-chapter-summary::before {
    content: '▸';
    color: var(--dm-primary, #0080c9);
    font-size: 0.85rem;
    transition: transform 0.15s ease;
    flex-shrink: 0;
    width: 1em;
}

.dm-book-toc-chapter[open] > .dm-book-toc-chapter-summary::before {
    transform: rotate(90deg);
}

.dm-book-toc-chapter-link {
    flex: 1;
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    color: #222;
    text-decoration: none;
}

.dm-book-toc-chapter-link:hover,
.dm-book-toc-chapter-link:focus {
    color: var(--dm-primary, #0080c9);
}

.dm-book-toc-chapter-num {
    color: var(--dm-primary, #0080c9);
    font-weight: 700;
    min-width: 2em;
}

.dm-book-toc-chapter-title {
    font-weight: 500;
}

.dm-book-toc-count {
    font-size: 0.82rem;
    color: #888;
    white-space: nowrap;
}

.dm-book-toc-paragraphs {
    list-style: none;
    margin: 0;
    padding: 0 1rem 0.75rem 2.5rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.94rem;
}

.dm-book-toc-paragraphs li {
    padding: 0.35rem 0;
    border-bottom: 1px dashed #f0f0f0;
}

.dm-book-toc-paragraphs li:last-child {
    border-bottom: none;
}

.dm-book-toc-paragraphs a {
    display: flex;
    gap: 0.5rem;
    color: #444;
    text-decoration: none;
}

.dm-book-toc-paragraphs a:hover,
.dm-book-toc-paragraphs a:focus {
    color: var(--dm-primary, #0080c9);
}

.dm-book-toc-para-num {
    color: #888;
    min-width: 2.5em;
}

/* ==========================================================================
   Document toolbar (top-of-page icon-knoppen: PDF, Print, Share)
   ========================================================================== */

.dm-document-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    flex-wrap: wrap;
}

.dm-doc-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    color: #555;
    font-size: 0.85em;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.dm-doc-tool-btn:hover,
.dm-doc-tool-btn:focus {
    color: var(--dm-primary, #0080c9);
    border-color: var(--dm-primary, #0080c9);
    outline: none;
    background: #fff;
}

.dm-doc-tool-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.dm-doc-tool-btn-copied {
    color: #2e7d32 !important;
    border-color: #2e7d32 !important;
}

.dm-doc-tool-btn-copied::after {
    content: " ✓ gekopieerd";
    font-size: 0.9em;
}

@media (max-width: 480px) {
    .dm-doc-tool-label { display: none; }
    .dm-doc-tool-btn {
        padding: 0.55rem 0.75rem;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    .dm-doc-tool-btn .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
}

/* ==========================================================================
   PDF Export Modal
   ========================================================================== */

body.dm-modal-open { overflow: hidden; }

.dm-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dm-pdf-modal[hidden] { display: none; }

.dm-pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.dm-pdf-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: dm-pdf-modal-in 0.15s ease;
}

@keyframes dm-pdf-modal-in {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.dm-pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
}

.dm-pdf-modal-title {
    margin: 0;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dm-primary, #0080c9);
}

.dm-pdf-modal-close {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dm-pdf-modal-close:hover,
.dm-pdf-modal-close:focus {
    color: #333;
    background: #f4f4f4;
    outline: none;
}

.dm-pdf-modal .dm-pdf-wizard-form {
    padding: 1.25rem 1.25rem 1.25rem;
}

.dm-pdf-wizard-cancel {
    background: transparent;
    border: 1px solid #dcdcdc;
    color: #555;
    border-radius: 4px;
    padding: 0.65rem 1.25rem;
    font-size: 1em;
    cursor: pointer;
    margin-right: 0.5rem;
}

.dm-pdf-wizard-cancel:hover,
.dm-pdf-wizard-cancel:focus {
    color: #222;
    border-color: #bbb;
    outline: none;
}

/* ==========================================================================
   PDF Export Wizard (legacy — niet meer in template, stijlen blijven voor hergebruik)
   ========================================================================== */

.dm-pdf-wizard {
    margin: 2rem 0 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}

.dm-pdf-wizard[open] {
    background: #fff;
    border-color: #d0d0d0;
}

.dm-pdf-wizard-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--dm-primary, #0080c9);
    list-style: none;
    user-select: none;
}

.dm-pdf-wizard-trigger::-webkit-details-marker {
    display: none;
}

.dm-pdf-wizard-trigger::before {
    content: "▸";
    display: inline-block;
    font-size: 0.8em;
    transition: transform 0.15s ease;
    color: #888;
}

.dm-pdf-wizard[open] .dm-pdf-wizard-trigger::before {
    transform: rotate(90deg);
}

.dm-pdf-wizard-trigger .dashicons {
    color: var(--dm-primary, #0080c9);
}

.dm-pdf-wizard-form {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dm-pdf-wizard-form fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.75rem 1rem 1rem;
    margin: 0;
}

.dm-pdf-wizard-form legend {
    font-weight: 600;
    padding: 0 0.4rem;
    color: #333;
    font-size: 0.95em;
}

.dm-pdf-wizard-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    cursor: pointer;
}

.dm-pdf-wizard-form input[type="radio"],
.dm-pdf-wizard-form input[type="checkbox"] {
    margin: 0;
}

.dm-pdf-wizard-chapters-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dm-pdf-wizard-selectall {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0.25rem 0.6rem;
    font-size: 0.85em;
    cursor: pointer;
    color: #555;
}

.dm-pdf-wizard-selectall:hover {
    border-color: var(--dm-primary, #0080c9);
    color: var(--dm-primary, #0080c9);
}

.dm-pdf-wizard-chapters-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-right: 0.25rem;
}

.dm-pdf-wizard-ch-num {
    color: #888;
    min-width: 2em;
    text-align: right;
}

.dm-pdf-wizard-actions {
    display: flex;
    justify-content: flex-end;
}

.dm-pdf-wizard-submit {
    background: var(--dm-primary, #0080c9);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.65rem 1.25rem;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dm-pdf-wizard-submit:hover {
    background: #006ba8;
}

/* ===================================================================
   WERKBOEKEN OVERZICHTPAGINA
   =================================================================== */
.dm-werkboeken-overview-wrap {
    margin: 2rem auto 4rem;
}

.dm-werkboeken-intro {
    max-width: 880px;
    margin: 0 auto 2rem;
    line-height: 1.65;
    color: #333;
}

.dm-werkboeken-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-style: italic;
}

/* ---- Hero werkboekenoverzicht ------------------------------------- */
.dm-werkboeken-hero-content {
    max-width: 760px;
}

.dm-werkboeken-hero-sub {
    margin: 0.85rem 0 0;
    font-size: 1.1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    max-width: 60ch;
}

/* Compound selector om de theme `.nvk-container { padding: 0 ... }` te overrulen
   (de theme-CSS laadt ná de plugin-CSS, dus de specificiteit moet hier hoger). */
.nvk-container.dm-werkboeken-overview-wrap {
    padding-top: 4.5rem;
    padding-bottom: 6rem;
}

@media (max-width: 720px) {
    .nvk-container.dm-werkboeken-overview-wrap {
        padding-top: 3rem;
        padding-bottom: 4rem;
    }
}

/* ---- Werkboeken-lijst (rij-kaarten) ------------------------------- */
.dm-werkboeken-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 980px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dm-werkboeken-list-item {
    margin: 0;
}

.dm-werkboeken-list-link {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.1rem 1.5rem 1.1rem 1.1rem;
    background: #fff;
    border: 1px solid #ece9f4;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 1px 2px rgba(31, 27, 58, 0.04);
}

.dm-werkboeken-list-link:hover,
.dm-werkboeken-list-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(91, 42, 134, 0.35);
    box-shadow: 0 14px 30px -16px rgba(31, 27, 58, 0.25);
    outline: none;
}

.dm-werkboeken-list-cover {
    width: 88px;
    height: 88px;
    border-radius: 8px;
    background: linear-gradient(135deg, #5b2a86 0%, #c8057f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.dm-werkboeken-list-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.18), transparent 55%),
        radial-gradient(circle at 20% 80%, rgba(0, 128, 201, 0.30), transparent 60%);
    pointer-events: none;
}

.dm-werkboeken-list-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.dm-werkboeken-list-cover .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 1;
}

.dm-werkboeken-list-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.dm-werkboeken-list-title {
    font-family: 'Rubik', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1f1b3a;
    line-height: 1.3;
    letter-spacing: -0.01em;
    transition: color 0.18s ease;
}

.dm-werkboeken-list-link:hover .dm-werkboeken-list-title,
.dm-werkboeken-list-link:focus-visible .dm-werkboeken-list-title {
    color: #5b2a86;
}

.dm-werkboeken-list-excerpt {
    font-size: 0.92rem;
    line-height: 1.45;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-werkboeken-list-meta {
    font-size: 0.82rem;
    color: #6b6878;
    line-height: 1.4;
}

.dm-werkboeken-list-arrow {
    color: #c8c4d6;
    font-size: 1.35rem;
    line-height: 1;
    justify-self: end;
    transition: transform 0.18s ease, color 0.18s ease;
}

.dm-werkboeken-list-link:hover .dm-werkboeken-list-arrow,
.dm-werkboeken-list-link:focus-visible .dm-werkboeken-list-arrow {
    color: #5b2a86;
    transform: translateX(4px);
}

@media (max-width: 720px) {
    .dm-werkboeken-list-link {
        grid-template-columns: 64px 1fr auto;
        gap: 1rem;
        padding: 0.9rem 1rem 0.9rem 0.9rem;
    }
    .dm-werkboeken-list-cover {
        width: 64px;
        height: 64px;
    }
    .dm-werkboeken-list-cover .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }
    .dm-werkboeken-list-title {
        font-size: 1.05rem;
    }
    .dm-werkboeken-list-meta {
        font-size: 0.78rem;
    }
    .dm-werkboeken-list-excerpt {
        display: none;
    }
    .dm-werkboeken-list-arrow {
        font-size: 1.15rem;
    }
}

/* ---- Werkboeken kaart-grid ---------------------------------------- */
.dm-werkboeken-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    /* auto-fill met een vaste max van 360px — kaarten blijven netjes naast
       elkaar staan (geen 1fr-uitrekken), ook bij weinig items. */
    grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
    gap: 1.5rem;
    justify-content: start;
}

.dm-werkboeken-overview[data-columns="1"] .dm-werkboeken-grid {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin: 0 auto;
    justify-content: stretch;
}

.dm-werkboeken-card {
    background: #fff;
    border: 1px solid #ece9f4;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(31, 27, 58, 0.04);
}

.dm-werkboeken-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px -18px rgba(31, 27, 58, 0.28);
    border-color: rgba(91, 42, 134, 0.35);
}

.dm-werkboeken-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.dm-werkboeken-card-cover {
    height: 140px;
    background: linear-gradient(135deg, #5b2a86 0%, #c8057f 100%);
    overflow: hidden;
    position: relative;
}

.dm-werkboeken-card-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18), transparent 50%),
        radial-gradient(circle at 15% 85%, rgba(0, 128, 201, 0.35), transparent 55%);
    pointer-events: none;
}

.dm-werkboeken-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.dm-werkboeken-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
    position: relative;
    z-index: 1;
}

.dm-werkboeken-card-cover-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.dm-werkboeken-card-body {
    padding: 1.25rem 1.4rem 0.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dm-werkboeken-card-title {
    font-family: 'Rubik', system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.6rem;
    color: #1f1b3a;
    letter-spacing: -0.01em;
    transition: color 0.18s ease;
}

.dm-werkboeken-card:hover .dm-werkboeken-card-title {
    color: #5b2a86;
}

.dm-werkboeken-card-excerpt {
    margin: 0 0 0.9rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #555;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-werkboeken-card-meta {
    margin: auto 0 0;
    font-size: 0.82rem;
    color: #6b6878;
    line-height: 1.4;
}

.dm-werkboeken-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5b2a86;
    letter-spacing: 0.01em;
}

.dm-werkboeken-card-cta-arrow {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.18s ease;
}

.dm-werkboeken-card:hover .dm-werkboeken-card-cta-arrow {
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .dm-werkboeken-grid,
    .dm-werkboeken-overview[data-columns="2"] .dm-werkboeken-grid,
    .dm-werkboeken-overview[data-columns="3"] .dm-werkboeken-grid,
    .dm-werkboeken-overview[data-columns="4"] .dm-werkboeken-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .dm-werkboeken-card-cover {
        height: 110px;
    }
    .dm-werkboeken-card-body {
        padding: 1rem 1.1rem 0.4rem;
    }
    .dm-werkboeken-card-cta {
        padding: 0.75rem 1.1rem 1rem;
    }
}

/* ===================================================================
   FEEDBACK MODAL
   =================================================================== */
.dm-feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dm-feedback-modal[hidden] { display: none; }

.dm-feedback-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.dm-feedback-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 580px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: dm-feedback-modal-in 0.18s ease;
}

@keyframes dm-feedback-modal-in {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.dm-feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid #eef0f3;
}

.dm-feedback-modal-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.15rem;
    font-weight: 500;
    margin: 0;
    color: #522582;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dm-feedback-modal-title .dashicons {
    font-size: 22px; width: 22px; height: 22px;
    color: #c8057f;
}

.dm-feedback-modal-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    color: #888;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.dm-feedback-modal-close:hover,
.dm-feedback-modal-close:focus {
    background: #f5f5f5;
    color: #222;
    outline: none;
}

.dm-feedback-flash {
    margin: 16px 22px 0;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.dm-feedback-flash-success {
    background: #ebf7f0;
    border: 1px solid #b6e0c4;
    color: #1f6b3a;
}

.dm-feedback-flash-error {
    background: #fdecec;
    border: 1px solid #f5b9b9;
    color: #8b1d1d;
}

.dm-feedback-form {
    padding: 18px 22px 22px;
}

.dm-feedback-context {
    margin: 0 0 1rem;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.5;
}

.dm-feedback-field-group {
    border: 0;
    padding: 0;
    margin: 0 0 1.1rem;
}

.dm-feedback-field-group legend {
    font-weight: 600;
    font-size: 0.92rem;
    color: #333;
    padding: 0 0 0.4rem;
}

.dm-feedback-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.dm-feedback-radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.dm-feedback-field {
    margin: 0 0 1.1rem;
    display: flex;
    flex-direction: column;
}

.dm-feedback-field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.35rem;
}

.dm-feedback-req {
    color: #c8057f;
    margin-left: 0.15em;
}

.dm-feedback-field input[type="text"],
.dm-feedback-field input[type="email"],
.dm-feedback-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dm-feedback-field input:focus,
.dm-feedback-field textarea:focus {
    outline: none;
    border-color: #0080c9;
    box-shadow: 0 0 0 3px rgba(0, 128, 201, 0.15);
}

.dm-feedback-field textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
    font-family: inherit;
}

.dm-feedback-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dm-feedback-privacy {
    margin: 0 0 1.2rem;
    font-size: 0.82rem;
    color: #666;
    line-height: 1.5;
}

.dm-feedback-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

.dm-feedback-cancel,
.dm-feedback-submit {
    padding: 9px 18px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.dm-feedback-cancel {
    background: #f1f3f5;
    color: #333;
}

.dm-feedback-cancel:hover {
    background: #e6e8ea;
}

.dm-feedback-submit {
    background: #0080c9;
    color: #fff;
}

.dm-feedback-submit:hover {
    background: #006ba8;
}

@media (max-width: 480px) {
    .dm-feedback-field-row {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   THEMA'S — werkboek-landingspagina (frontend + sidebar)
   =================================================================== */

/* Thema-kaarten op de werkboek-voorpagina (in plaats van de
   "Inhoudsopgave"-sectie wanneer er thema's gedefinieerd zijn). */
.dm-book-themes {
    margin: 2rem 0 2.5rem;
}

.dm-book-themes-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f1b3a;
    margin: 0 0 1.25rem;
}

.dm-book-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.dm-book-theme-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: var(--dm-tertiary, #522582); /* effen paars i.p.v. verloop */
    color: #fff;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(31, 27, 58, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
    overflow: hidden;
    min-height: 96px;
}

.dm-book-theme-card::after {
    content: none; /* geen radiale overlay — effen paars */
}

.dm-book-theme-card:hover,
.dm-book-theme-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -14px rgba(31, 27, 58, 0.45);
    filter: brightness(1.05);
    outline: none;
    color: #fff;
}

.dm-book-theme-card-num {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.88);
    flex-shrink: 0;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.dm-book-theme-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.dm-book-theme-card-title {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.25;
    color: #fff;
}

.dm-book-theme-card-desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-book-theme-card-meta {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
}

/* Detail-secties (hoofdstukken per thema), onder de kaarten. */
.dm-book-themes-detail {
    margin: 3rem 0 0;
}

.dm-book-theme-section {
    margin: 0 0 2.5rem;
}

.dm-book-theme-section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #ece9f4;
}

.dm-book-theme-section-num {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: #c8057f;
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: -0.02em;
    margin-top: 0.15rem;
}

.dm-book-theme-section-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f1b3a;
    margin: 0 0 0.25rem;
}

.dm-book-theme-section-desc {
    margin: 0;
    font-size: 0.92rem;
    color: #6b6878;
    line-height: 1.4;
}

.dm-book-theme-section-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.dm-book-theme-chapter-link {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    background: #fff;
    border: 1px solid #ece9f4;
    border-radius: 10px;
    text-decoration: none;
    color: #1f1b3a;
    font-size: 0.95rem;
    line-height: 1.3;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dm-book-theme-chapter-link:hover,
.dm-book-theme-chapter-link:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(91, 42, 134, 0.4);
    box-shadow: 0 6px 14px -8px rgba(31, 27, 58, 0.25);
    color: #5b2a86;
    outline: none;
}

.dm-book-theme-chapter-title {
    font-weight: 500;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-book-theme-chapter-meta {
    font-size: 0.78rem;
    color: #8a86a0;
    white-space: nowrap;
}

.dm-book-theme-chapter-arrow {
    color: #c8c4d6;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.15s ease, color 0.15s ease;
}

.dm-book-theme-chapter-link:hover .dm-book-theme-chapter-arrow {
    color: #5b2a86;
    transform: translateX(3px);
}

/* Sidebar: thema-lijst met hover-uitklap (alleen op de
   werkboek-landingspagina). */
.dm-toc-nav--themed .dm-toc-themes-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.dm-toc-theme-item {
    margin: 0;
    border-bottom: 1px solid #f0eef7;
}

.dm-toc-theme-item:last-child {
    border-bottom: 0;
}

.dm-toc-theme-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
}

.dm-toc-theme-link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0;
    text-decoration: none;
    color: #1f1b3a;
    font-size: 0.92rem;
    line-height: 1.3;
    transition: color 0.15s ease;
    min-width: 0;
}

.dm-toc-theme-link:hover,
.dm-toc-theme-link:focus-visible {
    color: #5b2a86;
    outline: none;
}

.dm-toc-theme-num {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    color: #c8057f;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    width: 22px;
}

.dm-toc-theme-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-toc-theme-chapters {
    list-style: none;
    margin: 0 0 0.4rem;
    padding: 0 12px 0 38px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding-bottom 0.3s ease;
}

.dm-toc-theme-chapters > li {
    margin: 0;
}

/* Hoofdstuk-link in een thema-sidebar */
.dm-toc-theme-chapters > li > a {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.88rem;
    color: #5d5b6b;
    text-decoration: none;
    line-height: 1.35;
    transition: color 0.15s ease;
}

.dm-toc-theme-chapters > li > a:hover,
.dm-toc-theme-chapters > li > a:focus-visible {
    color: #5b2a86;
    outline: none;
}

/* Actief hoofdstuk: paarse highlight + vette weergave */
.dm-toc-theme-chapter.active > a {
    color: #5b2a86;
    font-weight: 600;
}

/* Genest niveau: paragrafen onder het actieve hoofdstuk */
.dm-toc-theme-paragraphs {
    list-style: none;
    margin: 0.2rem 0 0.4rem;
    padding: 0 0 0 14px;
    border-left: 2px solid #ece9f4;
}

.dm-toc-theme-paragraphs li {
    margin: 0;
}

.dm-toc-theme-paragraphs a {
    display: flex;
    gap: 0.45rem;
    padding: 0.3rem 0;
    font-size: 0.83rem;
    color: #6b6878;
    text-decoration: none;
    line-height: 1.35;
    transition: color 0.15s ease;
}

.dm-toc-theme-paragraphs a:hover,
.dm-toc-theme-paragraphs a:focus-visible {
    color: #5b2a86;
    outline: none;
}

.dm-toc-theme-paragraphs .dm-toc-para-num {
    color: #b7b3c7;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    flex-shrink: 0;
    min-width: 16px;
}

.dm-toc-theme-paragraphs li.active a {
    color: #5b2a86;
    font-weight: 600;
}

.dm-toc-theme-paragraphs li.active .dm-toc-para-num {
    color: #5b2a86;
}

/* Uitklap-trigger via hover (desktop) en focus-within voor toetsenbord.
   Alleen actief in de werkboek-voorpagina-modus (waar geen actief thema
   gemarkeerd is); binnen content blijft het actieve thema persistent
   uitgeklapt zodat er geen "verdwijnende" content is wanneer de muis
   verschuift. */
@media (hover: hover) and (pointer: fine) {
    .dm-toc-theme-item:not(.active):hover > .dm-toc-theme-chapters,
    .dm-toc-theme-item:not(.active):focus-within > .dm-toc-theme-chapters {
        max-height: 1500px;
        padding-bottom: 0.5rem;
    }
}

/* Klik-toggle (.is-open) of actief thema klapt automatisch open. */
.dm-toc-theme-item.is-open > .dm-toc-theme-chapters,
.dm-toc-theme-item.active > .dm-toc-theme-chapters {
    max-height: 1500px;
    padding-bottom: 0.5rem;
}

.dm-toc-nav--themed .dm-toc-toggle {
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0.5rem;
    color: #8a86a0;
    transition: color 0.15s ease, transform 0.2s ease;
}

.dm-toc-nav--themed .dm-toc-toggle:hover {
    color: #5b2a86;
}

.dm-toc-nav--themed .dm-toc-toggle-icon {
    transition: transform 0.2s ease;
}

.dm-toc-theme-item.is-open .dm-toc-toggle-icon,
.dm-toc-theme-item.active .dm-toc-toggle-icon,
.dm-toc-theme-item:not(.active):hover .dm-toc-toggle-icon {
    transform: rotate(180deg);
}

@media (max-width: 600px) {
    .dm-book-themes-grid {
        grid-template-columns: 1fr;
    }
    .dm-book-theme-section-list {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   APARTE THEMAPAGINA  (/document/{book}/thema/{id}/)
   =================================================================== */

.dm-theme-article {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 40px 64px;
}

.dm-theme-hero {
    position: relative;
    margin: 0 0 2.5rem;
    padding: 2.5rem 2.75rem;
    background: linear-gradient(135deg, #5b2a86 0%, #c8057f 130%);
    color: #fff;
    border-radius: 16px;
    overflow: hidden;
}

.dm-theme-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.18), transparent 55%),
        radial-gradient(circle at 8% 88%, rgba(0, 128, 201, 0.32), transparent 60%);
    pointer-events: none;
}

.dm-theme-hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.dm-theme-hero-eyebrow {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.dm-theme-hero-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.dm-theme-hero-back:hover,
.dm-theme-hero-back:focus-visible {
    color: #fff;
    text-decoration: underline;
    outline: none;
}

.dm-theme-hero-back .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.dm-theme-hero-title {
    font-family: 'Rubik', sans-serif;
    margin: 0;
    font-size: 2.2rem;
    line-height: 1.15;
    color: #fff;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.dm-theme-hero-desc {
    margin: 0.85rem 0 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    max-width: 60ch;
}

.dm-theme-hero-meta {
    margin: 1.1rem 0 0;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}

.dm-theme-chapter-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.dm-theme-chapter-card {
    margin: 0;
}

.dm-theme-chapter-card-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.1rem;
    padding: 1.1rem 1.25rem;
    background: #fff;
    border: 1px solid #ece9f4;
    border-radius: 12px;
    text-decoration: none;
    color: #1f1b3a;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 1px 2px rgba(31, 27, 58, 0.04);
}

.dm-theme-chapter-card-link:hover,
.dm-theme-chapter-card-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(91, 42, 134, 0.4);
    box-shadow: 0 14px 30px -16px rgba(31, 27, 58, 0.28);
    outline: none;
}

.dm-theme-chapter-card-num {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: #c8057f;
    line-height: 1;
    letter-spacing: -0.02em;
}

.dm-theme-chapter-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.dm-theme-chapter-card-title {
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1f1b3a;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.dm-theme-chapter-card-link:hover .dm-theme-chapter-card-title {
    color: #5b2a86;
}

.dm-theme-chapter-card-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-theme-chapter-card-meta {
    font-size: 0.78rem;
    color: #8a86a0;
    letter-spacing: 0.02em;
    margin-top: 0.15rem;
}

.dm-theme-chapter-card-arrow {
    color: #c8c4d6;
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.15s ease, color 0.15s ease;
}

.dm-theme-chapter-card-link:hover .dm-theme-chapter-card-arrow {
    color: #5b2a86;
    transform: translateX(3px);
}

.dm-theme-empty {
    padding: 2.5rem;
    text-align: center;
    color: #888;
    font-style: italic;
    background: #faf9fd;
    border: 1px dashed #ddd6ee;
    border-radius: 12px;
}

/* "Overige hoofdstukken" rustig blokje op werkboek-voorpagina */
.dm-book-themes-extras {
    margin: 2.5rem 0 0;
}

.dm-book-themes-extras-title {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a86a0;
    font-weight: 600;
    margin: 0 0 0.9rem;
}

.dm-book-themes-extras-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem;
}

.dm-book-themes-extras-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: #fff;
    border: 1px solid #ece9f4;
    border-radius: 10px;
    color: #1f1b3a;
    text-decoration: none;
    font-size: 0.92rem;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dm-book-themes-extras-list a:hover,
.dm-book-themes-extras-list a:focus-visible {
    border-color: rgba(91, 42, 134, 0.4);
    color: #5b2a86;
    transform: translateY(-1px);
    outline: none;
}

.dm-book-themes-extras-list a span {
    color: #c8c4d6;
    transition: color 0.15s ease, transform 0.15s ease;
}

.dm-book-themes-extras-list a:hover span {
    color: #5b2a86;
    transform: translateX(2px);
}

@media (max-width: 768px) {
    .dm-theme-article {
        padding: 20px 16px 64px;
    }
    .dm-theme-hero {
        padding: 1.75rem 1.5rem;
    }
    .dm-theme-hero-title {
        font-size: 1.6rem;
    }
    .dm-theme-chapter-grid {
        grid-template-columns: 1fr;
    }
}

/* Auteurs-blok op de themapagina */
.dm-theme-authors {
    margin: 0 0 2rem;
    padding: 1.25rem 1.5rem;
    background: #faf8fd;
    border: 1px solid #ece9f4;
    border-radius: 12px;
}

.dm-theme-authors-title {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a86a0;
    font-weight: 600;
    margin: 0 0 0.85rem;
}

.dm-theme-authors-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
}

.dm-theme-author {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    background: #fff;
    border: 1px solid #ece9f4;
    border-radius: 999px;
    font-size: 0.92rem;
    color: #1f1b3a;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.dm-theme-author:hover {
    border-color: rgba(91, 42, 134, 0.4);
    transform: translateY(-1px);
}

.dm-theme-author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b2a86 0%, #c8057f 130%);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    font-family: 'Rubik', sans-serif;
    flex-shrink: 0;
}

.dm-theme-author-name {
    line-height: 1.3;
}

@media (max-width: 600px) {
    .dm-theme-authors {
        padding: 1rem 1.1rem;
    }
    .dm-theme-author {
        font-size: 0.88rem;
    }
}

/* ===================================================================
   LIGHTBOX — vergroten + opslaan voor figuren én tabellen
   =================================================================== */
.dm-zoomable, .dm-zoomable-table { position: relative; display: inline-block; }
.dm-zoomable-table { display: block; }

.dm-zoom-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(82, 37, 130, 0.25);
    border-radius: 6px;
    color: #5b2a86;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.dm-zoomable:hover .dm-zoom-btn,
.dm-zoomable:focus-within .dm-zoom-btn,
.dm-zoomable-table:hover .dm-zoom-btn,
.dm-zoomable-table:focus-within .dm-zoom-btn,
.dm-zoom-btn:focus {
    opacity: 1;
    transform: translateY(0);
}
.dm-zoom-btn:hover {
    background: #fff;
    color: #1f1b3a;
}

.dm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.dm-lightbox[hidden] { display: none; }
.dm-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
}
.dm-lightbox-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: min(1200px, 96vw);
    max-height: 92vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.45);
    overflow: hidden;
}
.dm-lightbox-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #ece9f4;
    background: #faf8fd;
}
.dm-lightbox-title {
    flex: 1 1 auto;
    font-family: 'Rubik', system-ui, sans-serif;
    font-weight: 600;
    color: #1f1b3a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dm-lightbox-action {
    background: #5b2a86;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.dm-lightbox-action:hover { filter: brightness(1.1); }
.dm-lightbox-close {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #555;
}
.dm-lightbox-close:hover { background: #ece9f4; color: #1f1b3a; }
.dm-lightbox-content {
    padding: 20px 24px;
    overflow: auto;
    flex: 1 1 auto;
}
.dm-lightbox-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.dm-lightbox-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}
body.dm-lightbox-open { overflow: hidden; }

/* Print-modus voor "Opslaan als PDF" — alleen lightbox-content zichtbaar */
@media print {
    body.dm-lightbox-print > *:not(.dm-lightbox) { display: none !important; }
    body.dm-lightbox-print .dm-lightbox,
    body.dm-lightbox-print .dm-lightbox-dialog {
        position: static !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        max-width: none !important;
        max-height: none !important;
    }
    body.dm-lightbox-print .dm-lightbox-backdrop,
    body.dm-lightbox-print .dm-lightbox-toolbar { display: none !important; }
}
