/* Word and Way — Material theme overrides.
 *
 * The print pieces use a warm Nunito + terracotta palette. The web site is
 * a teacher-facing archive — volunteers come here to prep and download —
 * so it goes in a different direction: editorial monochrome with a single
 * cool accent. Calm, library-feeling, distinct from the printables.
 *
 *   --paper:   #fafaf7   warm off-white
 *   --ink:     #14171c   near-black, slight blue undertone
 *   --rule:    #e3e1dc   cool warm-gray for borders
 *   --accent:  #2f6f8f   slate teal — links + active state
 */

/* Light scheme — primary is the dark ink (header bar), accent is slate teal. */
[data-md-color-primary="custom"] {
  --md-primary-fg-color:        #14171c;
  --md-primary-fg-color--light:  #2a2f38;
  --md-primary-fg-color--dark:   #0a0c10;
  --md-primary-bg-color:         #ffffff;
  --md-primary-bg-color--light:  rgba(255, 255, 255, 0.7);

  --md-typeset-a-color:          #2f6f8f;
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color:          #2f6f8f;
  --md-accent-fg-color--transparent: rgba(47, 111, 143, 0.1);
  --md-accent-bg-color:          #ffffff;
  --md-accent-bg-color--light:   rgba(255, 255, 255, 0.7);
}

:root {
  --md-default-fg-color:         #14171c;
  --md-default-fg-color--light:  #3b4250;
  --md-default-fg-color--lighter: #6b7280;
  --md-default-fg-color--lightest: rgba(20, 23, 28, 0.06);
  --md-default-bg-color:         #fafaf7;

  --md-code-bg-color:            #f1efe9;
  --md-code-fg-color:            #14171c;
}

/* Dark scheme — invert to high-contrast paper-on-ink. */
[data-md-color-scheme="slate"][data-md-color-primary="custom"] {
  --md-primary-fg-color:        #0a0c10;
  --md-primary-fg-color--light: #1d2027;
  --md-primary-fg-color--dark:  #050608;
  --md-typeset-a-color:         #7fb6cc;
}
[data-md-color-scheme="slate"][data-md-color-accent="custom"] {
  --md-accent-fg-color:         #7fb6cc;
  --md-accent-fg-color--transparent: rgba(127, 182, 204, 0.15);
}
[data-md-color-scheme="slate"] {
  --md-default-bg-color:        #14171c;
  --md-default-bg-color--light: rgba(250, 250, 247, 0.05);
  --md-code-bg-color:           #1d2027;
}

/* "Bottom line" admonition — cool slate-teal rule, no warm fill. */
.md-typeset .admonition.quote,
.md-typeset details.quote {
  border-color: #2f6f8f;
  background-color: rgba(47, 111, 143, 0.04);
}
.md-typeset .quote > .admonition-title,
.md-typeset .quote > summary {
  background-color: rgba(47, 111, 143, 0.08);
  color: #2f6f8f;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
}
.md-typeset .quote > .admonition-title::before,
.md-typeset .quote > summary::before {
  background-color: #2f6f8f;
  -webkit-mask-image: var(--md-admonition-icon--quote);
          mask-image: var(--md-admonition-icon--quote);
}
.md-typeset .quote em {
  font-style: italic;
  font-size: 1.05rem;
  color: #14171c;
}
[data-md-color-scheme="slate"] .md-typeset .quote em {
  color: #f5f3ee;
}

/* Tables — quiet header, no warm tint. */
.md-typeset table:not([class]) th {
  background-color: #f1efe9;
  color: #14171c;
  border-bottom: 2px solid #14171c;
  font-weight: 700;
}
.md-typeset table:not([class]) td {
  border-color: #e3e1dc;
}
[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: #1d2027;
  color: #f5f3ee;
  border-bottom-color: #f5f3ee;
}
[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
  border-color: #2a2f38;
}

/* Inline icons in tables — sized to fit text line. */
.md-typeset .twemoji {
  vertical-align: -0.2em;
}
.md-typeset td .twemoji {
  height: 1.05em;
  margin-right: 0.25em;
}

/* Headings — tight, monochrome, thin rule under H2. */
.md-typeset h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #14171c;
}
.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #14171c;
  border-bottom: 1px solid #e3e1dc;
  padding-bottom: 0.3em;
  margin-top: 2em;
}
[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2 {
  color: #f5f3ee;
}
[data-md-color-scheme="slate"] .md-typeset h2 {
  border-bottom-color: rgba(227, 225, 220, 0.18);
}

/* Sidebar nav — active item slate teal. */
.md-nav__link--active,
.md-nav__link.md-nav__link--active {
  color: #2f6f8f;
  font-weight: 700;
}
[data-md-color-scheme="slate"] .md-nav__link--active {
  color: #7fb6cc;
}

/* Top tabs (age groups) — muted, with a slate-teal active underline so the
 * dark header bar reads as one continuous element instead of two stacked
 * stripes of color. */
.md-tabs {
  background-color: #14171c;
  border-bottom: 1px solid #2a2f38;
}
.md-tabs__link {
  color: rgba(245, 243, 238, 0.72);
  opacity: 1;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.md-tabs__link:hover,
.md-tabs__link:focus {
  color: #ffffff;
}
.md-tabs__item--active .md-tabs__link {
  color: #ffffff;
  font-weight: 700;
}
.md-tabs__item--active {
  border-bottom: 2px solid #2f6f8f;
}
