/* ============================================
   Web fonts — Source Serif 4 for long-form body
   Headings/UI stay on the Material default (Roboto).
   ============================================ */
@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&display=swap");

/* ============================================
   Color palette — unified navy
   ============================================ */
:root,
[data-md-color-primary="custom"] {
  --sdp-accent:    #8B1E1E;  /* editor's-mark red — links, key-lines, marginalia */
  --sdp-header:    #0f1e36;  /* deep ink-navy header — book-cover feel */
  --sdp-rule:      rgba(255, 255, 255, 0.12);  /* subtle hairline under the header */
  --sdp-note-bg:   #fafbfc;  /* neutral surface — admonitions, nav section labels */
  --sdp-note-edge: #e2e5eb;
  --md-primary-fg-color:        var(--sdp-header);
  --md-primary-fg-color--light: #2c4e72;
  --md-primary-fg-color--dark:  #112742;
}

h1 {
    font-weight: bold !important;
    color: #000 !important;
    font-size: 1.3rem !important; /* Adjust as needed */
    line-height: 1.1;
    word-break: normal;
  }

/* ============================================
   Announce bar — pre-release notice
   ============================================ */
.md-banner {
  background-color: #1f3a5f;
  color: #ffffff;
}
.md-banner__inner {
  font-weight: 600;
  text-align: center;
  font-size: 0.85rem;
}
.md-banner .md-banner__button {
  color: #ffffff;
}



h2 {
  font-weight: bold !important;
} 

.md-nav--secondary .md-nav__item .md-nav__link {
  font-weight: normal;
}

.md-nav--secondary > .md-nav__list > .md-nav__item > .md-nav__link {
  font-weight: bold;
}

.md-nav--secondary .md-nav__item .md-nav__list .md-nav__item .md-nav__link {
  color: #888;
}

/* Highlight the current TOC item in the right sidebar */
.md-nav--secondary .md-nav__link--active {
  color: var(--sdp-accent) !important;
  font-weight: bold !important;
}

/* Hide the "Table of contents" label — the column itself is self-evident */
.md-nav--secondary > .md-nav__title {
  display: none !important;
}

.sidebar-separator {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 8px 0 12px 0;
}

/* Highlight the current chapter in the left sidebar */
.md-nav--primary .md-nav__item .md-nav__link--active {
  font-weight: bold !important;
  color: var(--sdp-accent) !important;
}

/* Neutralize note / info / quote admonitions (Chapter Info, Book Info, etc.) */
.md-typeset .admonition.note,
.md-typeset details.note,
.md-typeset .admonition.info,
.md-typeset details.info,
.md-typeset .admonition.quote,
.md-typeset details.quote,
.md-typeset .admonition.abstract,
.md-typeset details.abstract,
.md-typeset .admonition.tip,
.md-typeset details.tip {
    background-color: var(--sdp-note-bg) !important;
    background-image: none !important;
    border-radius: 4px;
    border: 1px solid var(--sdp-note-edge) !important;
    border-left: 1px solid var(--sdp-note-edge) !important;
    box-shadow: none !important;
    min-height: 2em;
}

/* Title strip — Material paints a 10%-tinted band; flatten it */
.md-typeset .note > .admonition-title,
.md-typeset .note > summary,
.md-typeset .info > .admonition-title,
.md-typeset .info > summary,
.md-typeset .quote > .admonition-title,
.md-typeset .quote > summary,
.md-typeset .abstract > .admonition-title,
.md-typeset .abstract > summary,
.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
    background-color: var(--sdp-note-bg) !important;
    background-image: none !important;
    border-left: none !important;
    border-bottom: 1px solid var(--sdp-note-edge) !important;
    color: #6b7280 !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0.5rem 0.75rem 0.5rem 2rem !important;
}

/* Icon — pin it vertically centered with the title text */
.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before,
.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before,
.md-typeset .quote > .admonition-title::before,
.md-typeset .quote > summary::before,
.md-typeset .abstract > .admonition-title::before,
.md-typeset .abstract > summary::before,
.md-typeset .tip > .admonition-title::before,
.md-typeset .tip > summary::before {
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: 0.9rem !important;
    width: 0.9rem !important;
}

/* Icon on the title strip */
.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before,
.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before,
.md-typeset .quote > .admonition-title::before,
.md-typeset .quote > summary::before,
.md-typeset .abstract > .admonition-title::before,
.md-typeset .abstract > summary::before,
.md-typeset .tip > .admonition-title::before,
.md-typeset .tip > summary::before {
    background-color: #6b7280 !important;
}

