/* simple theme */
:root {
  --navy: #1a2a4f;
  --text: #111;
  --bg: #f4f4f4;
}

body {
  background-color: var(--bg, white);
  color: var(--text, black);
  font-family: "Roboto", Arial, sans-serif;
  margin: 0;
  text-align: center;
}

/* header */
header {
  background-color: var(--navy);
  color: white;
  padding: 15px;
  /* wider-gamut color() example for border color (assignment requirement) */
  border: 4px solid;
  /* fallback for older browsers */
  border-color: var(--navy);
  /* wider-gamut color() overrides when supported */
  border-color: color(display-p3 0.1 0.2 0.4);
}

/* headings */
h1 {
  margin: 0;
}

h2 {
  color: var(--bg);
  margin-top: 20px;
}

/* center sections */
section {
  margin: 20px auto;
  padding: 15px;
  background-color: white;
  border: 1px solid black;
  width: 70%;
}

/* text */
p {
  margin-bottom: 10px;
}

/* nav */
nav ol {
  padding: 10px;
  list-style-position: inside;
}

/* links */
a {
  color: var(--navy);
  text-decoration: underline;
}

a:hover {
  color: black;
}

/* images */
img {
  width: 50%;
  max-width: 400px;
  display: block;
  margin: 10px auto; /* center image */
}

/* button */
button {
  background-color: var(--navy);
  color: white;
  padding: 5px;
}

button:active {
  background-color: black;
}

/* footer */
footer {
  margin: 20px;
  /* hsl() example for a soft footer background */
  background-color: hsl(210 30% 95%);
}

/* selectors */
* {
  box-sizing: border-box;
}

#attendance {
  background-color: #eef2f7;
}

.highlight {
  color: navy;
}

section p {
  font-size: 16px;
}

nav > ol {
  margin: 0;
}

h2 + p {
  font-style: italic;
}

h2 ~ ul {
  text-align: left;
  width: fit-content;
  margin: 0 auto;
}

input[type="text"] {
  border: 1px solid navy;
}

h1,
h2,
h3 {
  font-family: "Roboto", Arial, sans-serif;
}

section.highlight {
  border-color: navy;
}

section:has(img) {
  background-color: #f8fbff;
}

main section {
  max-width: 800px;
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  section {
    width: 90%;
    margin: 15px auto;
    padding: 10px;
  }

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

  nav ol {
    text-align: center;
    padding-left: 0;
  }
}

/* more required css */
div {
  background-color: rgba(10, 20, 40, 0.08);
}

main {
  background-color: color-mix(in srgb, navy 80%, white 20%);
}

footer {
  color: #111;
}

section {
  min-width: 250px;
}

video {
  height: 270px;
}

audio {
  width: 300px;
}

summary {
  display: inline;
}

label {
  display: inline-block;
  width: 90px;
}

details {
  display: block;
}

form {
  margin-top: 30px;
  margin-right: 40px;
  margin-bottom: 30px;
  margin-left: 40px;
  padding-top: 20px;
  padding-right: 25px;
  padding-bottom: 20px;
  padding-left: 25px;
  border-style: solid;
  border-color: black;
  border-width: 2px;
}

fieldset {
  margin: auto;
  padding: 1rem 2rem;
  border: 2px solid navy;
  border-radius: 8px;
}

nav {
  position: relative;
}

footer {
  position: static;
}

nav li {
  display: inline-block;
  margin: 0.2in;
}

main section {
  font-size: 1.1em;
}

header p {
  margin-bottom: 12pt;
}

/* flex + grid */
nav ol {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

#media {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  row-gap: 20px;
}

/* nested selector example (newer CSS nesting syntax) */
section {
  h3 {
    color: navy;
    font-weight: 600;
  }
}

/* fallback for browsers that don't support CSS nesting */
section h3 {
  color: navy;
  font-weight: 600;
}
