/* CSS Variable with fallback */
:root {
  --main-bg: #f4f6f9;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--main-bg, white);
  font-family: Arial, sans-serif;
  margin: 0 auto;
  min-width: 320px;
}

header {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 5;
  padding: 0.5em 1rem;
  text-align: center;
}

h1 {
  color: rgb(15, 52, 96);
  margin-top: 20px;
  margin-bottom: 8px;
  margin-left: 0;
  margin-right: 0;
  font-size: 2rem;
  font-family: 'Tangerine', cursive;
}

h2, h3 {
  margin-bottom: 8px;
}

h2 {
  color: #2980b9;
}

h2 + h3 {
  margin-top: 4px;
}

h2 ~ p {
  line-height: 1.6;
}

nav {
  background-color: color-mix(in srgb, rgb(15, 52, 96) 85%, white 15%);
  padding: 10px 16px;
  border: 2px solid rgb(15, 52, 96);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;

  & a {
    color: white;
    text-decoration: none;
    padding: 0 0.5em;

    &:hover {
      color: #aed6f1;
      text-decoration: underline;
    }

    &:active {
      color: #f4f6f9;
    }
  }
}

p {
  color: hsl(0, 0%, 15%);
  font-size: 1rem;
}

footer {
  background-color: hsla(210, 50%, 90%, 0.8);
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 24px;
  padding-right: 24px;
  font-size: 12pt;
  text-align: center;
}

strong {
  color: navy;
}

li {
  color: color(display-p3 0.1 0.1 0.1);
}

main {
  max-width: 860px;
  min-width: 300px;
  width: 90%;
  margin: 0 auto;
}

main > section {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

section {
  position: relative;
  border-style: solid;
  border-color: #2980b9;
  border-width: 1px;
  border-radius: 8px;
  margin: 16px 0;
  padding: 16px 24px;
}

section:has(h3) {
  background-color: rgba(41, 128, 185, 0.03);
}

#attendance ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(24px, auto);
  gap: 8px;
}

summary + p {
  padding-left: 16px;
}

.reminder {
  border-radius: 4px;
  padding: 8px 12px;
  margin: 12px 0;
}

div.reminder {
  background-color: rgba(41, 128, 185, 0.08);
  border-left: 3px solid #2980b9;
}

img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin-bottom: 0.5cm;
}

label {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

button[type="submit"] {
  background-color: rgb(15, 52, 96);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14pt;
  width: 200px;
  height: 44px;
  cursor: pointer;
}

button[type="submit"]:hover {
  background-color: #2980b9;
}

button[type="submit"]:active {
  background-color: peachpuff;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }

  nav {
    gap: 4px;
    font-size: 0.9rem;
  }

  #attendance ul {
    grid-template-columns: repeat(2, 1fr);
  }

  section {
    padding: 12px 16px;
  }

  button[type="submit"] {
    width: 100%;
    font-size: 12pt;
  }

  video {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.2rem;
  }

  nav {
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
  }

  #attendance ul {
    grid-template-columns: 1fr;
  }

  section {
    padding: 10px 12px;
    border-radius: 4px;
  }

  main {
    width: 95%;
  }

  img {
    max-width: 100%;
  }

  video {
    max-width: 100%;
  }

  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  fieldset {
    min-width: 0;
  }
}