/* Compact body content inside these admonitions */
.md-typeset .admonition.note > p,
.md-typeset details.note > p,
.md-typeset .admonition.info > p,
.md-typeset details.info > p,
.md-typeset .admonition.quote > p,
.md-typeset details.quote > p,
.md-typeset .admonition.abstract > p,
.md-typeset details.abstract > p,
.md-typeset .admonition.tip > p,
.md-typeset details.tip > p {
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
    margin: 0.3rem 0 !important;
}

/* If the note is truly empty and not rendering, add a non-breaking space (&nbsp;) inside the note in your markdown. */

/* ============================================
   Content Level Filter
   ============================================ */

/* Inline filter elements (inside info box) */
#chapter-reading-time {
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  display: inline !important;
  color: #888 !important;
}

.chapter-completion {
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #888 !important;
  margin-top: 4px !important;
}

.progress-bar {
  width: 100px !important;
  height: 6px !important;
  background: #ddd !important;
  border-radius: 3px !important;
  overflow: hidden !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin: 0 !important;
  padding: 0 !important;
}

.progress-bar-fill {
  height: 6px !important;
  background: var(--sdp-header) !important;
  border-radius: 3px !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Progress bar width classes */
.progress-10 { width: 10% !important; }
.progress-20 { width: 20% !important; }
.progress-30 { width: 30% !important; }
.progress-40 { width: 40% !important; }
.progress-50 { width: 50% !important; }
.progress-60 { width: 60% !important; }
.progress-70 { width: 70% !important; }
.progress-80 { width: 80% !important; }
.progress-90 { width: 90% !important; }
.progress-100 { width: 100% !important; }

#filter-buttons-inline {
  display: inline !important;
  margin-left: 4px !important;
}

/* Filter options style */
.filter-option {
  color: #aaa !important;
  cursor: pointer !important;
  font-weight: 400 !important;
  font-size: 0.75rem !important;
  transition: color 0.2s ease !important;
}

.filter-option:hover {
  color: #555 !important;
}

.filter-option.active {
  color: #000 !important;
}

.filter-sep {
  color: #ccc !important;
  margin: 0 6px !important;
}

/* Fallback: Filter buttons sticky bar (when no inline container) */
#content-filter-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  margin-right: 4px;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid #ced4da;
  border-radius: 20px;
  background: white;
  color: #495057;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.filter-btn.active {
  background: var(--sdp-accent);
  color: white;
  border-color: var(--sdp-accent);
}

.filter-btn[data-level="1"].active {
  background: #c62828;
  border-color: #c62828;
}

.filter-btn[data-level="2"].active {
  background: #ef6c00;
  border-color: #ef6c00;
}

.filter-btn[data-level="3"].active {
  background: #2e7d32;
  border-color: #2e7d32;
}

/* Hidden content */
.content-hidden {
  display: none !important;
}

/* Hidden in Essential mode */
.essential-hidden {
  display: none !important;
}

/* Key lines (!! at start) - highlighted in Complete mode */
.key-line {
  font-weight: 500 !important;
  border-left: 3px solid var(--sdp-accent) !important;
  padding-left: 12px !important;
  margin-left: -15px !important;
}

/* Key phrases (!!...!! inline) - no special styling in Complete mode */
.key-phrase {
  /* No styling - looks like normal text */
}

/* In Essential mode, show only key phrases */
.show-key-only {
  font-size: 0 !important;
  color: transparent !important;
}

.show-key-only .key-phrase {
  font-size: 0.8rem !important;
  color: #000 !important;
  background: none !important;
}

/* Key summary (shown in Essential mode for inline phrases) */
.key-summary {
  font-weight: 500 !important;
  border-left: 3px solid var(--sdp-accent) !important;
  padding-left: 12px !important;
  margin-left: -15px !important;
}

/* Hidden TOC items */
.toc-hidden {
  display: none !important;
}

/* ============================================
   Incomplete Chapters Styling (progress < 50%)
   Pure CSS solution - no flash on navigation
   ============================================ */

/* Chapters with progress < 50% - listed by URL */
.md-nav--primary .md-nav__link[href*="/change/"],
.md-nav--primary .md-nav__link[href*="/flexibility/"],
.md-nav--primary .md-nav__link[href*="/longevity/"],
.md-nav--primary .md-nav__link[href*="/availability/"],
.md-nav--primary .md-nav__link[href*="/performance/"],
.md-nav--primary .md-nav__link[href*="/cost/"],
.md-nav--primary .md-nav__link[href*="/process/"],
.md-nav--primary .md-nav__link[href*="/operability/"],
.md-nav--primary .md-nav__link[href*="/team-organization/"]{
  color: #999 !important;
  font-style: italic;
}

