/* EduCore Brand Theme for mdBook
   Matches indusknowledge.com design language
   Font: Inter | Colors: Orange/Burgundy brand palette

   NOTE: mdBook sets font-size: 62.5% on :root (1rem = 10px)
   and font-size: 1.6rem on body (= 16px). We override with !important.
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Override mdBook CSS Variables ─────────────────────────────── */
:root {
  --content-max-width: 860px !important;
}

.light, .rust, .coal, .navy, .ayu {
  --bg: #ffffff !important;
  --fg: #111827 !important;
  --sidebar-bg: #f9fafb !important;
  --sidebar-fg: #111827 !important;
  --sidebar-active: #c2410c !important;
  --sidebar-non-existant: #9ca3af !important;
  --sidebar-spacer: #e5e7eb !important;
  --links: #c2410c !important;
  --inline-code-color: #862633 !important;
  --quote-bg: #fff7ed !important;
  --quote-border: #c2410c !important;
  --table-border-color: #e5e7eb !important;
  --table-header-bg: #f9fafb !important;
  --table-alternate-bg: #fffbf5 !important;
  --scrollbar: #d1d5db !important;
  --icons: #6b7280 !important;
  --icons-hover: #c2410c !important;
  --theme-popup-bg: #ffffff !important;
  --theme-popup-border: #e5e7eb !important;
  --theme-hover: #fff7ed !important;
  --search-mark-bg: #fed7aa !important;
  --warning-border: #c2410c !important;
  --color-scheme: light !important;
}

/* ── Font & Body Override ──────────────────────────────────────── */
:root {
  font-size: 100% !important; /* Reset from 62.5% back to 16px base */
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  color: #111827 !important;
  background-color: #ffffff !important;
}

body {
  font-size: 17px !important;
  line-height: 1.75 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  background-color: #f9fafb !important;
  border-right: 1px solid #e5e7eb !important;
}

.sidebar .sidebar-scrollbox {
  padding: 12px 14px !important;
}

.sidebar .sidebar-scrollbox a {
  font-family: 'Inter', sans-serif !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  transition: all 150ms ease !important;
  color: #374151 !important;
}

.sidebar .sidebar-scrollbox a:hover {
  color: #c2410c !important;
  background-color: #fff7ed !important;
}

.sidebar .sidebar-scrollbox a.active {
  color: #c2410c !important;
  background-color: #fff7ed !important;
  font-weight: 600 !important;
}

/* Section headers in sidebar */
.sidebar .sidebar-scrollbox li.part-title {
  color: #862633 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin-top: 20px !important;
  padding-left: 10px !important;
  font-family: 'Inter', sans-serif !important;
}

/* Logo in sidebar */
.sidebar .sidebar-scrollbox::before {
  content: '';
  display: block;
  width: 100%;
  height: 144px;
  background: url('logo.png') no-repeat center;
  background-size: contain;
  margin-bottom: 24px;
  padding: 12px 0;
}

/* ── Content Area ─────────────────────────────────────────────── */
.content {
  max-width: 860px !important;
  padding: 32px 48px !important;
}

.content main {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 17px !important;
  line-height: 1.8 !important;
  color: #111827 !important;
}

.content main p {
  margin-bottom: 1.25em !important;
}

/* ── Headings ─────────────────────────────────────────────────── */
.content h1 {
  font-family: 'Inter', sans-serif !important;
  color: #862633 !important;
  font-weight: 800 !important;
  font-size: 36px !important;
  border-bottom: 3px solid #c2410c !important;
  padding-bottom: 10px !important;
  margin-bottom: 28px !important;
  margin-top: 0 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.2 !important;
}

.content h2 {
  font-family: 'Inter', sans-serif !important;
  color: #111827 !important;
  font-weight: 700 !important;
  font-size: 26px !important;
  margin-top: 48px !important;
  margin-bottom: 20px !important;
  letter-spacing: -0.02em !important;
  line-height: 1.3 !important;
}

.content h3 {
  font-family: 'Inter', sans-serif !important;
  color: #862633 !important;
  font-weight: 700 !important;
  font-size: 21px !important;
  margin-top: 36px !important;
  margin-bottom: 14px !important;
  letter-spacing: -0.01em !important;
  line-height: 1.4 !important;
}

.content h4 {
  font-family: 'Inter', sans-serif !important;
  color: #111827 !important;
  font-weight: 600 !important;
  font-size: 18px !important;
  margin-top: 28px !important;
  margin-bottom: 10px !important;
  line-height: 1.4 !important;
}

