/* Networker export styles.
 * Applied to HTML, PDF, and EPUB/MOBI exports. Word (docx) uses a
 * separate styling model (reference templates), so CSS rules here
 * don't affect docx output — that's a separate option (not yet
 * exposed via UI).
 * Edit and Save here; the next export uses the updated styles. */

@page {
    size: letter;
    margin: 2cm;
    @bottom-center {
        content: counter(page);
    }
}

body {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.5;
    margin: 2em;
    color: #222;
}

h1, h2, h3 {
    font-family: Helvetica, Arial, sans-serif;
    color: #111;
}
h1 { font-size: 1.8em; }
h2 { font-size: 1.4em; margin-top: 1.5em; }
h3 { font-size: 1.15em; }

p  { margin: 0 0 0.8em 0; }
ul, ol { margin: 0 0 0.8em 1.5em; }

code, pre {
    font-family: "Menlo", "Consolas", monospace;
    font-size: 0.95em;
}
pre {
    background: #f4f4f4;
    padding: 0.6em 1em;
    border-radius: 3px;
    overflow-x: auto;
}

blockquote {
    border-left: 3px solid #888;
    padding-left: 1em;
    color: #555;
    margin: 0 0 0.8em 0;
}


/* ─── Responsive base (always included) ─── */
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
/* Wide tables scroll within their column instead of widening the page */
.site-content table { display: block; overflow-x: auto; max-width: 100%; }

/* ─── Publish-pipeline chrome (always included) ─── */

.site-nav, .page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
    padding: 0.7em 1em;
    margin: 0 0 1.8em 0;
    background: #fafafa;
    border-bottom: 1px solid #e4e4e4;
    font-size: 0.85em;
    color: #888;
}

.site-nav a, .page-nav a {
    color: #5a6c7d;
    text-decoration: none;
}
.site-nav a:hover, .page-nav a:hover {
    color: #1a2733;
    text-decoration: underline;
}