/* Hover state for incomplete chapters */
.md-nav--primary .md-nav__link[href*="/change/"]:hover,
.md-nav--primary .md-nav__link[href*="/flexibility/"]:hover,
.md-nav--primary .md-nav__link[href*="/longevity/"]:hover,
.md-nav--primary .md-nav__link[href*="/availability/"]:hover,
.md-nav--primary .md-nav__link[href*="/performance/"]:hover,
.md-nav--primary .md-nav__link[href*="/cost/"]:hover,
.md-nav--primary .md-nav__link[href*="/process/"]:hover,
.md-nav--primary .md-nav__link[href*="/operability/"]:hover,
.md-nav--primary .md-nav__link[href*="/team-organization/"]:hover{
  color: #666 !important;
}

/* "About" / "Feedback" — discreet, secondary chrome links.
   Sans-serif so they read as UI controls, not as part of the book title. */
.md-header__about-link {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  align-self: center;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
}

/* Push the first auxiliary link to the right so it sits after the title block */
.md-header__about-link:first-of-type {
  margin-left: auto;
}

.md-header__about-link:hover {
  color: rgba(255, 255, 255, 0.95);
  background: transparent;
}

/* Active state — shows current page (e.g., on /about) */
.md-header__about-link--active,
.md-header__about-link--active:hover {
  color: #ffffff;
  font-weight: 600;
}

/* Desktop: show text label, hide icon; thin vertical separator between items */
.md-header__about-link-icon { display: none; }
.md-header__about-link-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
  display: block;
}

/* Vertical separator after About and Feedback (not after the last item) */
.md-header__about-link + .md-header__about-link::before,
.md-header__about-link + label.md-header__button::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.9rem;
  background: rgba(255, 255, 255, 0.25);
  margin-right: 10px;
  vertical-align: middle;
}

/* Mobile: swap to icon-only so About + Feedback don't crowd the header */
@media screen and (max-width: 60em) {
  .md-header__about-link {
    padding: 6px 6px;
  }
  .md-header__about-link-text { display: none; }
  .md-header__about-link-icon { display: inline-flex; }
  .md-header__about-link + .md-header__about-link::before,
  .md-header__about-link + label.md-header__button::before { display: none; }
}

/* ============================================
   Header — book-cover look
   ============================================ */

/* Deep ink-navy, with a warm hairline at the bottom */
.md-header {
  border-bottom: 1px solid var(--sdp-rule);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

/* Drop the logo entirely — title alone carries the header (book-cover look) */
.md-header .md-logo {
  display: none !important;
}

/* Title block: site name on top, italic subtitle underneath */
.md-header__topic--book {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.1;
  padding: 4px 0;
}

.md-header__site-name {
  font-family: var(--sdp-serif) !important;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: #fff;
}

.md-header__subtitle {
  font-family: var(--sdp-serif) !important;
  font-size: 0.65rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

@media screen and (max-width: 60em) {
  .md-header__site-name { font-size: 0.85rem; }
  .md-header__subtitle  { font-size: 0.58rem; }
}

/* Search becomes a clean icon — no inline placeholder taking space */
.md-search__form {
  background: transparent !important;
}

.md-search__form:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Search input text must be readable on the dark header background */
.md-search__input {
  color: #ffffff !important;
}

.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* ============================================
   Reading-mode header tint
   In Essential mode, recolor the top header bar so the reader sees at a glance
   which mode they're in. Complete mode keeps the default navy.
   ============================================ */
body.mode-essential .md-header {
  border-bottom: 2px solid var(--sdp-accent) !important;
}

/* Section group titles (Foundations, System Qualities) — neutral, non-clickable on desktop */
.md-nav--primary > .md-nav__list > .md-nav__item--section > .md-nav__link {
  background: var(--sdp-note-bg);
  border-left: 2px solid #9ca3af;
  padding: 3px 8px;
  margin: 6px 0 2px 0;
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b5563 !important;
  border-radius: 2px;
  pointer-events: none;
  cursor: default;
}

/* On mobile, the nav is a collapsible drawer — section titles must stay clickable
   so users can expand "Foundations" / "System Qualities" / "Process". */
@media screen and (max-width: 76.1875em) {
  .md-nav--primary > .md-nav__list > .md-nav__item--section > .md-nav__link {
    pointer-events: auto;
    cursor: pointer;
  }
}

/* ============================================
   Feedback modal
   ============================================ */
.feedback-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}

.feedback-modal__overlay.is-open {
  display: flex;
}

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

.feedback-modal__card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  padding: 24px 24px 20px;
  font-family: inherit;
}

