:root {
  font-size: 100%;
  line-height: 1.4;
  --link-color: navy;
  --bg-color: white;
  --text-color: black;
  --border-color: black;
  --button-text-color: white;
  --button-bg: black;
  /* white space */
  --small: 0.25rem;
  --half: 0.75rem;
  --normal: 1rem;
  --medium: 1.75rem;
  --large: 2.25rem;
  --day-bg: hsl(256 71% 80%);
  --evening-bg: hsl(113 92% 76%);
}

* {
  box-sizing: border-box;
}

/* Schriftgrössen */

h1,
h2,
h3 {
  font-size: unset;
  font-weight: unset;
}

label {
  font-size: 0.875rem;
}

ul.curriculum > * {
  font-size: unset;
  font-weight: unset;
}

ul.curriculum h3 {
  font-size: unset;
}

.button-link,
.button-button {
  font-size: 0.875rem;
  font-weight: 500;
}

th {
  font-weight: normal;
}

#single-schoolday h3,
#single-schoolday dl dt {
  font-weight: 600;
}

/* Ende Schriftgrössen */

/* Weissraum aka. Abstände */
/*
  Es ist erlaubt, Abstände anderswo zu verwenden, wenn es
  Aus dem Kontext heraus Sinn ergibt, siehe Helferlein.
*/

body {
  margin: 0;
  padding: 0.25rem;
}

footer {
  margin-top: auto; /* Flex item —> move to bottom */
}

.button-link,
.button-button {
  padding: 0.2rem 0.3rem 0.2rem;
}

.button-button {
  margin-top: var(--normal);
  padding-top: 0.3rem;
}

h3 {
  margin-bottom: var(--half);
}

table#all-schooldays th,
table#all-schooldays td {
  padding: var(--small) var(--small) 0;
}

table#all-schooldays th:first-of-type,
table#all-schooldays td:first-of-type {
  padding-left: 0;
}

table#all-schooldays th:last-of-type,
table#all-schooldays td:last-of-type {
  padding-right: 0;
}

h1 {
  margin-bottom: var(--medium);
}

#single-schoolday dl dd {
  margin-left: var(--normal);
  margin-bottom: var(--small);
}

.schoolday {
  margin-bottom: var(--normal);
}
.schoolday p,
.schoolday h3 {
  margin: 0;
}
form {
  margin-bottom: var(--large);
}
form section {
  margin-bottom: var(--normal);
}

label,
input {
  margin-bottom: var(--normal);
}

label {
  margin-right: 0.25rem;
}

p.small:last-of-type {
  margin-bottom: 0;
}
h1,
h2,
h3 {
  margin: 0;
}

ul.curriculum,
table#all-schooldays {
  margin: 2rem 0;
}

ul.curriculum > li {
  margin: 0;
}

/* Ende Weissraum */

body {
  font-family: 'Fragment Mono', 'MD UI', --system, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Links & Buttons */

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

h1 a {
  color: unset;
  text-decoration: none;
}

.button-link,
.button-button {
  display: inline-block;
  border: 1px solid var(--border-color);
  border-radius: 0.125rem;
  color: var(--text-color);
  background: transparent;
  letter-spacing: 0.0625rem;
  text-decoration: none;
}

.button-link:hover,
.button-button:hover {
  color: var(--bg-color);
  background: var(--text-color);
  text-decoration: none;
}

/* Ende Links & Buttons */

/* Helferlein */

.inline {
  display: inline;
  margin: 0;
}

.inline-block {
  display: inline-block;
  margin: 0;
}

.no-list {
  list-style: none;
  padding: 0;
}

.flex-list {
  display: flex;
  list-style: none;
  padding: 0;
}

.flex-list li {
  margin-right: var(--normal);
}

.h-flex {
  display: flex;
  align-items: baseline;
}

/* Ende Helferlein */

table#all-schooldays {
  border-collapse: collapse;
}

table#all-schooldays tr {
  border-bottom: 1px solid var(--border-color);
}

table#all-schooldays tr.day .title,
table#all-schooldays tr.day .teacher {
  background-color: var(--day-bg);
}

table#all-schooldays tr.evening .title,
table#all-schooldays tr.evening .teacher {
  background-color: var(--evening-bg);
}

th {
  text-align: left;
  padding-bottom: 0.25rem;
}

th,
td {
  padding-right: var(--normal);
}

