/* Element defaults. Headings and body are Figtree; sizes follow docs/design/README.md "Typography". */
@layer base {
  *, *::before, *::after { box-sizing: border-box; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 16px;
    /* No grey flash on tap (iOS/Android): buttons, rows and tabs have their own pressed and hover
       states. Inherited by every element. */
    -webkit-tap-highlight-color: transparent;
  }

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

  h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    letter-spacing: -0.01em;
    line-height: 1.2;
  }
  h1 { font-size: 40px; letter-spacing: -0.02em; line-height: 1.05; }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }
  h4 { font-size: 16px; }

  p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
  ul, ol { padding: 0; }

  a {
    color: var(--color-blue);
    text-decoration: none;
    text-underline-offset: 3px;
  }
  a:hover { color: var(--color-blue-deep); }

  img, svg, video, canvas, iframe { display: block; max-width: 100%; }
  img { height: auto; }

  button, input, select, textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
  }
  button { cursor: pointer; }
  button:disabled { cursor: not-allowed; }

  b, strong { font-weight: 700; }
  small { font-size: 12.5px; }
  code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }
  hr { height: 1px; margin: 0; border: 0; background: var(--color-hairline); }

  /* Search snippets (ts_headline <mark>) */
  mark {
    padding: 0 3px;
    border-radius: 4px;
    background: var(--petal-form-bg);
    color: var(--petal-form-fg);
    font-weight: 700;
  }

  /* Focus: one ring everywhere (0 0 0 2px #1d6aa1); never the browser default. */
  :focus { outline: none; }
  :focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
  }

  ::selection { background: color-mix(in srgb, var(--color-blue) 22%, transparent); }

  /* `hidden` must win over component display rules. */
  [hidden] { display: none !important; }

  .icon {
    display: block;
    flex: none;
    width: 1em;
    height: 1em;
  }

  .skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: var(--color-text);
    color: var(--color-bg);
    font-weight: 700;
    transform: translateY(-200%);
  }
  .skip-link:focus { transform: none; }

  /* Hover, focus and selected states fade instead of switching. Zero specificity in the lowest
     layer: any component or page that sets its own transition keeps it. Transform and opacity are
     left out: drag-and-drop never lags behind the pointer, and an element shown by a style change
     (a file input, a revealed control) is there at once. */
  :where(a, button, summary, label, input, select, textarea, [role="tab"], [role="menuitem"], [role="option"],
         .list-row, .card, .site-card, .search-hit, .search-member, .search-person, .staff-done, .player-drop) {
    transition-property: color, background-color, border-color, outline-color, box-shadow, text-decoration-color;
    transition-duration: var(--motion-fast);
    transition-timing-function: var(--ease-standard);
  }

  /* Reduced motion: no animation or transition runs at all (the system tests run this way too). */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0s !important;
      animation-delay: 0s !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0s !important;
      transition-delay: 0s !important;
      scroll-behavior: auto !important;
    }
  }
}
