/* Newsreader by Production Type; license: ../assets/fonts/OFL-Newsreader.txt. */
@font-face {
  font-family: Newsreader;
  src: url("../assets/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* Shared colors, type and page spacing. */
:root {
  --paper: #f7f5ee;
  --canvas: #faf8f1;
  --ink: #391624;
  --muted: #71525e;
  --line: #c6b6b8;
  --control-line: #957782;
  --pink: #d8aac2;
  --green: #d7e4ba;
  --focus: #2447b4;
  --font-display: Newsreader, Georgia, serif;
  --font-ui: Arial, Helvetica, sans-serif;
  --page-gutter: clamp(20px, 4vw, 64px);
  --section-space: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  scrollbar-color: var(--muted) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font-ui);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

a {
  color: inherit;
  text-underline-offset: 4px;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  cursor: pointer;
  border: 1px solid var(--control-line);
  min-height: 44px;
  border-radius: 0;
  padding: 10px 16px;
  background: transparent;
  font-size: 14px;
}

input {
  font: inherit;
  color: inherit;
  border: 1px solid var(--control-line);
  min-height: 44px;
  border-radius: 0;
  width: 100%;
  min-width: 0;
  padding: 12px;
  background: var(--canvas);
  caret-color: var(--ink);
}

button:hover:not(:disabled) {
  background: var(--green);
  border-color: var(--ink);
}

button:active:not(:disabled) {
  background: var(--pink);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input::placeholder {
  color: var(--muted);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
svg:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

h2 {
  font: 450 clamp(30px, 3.2vw, 44px)/1.05 var(--font-display);
  letter-spacing: -0.025em;
}

p {
  margin: 0;
  max-width: 70ch;
}

figure {
  margin: 0;
}

/* Keyboard navigation and assistive text. */
.skip {
  position: absolute;
  left: 20px;
  top: -100px;
  background: var(--paper);
  padding: 12px;
  z-index: 30;
}

.skip:focus {
  top: 12px;
}

.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;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 760px) {
  :root {
    --page-gutter: max(
      20px,
      env(safe-area-inset-left),
      env(safe-area-inset-right)
    );
    --section-space: 40px;
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body:has(.publish-fields input:focus) .sidebar nav {
    visibility: hidden;
    pointer-events: none;
  }

  h2 {
    font-size: 32px;
  }
}

@media (pointer: coarse) {
  button {
    min-height: 48px;
  }

  input {
    min-height: 48px;
  }
}