#single-schoolday .day-marker,
#single-schoolday .evening-marker {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  position: relative;
  top: 0.2rem;
  margin-right: 1ch;
}

#single-schoolday .day-marker {
  background: var(--day-bg);
}
#single-schoolday .evening-marker {
  background: var(--evening-bg);
}

#all-teachers {
  display: grid;
  grid-template-columns: max-content 1fr;
  /*
    - Dies nur, damit die <li> nicht breiter als nötig werden.
    - So lassen sich die initalen fein untereinander aufreihen.
  */
}

#all-teachers li {
  grid-column: 1/2;
  display: flex;
}

#all-teachers li a {
  padding-right: 1rem;
  flex-grow: 1;
  /* animation: move-initials 0.5s 0.1s ease-in forwards; */
}
/*
@keyframes move-initials {
  from {
    flex-grow: 0;
  }
  to {
    flex-grow: 1;
  }
}
*/

/* checkobx-table in schoolday form */

#teacher-selection {
  display: block;
}

#teacher-selection input,
#teacher-selection label {
  margin: 0;
}

input[type='text'] {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

/* Curriculum Frontend */

main {
  flex-grow: 1; /* fill viewport */
  display: flex;
  flex-direction: column;
}

.day .schoolday-info {
  background: var(--day-bg);
}
.evening .schoolday-info {
  background: var(--evening-bg);
}

ul.curriculum > li {
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-gap: 0.25rem;
  grid-template-columns: 3ch max-content 1fr 1fr;
}
ul.curriculum > li:last-of-type {
  border-bottom: 1px solid var(--border-color);
}

ul.curriculum > aside.curriculum-header {
  display: none;
}

ul.curriculum > li > time,
ul.curriculum > li > div {
  display: grid;
  grid-template-columns: subgrid;
}

ul.curriculum > li > time {
  grid-column: 1/3;
}
ul.curriculum > li > .schoolday-info {
  grid-column: 3/5;
  padding: 0 0.25rem;
}

ul.curriculum h3 {
  grid-column: 1/-1;
}

table#all-schooldays .date,
ul.curriculum > li > time .date {
  font-variant-numeric: tabular-nums;
}

ul.curriculum li .teacher {
  text-align: right;
}

.legende-teachers {
  grid-column: 1/-1;
  text-align: right;
}
.legende.teachers small {
  display: inline-block;
  line-height: 1.1;
}

@media (min-width: 600px) {
  body {
    padding: 0.5rem;
  }

  /* Weissraum Desktop */

  ul.curriculum {
    margin: 4rem 0;
  }
  ul.curriculum > aside.curriculum-header {
    margin: 0;
  }
  ul.curriculum .curriculum-header .class-type {
    padding-left: 0.25rem;
  }

  /* Ende Weissraum Desktop */

  ul.curriculum {
    display: grid;
    align-content: start;
    grid-template-columns: min-content min-content 1fr min-content max-content 1fr min-content max-content;
    grid-gap: 0 2rem;
    /* line-height: 1.4; */
    flex-grow: 1;
  }

  ul.curriculum > li {
    grid-column: 1/-1;
    grid-template-columns: subgrid;
    grid-gap: inherit;
  }

  ul.curriculum > aside.curriculum-header {
    display: block;
    grid-column: 3/-2;
    display: grid;
    grid-template-columns: subgrid;
  }

  ul.curriculum > li > time {
    grid-column: 1/3;
  }

  ul.curriculum > li.day > .schoolday-info {
    grid-column: 3/6;
  }

  ul.curriculum > li.evening > .schoolday-info {
    grid-column: 6/9;
  }

  ul.curriculum h3 {
    grid-column: 1/2;
  }
}

/* End Curriculum Frontend */

@media (prefers-color-scheme: dark) {
  :root {
    --link-color: hsl(60 0% 95%);
    --bg-color: black;
    --text-color: hsl(220 0% 90%);
    --border-color: hsl(220 0% 45%);
    --day-bg: transparent;
    --evening-bg: transparent;
  }

  .day .schoolday-info {
    color: hsl(256 100% 65%);
  }
  .evening .schoolday-info {
    color: hsl(160 100% 36%);
  }

  body,
  th,
  ul.curriculum,
  ul.curriculum * {
    font-weight: 200; /* Magere Schrift in der Dunkelheit! */
    letter-spacing: 0.0125rem;
  }
}
