/* =========================================================================
   Enterprise AI Framework — landing page + polish
   Hero styles are scoped with the .mdx- prefix so they never affect
   normal documentation pages.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Accessibility helper: keep an <h1> in the DOM for a11y/SEO but hide it
   visually (prevents Material from injecting a fallback "Home" heading).
   ------------------------------------------------------------------------- */
.mdx-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.mdx-container {
  padding-top: 1rem;
  background:
    linear-gradient(
      to bottom,
      var(--md-primary-fg-color),
      color-mix(in srgb, var(--md-primary-fg-color) 55%, transparent) 60%,
      var(--md-default-bg-color) 100%
    );
}

[data-md-color-scheme="slate"] .mdx-container {
  background:
    linear-gradient(
      to bottom,
      var(--md-primary-fg-color),
      color-mix(in srgb, var(--md-primary-fg-color) 40%, var(--md-default-bg-color)) 70%,
      var(--md-default-bg-color) 100%
    );
}

.mdx-hero {
  margin: 0 0.8rem;
  color: var(--md-primary-bg-color);
}

.mdx-hero__content {
  padding-bottom: 4rem;
  max-width: 42rem;
}

.mdx-hero h1 {
  margin-bottom: 1rem;
  color: currentColor;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mdx-hero p {
  margin-bottom: 2rem;
  font-size: 0.9rem;
  opacity: 0.92;
  max-width: 34rem;
}

/* Buttons. */
.mdx-hero .md-button {
  margin-top: 0.5rem;
  margin-right: 0.5rem;
  color: var(--md-primary-bg-color);
  border-width: 2px;
  transition:
    transform 0.25s,
    background-color 0.25s,
    color 0.25s,
    border-color 0.25s;
}

.mdx-hero .md-button:focus,
.mdx-hero .md-button:hover {
  background-color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
  transform: translateY(-2px);
}

.mdx-hero .md-button--primary {
  background-color: var(--md-primary-bg-color);
  border-color: var(--md-primary-bg-color);
  color: var(--md-primary-fg-color);
}

/* Wider hero copy on large screens. */
@media screen and (min-width: 60em) {
  .mdx-hero {
    display: flex;
    align-items: center;
  }

  .mdx-hero__content {
    margin-top: 3.5rem;
    padding-bottom: 5rem;
  }

  .mdx-hero h1 {
    font-size: 2.6rem;
  }

  .mdx-hero p {
    font-size: 1.05rem;
  }
}

/* -------------------------------------------------------------------------
   Landing content sections (scoped to the home page via :has(.mdx-hero))
   ------------------------------------------------------------------------- */
body:has(.mdx-hero) .md-content__inner > h2 {
  margin-top: 2.75rem;
  font-weight: 700;
}

body:has(.mdx-hero) .md-content__inner > h2::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 0.2rem;
  margin-bottom: 0.65rem;
  border-radius: 0.2rem;
  background: var(--md-accent-fg-color);
}

/* -------------------------------------------------------------------------
   Feature cards
   ------------------------------------------------------------------------- */
.md-typeset .grid.cards {
  margin-top: 1.5rem;
  grid-gap: 1rem;
}

.md-typeset .grid.cards > ul > li {
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  padding: 1.1rem;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s;
}

.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-4px);
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

/* Card icon accent */
.md-typeset .grid.cards .twemoji svg {
  fill: var(--md-primary-fg-color);
  transition: fill 0.25s;
}

.md-typeset .grid.cards > ul > li:hover .twemoji svg {
  fill: var(--md-accent-fg-color);
}

.md-typeset .grid.cards a[href] {
  font-weight: 600;
}

/* Images open in a glightbox lightbox (zoom-in cursor signals this) */
.md-typeset a.glightbox img,
.md-typeset a.glightbox {
  cursor: zoom-in;
}

/* =========================================================================
   Page hierarchy, navigation, and component polish (all pages)
   ========================================================================= */

/* Hero: keep the button area on a solid part of the gradient so both buttons pass
   contrast, and give the secondary button its own translucent fill. */
.mdx-container {
  background:
    linear-gradient(
      to bottom,
      var(--md-primary-fg-color) 0%,
      var(--md-primary-fg-color) 55%,
      color-mix(in srgb, var(--md-primary-fg-color) 70%, var(--md-default-bg-color)) 85%,
      var(--md-default-bg-color) 100%
    );
}

[data-md-color-scheme="slate"] .mdx-container {
  background:
    linear-gradient(
      to bottom,
      var(--md-primary-fg-color) 0%,
      var(--md-primary-fg-color) 55%,
      var(--md-default-bg-color) 100%
    );
}

.mdx-hero .md-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.mdx-hero .md-button .twemoji svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}

.mdx-hero .mdx-hero__secondary {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.85);
  color: #ffffff;
}