/* ── Links ────────────────────────────────────────────────────── */
.content a {
  color: #c2410c !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  border-bottom: 1px solid transparent !important;
  transition: all 150ms ease !important;
}

.content a:hover {
  color: #862633 !important;
  border-bottom-color: #862633 !important;
}

/* ── Lists ────────────────────────────────────────────────────── */
.content ul, .content ol {
  margin-bottom: 1.25em !important;
  padding-left: 1.5em !important;
  font-size: 17px !important;
}

.content li {
  margin-bottom: 0.5em !important;
  line-height: 1.7 !important;
}

/* ── Code blocks ──────────────────────────────────────────────── */
.content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', monospace !important;
  font-size: 15px !important;
  background: #f3f4f6 !important;
  padding: 3px 7px !important;
  border-radius: 6px !important;
  color: #862633 !important;
  font-weight: 500 !important;
}

.content pre {
  background: #1e1e2e !important;
  border-radius: 12px !important;
  padding: 20px 24px !important;
  border: 1px solid #2d2d3f !important;
  margin: 24px 0 !important;
}

.content pre code {
  background: transparent !important;
  color: #e0def4 !important;
  padding: 0 !important;
  font-weight: 400 !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
}

/* ── Tables ───────────────────────────────────────────────────── */
.content table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 24px 0 !important;
  font-size: 15px !important;
  font-family: 'Inter', sans-serif !important;
}

.content table th {
  background: #f9fafb !important;
  color: #111827 !important;
  font-weight: 600 !important;
  text-align: left !important;
  padding: 12px 16px !important;
  border-bottom: 2px solid #e5e7eb !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.content table td {
  padding: 12px 16px !important;
  border-bottom: 1px solid #f3f4f6 !important;
  vertical-align: top !important;
}

.content table tr:hover {
  background-color: #fffbf5 !important;
}

/* ── Blockquotes ──────────────────────────────────────────────── */
.content blockquote {
  border-left: 4px solid #c2410c !important;
  background: #fff7ed !important;
  padding: 16px 24px !important;
  margin: 24px 0 !important;
  border-radius: 0 12px 12px 0 !important;
  color: #4b5563 !important;
  font-size: 16px !important;
  line-height: 1.7 !important;
}

.content blockquote p {
  margin: 6px 0 !important;
}

.content blockquote strong {
  color: #111827 !important;
}

/* ── Horizontal rules ─────────────────────────────────────────── */
.content hr {
  border: none !important;
  border-top: 2px solid #f3f4f6 !important;
  margin: 40px 0 !important;
}

/* ── Nav buttons ──────────────────────────────────────────────── */
.nav-chapters {
  font-size: 15px !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
}

.nav-chapters a {
  color: #c2410c !important;
}

.nav-chapters a:hover {
  color: #862633 !important;
}

/* ── Search ───────────────────────────────────────────────────── */
#searchbar {
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 15px !important;
  padding: 8px 12px !important;
}

#searchbar:focus {
  border-color: #c2410c !important;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.1) !important;
  outline: none !important;
}

/* ── Menu bar ─────────────────────────────────────────────────── */
#menu-bar {
  border-bottom: 1px solid #e5e7eb !important;
  background-color: #ffffff !important;
}

#menu-bar i {
  color: #6b7280 !important;
}

#menu-bar i:hover {
  color: #c2410c !important;
}

/* ── Mermaid Diagram Overrides ─────────────────────────────────── */
.mermaid {
  background: transparent !important;
}

.mermaid .node rect,
.mermaid .node polygon,
.mermaid .node circle {
  fill: #fff7ed !important;
  stroke: #c2410c !important;
}

.mermaid .node .label {
  color: #111827 !important;
}

.mermaid .edgePath .path {
  stroke: #9a3412 !important;
}

.mermaid .edgeLabel {
  background-color: #ffffff !important;
  color: #111827 !important;
}

.mermaid .cluster rect {
  fill: #f9fafb !important;
  stroke: #e5e7eb !important;
}

.mermaid .node.default > rect,
.mermaid .node.default > polygon {
  fill: #fff7ed !important;
  stroke: #c2410c !important;
}

.mermaid marker#arrowhead path {
  fill: #9a3412 !important;
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ── Print ────────────────────────────────────────────────────── */
@media print {
  .sidebar, .nav-chapters, #menu-bar {
    display: none !important;
  }
  .content {
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .content {
    padding: 20px 24px !important;
  }
  .content main {
    font-size: 16px !important;
  }
  .content h1 {
    font-size: 28px !important;
  }
  .content h2 {
    font-size: 22px !important;
  }
}
