/* The documentation site in the Undine palette (docs/brand.md).
   Dark: the app's shipped theme (deep water). Light: the logo's colours, deep teal and aqua, on a white ground.
   Brand rules kept here: one accent (aqua); blue-green neutrals, never grey; no cards: group by space and 1 px
   hairlines; notes are tinted bands without a frame; controls take a 4 px radius, structure is square. */

/* Latin and digits from Atkinson Hyperlegible Next, Japanese from BIZ UDPGothic (Material sets these on body) */
html body {
  --md-text-font-family: "Atkinson Hyperlegible Next", "BIZ UDPGothic", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --md-code-font-family: "JetBrains Mono", SFMono-Regular, Consolas, Menlo, "BIZ UDPGothic", monospace;
}
:root { --u-radius: 4px; }

/* ---------------------------------------------------------------- light: the logo on white */
[data-md-color-scheme="default"] {
  --u-ground: #ffffff;
  --u-band: #f2f8f9;           /* a depth band: the one region that leads */
  --u-well: #eaf3f5;
  --u-line: #d6e6ea;
  --u-line2: #b9d3da;
  --u-text: #12303a;
  --u-soft: #3b5a64;
  --u-dim: #5b7a84;
  --u-teal: #1b4c5e;            /* the logo's deep teal */
  --u-link: #1f6f78;            /* aqua, darkened to read on white */
  --u-link-hi: #14555d;
  --u-accent: #72bfc6;          /* the logo's wave */
  --u-ok: #2c8466;
  --u-warn: #9a6a10;
  --u-err: #b4474f;
  --u-info: #2f7d9a;
  --u-agent: #6a5bb5;

  --md-default-bg-color: var(--u-ground);
  --md-default-fg-color: var(--u-text);
  --md-default-fg-color--light: var(--u-soft);
  --md-default-fg-color--lighter: var(--u-dim);
  --md-default-fg-color--lightest: var(--u-line);
  --md-primary-fg-color: var(--u-teal);
  --md-primary-fg-color--dark: #153d4b;
  --md-primary-bg-color: #f2f8f9;
  --md-primary-bg-color--light: #cfe3e7;
  --md-accent-fg-color: var(--u-link-hi);
  --md-accent-fg-color--transparent: rgba(31, 111, 120, 0.1);
  --md-typeset-color: var(--u-text);
  --md-typeset-a-color: var(--u-link);
  --md-code-bg-color: var(--u-well);
  --md-code-fg-color: #1d3e48;
  --md-typeset-table-color: var(--u-line);
  --md-footer-bg-color: var(--u-teal);
  --md-footer-bg-color--dark: #153d4b;
  --md-footer-fg-color: #f2f8f9;
}

/* ---------------------------------------------------------------- dark: the app's deep water */
[data-md-color-scheme="slate"] {
  --u-ground: #071217;
  --u-band: #0c1b22;
  --u-well: #050e12;
  --u-line: #1a3540;
  --u-line2: #2a4856;
  --u-text: #e6f2f4;
  --u-soft: #b6cbd1;
  --u-dim: #93adb5;
  --u-teal: #1b4c5e;
  --u-link: #72bfc6;
  --u-link-hi: #9ad8dd;
  --u-accent: #72bfc6;
  --u-ok: #8fd6b5;
  --u-warn: #e6c88f;
  --u-err: #e9929a;
  --u-info: #9bdcf2;
  --u-agent: #b7a9ee;

  --md-hue: 195;
  --md-default-bg-color: var(--u-ground);
  --md-default-fg-color: var(--u-text);
  --md-default-fg-color--light: var(--u-soft);
  --md-default-fg-color--lighter: var(--u-dim);
  --md-default-fg-color--lightest: var(--u-line);
  --md-primary-fg-color: #0c1b22;
  --md-primary-fg-color--dark: #050e12;
  --md-primary-bg-color: var(--u-text);
  --md-primary-bg-color--light: var(--u-dim);
  --md-accent-fg-color: var(--u-link-hi);
  --md-accent-fg-color--transparent: rgba(114, 191, 198, 0.12);
  --md-typeset-color: var(--u-text);
  --md-typeset-a-color: var(--u-link);
  --md-code-bg-color: #0c1b22;
  --md-code-fg-color: #d3e6ea;
  --md-typeset-table-color: var(--u-line);
  --md-footer-bg-color: #0c1b22;
  --md-footer-bg-color--dark: #050e12;
  --md-footer-fg-color: var(--u-text);
}

