:root {
  font: normal 16px/1.333 var(--font-family);
  font-feature-settings: "kern" on;
  text-rendering: optimizeLegibility;
  accent-color: var(--color-accent);
  scrollbar-gutter: stable;
}
@media (--gt-mobile) {
  :root {
    scroll-padding-top: 100px;
  }
}

body {
  background: var(--color-back);
  color: var(--color-text);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  scrollbar-gutter: stable;
}

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

a {
  color: var(--color-link);
  transition: color .3s;
}

a:focus, a:hover {
  color: var(--color-link-hover);
}

/* external links: add icon after them */
a[href^="https://"]:after {
  content: "";
  display: inline-block;
  width: 1.2ex;
  height: 1.2ex;
  vertical-align: baseline;
  background: var(--color-link);
  mask: url(../images/ext_link.svg);
  mask-size: cover;
  margin-left: .2em;
}

a[href^="https://"]:focus:after,
a[href^="https://"]:hover:after {
  background-color: var(--color-link-hover);
}

svg {
  fill: currentColor;
  overflow: visible; /* TODO quick fix for glyphs getting cut off */
}

th, td {
  padding: .2em .5em;
}

th {
  font-weight: 600;
}

th[scope="row"] {
  text-align: right;
}

blockquote {
  font-style: italic;
}

blockquote em,
blockquote i {
  font-style: normal;
}

/* font sizes and typographic adaptions */

.h1,
h1 {
  font-size: calc(1rem * var(--font-mod) * var(--font-mod) * var(--font-mod) * var(--font-mod) * var(--font-mod));
  font-weight: normal;
  font-variation-settings: "opsz" 35;
}

.h2,
h2 {
  font-size: calc(1rem * var(--font-mod) * var(--font-mod) * var(--font-mod) * var(--font-mod));
  font-weight: normal;
}

.h3,
h3 {
  font-size: calc(1rem * var(--font-mod) * var(--font-mod) * var(--font-mod));
  font-weight: normal;
}

.h4,
h4 {
  font-size: calc(1rem * var(--font-mod) * var(--font-mod));
}

.text_big,
.h5,
h5 {
  font-size: calc(1rem * var(--font-mod));
}

.tiles .missing-cp,
.tiles .cp:before,
.ln .meta,
.cp-toolbox,
.cp-toolbox button,
.page-footer,
.badge,
.direct-link,
small, .text_small, figcaption {
  font-size: calc(1rem / var(--font-mod));
  font-family: var(--font-family-alternate);
}

dd + dt {
  margin-top: 1em;
}

.visually-hidden:not(:focus):not(:active):not(:focus-within) {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.badge {
  display: inline-block;
  padding: .3em .5em;
  font-weight: normal;
  line-height: 1;
  background: var(--color-back-dim);
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  border-radius: 3px;
}

.bulletless {
  padding-left: 0;
  list-style: none;
}

.direct-link {
  opacity: 0;
  text-decoration: none;
  transition: opacity .3s;
}

.direct-link:focus-within,
:hover > .direct-link {
  opacity: .75;
}

.tiles > li > *,
.card {
  border-radius: 3px;
  background: #0000000a;
  box-shadow: 2px 2px 5px hsla(from var(--color-shadow) h s l / .20),
              -2px -2px 5px var(--color-input-back);
}

.card {
  padding: .75em;
}

.tiles > li > *:focus,
.tiles > li > *:hover,
.card:focus {
  position: relative;
  top: -1px;
  left: -1px;
  box-shadow: 10px 10px 20px hsla(from var(--color-shadow) h s l / .20),
              -10px -10px 20px var(--color-input-back);
}