.feedback-modal__title {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f2937;
}

.feedback-modal__intro {
  margin: 0 0 14px 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #4b5563;
}

.feedback-modal__textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.85rem;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  resize: vertical;
  min-height: 120px;
  outline: none;
}

.feedback-modal__textarea:focus {
  border-color: #1f6f4a;
  box-shadow: 0 0 0 2px rgba(31, 111, 74, 0.15);
}

/* Honeypot — visually hidden but present in the DOM for bots to fill */
.feedback-modal__hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.feedback-modal__status {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #4b5563;
}

.feedback-modal__status.is-error {
  color: #b91c1c;
}

.feedback-modal__status.is-ok {
  color: #1f6f4a;
}

.feedback-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.feedback-modal__send,
.feedback-modal__cancel {
  font: inherit;
  font-size: 0.82rem;
  padding: 7px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.feedback-modal__send {
  background: #1f6f4a;
  color: #fff;
}

.feedback-modal__send:hover:not(:disabled) {
  background: #195c3d;
}

.feedback-modal__send:disabled,
.feedback-modal__cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-modal__cancel {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.feedback-modal__cancel:hover:not(:disabled) {
  background: #f3f4f6;
}

/* ============================================
   Reading typography — long-form serif
   Body + sidebars share the same serif so the chrome reads as one book.
   The header bar and code blocks keep their original fonts.
   ============================================ */
:root {
  --sdp-serif: "Source Serif 4", "Source Serif Pro", "Iowan Old Style", "Charter", "Georgia", serif;
}

.md-typeset p,
.md-typeset li,
.md-typeset blockquote,
article.md-content__inner p,
article.md-content__inner li {
  font-family: var(--sdp-serif) !important;
  font-size: 0.84rem;
  line-height: 1.7;
  color: #1f2937;
  text-align: left !important;
  hyphens: none;
}

/* ============================================
   Reading measure — cap the content column to a book-like width
   ~68 characters per line at the current body size.
   ============================================ */
.md-content__inner {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ============================================
   Page background — soft gray surrounding a white reading "sheet".
   Effect: paper-on-table.
   ============================================ */
:root,
[data-md-color-scheme="default"] {
  --md-default-bg-color: #fafbfc;
}

body,
.md-main,
.md-main__inner,
.md-sidebar,
.md-sidebar__scrollwrap,
.md-nav,
.md-nav--primary,
.md-nav--secondary {
  background-color: #fafbfc !important;
}

.md-content {
  background-color: #ffffff;
}

/* Tighten the gap between the header bar and the first content/nav row */
.md-main__inner {
  margin-top: 0 !important;
  padding-top: 0.4rem !important;
}

/* ============================================
   Sidebar scrollbars — thin, near-invisible, visible on hover only.
   Removes the heavy vertical gray rails next to the nav and TOC.
   ============================================ */
.md-sidebar__scrollwrap {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s ease;
}
.md-sidebar__scrollwrap:hover {
  scrollbar-color: rgba(15, 23, 42, 0.18) transparent;
}

/* WebKit (Safari, Chrome) */
.md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 6px;
}
.md-sidebar__scrollwrap::-webkit-scrollbar-track {
  background: transparent;
}
.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s ease;
}
.md-sidebar__scrollwrap:hover::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
}
.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.32);
}

