/* The defaults of the elements, for the Backoffice and the website of the platform alike (ADR
   0015; docs/research/design-system.md, sections 4 and 5). Only roles of tokens.css. */

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

/* Hyphenation needs the language of the document, which both hosts set to de (section 4.4). */
html {
  background: var(--rr-surface-page);
  color: var(--rr-text);
  font: var(--rr-font-text-md);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 8 4 3;
  overflow-wrap: break-word;
}

body {
  margin: 0;
}

/* Vollkorn only for the title of a page; the sections below it use the text font (section 4.1). */
h1 {
  margin: 0 0 var(--rr-space-5);
  font: var(--rr-font-heading-lg);
  color: var(--rr-heading);
}

/* FocusOnNavigate of Blazor puts the focus on the h1 of a new page, so that screen readers
   announce the page; the title is no control and shows no ring, as in app.css of the template
   (dotnet/aspnetcore v11.0.0, src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/
   BlazorWebCSharp.1/wwwroot/app.css). */
h1:focus {
  outline: none;
}

h2 {
  margin: var(--rr-space-6) 0 var(--rr-space-3);
  font: var(--rr-font-heading-md);
}

h3 {
  margin: var(--rr-space-5) 0 var(--rr-space-2);
  font: var(--rr-font-heading-sm);
}

h4,
h5,
h6 {
  margin: var(--rr-space-4) 0 var(--rr-space-2);
  font: var(--rr-font-text-md-strong);
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--rr-space-4);
}

small {
  font: var(--rr-font-text-sm);
}

a {
  color: var(--rr-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--rr-accent-hover);
  text-decoration-thickness: 2px;
}

/* The focus ring: 2 px solid in the accent, 2 px from the element, on every layer (section
   5.4). */
:focus-visible {
  outline: 2px solid var(--rr-accent);
  outline-offset: 2px;
}

hr {
  margin: var(--rr-space-5) 0;
  border: 0;
  border-top: 1px solid var(--rr-border-subtle);
}

/* Numbers, times and keys in the text font with digits of the same width, no monospace face
   (section 6.2, rule 4). */
kbd {
  padding: 0 var(--rr-space-1);
  border: 1px solid var(--rr-border-subtle);
  border-radius: var(--rr-radius-control);
  background: var(--rr-surface-sunken);
  font: inherit;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

time {
  font-variant-numeric: tabular-nums;
}

/* Motion answers an action only, and the setting of the device turns it off (section 5.5). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
