/*
 * swXtch.io branding for Material for MkDocs.
 *
 * Brand tokens (colors, fonts) are taken from the official brand kit in
 * github.com/swxtchio/swx-marketing (brand/brand-kit/code/swxtch_palette.css,
 * v1.0). Logo/favicon SVGs are copied from the same brand-kit/logos.
 * See RUNBOOK.md ("Branding assets") for how to refresh these.
 */

:root {
  /* Primary brand palette (exact values from swxtch_palette.css). */
  --swx-orange:   #EE7529;   /* brand accent, X-mark, CTAs, headlines */
  --swx-amber:    #F09A4E;   /* X-mark depth layer / hero glow only */
  --swx-ink:      #0E0E10;   /* deep neutral, dark backgrounds */
  --swx-white:    #FFFFFF;
  --swx-graphite: #1E1E22;
  --swx-smoke:    #2A2A30;
  --swx-mist:     #A6A6AD;
  --swx-paper:    #F7F7F5;

  --md-accent-fg-color: var(--swx-orange);
}

/* Pin the accent to swXtch orange in both schemes. */
[data-md-color-scheme="slate"],
[data-md-color-scheme="default"] {
  --md-accent-fg-color: var(--swx-orange);
  --md-primary-fg-color: var(--swx-ink);
}

/* Dark scheme uses swXtch Ink surfaces. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--swx-ink);
  --md-code-bg-color: var(--swx-graphite);
}

/* Orange links (Material defaults to the primary color for links). */
[data-md-color-scheme="slate"] .md-typeset a,
[data-md-color-scheme="default"] .md-typeset a {
  color: var(--swx-orange);
}

.md-header__title {
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Layout width                                                        */
/* ------------------------------------------------------------------ */
/* Material caps the whole grid at ~61rem and centers it, leaving large
   empty margins on wide screens. Widen the grid so the nav + content + TOC
   use more of the viewport... */
@media screen and (min-width: 76.25em) {
  .md-grid {
    max-width: min(1480px, 90vw);
  }
}
/* ...but keep the article's text measure comfortable so body paragraphs never
   run to very long lines. The reclaimed width goes to the nav and TOC; the
   content column is capped and centered. Tables/code still scroll if wider. */
.md-content {
  max-width: 52rem;   /* ~90-char measure: comfortable prose, not a long line */
  margin-left: auto;
  margin-right: auto;
}

/* ------------------------------------------------------------------ */
/* Home landing page                                                  */
/* ------------------------------------------------------------------ */

/* Hero band: paper background with an orange/amber "sun" glow at right. */
.swx-hero {
  margin: -1.2rem -1.2rem 2rem;
  padding: 3.2rem 2.4rem 2.8rem;
  border-radius: 0 0 12px 12px;
  background:
    radial-gradient(circle at 92% 18%, var(--swx-orange) 0%, rgba(240, 154, 78, 0.55) 16%, rgba(247, 247, 245, 0) 52%),
    linear-gradient(180deg, #ffffff 0%, var(--swx-paper) 100%);
  color: var(--swx-ink);
}

.swx-hero h1 {
  color: var(--swx-orange);
  font-weight: 800;
  margin: 0 0 .4rem;
  font-size: 2.1rem;
}

.swx-hero p {
  color: #3a3a3a;
  font-size: .9rem;
  max-width: 40rem;
  margin: 0 0 1.4rem;
}

/* Hero search box - a label that opens Material's built-in search overlay. */
.swx-hero-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 30rem;
  padding: .7rem 1rem;
  background: var(--swx-white);
  border: 1px solid #e7d5c6;
  border-radius: 24px;
  color: #8a8a8a;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(14, 14, 16, .08);
  transition: box-shadow .2s, border-color .2s;
}
.swx-hero-search:hover {
  border-color: var(--swx-orange);
  box-shadow: 0 4px 16px rgba(238, 117, 41, .2);
}
.swx-hero-search .twemoji {
  color: var(--swx-orange);
}

/* Section headings on the home page pick up the orange accent. */
.md-typeset .swx-home h2 {
  color: var(--swx-orange);
  border-bottom: 2px solid rgba(238, 117, 41, .25);
  padding-bottom: .3rem;
}

/* Bullseye icons on the category cards. */
.md-typeset .swx-card-icon {
  color: var(--swx-orange);
  font-size: 1.4rem;
  vertical-align: -.2rem;
}

/* Category cards: orange top accent. */
.md-typeset .swx-cards > ul > li,
.md-typeset .swx-cards .card {
  border-top: 3px solid var(--swx-orange);
}

/* The card title term is also a glossary abbreviation; its tooltip is redundant
   here and overlapped the card description. content-header.js strips the title;
   drop the abbr's dotted underline / help cursor so it reads as plain card text. */
.md-typeset .swx-cards abbr {
  text-decoration: none;
  border-bottom: none;
  cursor: inherit;
}

/* ------------------------------------------------------------------ */
/* Per-article content header (breadcrumbs are native Material)         */
/* ------------------------------------------------------------------ */
.swx-content-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin: -.4rem 0 1.2rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  font-size: .72rem;
}
.swx-validated {
  color: var(--md-default-fg-color--light);
}
.swx-content-header__actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.swx-md-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .6rem;
  border: 1px solid var(--swx-orange);
  border-radius: 6px;
  color: var(--swx-orange);
  background: transparent;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.swx-md-btn:hover {
  background: var(--swx-orange);
  color: #fff;
}
.swx-md-btn svg { flex: 0 0 auto; }