/* ---------------------------------------------------------------- frame */
.md-header { box-shadow: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
[data-md-color-scheme="slate"] .md-header { border-bottom-color: var(--u-line); }
.md-header__title { font-weight: 700; }
.md-search__form { border-radius: var(--u-radius); }
.md-footer { border-top: 1px solid var(--u-line); }

/* the sidebar: each section a small uppercase heading, its pages under it (as the react-admin docs do) */
@media screen and (min-width: 76.25em) {
  .md-nav--primary > .md-nav__list > .md-nav__item--section > .md-nav__link {
    margin-top: 1.1em;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--u-dim);
  }
  .md-nav--primary .md-nav__item--section > .md-nav { margin-left: 0; }
  .md-nav--primary .md-nav__link--active { font-weight: 700; }
  .md-sidebar--primary .md-sidebar__scrollwrap { border-right: 1px solid var(--u-line); }
}
.md-nav__link--active, .md-nav__link:is(:focus, :hover) { color: var(--u-link); }

/* ---------------------------------------------------------------- type */
.md-typeset { font-size: 0.78rem; line-height: 1.7; }
.md-typeset :is(h1, h2, h3) { color: var(--u-text); letter-spacing: -0.01em; }
.md-typeset h1 { font-weight: 700; }
.md-typeset h2 { font-weight: 700; margin-top: 2em; padding-top: 0.6em; border-top: 1px solid var(--u-line); }
.md-typeset h3 { font-weight: 700; }
.md-typeset a { text-underline-offset: 0.15em; }
.md-typeset a:hover { color: var(--u-link-hi); }
:lang(ja) .md-typeset { line-height: 1.85; }

.md-typeset code { border-radius: 2px; font-variant-ligatures: none; }
.md-typeset pre > code, .md-typeset .highlight, .md-typeset .highlighttable { border-radius: 0; }
.md-typeset pre > code { border: 1px solid var(--u-line); }

.md-typeset table:not([class]) {
  font-size: 0.72rem;
  border: 1px solid var(--u-line);
  border-radius: 0;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.md-typeset table:not([class]) th { background: var(--u-band); color: var(--u-text); }
.md-typeset table:not([class]) td { border-top: 1px solid var(--u-line); }
.md-typeset img { border-radius: 0; }

.md-typeset .md-button {
  border-radius: var(--u-radius);
  border-width: 1px;
  font-weight: 700;
  padding: 0.55em 1.3em;
  color: var(--u-link);
}
.md-typeset .md-button--primary { background: var(--u-teal); border-color: var(--u-teal); color: #f2f8f9; }
[data-md-color-scheme="slate"] .md-typeset .md-button--primary { background: var(--u-accent); border-color: var(--u-accent); color: #071217; }
.md-typeset .md-button:is(:focus, :hover) { background: var(--u-link-hi); border-color: var(--u-link-hi); color: var(--u-ground); }

/* notes: a tinted band without a frame, a 1 px line where it starts */
.md-typeset :is(.admonition, details) {
  --u-c: var(--u-info);
  border: 0;
  border-left: 1px solid var(--u-c);
  border-radius: 0;
  box-shadow: none;
  background: color-mix(in srgb, var(--u-c) 8%, transparent);
  font-size: 0.74rem;
}
.md-typeset :is(.admonition-title, summary) { background: transparent !important; font-weight: 700; color: var(--u-text); }
.md-typeset :is(.admonition-title, summary)::before { background-color: var(--u-c) !important; }
.md-typeset :is(.note, .info, .abstract, .quote) { --u-c: var(--u-info); }
.md-typeset :is(.tip, .success, .hint) { --u-c: var(--u-ok); }
.md-typeset :is(.warning, .question, .caution, .attention) { --u-c: var(--u-warn); }
.md-typeset :is(.danger, .failure, .bug, .error) { --u-c: var(--u-err); }
.md-typeset .example { --u-c: var(--u-agent); }

/* ---------------------------------------------------------------- the home page */
.md-typeset .u-hidden-title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.md-typeset h2.u-section-title {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--u-dim);
  margin: 2.6em 0 1em;
  padding-top: 0;
  border-top: 0;
}
.md-typeset h2.u-section-title .headerlink { display: none; }

.md-typeset .u-hero { display: grid; gap: 1.6rem; align-items: center; margin: 0.4rem 0 1rem; }
@media screen and (min-width: 60em) { .md-typeset .u-hero { grid-template-columns: 1fr 1.15fr; } }
.md-typeset .u-eyebrow {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--u-link);
}
.md-typeset .u-hero__title {
  margin: 0.3em 0 0.5em;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--u-text);
}
:lang(ja) .md-typeset .u-hero__title { font-size: 1.45rem; line-height: 1.4; letter-spacing: 0; }
.md-typeset .u-hero__text > p:not([class]) { color: var(--u-soft); font-size: 0.86rem; }
.md-typeset .u-hero__text .md-button { margin: 0.4rem 0.5rem 0 0; }
.md-typeset .u-hero__figure { margin: 0; }
.md-typeset .u-hero__figure img { display: block; width: 100%; border: 1px solid var(--u-line); }
.md-typeset .u-hero__figure figcaption { max-width: none; margin: 0.5em 0 0; font-size: 0.66rem; font-style: normal; color: var(--u-dim); text-align: left; }

