/* ===== milk documentation — custom theme ===== */

/* ---------- Smooth scroll ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- Layout ---------- */
.md-grid {
  max-width: 1440px;
}

/* ---------- Header ---------- */
.md-header {
  box-shadow:
    0 0 0.2rem rgba(0, 0, 0, 0.1),
    0 0.2rem 0.4rem rgba(0, 0, 0, 0.2);
}

/* ---------- Navigation tabs ---------- */
.md-tabs__link--active {
  font-weight: 700;
}

/* ---------- Hero banner (home page) ---------- */
.md-hero {
  padding: 2.4rem 1.2rem 1.6rem;
  background: linear-gradient(
    135deg,
    rgba(0, 191, 165, 0.12) 0%,
    rgba(0, 151, 167, 0.08) 100%
  );
  border-radius: 0.6rem;
  margin-bottom: 2rem;
  text-align: center;
}

[data-md-color-scheme="slate"] .md-hero {
  background: linear-gradient(
    135deg,
    rgba(0, 191, 165, 0.18) 0%,
    rgba(0, 151, 167, 0.10) 100%
  );
}

.md-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.md-hero .md-hero__tagline {
  font-size: 1.1rem;
  opacity: 0.8;
  max-width: 42em;
  margin: 0 auto;
}

.md-hero .md-hero__badges {
  margin-top: 0.8rem;
}

.md-hero .md-hero__badges img {
  margin: 0 0.2rem;
  vertical-align: middle;
}

/* ---------- Card grid hover ---------- */
.md-typeset .grid.cards > ul > li {
  position: relative;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0.3rem 0.8rem rgba(0, 0, 0, 0.12),
    0 0.1rem 0.3rem rgba(0, 0, 0, 0.08);
}

[data-md-color-scheme="slate"]
  .md-typeset .grid.cards > ul > li:hover {
  box-shadow:
    0 0.3rem 0.8rem rgba(0, 0, 0, 0.35),
    0 0.1rem 0.3rem rgba(0, 0, 0, 0.2);
}

/* Stretch each card's trailing link over the full card so the whole
   card — not just the "-> Link" line — is clickable. */
.md-typeset .grid.cards > ul > li > :last-child a {
  position: static;
}

.md-typeset .grid.cards > ul > li > :last-child a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---------- Section dividers ---------- */
.md-typeset hr {
  border: none;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 191, 165, 0.35),
    transparent
  );
}

/* ---------- Code blocks ---------- */
.highlight pre {
  border-radius: 0.3rem;
  border-left: 3px solid rgba(0, 191, 165, 0.45);
  font-family: var(--md-code-font-family);
}

[data-md-color-scheme="slate"] .highlight pre {
  border-left-color: rgba(0, 191, 165, 0.35);
}

/* ---------- Tables — compact cells ---------- */
.md-typeset table:not([class]) {
  font-size: 0.7rem;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.25em 0.8em;
}

/* ---------- Tables — zebra striping ---------- */
.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: rgba(0, 191, 165, 0.04);
}

[data-md-color-scheme="slate"]
  .md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: rgba(0, 191, 165, 0.06);
}

/* ---------- Details / summary ---------- */
details {
  margin-bottom: 1em;
}

details summary {
  cursor: pointer;
  padding: 0.4em 0;
}

/* Plain grey collapsible: <details class="plain" markdown="1"> */
.md-typeset details.plain {
  border-color: var(--md-default-fg-color--lightest);
  box-shadow: none;
}

.md-typeset details.plain > summary {
  background-color: var(--md-default-fg-color--lightest);
  padding-left: 0.8rem;
}

.md-typeset details.plain > summary::before {
  display: none;
}

/* ---------- Announce banner ---------- */
.md-banner {
  font-size: 0.78rem;
}

/* ---------- Mermaid diagram theming ---------- */
.mermaid svg {
  max-width: 100%;
}

/* Teal node fills in light mode */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon {
  stroke: #0097a7 !important;
}

[data-md-color-scheme="slate"] .mermaid .node rect,
[data-md-color-scheme="slate"] .mermaid .node circle,
[data-md-color-scheme="slate"]
  .mermaid .node polygon {
  stroke: #4dd0e1 !important;
}

/* ---------- Footer — softer divider ---------- */
.md-footer {
  border-top: 2px solid rgba(0, 191, 165, 0.15);
}

/* Label the footer dates: first fact is last update, second is creation. */
.md-source-file__fact:nth-child(1)::before { content: "Last modified: "; }
.md-source-file__fact:nth-child(2)::before { content: "Created: "; }