/* Native Material breadcrumbs (navigation.path): tint the chevrons/links. */
.md-content .md-nav--secondary,
.md-path {
  font-size: .72rem;
}

/* Two-column lists (Recently Modified / Popular) with checkmark bullets. */
.md-typeset .swx-lists ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.md-typeset .swx-lists ul li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: .5rem;
}
.md-typeset .swx-lists ul li::before {
  content: "\2713"; /* checkmark */
  position: absolute;
  left: 0;
  color: var(--swx-orange);
  font-weight: 700;
}

/* `> [!IMPORTANT]` boxes (hooks/swx_markdown.py): Material has no "important"
   type, so style it purple with GitHub's report icon, as Typora shows it. */
:root {
  --md-admonition-icon--important: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.586a.25.25 0 0 0-.177.073l-3.5 3.5A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.427-3.427A1.75 1.75 0 0 1 11.164 17h9.586a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25ZM12 6a.75.75 0 0 1 .75.75v4a.75.75 0 0 1-1.5 0v-4A.75.75 0 0 1 12 6m0 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2"/></svg>');
}
.md-typeset .admonition.important {
  border-color: rgb(124, 77, 255);
}
.md-typeset .important > .admonition-title {
  background-color: rgba(124, 77, 255, .1);
}
.md-typeset .important > .admonition-title::before {
  background-color: rgb(124, 77, 255);
  -webkit-mask-image: var(--md-admonition-icon--important);
          mask-image: var(--md-admonition-icon--important);
}

/* Pull-request preview banner (scripts/preview.py, in Material's announce bar):
   swXtch orange so a preview is never mistaken for the published docs. */
.md-banner:has(.swx-preview-banner) {
  background-color: var(--swx-orange);
  color: var(--swx-ink);
}
.swx-preview-banner {
  text-align: center;
}
.md-typeset .swx-preview-banner a,
.swx-preview-banner a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* Version notice (hooks/version_status.py, in Material's announce bar) on every page
   of a version that is not the latest release: a pre-release or an older version. */
.swx-version-notice {
  text-align: center;
}
.md-typeset .swx-version-notice a,
.swx-version-notice a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* Left-menu separators and group labels, written in a folder's _menu.md nav:
     - "-": "#swx-sep"           a thin line
     - "Label": "#swx-group"     a small heading that cannot be clicked
   They are menu links that these rules restyle (see docs-writers/TYPORA.md). */
.md-nav__item:has(> .md-nav__link[href$="#swx-sep"]) {
  border-top: 1px solid var(--md-default-fg-color--lightest);
  margin: .5em .6rem .3em 0;
}
.md-nav__link[href$="#swx-sep"] {
  display: none;
}
.md-nav__link[href$="#swx-group"] {
  pointer-events: none;
  cursor: default;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--md-default-fg-color--light);
  margin-top: 1.1em;
}