.site-nav-prev, .page-nav-prev,
.site-nav-next, .page-nav-next {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-nav-next, .page-nav-next { text-align: right; }

.site-nav-current, .page-nav-up {
    flex: 0 1 auto;
    text-align: center;
    color: #2a3540;
    font-weight: 600;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Top-level publication index */
.publish-section { margin: 0 0 1.8em 0; }
.publish-section h2 {
    margin: 0.5em 0 0.4em 0;
    font-size: 1.15em;
    color: #4a5a6a;
    letter-spacing: 0.02em;
}
.publish-toc {
    list-style: none;
    padding-left: 0.5em;
    margin: 0;
}
.publish-toc li { padding: 0.2em 0; }
.publish-toc li a { color: #2a6496; text-decoration: none; }
.publish-toc li a:hover { text-decoration: underline; }

/* Concat-with-divider boundary between pages */
.page-divider {
    border: 0;
    border-top: 1px dashed #d0d0d0;
    margin: 2em 0;
}

/* ─── Notebook site theme (page-per-file layout only) ─── */
/* Scoped to `body.site` (set by the orchestrator for page-per-file) so the
   full-bleed banner/sidebar layout never touches the concat layouts. */

body.site { margin: 0; }

.site-banner {
    background: #1f2a44;
    color: #fff;
    padding: 1.1em 1.5em;
}
.banner-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 0.9em; }
.site-logo { height: 40px; width: auto; display: block; flex: 0 0 auto; }
.banner-text { display: flex; flex-direction: column; gap: 0.1em; }
.site-tagline { font-size: 0.8em; font-weight: 400; opacity: 0.8; }
.site-banner .site-title {
    color: #fff;
    font-size: 1.25em;
    font-weight: 600;
    text-decoration: none;
}

.site-layout {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    align-items: flex-start;
}

.notebook-nav {
    flex: 0 0 220px;
    background: #f6f7f9;
    border-right: 1px solid #e4e6ea;
    padding: 1.25em 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
}
.notebook-nav ul { list-style: none; margin: 0; padding: 0; }
.notebook-nav li a {
    display: block;
    padding: 0.4em 1.25em;
    color: #222;
    text-decoration: none;
    font-size: 0.95em;
}
.notebook-nav li a:hover { background: #eceef1; }
.notebook-nav li.active a {
    color: #2d6cdf;
    font-weight: 600;
    border-left: 3px solid #2d6cdf;
    padding-left: calc(1.25em - 3px);
}

.site-content {
    flex: 1 1 auto;
    padding: 1.75em 2em;
    max-width: 760px;
}
.site-content img { max-width: 100%; height: auto; }
.site-content h1:first-child, .site-content h2:first-child { margin-top: 0; }

/* ─── Collapsible table of contents (pure-CSS hamburger toggle) ─── */
/* The hidden #toc-toggle checkbox sits just before .site-layout; its
   <label class="toc-toggle-btn"> lives in the banner. Default state
   (unchecked) shows the sidebar on desktop; checking it collapses the
   sidebar so the content spans full width. The mobile breakpoint below
   flips the default (collapsed) and the checked state (expanded). */
.toc-toggle { display: none; }
.toc-toggle-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9em;
    height: 1.9em;
    margin-right: 0.1em;
    font-size: 1.15em;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    border-radius: 5px;
    user-select: none;
}
.toc-toggle-btn:hover { background: rgba(255,255,255,0.14); }
.toc-toggle:checked ~ .site-layout .notebook-nav { display: none; }

.site-footer {
    border-top: 1px solid #e4e6ea;
    color: #666;
    font-size: 0.85em;
    text-align: center;
    padding: 1.5em;
}
.site-footer a { color: #2d6cdf; }

@media (max-width: 720px) {
    .site-layout { flex-direction: column; }
    .notebook-nav {
        flex-basis: auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e4e6ea;
        position: static;
        display: none;   /* collapsed by default on small screens */
    }
    .toc-toggle:checked ~ .site-layout .notebook-nav { display: block; }
    .site-content { padding: 1.25em; }
}

/* ─── Landing / home page (page-per-file, when a Home config page exists) ─── */

.hero {
    position: relative;
    text-align: center;
    color: #fff;
    padding: 5rem 1.5rem 5.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #1f2a44, #2d6cdf);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-scrim { position: absolute; inset: 0; z-index: 1; }
.hero.has-image .hero-scrim {
    background: linear-gradient(135deg, rgba(31,42,68,0.82), rgba(31,42,68,0.5));
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 2.8rem; line-height: 1.1; margin: 0 0 0.7rem; letter-spacing: -0.5px; color: #fff; }
.hero-tagline { font-size: 1.2rem; opacity: 0.92; margin: 0 0 2rem; font-weight: 400; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
    display: inline-block; padding: 0.8rem 1.8rem; border-radius: 7px;
    font-size: 1.02rem; font-weight: 600; text-decoration: none;
}
.btn-primary { background: #fff; color: #1f2a44; }
.btn-secondary { border: 1.5px solid rgba(255,255,255,0.8); color: #fff; }

.intro { max-width: 720px; margin: 0 auto; padding: 3.5rem 1.5rem 1rem; text-align: center; }
.intro p { font-size: 1.18rem; color: #333; margin: 0; }

.contents { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.contents h2 {
    font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: #666; font-weight: 600; margin: 0 0 1.5rem; text-align: center;
}
.contents-grid { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 2.5rem; row-gap: 1.6rem; }
.toc-item { border-top: 1px solid #e4e6ea; padding-top: 0.9rem; }
.toc-title {
    display: inline-block; font-size: 1.08rem; font-weight: 600;
    color: #2d6cdf; text-decoration: none; margin-bottom: 0.2rem;
}
.toc-title:hover { text-decoration: underline; }
.toc-desc { display: block; font-size: 0.92rem; color: #666; }

@media (max-width: 820px) {
    .contents-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.1rem; }
}
@media (max-width: 560px) {
    .contents-grid { grid-template-columns: 1fr; }
}
