/* Chronity theme overrides for MkDocs Material
 * Palette + typography sourced from /Users/jack/Projects/chronity-brand/
 * 95% indigo/zinc, ≤5% amber — amber is reserved for a single accent only
 */

/* =========================================================
 * Palette — indigo primary, zinc neutrals
 * ========================================================= */

:root {
  /* Primary (indigo-500 / 600 / 700) */
  --md-primary-fg-color:            #6366F1;
  --md-primary-fg-color--light:     #818CF8;
  --md-primary-fg-color--dark:      #4F46E5;
  --md-primary-bg-color:            #FFFFFF;
  --md-primary-bg-color--light:     #FFFFFFB3;

  /* Accent (indigo-600 for hover) */
  --md-accent-fg-color:             #4F46E5;
  --md-accent-fg-color--transparent:#4F46E51A;
  --md-accent-bg-color:             #FFFFFF;

  /* Typeset */
  --md-default-fg-color:            #3F3F46; /* zinc-700 — body */
  --md-default-fg-color--light:     #52525B; /* zinc-600 */
  --md-default-fg-color--lighter:   #71717A; /* zinc-500 */
  --md-default-fg-color--lightest:  #A1A1AA; /* zinc-400 — never body */
  --md-default-bg-color:            #FAFAFA; /* zinc-50 — page bg */

  /* Typeset headings / strong */
  --md-typeset-color:               #3F3F46;
  --md-typeset-a-color:             #4F46E5; /* indigo-600 — AA on zinc-50 */

  /* Code */
  --md-code-fg-color:               #3F3F46;
  --md-code-bg-color:               #F4F4F5; /* zinc-100 */
  --md-code-hl-color:               #6366F11A;
  --md-code-hl-color--light:        #6366F10F;

  /* Admonition + misc */
  --md-admonition-fg-color:         var(--md-default-fg-color);
  --md-admonition-bg-color:         #FFFFFF;

  /* Footer — zinc-900 per brand */
  --md-footer-bg-color:             #18181B;
  --md-footer-bg-color--dark:       #0A0A0B;
  --md-footer-fg-color:             #E4E4E7; /* zinc-200 */
  --md-footer-fg-color--light:      #A1A1AA; /* zinc-400 */
  --md-footer-fg-color--lighter:    #71717A; /* zinc-500 */
}

/* =========================================================
 * Typography — Outfit throughout
 * ========================================================= */

html,
body {
  font-feature-settings: "kern", "liga", "cv08";
}

.md-typeset {
  font-size: 0.8rem;          /* 16px default */
  line-height: 1.65;
  color: var(--md-default-fg-color);
  font-weight: 400;
}

.md-typeset p {
  color: var(--md-default-fg-color);
}

/* Headings — bold, sentence case, tight leading (per typography.md) */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #18181B; /* zinc-900 */
  line-height: 1.25;
}

.md-typeset h1 {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
  color: #18181B;
}

.md-typeset h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 2.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid #E4E4E7; /* zinc-200 */
}

.md-typeset h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 1.6rem;
}

.md-typeset h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.6rem;
  color: #27272A;
}

.md-typeset h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.2rem;
  color: #27272A;
}

/* Links — indigo-600 (AA on zinc-50), underline preserved */
.md-typeset a {
  color: #4F46E5;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

.md-typeset a:hover {
  color: #4338CA; /* indigo-700 */
  text-decoration-thickness: 2px;
}

/* Strong — zinc-900 for subtle emphasis */
.md-typeset strong {
  color: #18181B;
  font-weight: 600;
}

/* =========================================================
 * Header — light, quiet, logo first
 * ========================================================= */

.md-header {
  background-color: #FFFFFF;
  color: #3F3F46;
  box-shadow: 0 1px 0 #E4E4E7;
}

.md-header--shadow {
  box-shadow: 0 1px 0 #E4E4E7;
}

.md-header__title {
  color: #18181B;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.6rem;
  width: auto;
}

/* Search input */
.md-search__input {
  background-color: #F4F4F5;
  color: #3F3F46;
}

.md-search__input::placeholder {
  color: #71717A;
}

.md-search__input + .md-search__icon {
  color: #71717A;
}

/* =========================================================
 * Tabs (top-level nav strip) — subtle, underlined on active
 * ========================================================= */

.md-tabs {
  background-color: #FFFFFF;
  color: #52525B;
  border-bottom: 1px solid #E4E4E7;
}

.md-tabs__link {
  opacity: 1;
  color: #52525B;
  font-weight: 500;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  color: #4F46E5;
}

/* =========================================================
 * Sidebar — light canvas, engraved active state
 * ========================================================= */

.md-sidebar {
  background-color: transparent;
}

.md-nav {
  font-size: 0.72rem;
}

.md-nav__title {
  color: #71717A;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.md-nav__link {
  color: #52525B;
  font-weight: 400;
  transition: color 120ms ease;
}

.md-nav__link:hover {
  color: #4F46E5;
}

/* Engraved active — 2px indigo left-border, no fill (matches portal) */
.md-nav__item .md-nav__link--active,
.md-nav__item--active > .md-nav__link {
  color: #18181B;
  font-weight: 500;
  position: relative;
}

.md-nav__item .md-nav__link--active::before,
.md-nav__item--active > .md-nav__link::before {
  content: "";
  position: absolute;
  left: -0.6rem;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 2px;
  background-color: #6366F1;
  border-radius: 1px;
}

/* TOC (right-hand) */
.md-nav--secondary .md-nav__title {
  box-shadow: none;
  color: #71717A;
}

.md-nav--secondary .md-nav__link--passed {
  color: #52525B;
}

/* =========================================================
 * Content — cards, tables, admonitions
 * ========================================================= */

.md-main {
  background-color: #FAFAFA; /* zinc-50 */
}

.md-content {
  background-color: #FAFAFA;
}

.md-content__inner {
  margin: 0 auto;
  padding-top: 1.4rem;
  max-width: 48rem;
}

/* Hide "Edit this page" pencil (we don't expose source) */
.md-content__button {
  display: none;
}

/* Tables — white card with zinc-200 border */
.md-typeset table:not([class]) {
  background-color: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.75rem;
}

.md-typeset table:not([class]) th {
  background-color: #FAFAFA;
  color: #18181B;
  font-weight: 600;
  border-bottom: 1px solid #E4E4E7;
}

.md-typeset table:not([class]) td {
  border-top: 1px solid #F4F4F5;
  color: #3F3F46;
}

/* Inline code */
.md-typeset code {
  background-color: #F4F4F5;
  color: #3F3F46;
  border-radius: 6px;
  padding: 0.1em 0.35em;
  font-size: 0.86em;
}

/* Block quotes — quiet indigo left rule */
.md-typeset blockquote {
  color: #52525B;
  border-left: 2px solid #6366F1;
  padding-left: 1rem;
  font-style: normal;
}

/* Admonitions — flatter, paper-y */
.md-typeset .admonition,
.md-typeset details {
  border: 1px solid #E4E4E7;
  border-radius: 12px;
  background-color: #FFFFFF;
  box-shadow: none;
  font-size: 0.78rem;
}

.md-typeset .admonition > .admonition-title,
.md-typeset details > summary {
  background-color: #FAFAFA;
  color: #18181B;
  font-weight: 600;
  border-bottom: 1px solid #F4F4F5;
}

/* Tip admonition — indigo tint */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #E0E7FF; /* indigo-100 */
}

