/* Reset and typography. */

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

/* Anchor jumps and keyboard focus stop below the sticky header. */
html {
  scroll-padding-top: var(--header-height);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  color: var(--brown);
  background: var(--cream);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

/* Long words (e.g. "Lieblingskombinationen" at 200% text size on a phone)
   break instead of running off the screen. "anywhere" rather than
   "break-word", because only that also lets flex items shrink. It has no
   effect at normal sizes, where every word fits. */
main {
  overflow-wrap: anywhere;
}

/* Plain links. Components that style their own links (nav, buttons,
   icons) set their own hover, so this stays weak with :where().
   Hover thickens the underline instead of changing colour, so contrast
   stays the same in every state. */
a {
  color: inherit;
}
:where(a):hover {
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: var(--space-1);
}

/* Text for screen readers only. */
.visually-hidden {
  position: absolute;
  /* stylelint-disable-next-line montclair/grid-4 -- 1px is the standard size for screen-reader-only text */
  width: 1px;
  /* stylelint-disable-next-line montclair/grid-4 -- same */
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.caps {
  font-family: var(--font-caps);
  font-weight: 400;
}
.script {
  font-family: var(--font-script);
  font-weight: 400;
}
.accent {
  color: var(--coral);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
  }
}
