/*
 * Stylesheet of docs.elunyo.app. It follows the Vitrine tokens of elunyo-web
 * (src/styles/tokens.css): same colours, radii and typeface. The theme
 * follows the system, in CSS only: the site has no script of its own.
 *
 * Work Sans 300, 400 and 500, Latin subset, served by the site itself (no
 * third-party font CDN). License: OFL-1.1, in docs-site/assets/fonts.
 */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/work-sans-latin-300-normal.ff2dad979feb.woff2") format('woff2');
}

@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/work-sans-latin-400-normal.418b06936717.woff2") format('woff2');
}

@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/work-sans-latin-500-normal.943a4b2d8b49.woff2") format('woff2');
}

:root {
  --bg: #0e0d0c;
  --surface-1: #181715;
  --surface-2: #211f1c;
  --line: #2c2925;
  --line-strong: #3a3631;
  --text: #f3eee6;
  --text-soft: #cfc7bc;
  --text-muted: #a39a8e;
  --accent: #d8b77a;
  --on-accent: #1a1610;
  --accent-soft: #2a2418;
  --accent-soft-text: #e7cc98;
  --accent-text: #d8b77a;
  --success-text: #7fd6a4;
  --error-text: #f49a8d;
  --brand-mark: #d8b77a;
  --brand-name: #f3eee6;
  --focus-ring: #d8b77a;
  color-scheme: dark;

  --font: 'Work Sans', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius-pill: 999px;
  --radius-item: 12px;
  --radius-inline: 6px;
  --radius-field: 14px;
  --header: 64px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f2ec;
    --surface-1: #fffdf9;
    --surface-2: #eee8df;
    --line: #e3dbcf;
    --line-strong: #cdc2b2;
    --text: #1a1714;
    --text-soft: #423b33;
    --text-muted: #665d52;
    --accent: #d4af6a;
    --on-accent: #1a1610;
    --accent-soft: #f4e9d3;
    --accent-soft-text: #6e5014;
    --accent-text: #7f5e21;
    --success-text: #1d6a40;
    --error-text: #a5321f;
    --brand-mark: #9c7942;
    --brand-name: #0e0d0c;
    --focus-ring: #7f5e21;
    color-scheme: light;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

/* Smooth scrolling to the sections of a guide. Not on the reference: Redoc
   keeps a linked operation at the top while it renders, and a smooth
   scroll makes it give up halfway. */
@media (prefers-reduced-motion: no-preference) {
  .guides {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

.skip {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  text-decoration: none;
}

.logo {
  display: block;
  height: 24px;
  width: auto;
}

.logo-line {
  stroke: var(--brand-mark);
}

.logo-dot {
  fill: var(--brand-mark);
}

.logo-name {
  fill: var(--brand-name);
}

.brand-tag {
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0.06em;
}

.top-nav {
  display: flex;
  gap: 4px;
}

.top-nav a {
  padding: 8px 10px;
  border-radius: var(--radius-item);
  color: var(--text-soft);
  font-size: 15px;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a[aria-current] {
  color: var(--text);
}

.top-nav a[aria-current] {
  background: var(--surface-2);
}

/* Phones: the product link stays in the footer, and the rest shrinks so
   the header never scrolls sideways. */
@media (max-width: 599px) {
  .top {
    padding: 0 16px;
    gap: 8px;
  }

  .logo {
    height: 20px;
  }

  .top-nav a {
    padding: 8px;
  }

  .top-nav a[href^='https:'] {
    display: none;
  }
}

/* Layout: one column on small screens; the list of guides on the left from
   900 px; the page's own sections on the right from 1200 px. */

.layout {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 600px) {
  .layout {
    padding: 0 20px;
  }
}

.side,
.toc {
  display: none;
}

.menu {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--surface-1);
}

.menu summary {
  padding: 12px 16px;
  font-weight: 500;
  cursor: pointer;
}

.menu ul,
.side ul,
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu ul {
  padding: 0 8px 8px;
}

.menu a,
.side a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-item);
  color: var(--text-soft);
  font-size: 15px;
  line-height: 22px;
  text-decoration: none;
}

.menu a:hover,
.side a:hover {
  color: var(--text);
}

.menu a[aria-current],
.side a[aria-current] {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-weight: 500;
}

.content {
  min-width: 0;
  padding: 32px 0 80px;
}

@media (min-width: 900px) {
  .layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 48px;
  }

  .menu {
    display: none;
  }

  .side {
    display: block;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 40px 0;
  }

  .content {
    padding-top: 40px;
  }
}

