/*
 * DefendFlow documentation theme
 *
 * Mirrors the marketing site (landing/defendflow.css): white surfaces, soft
 * tinted panels, dark ink text, a single deep-blue accent, Geist typography
 * and rounded, lightly shadowed panels. Code blocks stay dark on purpose;
 * they are the one place the tool-like contrast earns its keep.
 */

:root {
  --df-bg: #ffffff;
  --df-bg-alt: #f6f7fb;
  --df-bg-tint: #eef6fc;
  --df-ink: #0f1729;
  --df-text: #0f1729;
  --df-text-secondary: #2c3547;
  --df-text-muted: #5b6579;
  --df-accent: #0369a1;
  --df-accent-hover: #075985;
  --df-accent-bright: #0ea5e9;
  --df-accent-soft: #e6f4fd;
  --df-border: #e4e7ef;
  --df-border-strong: #cfd5e1;
  --df-shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.05), 0 1px 6px rgba(15, 23, 41, 0.04);
  --df-shadow-md: 0 6px 20px rgba(15, 23, 41, 0.08);

  --md-primary-fg-color: var(--df-bg);
  --md-primary-fg-color--light: var(--df-bg-alt);
  --md-primary-fg-color--dark: #eef0f5;
  --md-primary-bg-color: var(--df-text);
  --md-primary-bg-color--light: var(--df-text-muted);
  --md-accent-fg-color: var(--df-accent);
  --md-accent-fg-color--transparent: rgba(3, 105, 161, 0.08);

  --md-default-bg-color: var(--df-bg);
  --md-default-bg-color--light: rgba(255, 255, 255, 0.72);
  --md-default-bg-color--lighter: rgba(255, 255, 255, 0.5);
  --md-default-bg-color--lightest: rgba(255, 255, 255, 0.3);
  --md-default-fg-color: var(--df-text);
  --md-default-fg-color--light: var(--df-text-secondary);
  --md-default-fg-color--lighter: var(--df-text-muted);
  --md-default-fg-color--lightest: rgba(91, 101, 121, 0.35);

  --md-typeset-color: var(--df-text-secondary);
  --md-typeset-a-color: var(--df-accent);
  --md-code-bg-color: var(--df-bg-alt);
  --md-code-fg-color: var(--df-text);
  --md-footer-bg-color: var(--df-ink);
  --md-footer-bg-color--dark: #0a101e;
  --md-footer-fg-color: #d5dce8;
  --md-footer-fg-color--light: #a8b3c7;
  --md-footer-fg-color--lighter: #8b96aa;
}

html {
  color-scheme: light;
  scrollbar-color: var(--df-border-strong) var(--df-bg);
}

body {
  background: var(--df-bg);
  color: var(--df-text-secondary);
}