/* Headings: a stronger, darker title and clearly separated sections. */
.md-typeset h1 {
  margin-bottom: 0.6rem;
  color: var(--md-default-fg-color);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.md-typeset h2 {
  margin-top: 2.2em;
  padding-bottom: 0.3em;
  border-bottom: 0.05rem solid var(--md-default-fg-color--lightest);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.md-typeset h3 {
  font-weight: 600;
}

/* Document metadata chips under the page title. */
.md-typeset .doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
}

.md-typeset .doc-meta__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0.15rem 0.6rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: 1rem;
  background: var(--md-code-bg-color);
  color: var(--md-default-fg-color--light);
  font-size: 0.64rem;
  line-height: 1.6;
}

.md-typeset .doc-meta__chip svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

.md-typeset .doc-meta__chip--status {
  border-color: color-mix(in srgb, var(--md-accent-fg-color) 45%, transparent);
  color: var(--md-accent-fg-color);
  font-weight: 600;
}

/* Sidebar: readable section labels, a visible active page, and aligned icons. */
.md-nav--primary .md-nav__item--section > .md-nav__link {
  color: var(--md-default-fg-color);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-nav__link .md-icon svg,
.md-nav__link > .twemoji svg {
  opacity: 0.75;
}

@media screen and (min-width: 76.25em) {
  .md-nav--primary .md-nav__link--active {
    margin-left: -0.6rem;
    padding-left: 0.5rem;
    border-left: 0.1rem solid var(--md-accent-fg-color);
    font-weight: 600;
  }
}

/* Tabs: a clear marker under the active section. */
.md-tabs__link--active,
.md-tabs__item--active .md-tabs__link {
  font-weight: 700;
  opacity: 1;
}

.md-tabs__item--active {
  box-shadow: inset 0 -0.12rem 0 var(--md-primary-bg-color);
}

/* Breadcrumbs sit closer to the title. */
.md-path {
  margin-bottom: 0.4rem;
  font-size: 0.66rem;
}

/* Tables: tinted header row, rounded frame, and row hover for scanning wide tables. */
.md-typeset table:not([class]) {
  border-radius: 0.4rem;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background-color: color-mix(in srgb, var(--md-primary-fg-color) 8%, var(--md-default-bg-color));
  color: var(--md-default-fg-color);
  font-weight: 650;
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: color-mix(in srgb, var(--md-accent-fg-color) 6%, transparent);
}

/* Figure credit captions under images. */
.md-typeset small {
  display: block;
  margin-top: -0.4rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.64rem;
}

/* Admonitions: softer corners to match cards and chips. */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 0.4rem;
}

/* Keep the hero title light on the dark gradient, above the global h1 color. */
.md-typeset .mdx-hero h1 {
  color: var(--md-primary-bg-color);
}

/* The chip row is a list: drop the default list indentation. */
.md-typeset ul.doc-meta,
.md-typeset ul.doc-meta > li {
  margin-left: 0;
}

/* The home page already marks its sections with an accent bar. */
body:has(.mdx-hero) .md-typeset h2 {
  border-bottom: 0;
}

/* =========================================================================
   Mermaid diagrams (rendered by docs/javascripts/diagrams.js)
   ========================================================================= */

/* Hide the raw source until the script replaces it, so readers never see a flash of code. */
.md-typeset pre.eaf-diagram {
  visibility: hidden;
  height: 4rem;
}

.md-typeset figure.eaf-diagram {
  position: relative;
  display: block;
  margin: 1.5em 0;
  padding: 1rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  background: var(--md-default-bg-color);
  text-align: center;
}

.md-typeset .eaf-diagram__canvas svg {
  height: auto;
  max-width: 100%;
}

.md-typeset .eaf-diagram__toolbar {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.md-typeset figure.eaf-diagram:hover .eaf-diagram__toolbar,
.md-typeset .eaf-diagram__toolbar:focus-within {
  opacity: 1;
}

.eaf-diagram__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-left: 0.2rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: 0.3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color--light);
  cursor: pointer;
}

.eaf-diagram__button:hover,
.eaf-diagram__button:focus-visible {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}

.eaf-diagram__button svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* Full-screen viewer */
.eaf-viewer {
  width: 96vw;
  max-width: none;
  height: 92vh;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0.6rem;
  background: #ffffff;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.eaf-viewer.is-dark {
  background: #1e2129;
}

.eaf-viewer::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.eaf-viewer__toolbar {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
}

.eaf-viewer .eaf-diagram__button {
  background: #ffffff;
  color: #333333;
}

.eaf-viewer.is-dark .eaf-diagram__button {
  background: #2b2f3a;
  color: #e6e6e6;
}

.eaf-viewer__stage {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.eaf-viewer__stage.is-dragging {
  cursor: grabbing;
}

.eaf-viewer__content {
  transform-origin: 0 0;
}

.eaf-viewer__hint {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: #777777;
  font-size: 0.7rem;
  pointer-events: none;
}

/* Material sizes figures to their content; diagrams need the full column instead. */
.md-typeset figure.eaf-diagram {
  width: 100%;
  box-sizing: border-box;
}

.md-typeset .eaf-diagram__canvas {
  width: 100%;
}

/* Diagrams open in the viewer on click, like images in the lightbox. */
.md-typeset .eaf-diagram__canvas {
  cursor: zoom-in;
}

.md-typeset .eaf-diagram__toolbar {
  opacity: 0.7;
}
