/* ==========================================================================
   MNI Dossier Enhancements (Minimal) — Stylesheet v2.1
   ========================================================================== */

/* ---------- Section numbers ---------- */

.mni-num,
.section-number {
    color: #f19301;
    font-weight: 700;
    margin-right: 0.4em;
}

/* ---------- Child content injection ---------- */

.mni-child-content {
    margin: 1rem 0 2.5rem 0;
}

.mni-child-title {
    color: #2c6fbb;
    font-size: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ---------- Next section link ---------- */

.mni-next {
    margin-top: 3rem;
    padding-bottom: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.mni-next-link {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    background: #f7f9fc;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mni-next-link:hover {
    background: #e8f0fe;
    border-color: #2c6fbb;
}

.mni-next-label {
    color: #2c6fbb;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.mni-next-title {
    color: #1a2b3c;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ---------- "View full book" link ---------- */

.mni-view-full {
    text-align: center;
    margin: 2rem 0 1rem 0;
}

.mni-view-full-link {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    color: #666 !important;
    text-decoration: none !important;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.mni-view-full-link:hover {
    background: #f0f6ff;
    color: #2c6fbb !important;
    border-color: #2c6fbb;
}

/* ---------- Full book view ---------- */

.mni-full-book {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.mni-full-book-title {
    color: #2c6fbb;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #2c6fbb;
}

.mni-full-book-toc {
    background: #f7f9fc;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.mni-full-book-toc h2 {
    color: #2c6fbb;
    margin-top: 0;
}

.mni-full-book-toc ul {
    list-style: none;
    padding-left: 0;
}

.mni-full-book-toc ul ul {
    padding-left: 1.5rem;
}

.mni-full-book-toc a {
    color: #333;
    text-decoration: none;
}

.mni-full-book-toc a:hover {
    color: #2c6fbb;
    text-decoration: underline;
}

.mni-full-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    scroll-margin-top: 80px;
}

.mni-full-section:last-child {
    border-bottom: none;
}

.mni-full-section .mni-section-heading {
    color: #2c6fbb;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.mni-full-section.mni-level-1 .mni-section-heading {
    font-size: 2.2rem;
    background: #f0f6ff;
    padding: 1rem 1.5rem;
    border-left: 6px solid #2c6fbb;
    border-bottom: none;
}

.mni-full-section.mni-level-2 .mni-section-heading { font-size: 1.7rem; }
.mni-full-section.mni-level-3 .mni-section-heading { font-size: 1.35rem; }
.mni-full-section.mni-level-4 .mni-section-heading { font-size: 1.15rem; color: #f19301; border-bottom: none; }

.mni-view-toggle {
    text-align: center;
    margin: 1rem 0 2rem 0;
}

.mni-view-toggle-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background: #fff;
    border: 2px solid #2c6fbb;
    color: #2c6fbb !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
}

.mni-view-toggle-btn:hover,
.mni-view-toggle-btn.active {
    background: #2c6fbb;
    color: #fff !important;
}

@media print {
    .mni-view-toggle,
    .mni-next,
    .mni-view-full { display: none !important; }
    .mni-full-section.mni-level-1 { page-break-before: always; }
}

/* ---------- Auto-generated master references ---------- */

.mni-master-references {
    max-width: 900px;
}

.mni-master-refs-info {
    background: #f0f6ff;
    border-left: 4px solid #2c6fbb;
    padding: 12px 16px;
    margin-bottom: 2rem;
    color: #555;
    font-size: 0.9rem;
}

.master-references-list {
    font-size: 0.92rem;
    line-height: 1.65;
}

.master-references-list li {
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f0f0f0;
}

.master-references-list li:last-child {
    border-bottom: none;
}

@media print {
    .mni-master-refs-info { display: none; }
}


/* ============================================================================
 * Smart-scroll: clear the sticky header + search bar when jumping to anchors.
 *
 * Adjust --mni-scroll-offset below if your sticky bar height changes
 * (Astra header ≈ 80px + MNI search bar ≈ 60px = 140px currently).
 *
 * For figures, the JS in mni-smart-scroll.js does smart scrolling so the IMAGE
 * shows (not just the caption). The CSS below is the safety net AND handles
 * tables (where the title is already above the table, no JS needed).
 *
 * NOTE on selectors:
 *   - .figure-title catches both figures AND tables — both use that class in
 *     this dossier's markup (regardless of whether they're a figure or table).
 *   - [id^="figure-"] / [id^="table-"] catches any element whose ID begins with
 *     those prefixes, regardless of class — defensive belt-and-braces.
 *   - figure.wp-block-image catches the parent <figure> wrapper the JS scrolls to.
 * ============================================================================ */
:root {
    --mni-scroll-offset: 140px;
}

.figure-title,
.table-title,
[id^="figure-"],
[id^="table-"],
[id^="section-"],
figure.wp-block-image,
.wp-block-table,
table {
    scroll-margin-top: var(--mni-scroll-offset);
}