.md-typeset .admonition.tip > .admonition-title,
.md-typeset details.tip > summary {
  background-color: #EEF2FF; /* indigo-50 */
  color: #3730A3;           /* indigo-800 */
}

.md-typeset .admonition.tip > .admonition-title::before,
.md-typeset details.tip > summary::before {
  background-color: #4F46E5;
}

/* Images — rounded, bordered */
.md-typeset img {
  border-radius: 10px;
  border: 1px solid #E4E4E7;
  background-color: #FFFFFF;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2rem auto;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
}

/* =========================================================
 * Footer — dark zinc, per brand
 * ========================================================= */

.md-footer {
  background-color: #18181B;
}

.md-footer-meta {
  background-color: #0A0A0B;
}

.md-footer__link {
  opacity: 1;
}

/* =========================================================
 * Print — clean, page-at-a-time PDF export via Ctrl/Cmd-P
 * ========================================================= */

@media print {
  :root {
    --md-default-bg-color: #FFFFFF;
  }

  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer,
  .md-search,
  .chronity-print-btn,
  .md-content__button {
    display: none !important;
  }

  .md-main,
  .md-content,
  .md-content__inner {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    background-color: #FFFFFF !important;
  }

  .md-typeset {
    font-size: 11pt;
    line-height: 1.45;
    color: #18181B;
  }

  .md-typeset h1 {
    font-size: 22pt;
    page-break-before: avoid;
  }

  .md-typeset h2 {
    font-size: 16pt;
    page-break-after: avoid;
    border-top: 0;
    margin-top: 1.2em;
  }

  .md-typeset h3 {
    page-break-after: avoid;
  }

  .md-typeset img {
    border: 1px solid #E4E4E7;
    page-break-inside: avoid;
    max-height: 75vh;
  }

  .md-typeset table:not([class]) {
    page-break-inside: avoid;
  }

  .md-typeset a {
    color: #18181B;
    text-decoration: none;
  }

  /* Add a small footer on print */
  @page {
    margin: 20mm 16mm 22mm;
  }
}

/* =========================================================
 * Print button — floating pill, top right of each article
 * ========================================================= */

.chronity-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  float: right;
  margin-top: -3.2rem;
  margin-bottom: 0.4rem;
  padding: 0.35rem 0.8rem;
  background-color: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 8px;
  color: #52525B;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms ease;
}

.chronity-print-btn:hover {
  color: #4F46E5;
  border-color: #A5B4FC;
  background-color: #EEF2FF;
}

.chronity-print-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

@media (max-width: 48rem) {
  .chronity-print-btn {
    float: none;
    margin-top: 0;
    margin-bottom: 1rem;
  }
}

/* =========================================================
 * Placeholder screenshot styling — calm, not attention-seeking
 * ========================================================= */

.md-typeset img[alt][src*="screenshot-placeholder"] {
  background-color: #F4F4F5;
  border: 1px dashed #D4D4D8;
  box-shadow: none;
}

/* =========================================================
 * Homepage cards (manuals index) — used on index.md
 * ========================================================= */

.chronity-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin: 1.8rem 0;
}

.chronity-card {
  display: block;
  padding: 1.4rem;
  background-color: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 12px;
  color: inherit;
  text-decoration: none !important;
  transition: all 150ms ease;
}

.chronity-card:hover {
  border-color: #A5B4FC;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

.chronity-card h3 {
  margin: 0 0 0.4rem;
  color: #18181B;
  font-size: 1.05rem;
  font-weight: 700;
}

.chronity-card p {
  margin: 0;
  color: #52525B;
  font-size: 0.82rem;
  line-height: 1.55;
}

.chronity-card__meta {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366F1;
}