@media (min-width: 1200px) {
  .layout {
    grid-template-columns: 232px minmax(0, 1fr) 200px;
  }

  .toc {
    display: block;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 44px 0;
  }

  .toc p {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .toc a {
    display: block;
    padding: 4px 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
  }

  .toc a:hover {
    color: var(--text);
  }
}

/* Text of a guide, as the legal pages of elunyo-web. */

.prose {
  max-width: 760px;
}

.prose h1,
.prose h2,
.prose h3 {
  font-weight: 300;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.prose h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.08;
}

.prose h1 code {
  font-size: 0.82em;
}

.prose h2 {
  margin: 48px 0 12px;
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 32px 0 8px;
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
  letter-spacing: normal;
}

.prose p,
.prose li {
  color: var(--text-soft);
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.prose li + li {
  margin-top: 6px;
}

.prose li > ul,
.prose li > ol {
  margin: 6px 0 0;
}

.prose strong {
  color: var(--text);
  font-weight: 500;
}

.prose code {
  padding: 2px 6px;
  border-radius: var(--radius-inline);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.prose a code {
  color: inherit;
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: var(--accent-soft);
}

.prose blockquote p {
  margin: 0;
  color: var(--accent-soft-text);
  font-size: 15px;
  line-height: 24px;
}

.prose blockquote p + p {
  margin-top: 8px;
}

.prose blockquote strong,
.prose blockquote code {
  color: inherit;
}

.prose blockquote code {
  background: transparent;
  padding: 0;
}

.prose hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Code blocks. The classes are the ones the highlighter writes. */

.code {
  margin: 0 0 16px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--surface-1);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 22px;
  tab-size: 2;
}

.code code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

.code .c,
.code .c1,
.code .cm,
.code .ch,
.code .cs {
  color: var(--text-muted);
}

.code .k,
.code .kc,
.code .kd,
.code .kn,
.code .kp,
.code .kr,
.code .kt,
.code .nt,
.code .nb {
  color: var(--accent-text);
}

.code .s,
.code .s1,
.code .s2,
.code .sb,
.code .se,
.code .sx {
  color: var(--success-text);
}

.code .m,
.code .mi,
.code .mf,
.code .mh,
.code .il {
  color: var(--accent-soft-text);
}

.code .err {
  color: inherit;
}

/* Tables scroll inside their own box. */

.table {
  margin: 0 0 16px;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 22px;
}

.prose th,
.prose td {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.prose td code {
  overflow-wrap: normal;
  white-space: nowrap;
}

/* Previous and next guide. */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 760px;
  margin-top: 56px;
}

.pager a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.pager a:hover {
  border-color: var(--line-strong);
}

.pager span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
}

.pager-next {
  grid-column: 2;
  text-align: right;
}

/* Footer */

.foot {
  padding: 28px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 22px;
}

.foot p {
  max-width: 1280px;
  margin: 0 auto;
}

.foot p + p {
  margin-top: 4px;
}

.foot a {
  color: var(--text-soft);
}

/* Reference: Redoc draws the page and brings its own styles. In its light
   theme two colors stay under 4.5:1 on white (WCAG 1.4.3): the GET label
   (#25b869, 2.6:1) and the search placeholder (#9b9ca8, 2.7:1). They take
   darker shades of the same hues; the ID beats Redoc's own rules. */
#redoc .redoc.light {
  --search-trigger-color: #6e6f7a;
  --search-input-placeholder-color: #6e6f7a;
}

#redoc .redoc.light .tag-get,
#redoc .redoc.light .tag-unary,
#redoc .redoc.light .tag-query {
  --tag-color: #177245;
}

.loading {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px;
  color: var(--text-soft);
}
