/* Shared styles for support.aleta.io. Every page links only this file. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/inter-v4.1-variable-no-italics.woff2") format("woff2");
}

:root {
  --text: #1c1917;
  --muted: #6b6560;
  --rule: #e6e2df;
  --bg: #fff;
  --ink: 28 25 23; /* --text as an rgb triple, for translucent fills */
  --measure: 40rem; /* ~72 characters at the body size */
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 1.5rem 6rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* Everything sits in one centred column, text left-aligned within it. */
header,
main,
footer {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---------- Header ---------- */

header {
  padding: 3rem 0;
}

header img {
  /* Deliberately far smaller than h1 — at matching sizes the wordmark
     and the heading read as two headings. */
  height: 1.25rem;
  width: auto;
  display: block;
}

/* ---------- Text ---------- */

h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 3rem 0 0.75rem;
}

.lede {
  font-size: 1.0625rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.375rem;
}

li {
  margin: 0 0 0.375rem;
}


a {
  color: inherit;
}

/* ---------- Guide index ---------- */

.guides {
  list-style: none;
  padding: 0;
}

.guides li {
  margin: 0 0 1rem;
}

.guides a {
  font-weight: 500;
}

.guides span {
  display: block;
  /* Same treatment as a screenshot caption. */
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

strong {
  font-weight: 600;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.875em;
  background: #f5f3f1;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Screenshots ---------- */

figure {
  margin: 1.75rem 0 2rem;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgb(var(--ink) / 6%),
    0 8px 24px rgb(var(--ink) / 10%);
  cursor: zoom-in;
  background: var(--bg);
}

figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Expanded screenshot ---------- */

#expanded-screenshot {
  border: 0;
  /* showModal() focuses the dialog. It holds no controls, so the ring
     would only draw a box round the image. */
  outline: none;
  padding: 0;
  margin: auto;
  max-width: 94vw;
  background: none;
  cursor: zoom-out;
}

/* [open] matters: an id selector setting `display` unconditionally would
   outrank the browser's `dialog:not([open]) { display: none }` and leave
   the closed dialog sitting in the page. */
#expanded-screenshot[open] {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

#expanded-screenshot::backdrop {
  background: rgb(var(--ink) / 92%);
}

#expanded-screenshot img {
  display: block;
  max-width: 94vw;
  /* Leave room for the caption below. */
  max-height: calc(92vh - 4rem);
  width: auto;
  height: auto;
  border-radius: 6px;
  background: var(--bg);
}

#expanded-screenshot p {
  /* Capped so a long caption never widens the dialog past the image. */
  max-width: 60ch;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #d9d4d0;
}
