/* Palette taken from the portfolio project (assets/css/global.css):
   --color-vermilion #de4520 | --color-vermilion-2 #c93b19
   --color-bone #f4f3f1 | --color-bone-2 #eceae7 | --color-paper #ffffff
   --color-ink #0b0b0b | --color-ink-2 #141414 | --color-ink-3 #1d1d1d
   --color-muted #9a9a9a | --color-muted-2 #6e6e6e */

/* ---------------------------------------------------------------------------
   Theme-invariant chrome. Header and footer stay #252525 in both palettes.

   The scheme selectors are listed alongside :root on purpose. Material puts
   data-md-color-scheme on <body> and declares --md-footer-bg-color inside its
   own [data-md-color-scheme="slate"] rule. A declaration on the element itself
   beats a value inherited from :root (<html>), so :root alone silently loses
   the footer in slate. Matching the same element fixes it.
   --------------------------------------------------------------------------- */
:root,
[data-md-color-scheme="default"],
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #252525;
  --md-primary-fg-color--light: #313131;
  --md-primary-fg-color--dark:  #1a1a1a;
  --md-primary-bg-color:        #f4f3f1;
  --md-primary-bg-color--light: #f4f3f1b3;

  --md-footer-bg-color:         #252525;
  --md-footer-bg-color--dark:   #252525;
}

/* Light mode — bone page, ink text */
[data-md-color-scheme="default"] {
  --md-accent-fg-color:         #c93b19;
  --md-accent-fg-color--transparent: #c93b191a;
  --md-accent-bg-color:         #ffffff;
  --md-accent-bg-color--light:  #ffffffb3;

  --md-default-bg-color:        #f4f3f1;
  --md-default-fg-color:        #0b0b0b;
  --md-default-fg-color--light: #6e6e6e;
  --md-default-fg-color--lighter: #9a9a9a;
  --md-default-fg-color--lightest: rgba(11, 11, 11, 0.1);

  --md-code-bg-color:           #eceae7;
  --md-typeset-table-color:     rgba(11, 11, 11, 0.1);

  /* #de4520 is 4.2:1 on white — under AA for body text, so links use vermilion-2 at 5.1:1 */
  --md-typeset-a-color:         #c93b19;
}

/* Dark mode — derived from the ink scale; the portfolio itself ships light-only */
[data-md-color-scheme="slate"] {
  --md-accent-fg-color:         #de4520;
  --md-accent-fg-color--transparent: #de45201a;
  --md-accent-bg-color:         #f4f3f1;
  --md-accent-bg-color--light:  #f4f3f1b3;

  --md-default-bg-color:        #0b0b0b;
  --md-default-fg-color:        #f4f3f1;
  --md-default-fg-color--light: #9a9a9a;
  --md-default-fg-color--lighter: #6e6e6e;
  --md-default-fg-color--lightest: rgba(255, 255, 255, 0.12);

  --md-code-bg-color:           #1d1d1d;
  --md-typeset-table-color:     rgba(255, 255, 255, 0.12);
  --md-typeset-a-color:         #de4520;
}

/* ---------------------------------------------------------------------------
   Logo color lock.

   The logo is loaded from sabbirhassan.com and that SVG carries its own
   `@media (prefers-color-scheme: dark)` rules (a RealFaviconGenerator
   light-icon/dark-icon pair). For an SVG loaded via <img>, Chrome resolves
   those rules against the EMBEDDING ELEMENT's used color-scheme - not the OS
   setting. Material sets `color-scheme: light` on the default palette, so the
   mark painted its near-black variant against the #252525 header (1.4:1).

   Pinning the image's own color-scheme keeps the bone variant in both
   palettes, while the file itself still loads from the website so edits there
   continue to propagate.
   --------------------------------------------------------------------------- */
.md-logo img {
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   Search bar, resting (unfocused) state.

   Material's default is a #00000042 wash over the header, which reads as a
   different grey depending on what is behind it. Pinning it keeps the field at
   a fixed #3f3f3f against the #252525 header in both palettes.

   The focused state is left alone: Material swaps it to --md-default-bg-color
   through [data-md-toggle=search]:checked ~ ..., which outranks these rules.
   --------------------------------------------------------------------------- */
.md-search__form {
  background-color: #3f3f3f;
}

/* :hover is (0,2,0) so it needs its own rule - a slight lift keeps the
   affordance. Set this to #3f3f3f too if you want the field completely flat. */
.md-search__form:hover {
  background-color: #4a4a4a;
}

/* ---------------------------------------------------------------------------
   Active sidebar item.

   Material only recolors the current page's link (to --md-typeset-a-color) and
   sets no weight, so this adds the weight without disturbing the color. Scoped
   to .md-nav--primary so it applies to the page list on the left, not the
   table-of-contents entries on the right.
   --------------------------------------------------------------------------- */
.md-nav--primary .md-nav__item .md-nav__link--active {
  font-weight: 700;
}
