/* ============================================================
   SAIGE Theme for MkDocs Material
   Based on SAIGE PPT Template

   Palette:  Red #FF4052 / DarkGray #6A7A7C / LightGray #CBD0D1

   IMPORTANT: Do NOT override .md-typeset font-size.
   Material uses mixed em/rem internally — overriding the base
   causes cascading mismatches. Override individual elements only.
   ============================================================ */

:root {
  --md-primary-fg-color:        #FF4052;
  --md-primary-fg-color--light: #FF6B78;
  --md-primary-fg-color--dark:  #E0384A;
  --md-accent-fg-color:         #FF4052;
  --md-accent-fg-color--transparent: rgba(255, 64, 82, 0.1);
  --md-text-font: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --md-code-font: "JetBrains Mono", "Fira Code", Consolas, monospace;

  /* Override Material's code highlight variables for dark code blocks */
  --md-code-bg-color:             #1B1D23;
  --md-code-fg-color:             #E0E2E8;
  --md-code-hl-operator-color:    #FFFFFF;
  --md-code-hl-punctuation-color: #B0B4C0;
  --md-code-hl-comment-color:     #7C9A72;
  --md-code-hl-generic-color:     #C8CCD8;
  --md-code-hl-variable-color:    #C8CCD8;
  --md-code-hl-string-color:      #E8B67A;
  --md-code-hl-number-color:      #F0A0A0;
  --md-code-hl-keyword-color:     #FF6B78;
  --md-code-hl-name-color:        #C8CCD8;
  --md-code-hl-constant-color:    #7CC5EA;
  --md-code-hl-function-color:    #9CDCFE;
  --md-code-hl-special-color:     #CE9178;

  /* Admonition override */
  --md-admonition-bg-color:       #FAFAFA;
}

