@import "./colors.css";

/* reset */
* {
  margin: 0;
  padding: 0;
  border-radius: 0.15rem;
}

/* font */
html {
  color: #333;
  font-size: 20px;
  font-family: Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT",
    "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma,
    Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

@media screen and (min-width: 70rem) {
  html {
    /* jumping scrollbar fix: https://css-tricks.com/elegant-fix-jumping-scrollbar-issue/ */
    margin-left: calc(100vw - 100%);
  }
}

/* body layout */
body {
  margin: 0 auto;
  max-width: 50em;
  padding: 1em;
}

footer {
  padding: 2em 0;
}

body > * + *,
main > * + * {
  margin-top: 2rem;
}

h3 {
  font-size: 1em;
}

/* elements */
::selection {
  background-color: #3c3c3c;
  color: white;
}

:focus {
  outline-color: rebeccapurple;
}

button,
input,
textarea {
  background-color: white;
  border: 1px solid #e7e7e7;
  box-shadow: 0 1px 4px inset #00000005;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  padding: 0.25em 0.5em;
}

a button {
  color: initial;
}

button,
input[type="color"] {
  background: #f7f7f7;
  cursor: pointer;
}

.highlight,
.angebot.highlight,
.button.highlight {
  background: #ffe249;
  background: var(--highlight-background);
  border: var(--highlight-border);
}

a {
  color: inherit;
  text-decoration: none;
}

a:not(.no-style) {
  color: inherit;
  text-decoration: solid underline #dadada;
}

article > * + *,
section > * + *,
.article-section > * + *,
dl > dd + dt {
  margin-top: 0.5rem;
}

dt {
  font-weight: bold;
}

ul,
ol {
  padding-left: 1em;
}

/* external links */
a[href^="https://developer.mozilla.org/"]::after {
  content: "MDN";
  display: inline-block;
  font-size: 0.7em;
  vertical-align: super;
}

/* todo */
dd > .todo {
  float: right;
  max-width: 40%;
}

.todo {
  background-color: var(--highlight);
  box-shadow: 0 1px 4px 4px inset #00000005;
  padding: 0.5em 0.5em 0.5em 1.5em;
}

.todo::before {
  content: "Todo";
  font-weight: bold;
  margin-left: -1em;
}

/* logo */
.logo.badge {
  border: 1px solid #ffffff25;
  display: inline-block;
  padding: 0 0.35em;
}

.logo.inverted {
  background-color: #3c3c3c;
  color: white;
}

.logo::before {
  content: "grundlegend";
  font-weight: bold;
}

.logo::after {
  content: ".it";
}

pre {
  white-space: pre-line;
}

/*a[href^="tel"]::before {
  content: "☎️ ";
  font-style: normal;
}

a[href^="mailto"]::before {
  content: "📧 ";
  font-style: normal;
}*/

/* utilities */
.flex {
  display: flex;
}

.flex.wrap {
  flex-wrap: wrap;
}

.flex.column {
  flex-direction: column;
}

.flex .grow {
  flex-grow: 1;
}

.flex.center {
  justify-content: center;
}

.w-100 {
  width: 100%;
}

.w-50 {
  width: 40%;
  flex-grow: 1;
}

.flex.gap-1 {
  margin-left: -0.25em;
  margin-right: -0.25em;
}

.flex.gap-1 > * {
  margin: 0.25em;
}

.center {
  align-self: center;
}
