/* ==========================================================================
   Base: reset, page, focus, utilities
   ========================================================================== */

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

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

body {
  margin: 0;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}

/* Lists keep role="list" in the markup so Safari doesn't drop the semantics. */
ol,
ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-inline-size: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: var(--border-thin);
  text-underline-offset: 0.25em;
}

button,
input {
  font: inherit;
  color: inherit;
}

a,
button,
input,
label {
  touch-action: manipulation;
}

::selection {
  background: var(--tomato);
  color: var(--on-tomato);
}

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

.container {
  inline-size: 100%;
  max-inline-size: var(--measure);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right));
}

/* A Latin phrase kept on one line inside Arabic text (build.mjs). */
.nobr {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}