/* Main brand chrome */
.md-header {
  border-bottom: 1px solid var(--df-border);
  background: rgba(255, 255, 255, 0.86);
  color: var(--df-text);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.md-header[data-md-state="shadow"],
.md-header--shadow {
  box-shadow: none;
}

.md-header__inner {
  min-height: 3.6rem;
}

.md-header__button.md-logo {
  margin-right: 0.35rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.4rem;
}

.md-header__title {
  color: var(--df-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.md-header__button {
  color: var(--df-text);
}

.md-tabs {
  border-bottom: 1px solid var(--df-border);
  background: rgba(255, 255, 255, 0.94);
  color: var(--df-text);
}

.md-tabs__link {
  color: var(--df-text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 1;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  color: var(--df-text);
}

.md-tabs__link--active {
  font-weight: 600;
}

/* Search */
.md-search__form {
  border: 1px solid var(--df-border);
  border-radius: 999px;
  background: var(--df-bg-alt);
  color: var(--df-text);
}

.md-search__input {
  color: var(--df-text);
}

.md-search__input::placeholder,
.md-search__input + .md-search__icon {
  color: var(--df-text-muted);
}

.md-search__form:hover,
.md-search__input:focus {
  border-color: var(--df-border-strong);
  background: var(--df-bg);
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  border-color: var(--df-accent-bright);
  border-radius: 0.6rem;
  background: var(--df-bg);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.md-search__output {
  border-radius: 0 0 0.6rem 0.6rem;
  box-shadow: var(--df-shadow-md);
}

.md-search-result__meta {
  background: var(--df-bg-alt);
  color: var(--df-text-muted);
}

.md-search-result__link:hover {
  background: var(--df-accent-soft);
}

/* Navigation and table of contents */
.md-sidebar {
  background: transparent;
}

.md-nav__title {
  background: transparent !important;
  color: var(--df-text);
  font-weight: 700;
  letter-spacing: 0;
}

.md-nav__link {
  color: var(--df-text-muted);
  transition: color 150ms ease, background 150ms ease;
}

.md-nav__link:hover,
.md-nav__link:focus,
.md-nav__link--active {
  color: var(--df-accent);
}

.md-nav__link--active {
  font-weight: 600;
}

.md-nav__item .md-nav__link--active::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1rem;
  margin-right: 0.45rem;
  border-radius: 2px;
  background: var(--df-accent);
  vertical-align: -0.2rem;
}

/* Reading surface and typography */
.md-main {
  background: transparent;
}

.md-content {
  min-width: 0;
}

.md-content__inner {
  margin-bottom: 3rem;
}

.md-typeset {
  color: var(--df-text-secondary);
  font-size: 0.8rem;
  line-height: 1.7;
}

/* Paragraph rhythm mirrors the marketing .cap-copy p (16px / 1.7 line-height,
   ~0.6em gaps between paragraphs) rather than Material's looser 1em block. */
.md-typeset p {
  margin: 0.6em 0;
}

/* List items track the marketing .cap-copy li (16px / 1.6 line-height, tight
   0.2em item spacing) instead of Material's 0.5em gap. */
.md-typeset ul li,
.md-typeset ol li {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
  line-height: 1.6;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--df-text);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.md-typeset h1 {
  margin-bottom: 1.2rem;
  font-size: clamp(1.6rem, 3vw, 2.16rem); /* ~43px desktop, matches marketing .section-header h2 */
  line-height: 1.1;
  letter-spacing: -0.015em; /* matches marketing display heading tracking */
}

.md-typeset h1::before {
  content: "Documentation";
  display: block;
  margin-bottom: 0.7rem;
  color: var(--df-accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Section heading matches marketing .cap-copy h3: 24.8px / weight 600 / 1.6
   line-height, and NO underline rule (the marketing sub-heads have none) so the
   format lines up, not just the size. */
.md-typeset h2 {
  margin-top: 2rem;
  margin-bottom: 0.7rem;
  font-size: 1.24rem;
  line-height: 1.6;
}

.md-typeset h3 {
  font-size: 0.95rem;
  line-height: 1.4;
}

.md-typeset a {
  color: var(--df-accent);
  text-decoration-color: rgba(3, 105, 161, 0.35);
  text-underline-offset: 0.16rem;
}

.md-typeset a:hover {
  color: var(--df-accent-hover);
}

.md-typeset strong {
  color: var(--df-text);
}

.md-typeset hr {
  border-bottom-color: var(--df-border);
}

/* Cards and structured blocks */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li {
  border: 1px solid var(--df-border);
  border-radius: 12px;
  background: var(--df-bg);
  box-shadow: var(--df-shadow-sm);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid.cards > ol > li:hover {
  transform: translateY(-2px);
  border-color: var(--df-border-strong);
  box-shadow: var(--df-shadow-md);
}

.md-typeset .grid.cards .lg {
  color: var(--df-accent);
}

.md-typeset table:not([class]) {
  border: 1px solid var(--df-border);
  border-radius: 10px;
  background: var(--df-bg);
  box-shadow: var(--df-shadow-sm);
}

.md-typeset table:not([class]) th {
  border-bottom-color: var(--df-border);
  background: #f1f3f8;
  color: var(--df-text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-typeset table:not([class]) td {
  border-top-color: var(--df-border);
}

.md-typeset table:not([class]) tr:hover {
  background: var(--df-bg-alt);
}

/* Inline code is light; fenced code stays dark and tool-like. */
.md-typeset code,
.md-typeset kbd,
.md-typeset pre {
  font-family: "Geist Mono", ui-monospace, monospace;
}

.md-typeset code {
  border: 1px solid var(--df-border);
  border-radius: 6px;
  background: var(--df-bg-alt);
  color: var(--df-text);
}

.md-typeset pre > code {
  border: 0;
  background: transparent;
  color: #dbe3ee;
}

.highlight,
.md-typeset pre {
  --md-code-bg-color: var(--df-ink);
  --md-code-fg-color: #dbe3ee;
  --md-code-hl-color: rgba(14, 165, 233, 0.18);
  --md-code-hl-comment-color: #8b96aa;
  --md-code-hl-keyword-color: #c4b5fd;
  --md-code-hl-string-color: #86efac;
  --md-code-hl-number-color: #fcd34d;
  --md-code-hl-function-color: #7dd3fc;
  --md-code-hl-constant-color: #7dd3fc;
  --md-code-hl-special-color: #f9a8d4;
  --md-code-hl-name-color: #dbe3ee;
  --md-code-hl-operator-color: #a8b3c7;
  --md-code-hl-punctuation-color: #a8b3c7;
  --md-code-hl-variable-color: #dbe3ee;
  --md-code-hl-generic-color: #a8b3c7;
}

.highlight {
  border: 1px solid #1e2a44;
  border-radius: 10px;
  overflow: hidden;
  background: var(--df-ink);
}

.highlight span.filename {
  border-bottom: 1px solid #1e2a44;
  background: #16203a;
  color: #a8b3c7;
}

.md-clipboard {
  color: #8b96aa;
}

.md-clipboard:hover {
  color: #7dd3fc;
}

/* Admonitions */
.md-typeset .admonition,
.md-typeset details {
  border-width: 0 0 0 3px;
  border-radius: 8px;
  background: var(--df-bg-alt);
  box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
  border-radius: 0;
  background: rgba(3, 105, 161, 0.06);
  font-weight: 600;
}

/* Footer and utility controls */
.md-footer {
  border-top: 0;
  background: var(--df-ink);
  color: #a8b3c7;
}

.md-footer-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a101e;
}

.md-footer__link,
.md-footer__title,
.md-footer__direction {
  color: #d5dce8;
}

.md-top {
  border: 1px solid var(--df-border-strong);
  border-radius: 999px;
  background: var(--df-bg);
  color: var(--df-text);
  box-shadow: var(--df-shadow-md);
}

@media screen and (max-width: 76.234375em) {
  .md-nav--primary .md-nav__title[for="__drawer"] {
    border-bottom: 1px solid var(--df-border);
    background: var(--df-bg);
    color: var(--df-text);
  }

  .md-nav--primary .md-nav__title {
    background: var(--df-bg-alt);
    color: var(--df-text);
  }

  .md-nav--primary {
    background: var(--df-bg);
  }
}

@media screen and (max-width: 44.984375em) {
  .md-typeset h1 {
    font-size: 1.9rem;
  }

  .md-header__title {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


/* ===== DefendFlow header brand + CTAs (docs) ===== */
.md-header .md-logo { width: auto; display: inline-flex; align-items: center; }
.md-header .md-logo img, .md-header .md-logo svg { display: inline-block; height: 1.7rem; width: auto; }
.md-header .md-logo::after { content: "DefendFlow"; font-weight: 700; font-size: 1.05rem; white-space: nowrap; color: #0f1729; margin-left: .45rem; }
/* Brand wordmark color scheme: "Flow" in accent blue */
.wm-flow { color: #0284c7; }
/* Main-site nav in the docs header, matching the marketing pages so the whole
   site shares one top nav (Product / Attestation / Documentation / Get Flowing).
   Layout: brand on the left; the title flex-grows so the nav, the search box and
   the Get Flowing CTA cluster on the RIGHT — search sits to the RIGHT of the tabs. */
.md-header__title { flex-grow: 1; }
.df-nav { display: flex; align-items: center; gap: 1.5rem; margin-right: 1.3rem; }
.md-header__inner > .md-search { margin-left: 0; }
.md-header__cta { display: flex; align-items: center; margin-left: 1.3rem; }
.df-navlink { display: inline-flex; align-items: center; color: #5b6579; font-size: .72rem; font-weight: 500; letter-spacing: -0.005em; text-decoration: none; white-space: nowrap; }
.df-navlink:hover { color: #0f1729; }
.df-navlink--active { color: #0f1729; font-weight: 600; }
.df-cta { display: inline-flex; align-items: center; height: 1.85rem; padding: 0 .9rem; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; text-decoration: none; }
.df-cta-primary { background: #0f1729; color: #fff; border: 1px solid #0f1729; }
.df-cta-primary:hover { background: #1e2a44; border-color: #1e2a44; color: #fff; }
.df-cta-outline { border: 1px solid rgba(3,105,161,.45); color: #0369a1; }
.df-cta-outline:hover { background: rgba(3,105,161,.08); }
@media (max-width: 76.1875em) { .md-header__cta, .df-nav { display: none; } }

/* ===== Header title + content width (docs) =====
   The DefendFlow wordmark already ships via the .md-logo::after above, so the
   site_name topic ("GRCFlow Documentation") is redundant in the header. Hide
   just the site-title topic; keep the on-scroll active-page title. */
.md-header__title .md-header__topic:not([data-md-component]) { display: none; }

/* Reclaim the wide, near-empty left gutter on the docs pages: let the content
   column use more of the viewport instead of centering in a narrow band. */
@media (min-width: 76.25em) {
  .md-grid { max-width: 72rem; }
}

/* ===== Flowing "Bloom" hero on the docs landing page (docs/overrides/main.html) =====
   Same animated mesh-gradient canvas + deep-navy palette as the marketing heroes. */
.df-doc-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin: 0 0 2.25rem;
  padding: 3.4rem 2rem 3rem;
  background: linear-gradient(180deg, #06182f 0%, #0a2748 60%, #0b2c54 100%);
  border: 1px solid rgba(127, 227, 242, 0.18);
}
.df-doc-hero #gradient-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block;
  --gradient-color-1: #0a2a55;
  --gradient-color-2: #135ba8;
  --gradient-color-3: #2a97d6;
  --gradient-color-4: #46d5e6;
}
.df-doc-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(72% 72% at 50% 46%, rgba(3, 11, 26, 0.5), rgba(3, 11, 26, 0.2) 55%, transparent 82%);
}
.df-doc-hero-inner { position: relative; z-index: 1; text-align: center; }
.df-doc-hero-eyebrow { color: #7fe3f2; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.72rem; margin-bottom: 0.55rem; }
.df-doc-hero-title { font-weight: 800; font-size: clamp(2.1rem, 4vw, 2.9rem); line-height: 1; color: #f4f9ff; letter-spacing: -0.02em; }
.df-doc-hero-title span { color: #46d5e6; }
.df-doc-hero-sub { color: rgba(228, 240, 255, 0.85); margin: 0.7rem 0 0; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .df-doc-hero #gradient-canvas { display: none; } }

/* Phones: full-bleed the banner so it matches the edge-to-edge marketing heroes
   (square, flush under the header) instead of a rounded inset card. Scoped below
   Material's tablet breakpoint, where the sidebars are off-canvas drawers and the
   content column is the full viewport width — so the 100vw break-out is safe and
   adds no horizontal scroll. */
@media (max-width: 59.9375em) {
  .df-doc-hero {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -3.5rem;
    margin-bottom: 1.6rem;
    border-radius: 0;
    border: 0;
    padding: 3rem 1.5rem 2.6rem;
  }
}

/* The banner carries the brand on the docs landing page, so hide the duplicate
   markdown H1 (#grcflow) that would otherwise repeat "GRCFlow" right below it. */
.md-typeset h1#grcflow { display: none; }


/* ==========================================================================
   MARKETING FOOTER (injected via {% block footer %} in overrides/main.html)
   ==========================================================================
   Replicated from landing/defendflow.css so the docs footer renders identically
   to the marketing site's. Material does not use the .footer / .footer-col /
   .footer-head / .footer-legal / .footer-brand class names, so these plain rules
   do not collide with any Material component. var()s from the marketing stylesheet
   are resolved to concrete values here (--ink #0f1729, --sans -> Geist stack).
   The footer is rendered after .md-main, so it sits full-width at the very
   bottom of every page. Padding / text-align / font-size come from the marketing
   pages' inline base <style> (which the docs build has no equivalent of), and are
   folded in here so the band matches. */
.footer {
  padding: 3rem 2rem;
  border-top: 0;
  background: #0f1729;
  color: #a8b3c7;
  font-size: 0.85rem;
  text-align: center;
}

.footer a { color: #d5dce8; }
.footer a:hover { color: #fff; }
.footer p { color: #8b96aa; }

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 2rem 3rem;
  max-width: 820px;
  margin: 0 auto 2.5rem;
  text-align: left;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a { font-size: 0.9rem; }

.footer-head {
  margin-bottom: 0.35rem;
  color: #7dd3fc;
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-legal {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-brand { font-weight: 700; }

@media (max-width: 768px) {
  .footer { padding: 2rem 1rem; }
  .footer-cols { gap: 1.5rem 2rem; text-align: center; }
  .footer-col { align-items: center; }
}