/* Let illustrations breathe past the measure — full content width */
.md-content__inner > p > img,
.md-content__inner > p:has(> img) {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

/* Soften illustrations slightly so the black ink doesn't shout against the page */
.md-content__inner img {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.md-content__inner img:hover {
  opacity: 1;
}

/* Left chapter tree + right TOC share the body serif */
.md-nav,
.md-nav__title,
.md-nav__link,
.md-nav__list {
  font-family: var(--sdp-serif) !important;
}

/* In-content headings share the body serif — only the top header bar stays sans */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: var(--sdp-serif) !important;
}

/* Subtle hairline separators under H1 (chapter) and H2 (section).
   H3 (slides) intentionally left untouched — too frequent to underline. */
.md-typeset h1 {
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.1rem;
}

.md-typeset h2 {
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #eef0f3;
  margin-bottom: 0.9rem;
}

/* Code / inline-code stays in the mono font — opt back out of the serif cascade */
.md-typeset code,
.md-typeset pre,
.md-typeset kbd,
.md-typeset p code,
.md-typeset li code {
  font-family: var(--md-code-font, "Roboto Mono", monospace) !important;
}

/* ============================================
   Slim Chapter Info — collapse the boxed admonition to a single discreet line
   Targets only the admonition that contains the chapter-info widgets.
   ============================================ */
.md-typeset .admonition.info:has(#chapter-reading-time),
.md-typeset details.info:has(#chapter-reading-time) {
  background: transparent !important;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: -0.3rem 0 1.2rem 0 !important;
  min-height: 0 !important;
  font-size: 0.72rem !important;
  color: #9ca3af !important;
}

/* Hide the "Chapter Info" title strip entirely */
.md-typeset .admonition.info:has(#chapter-reading-time) > .admonition-title,
.md-typeset details.info:has(#chapter-reading-time) > summary {
  display: none !important;
}

/* The admonition body wraps the three spans — flatten it into a flex row */
.md-typeset .admonition.info:has(#chapter-reading-time) > p,
.md-typeset .admonition.info:has(#chapter-reading-time) > *:not(.admonition-title):not(summary) {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0 !important;
}

/* Each direct chapter-info span on the row */
.md-typeset .admonition.info:has(#chapter-reading-time) #chapter-reading-time,
.md-typeset .admonition.info:has(#chapter-reading-time) #filter-buttons-inline,
.md-typeset .admonition.info:has(#chapter-reading-time) .chapter-completion {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 6px;
}

/* Visible dot separator between the chapter-info spans */
.md-typeset .admonition.info:has(#chapter-reading-time) #chapter-reading-time::after,
.md-typeset .admonition.info:has(#chapter-reading-time) #filter-buttons-inline::after {
  content: "·";
  display: inline-block;
  margin: 0 12px;
  color: #d1d5db;
}

/* Slim the progress bar inside the chapter info line */
.md-typeset .admonition.info:has(#chapter-reading-time) .progress-bar {
  width: 60px !important;
  height: 4px !important;
  margin-left: 6px !important;
}
.md-typeset .admonition.info:has(#chapter-reading-time) .progress-bar-fill {
  height: 4px !important;
}

/* Tighten the dot separators so the whole row fits on a single line */
.md-typeset .admonition.info:has(#chapter-reading-time) #chapter-reading-time::after,
.md-typeset .admonition.info:has(#chapter-reading-time) #filter-buttons-inline::after {
  margin: 0 8px !important;
}

/* ============================================
   Hero image — promote the first illustration after the chapter intro
   ============================================ */
.md-typeset h1 ~ p:first-of-type + p img,
.md-typeset .admonition.info:has(#chapter-reading-time) + p img,
.md-typeset .admonition.info:has(#chapter-reading-time) + p + p img,
.md-typeset .admonition.info:has(#chapter-reading-time) ~ p:first-of-type img {
  display: block;
  margin: 1.6rem auto 2rem auto;
  max-width: 100%;
}

/* Illustrations read as ink on paper, not as web cards — no rounding, no shadow. */
.md-content__inner img {
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* ============================================
   Left sidebar — more room between section groups
   ============================================ */
.md-nav--primary > .md-nav__list > .md-nav__item--section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #eef0f3;
}

.md-nav--primary > .md-nav__list > .md-nav__item--section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ============================================
   Right TOC — contrast H2 (sections) vs H3 (slides)
   H2 = darker + bolder, H3 = lighter + lighter weight
   ============================================ */
.md-nav--secondary > .md-nav__list > .md-nav__item > .md-nav__link {
  color: #4b5563 !important;
  font-weight: 600 !important;
  font-size: 0.72rem !important;
  margin-top: 6px;
}

.md-nav--secondary .md-nav__item .md-nav__list .md-nav__item .md-nav__link {
  color: #9ca3af !important;
  font-weight: 400 !important;
}

.md-nav--secondary .md-nav__item .md-nav__list .md-nav__item .md-nav__link:hover {
  color: #374151 !important;
}

/* ============================================
   Writing-progress widget — author-facing, not reader-facing
   ============================================ */
.md-typeset .admonition.info:has(#chapter-reading-time) .chapter-completion {
  display: none !important;
}

/* Hide the separator preceding the (now hidden) progress widget */
.md-typeset .admonition.info:has(#chapter-reading-time) #filter-buttons-inline::after {
  display: none !important;
}