/* topic tiles: a grid drawn with hairlines, a faint icon in the corner (the react-admin docs' index, without cards) */
.md-typeset .u-tiles > ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--u-line);
  border-left: 1px solid var(--u-line);
}
.md-typeset .u-tiles > ul > li {
  position: relative;
  overflow: hidden;
  min-height: 8rem;
  margin: 0;
  padding: 0.9rem 1rem 1.2rem;
  border-right: 1px solid var(--u-line);
  border-bottom: 1px solid var(--u-line);
  transition: background-color 120ms;
}
.md-typeset .u-tiles > ul > li:hover { background: var(--u-band); }
.md-typeset .u-tiles > ul > li > p { position: relative; z-index: 1; margin: 0 0 0.35em; color: var(--u-soft); font-size: 0.72rem; line-height: 1.55; }
.md-typeset .u-tiles > ul > li > p:first-child { position: absolute; right: -0.7rem; bottom: -0.9rem; z-index: 0; margin: 0; }
.md-typeset .u-tiles .twemoji.u-tile__icon { display: block; width: 4.4rem; height: 4.4rem; --md-icon-size: 4.4rem; }
.md-typeset .u-tiles .u-tile__icon svg { width: 4.4rem; height: 4.4rem; max-height: none; fill: var(--u-teal); opacity: 0.14; }
[data-md-color-scheme="slate"] .md-typeset .u-tiles .u-tile__icon svg { fill: var(--u-accent); opacity: 0.1; }
.md-typeset .u-tiles > ul > li:hover .u-tile__icon svg { opacity: 0.22; }
.md-typeset .u-tiles > ul > li > p:nth-child(2) a { font-size: 0.92rem; font-weight: 700; color: var(--u-link); text-decoration: none; }
/* the whole tile is the link: the title's link covers the tile (the paragraph is static, the tile positioned) */
.md-typeset .u-tiles > ul > li > p:nth-child(2) { position: static; }
.md-typeset .u-tiles > ul > li > p:nth-child(2) a::after { content: ""; position: absolute; inset: 0; z-index: 2; }

/* three points, side by side, separated by hairlines */
.md-typeset .u-points { display: grid; gap: 0; }
@media screen and (min-width: 45em) { .md-typeset .u-points { grid-template-columns: repeat(3, 1fr); } }
.md-typeset .u-points > div { padding: 0 1.2rem 0.4rem; border-left: 1px solid var(--u-line); }
.md-typeset .u-points > div:first-child { border-left: 0; padding-left: 0; }
@media screen and (max-width: 44.99em) { .md-typeset .u-points > div { border-left: 0; padding: 0 0 0.6rem; } }
.md-typeset .u-points p { margin: 0.4em 0; font-size: 0.74rem; color: var(--u-soft); }
.md-typeset .u-points p strong { display: block; font-size: 0.86rem; color: var(--u-text); }

/* the showcase: a depth band */
.md-typeset .u-showcase { display: grid; gap: 1.2rem; align-items: center; padding: 1.2rem; background: var(--u-band); }
@media screen and (min-width: 60em) { .md-typeset .u-showcase { grid-template-columns: 1.1fr 1fr; } }
.md-typeset .u-showcase img { display: block; border: 1px solid var(--u-line); }
.md-typeset .u-showcase p { margin: 0 0 0.8em; font-size: 0.76rem; color: var(--u-soft); }

.md-typeset .u-links ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin: 0; padding: 0; list-style: none; }
.md-typeset .u-links li { margin: 0; }
.md-typeset .u-links a { font-weight: 700; text-decoration: none; }
.md-typeset .u-links .twemoji svg { fill: currentColor; }

/* phones: tiles in one column without the empty height, a smaller hero */
@media screen and (max-width: 44.99em) {
  .md-typeset .u-tiles > ul > li { min-height: 0; padding-bottom: 1rem; }
  .md-typeset .u-tiles .twemoji.u-tile__icon, .md-typeset .u-tiles .u-tile__icon svg { width: 3.2rem; height: 3.2rem; }
  .md-typeset .u-hero__title { font-size: 1.4rem; }
}

/* a table written with an empty header row (| | |) shows no header band */
.md-typeset table:not([class]) thead:not(:has(th:not(:empty))) { display: none; }
