/* ============================================================
   Value Chain Analysis — Custom Theme
   Clean, modern, black & white with subtle grays
   ============================================================ */

/* --- Color overrides --- */
:root {
  --md-primary-fg-color: #000000;
  --md-primary-fg-color--light: #333333;
  --md-primary-fg-color--dark: #000000;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #000000;
  --md-default-fg-color: #1a1a1a;
  --md-default-fg-color--light: #555555;
  --md-default-fg-color--lighter: #999999;
  --md-typeset-a-color: #000000;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #111111;
  --md-default-fg-color: #e0e0e0;
  --md-typeset-a-color: #ffffff;
  --md-accent-fg-color: #ffffff;
}

/* --- Typography (base — responsive overrides below) --- */

.md-typeset h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #000000;
  border-bottom: 2px solid #000000;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
}

[data-md-color-scheme="slate"] .md-typeset h1 {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2.5em;
  color: #000000;
}

[data-md-color-scheme="slate"] .md-typeset h2 {
  color: #e0e0e0;
}

.md-typeset h3 {
  font-weight: 600;
  color: #333333;
}

[data-md-color-scheme="slate"] .md-typeset h3 {
  color: #cccccc;
}

/* --- Links --- */
.md-typeset a {
  text-decoration: underline;
  text-decoration-color: #cccccc;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}

.md-typeset a:hover {
  text-decoration-color: #000000;
}

[data-md-color-scheme="slate"] .md-typeset a {
  text-decoration-color: #555555;
}

[data-md-color-scheme="slate"] .md-typeset a:hover {
  text-decoration-color: #ffffff;
}

/* Nav links should not have underlines */
.md-nav a,
.md-header a,
.md-footer a,
.md-tabs a {
  text-decoration: none !important;
}

/* --- Header --- */
.md-header {
  background-color: #000000;
  box-shadow: none;
  border-bottom: 1px solid #222222;
}

.md-header__title {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* --- Navigation tabs --- */
.md-tabs {
  background-color: #000000;
  border-bottom: 1px solid #222222;
}

/* --- Images --- */
.md-typeset img {
  border-radius: 4px;
  margin: 1.5em 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Hero images: first image after h1 gets special treatment */
.md-typeset h1 + p > img,
.md-typeset h1 + p + p > img:first-child {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  margin-bottom: 2em;
}

/* Section images: first image after h2 */
.md-typeset h2 + p > img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1.5em;
}

/* Inline images should be reasonably sized */
.md-typeset p > img {
  max-width: 100%;
  height: auto;
}

/* Diagram and chart images — keep original proportions */
.md-typeset img[alt*="chart"],
.md-typeset img[alt*="Chart"],
.md-typeset img[alt*="diagram"],
.md-typeset img[alt*="Diagram"],
.md-typeset img[alt*="Waterfall"],
.md-typeset img[alt*="waterfall"],
.md-typeset img[alt*="Cross-section"],
.md-typeset img[alt*="Satellite"],
.md-typeset img[alt*="Map"] {
  max-height: none;
  object-fit: contain;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  background: #fafafa;
  padding: 0.5em;
  border: 1px solid #eee;
  border-radius: 4px;
}

[data-md-color-scheme="slate"] .md-typeset img[alt*="chart"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="Chart"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="diagram"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="Diagram"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="Waterfall"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="waterfall"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="Cross-section"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="Satellite"],
[data-md-color-scheme="slate"] .md-typeset img[alt*="Map"] {
  background: #1a1a1a;
  border-color: #333;
}

/* --- Tables --- */
.md-typeset table:not([class]) {
  font-size: 0.78rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  background-color: #f5f5f5;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #555;
  border-bottom: 2px solid #ddd;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: #1a1a1a;
  color: #aaa;
  border-bottom-color: #333;
}

.md-typeset table:not([class]) td {
  border-bottom: 1px solid #f0f0f0;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
  border-bottom-color: #222;
}

.md-typeset table:not([class]) tr:last-child td {
  border-bottom: none;
}

/* Bold rows in tables (for totals/summary) */
.md-typeset table:not([class]) tr:last-child td strong {
  color: #000000;
}

/* --- Blockquotes --- */
.md-typeset blockquote {
  border-left: 3px solid #000000;
  background: #fafafa;
  padding: 1em 1.5em;
  margin: 1.5em 0;
  border-radius: 0 4px 4px 0;
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
  border-left-color: #ffffff;
  background: #1a1a1a;
}

.md-typeset blockquote p {
  margin: 0;
}

/* --- Code blocks --- */
.md-typeset code {
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  padding: 0.1em 0.3em;
  font-size: 0.85em;
}

[data-md-color-scheme="slate"] .md-typeset code {
  background: #1a1a1a;
  border-color: #333;
}

/* --- Horizontal rules --- */
.md-typeset hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 3em 0;
}

[data-md-color-scheme="slate"] .md-typeset hr {
  border-top-color: #333;
}

/* --- Footer --- */
.md-footer {
  background-color: #000000;
}

.md-content {
  padding-bottom: 4em;
}

/* --- Hide site title from sidebar --- */
.md-header__title .md-header__topic:first-child {
  display: none;
}

/* --- Hide empty TOC (pages with no H2 headings) --- */
.md-sidebar--secondary:has(.md-nav__list:empty) {
  display: none;
}

/* --- Sidebar nav --- */
.md-nav__link--active {
  font-weight: 600;
}

/* --- Search bar --- */
.md-search__input {
  background-color: #1a1a1a;
  color: #ffffff;
}

.md-search__input::placeholder {
  color: #999999;
}

.md-search__input:focus {
  background-color: #222222;
  color: #ffffff;
}

/* --- Framework images (consistent sizing on course overview) --- */
.framework-img {
  max-height: 280px;
  width: 100%;
  object-fit: contain;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 0.75em;
  margin: 0.5em 0 1.5em 0;
}

[data-md-color-scheme="slate"] .framework-img {
  background: #1a1a1a;
  border-color: #333;
}

/* --- Responsive content width ---
   Mobile (<768px):  full width, smaller type
   Tablet (768-1219px): comfortable reading width
   Desktop (1220px+): wide layout, larger type, more breathing room
*/

/* Mobile (default) */
.md-content {
  max-width: 100%;
}

.md-typeset {
  font-size: 0.8rem;
  line-height: 1.65;
}

/* Tablet */
@media screen and (min-width: 768px) {
  .md-typeset {
    font-size: 0.85rem;
    line-height: 1.7;
  }

  .md-content__inner {
    max-width: 680px;
    margin: 0 auto;
  }
}

/* Desktop */
@media screen and (min-width: 1220px) {
  .md-typeset {
    font-size: 0.9rem;
    line-height: 1.75;
  }

  .md-content__inner {
    max-width: 860px;
    margin: 0 auto;
  }

  .md-typeset h1 {
    font-size: 2em;
  }

  .md-typeset h2 {
    font-size: 1.5em;
  }

  /* Wider images on desktop */
  .md-typeset h1 + p > img,
  .md-typeset h1 + p + p > img:first-child {
    max-height: 480px;
  }

  .md-typeset h2 + p > img {
    max-height: 400px;
  }

  /* Tables can breathe */
  .md-typeset table:not([class]) {
    font-size: 0.82rem;
  }
}

/* --- Admonitions / callouts --- */
.md-typeset .admonition,
.md-typeset details {
  border: 1px solid #e0e0e0;
  border-left: 3px solid #000000;
  box-shadow: none;
  border-radius: 4px;
}

[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  border-color: #333;
  border-left-color: #ffffff;
}

/* --- Print: clean output --- */
@media print {
  .md-header,
  .md-footer,
  .md-sidebar,
  .md-tabs {
    display: none;
  }

  .md-content {
    max-width: 100%;
  }

  .md-typeset img {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