/* ======================== Header ======================== */
.md-header        { background: #333; }
.md-header__title { font-weight: 600; }
.md-tabs          { background: #444; }

/* ======================== Sidebar ======================== */
/* Do NOT override .md-sidebar width — let Material's grid handle it */
.md-nav__link--active,
.md-nav__link:hover   { color: var(--md-primary-fg-color) !important; }
.md-nav__item--active > .md-nav__link {
  color: var(--md-primary-fg-color) !important;
  font-weight: 600;
}

/* ======================== Headings ======================== */
.md-typeset h1 {
  font-weight: 700; color: #222;
  border-bottom: 2px solid #FF4052;
  padding-bottom: 0.25em;
}
.md-typeset h2 {
  font-weight: 600; color: #FF4052;
  border-bottom: 1px solid #E0E0E0;
  padding-bottom: 0.15em;
}
.md-typeset h3 {
  font-weight: 600; color: #333;
}
.md-typeset h4 {
  font-weight: 600; color: #555;
}

/* ======================== HR ======================== */
.md-typeset hr { border-top: 1px solid #CBD0D1; }

/* ======================== Tables ======================== */
.md-typeset table:not([class]) thead th,
.md-typeset .doc-contents table thead th {
  background: #6A7A7C; color: #fff; font-weight: 600;
  padding: 0.4em 0.7em;
  border: none; border-bottom: 2px solid #555;
}
.md-typeset table:not([class]) tbody td,
.md-typeset .doc-contents table tbody td {
  padding: 0.35em 0.7em;
  border: none; border-bottom: 1px dashed #CBD0D1;
  vertical-align: top;
}
.md-typeset table:not([class]) tbody tr:nth-child(even),
.md-typeset .doc-contents table tbody tr:nth-child(even) {
  background: #F7F7F7;
}
.md-typeset table:not([class]) tbody tr:hover,
.md-typeset .doc-contents table tbody tr:hover {
  background: rgba(255, 64, 82, 0.05);
}

/* ======================== Code ======================== */
/* Inline code */
.md-typeset code {
  background: #F0F0F0; color: #D63A4A;
  border-radius: 3px; padding: 0.05em 0.3em;
}

/* ── Code blocks ──────────────────────────────────────────
   SAIGE-branded dark theme with full Pygments token coverage.
   Palette derived from SAIGE Red #FF4052, paired with
   warm neutrals for readability on dark backgrounds.
   ──────────────────────────────────────────────────────── */
.md-typeset pre {
  background: #1B1D23 !important;
  border-left: 4px solid #FF4052;
  border-radius: 0 6px 6px 0;
  padding: 1em 1.2em;
  margin: 1em 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.md-typeset pre > code {
  color: #E0E2E8;              /* base text — warm off-white */
  background: transparent; padding: 0;
}

/* ── Token colors (every class used in this project) ── */
/* Comments:  c, c1                  → muted sage green   */
.md-typeset pre .c,
.md-typeset pre .c1  { color: #7C9A72; font-style: italic; }

/* Strings:   s, s1, s2, sa, si      → warm amber          */
.md-typeset pre .s,
.md-typeset pre .s1,
.md-typeset pre .s2,
.md-typeset pre .sa,
.md-typeset pre .si  { color: #E8B67A; }

/* Keywords:  k, kn, kc             → SAIGE red (soft)     */
.md-typeset pre .k,
.md-typeset pre .kn,
.md-typeset pre .kc  { color: #FF6B78; }

/* Builtins:  nb                     → sky blue             */
.md-typeset pre .nb  { color: #7CC5EA; }

/* Names:     n, nn, nv              → light slate          */
.md-typeset pre .n,
.md-typeset pre .nn,
.md-typeset pre .nv  { color: #C8CCD8; }

/* Operators: o, ow  (=, ==, not, in) → bright white       */
.md-typeset pre .o,
.md-typeset pre .ow  { color: #FFFFFF; }

/* Punctuation: p  ({, }, [, ], :, ,) → light gray          */
.md-typeset pre .p   { color: #B0B4C0; }

/* Numbers:   m, mi, mf              → soft coral           */
.md-typeset pre .m,
.md-typeset pre .mi,
.md-typeset pre .mf  { color: #F0A0A0; }

/* Whitespace: w                     → transparent          */
.md-typeset pre .w   { color: transparent; }

/* Line number links (if present)    → dim                  */
.md-typeset pre a    { color: #555 !important; text-decoration: none; }

/* ======================== Blockquote ======================== */
.md-typeset blockquote {
  border-left: 3px solid #FF4052;
  background: rgba(255, 64, 82, 0.03);
  color: #555;
}

/* ======================== Links ======================== */
.md-typeset a       { color: var(--md-primary-fg-color); }
.md-typeset a:hover { color: var(--md-primary-fg-color--dark); text-decoration: underline; }

/* ======================== Details / Admonitions ======================== */
/* Override Material's default blue (#448aff) → SAIGE gray */
.md-typeset details,
.md-typeset .admonition {
  border-color: #CBD0D1 !important;
  border-radius: 4px;
  margin: 0.6em 0;
  box-shadow: none;
}
.md-typeset details summary,
.md-typeset .admonition-title {
  font-weight: 600; color: #6A7A7C;
  background-color: rgba(203, 208, 209, 0.15) !important;
  border-color: #CBD0D1 !important;
  padding: 0.4em 0.8em; cursor: pointer;
}
/* Summary icon color (the :: marker / SVG) */
.md-typeset details summary::before,
.md-typeset details summary::after,
.md-typeset .admonition-title::before {
  color: #6A7A7C !important;
}
/* Focus ring */
.md-typeset details:focus-within {
  box-shadow: 0 0 0 0.2rem rgba(106, 122, 124, 0.15) !important;
}

/* ================================================================
   mkdocstrings — API Reference
   ================================================================ */

/* Class heading */
h2.doc.doc-heading {
  color: #222 !important;
  border-bottom: 2px solid #FF4052 !important;
}

/* Method heading */
h3.doc.doc-heading {
  color: #333 !important;
  border-bottom: 1px solid #E0E0E0 !important;
}
/* Remove red color + underline from code inside method headings */
h3.doc.doc-heading code,
h3.doc.doc-heading code span {
  background: none !important;
  color: #333 !important;
  padding: 0 !important;
}

/* Section titles: PARAMETERS, RETURNS */
.doc-section-title {
  color: #FF4052 !important;
  font-weight: 700 !important;
  font-size: 0.65rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Param/Return tables — compact */
.doc-contents table {
  font-size: 0.7rem !important;
}
.doc-contents table thead th {
  font-size: 0.65rem !important;
  padding: 0.3em 0.6em !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.doc-contents table tbody td {
  font-size: 0.7rem !important;
  padding: 0.3em 0.6em !important;
}
/* Param name code */
.doc-contents table td code {
  color: #333 !important; background: #ECECEC !important;
  padding: 0.02em 0.25em !important;
}
/* Description inside param table */
.doc-md-description,
.doc-md-description p {
  font-size: 0.7rem !important;
  line-height: 1.5;
  margin: 0.15em 0;
}

/* Code blocks inside docstrings */
.doc-contents pre > code {
  font-size: 0.68rem !important;
}

/* Object labels: classmethod, static, etc. */
.doc-label {
  background: #6A7A7C !important; color: #fff !important;
  border-radius: 3px; padding: 0.04em 0.3em;
  font-size: 0.6rem !important; font-weight: 600;
}
.doc-label code {
  font-size: inherit !important; color: inherit !important;
  background: none !important; padding: 0 !important;
}

/* Details inside docstrings (Usage, Keys, Note, etc.) */
.doc-contents details {
  font-size: 0.72rem;
  border-color: #CBD0D1 !important; border-radius: 3px;
}
.doc-contents details summary {
  font-size: 0.72rem; font-weight: 600; color: #6A7A7C;
  background-color: rgba(203, 208, 209, 0.12) !important;
}

/* ======================== Footer ======================== */
.md-footer      { background: #333; }
.md-footer-meta { background: #222; }

/* ======================== Scrollbar ======================== */
::-webkit-scrollbar           { width: 6px; }
::-webkit-scrollbar-track     { background: #F5F5F5; }
::-webkit-scrollbar-thumb     { background: #CBD0D1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6A7A7C; }

/* ======================== Print ======================== */
@media print {
  .md-content::after {
    content: "CONFIDENTIAL"; display: block; text-align: center;
    color: #CBD0D1; font-size: 0.7rem;
    margin-top: 2em; padding-top: 0.8em; border-top: 1px solid #E0E0E0;
  }
}
