/* Self-hosted variable fonts (SIL Open Font License, see static/fonts). Latin covers English, Spanish and French. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
}

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

  /* The scrollbar keeps its space on short pages too, so the page does not move sideways between pages. */
  /* Phones paint a square box over whatever is tapped, ignoring rounded corners; controls show their own pressed state. */
  html { -webkit-text-size-adjust: 100%; accent-color: var(--color-accent); scrollbar-gutter: stable; -webkit-tap-highlight-color: transparent; }

  body {
    margin: 0;
    min-block-size: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font: var(--font-size) / var(--line-height) var(--font-sans);
    overflow-wrap: break-word;
  }

  main { flex: 1; }
  main:focus { outline: none; }

  h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--tracking-tight); line-height: 1.12; text-wrap: balance; }
  h1 { font-size: var(--text-2xl); font-weight: 700; margin-block: 0 var(--space-4); }
  h2 { font-size: var(--text-xl); font-weight: 700; }
  h3 { font-size: var(--text-lg); font-weight: 700; }
  p, li { max-inline-size: var(--text-width); }

  a { color: var(--color-link); text-underline-offset: 0.15em; }
  a:hover { color: var(--color-primary-hover); }
  img, svg, video { max-inline-size: 100%; block-size: auto; }

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

  .skip-link {
    position: absolute;
    inset-inline-start: var(--space-3);
    inset-block-start: -4rem;
    z-index: 10;
    padding: var(--space-2) var(--space-4);
    background: var(--color-accent);
    color: var(--color-accent-text);
    border-radius: var(--radius);
  }
  .skip-link:focus { inset-block-start: var(--space-3); }

  /* Components set their own display, which would otherwise override the hidden attribute. */
  [hidden] { display: none !important; }

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

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
}

/* Cross-document view transitions: where supported, moving between pages cross-fades, and an event's picture glides from
   its card to the event page. The event page's picture is always named; a card is named by js/event-transitions.js only
   for the navigation to or from its event, so cards cut off by a carousel never show whole during a page change.
   Elsewhere the page simply changes. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
