/* ==========================================================================
   SHIPFLOW documentation theme
   Palette taken from shipflow.se so the embedded docs and the public site read
   as one product. Change these four tokens to re-brand everything below.
   ========================================================================== */

:root {
  --sf-navy: #1e3a5f;         /* headers, hero, primary surfaces */
  --sf-navy-dark: #1a2332;    /* hero gradient end, dark-mode chrome */
  --sf-navy-light: #2e4a6b;   /* hover states on navy */
  --sf-cyan: #00a6d6;         /* brand accent */
  --sf-cyan-ink: #0b7ba0;     /* accent darkened enough for body-text contrast */
  --sf-cyan-tint: #eaf6fb;    /* pale accent wash for card/chip backgrounds */
  --sf-border: #e5e7eb;
}

/* Material colour hooks. Set `primary: custom` / `accent: custom` in mkdocs.yml
   so the theme picks these up instead of its built-in blue. */
[data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--sf-navy);
  --md-primary-fg-color--light: var(--sf-navy-light);
  --md-primary-fg-color--dark: var(--sf-navy-dark);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color: var(--sf-cyan);
  --md-accent-fg-color--transparent: rgba(0, 166, 214, 0.1);
  --md-accent-bg-color: #ffffff;
  --md-accent-bg-color--light: rgba(255, 255, 255, 0.7);
}

/* Links in body text: navy is too close to the text colour to read as a link,
   so use the darkened brand cyan instead. */
[data-md-color-scheme="default"] {
  --md-typeset-a-color: var(--sf-cyan-ink);
}

/* Dark mode: pull Material's slate hue from its default indigo toward the
   brand navy, and lighten links back up for contrast on a dark ground. */
[data-md-color-scheme="slate"] {
  --md-hue: 214;
  --md-typeset-a-color: #4ec3e8;
  --sf-cyan-tint: rgba(0, 166, 214, 0.12);
  --sf-border: rgba(255, 255, 255, 0.12);
}

/* Visually hidden, but still read by screen readers and indexed by search.
   Used for the homepage <h1>, which must exist in the document but not be shown. */
.sf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Landing-page cards — Material's `grid cards`, made clickable across the
   whole tile, with an explicit column count so the rows are predictable.

   Material's default `.grid` uses `repeat(auto-fit, ...)`, which reflows the
   rows depending on viewport width. The landing pages group their links by
   meaning (manuals / tutorials / getting started), so the row breaks have to
   be fixed rather than left to auto-fit.

   `.sf-cards`     — card behaviour (hover, whole-tile link)
   `.sf-cards--3`  — three per row (homepage: 3 + 3 + 3)
   `.sf-cards--2`  — two per row   (User Manuals landing page)
   -------------------------------------------------------------------------- */

/* Mobile first: one column, then widen. */
.md-typeset .sf-cards--2,
.md-typeset .sf-cards--3 {
  grid-template-columns: 1fr;
}

@media screen and (min-width: 45em) {
  .md-typeset .sf-cards--2,
  .md-typeset .sf-cards--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 60em) {
  .md-typeset .sf-cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.md-typeset .sf-cards > ul > li {
  position: relative;
  border-color: var(--sf-border);
  border-radius: 0.4rem;
  transition: border-color 125ms, box-shadow 125ms, transform 125ms;
}

.md-typeset .sf-cards > ul > li:hover {
  border-color: var(--sf-cyan);
  box-shadow: 0 0.2rem 0.6rem rgba(30, 58, 95, 0.14);
  transform: translateY(-0.05rem);
}

/* The card title link is stretched over the whole tile. Nested links keep
   working because they sit above the overlay. */
.md-typeset .sf-cards a.sf-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.4rem;
}

.md-typeset .sf-cards a.sf-card-link {
  color: var(--md-default-fg-color);
}

.md-typeset .sf-cards > ul > li:hover a.sf-card-link {
  color: var(--sf-cyan-ink);
}

.md-typeset .sf-cards > ul > li > p:first-child {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.md-typeset .sf-cards .twemoji {
  color: var(--sf-cyan);
}

.md-typeset .sf-cards .twemoji svg {
  width: 1.2em;
  height: 1.2em;
}

/* Secondary links inside a card sit above the stretched overlay. */
.md-typeset .sf-cards > ul > li > p:not(:first-child) a {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Homepage footnote
   -------------------------------------------------------------------------- */

.md-typeset .sf-footnote {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sf-border);
  color: var(--md-default-fg-color--light);
  font-size: 0.7rem;
}

/* --------------------------------------------------------------------------
   Existing shared components
   -------------------------------------------------------------------------- */

.toc-container {
  background: var(--sf-cyan-tint);
  border-left: 4px solid var(--sf-cyan);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
}

.toc-container ul {
  margin: 0;
  padding-left: 1rem;
}

.toc-container li {
  margin: 0.3rem 0;
}

/* Global UI scale.
   Material sizes the entire interface (nav, headings, body text, code) relative to the
   html font-size, which it steps up responsively at wide viewports. The defaults read a
   little small in the embedded CAESES / SHIPFLOW doc viewer, so bump every tier one notch
   (~+10%). Adjust these three numbers together to make everything larger or smaller. */
html {
  font-size: 137.5%;
}
@media screen and (min-width: 100em) {
  html {
    font-size: 150%;
  }
}
@media screen and (min-width: 125em) {
  html {
    font-size: 162.5%;
  }
}
