body {
  font-family: Arial, sans-serif;
  margin: 10px 0;
  padding: 0;
  position: relative;
  min-height: 100vh;
  background-image: url("../media/hatter.png");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-color: #f0f0f0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: black;
  color: white;
  padding: 8px;
  z-index: 1000;
}

.skip-link:focus {
  left: 15%;
  top: 1%;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 40px;
  background-color: black;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header figure img {
  width: 60px;
  height: 60px;
}

nav {
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
}

nav ul li a {
  text-decoration: none;
  color: white !important;
  font-weight: bold;
  font-size: 1.5em;
}

nav ul li a.active {
  color: red !important;
  text-decoration: underline;
}

nav ul li a:visited {
  color: #666;
}

#toggleContrast {
  padding: 5px 10px;
  cursor: pointer;
  background-color: white;
  border: 1px solid black;
  font-size: 1em;
}

main {
  padding: 0px 20px 20px 20px;
  display: flex;
  justify-content: center;
  background-color: white;
  border: 2px solid black;
  border-radius: 10px;
  box-shadow: 5px 5px 10px black;
  max-width: 1200px;
  margin: 200px auto 50px auto;
  width: 90%;
  box-sizing: border-box;
}

section h1 {
  margin: 100px;
  font-size: 2.5em;
  text-align: center;
  margin-bottom: 20px;
}

section h1::after {
  content: '';
  display: block;
  margin: 5px auto;
  width: 100px;
  height: 4px;
  background-color: red;
}

table {
  width: 1000px;
  max-width: 1000px;
  border-collapse: collapse;
  margin: 30px auto;
  background-color: white;
}

th, td {
  border: 3px solid #ddd;
  padding: 12px;
  text-align: center;
}

th {
  background-color: white;
  font-size: 1.2em;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

footer {
  background-color: black;
  color: white;
  padding: 40px 60px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

footer section {
  flex: 1;
}

footer h3 {
  font-size: 1.5em;
  margin-bottom: 15px;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

footer ul li {
  margin-bottom: 25px;
}

footer ul li a:hover {
  color: lightblue;
}

footer ul li a:visited {
  color: gray;
}

footer a {
  color: white;
  text-decoration: underline;
}

@media (max-width: 768px) {
  table {
    width: 100%;
  }
  .carousel {
    width: 100%;
    height: auto;
    margin: 20px auto;
  }
  .carousel-item img {
    height: 30vh;
    object-fit: cover;
  }
  selection {
    flex-direction: column;
  }
  aside {
    width: 100%;
  }
  footer {
    flex-direction: column;
    gap: 20px;
  }
}

/* Tablet (769px - 1023px) */
@media (min-width: 769px) and (max-width: 1023px) {
  table {
    width: 100%;
    font-size: 0.9rem;
  }
  .carousel {
    width: 100%;
    height: auto;
    margin: 20px auto;
  }
  .carousel-item img {
    height: 40vh;
    object-fit: cover;
  }
  section {
    flex-direction: column;
  }
  aside {
    width: 100%;
  }
}

/* Desktop (≥1024px) */
@media (min-width: 1024px) {
  section {
    flex-direction: row;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
  }
  aside {
    width: 100%;
  }
  table {
    width: 100%;
  }
  .carousel {
    width: 45%;
    height: auto;
    margin: 60px 0;
  }
  .carousel-item img {
    height: 50vh;
    object-fit: cover;
  }
  .carousel-images {
    height: 100%;
  }
  footer {
    flex-direction: row;
    gap: 4vw;
  }
}

/* Small and Medium - Hamburger Menu */
@media (max-width: 1023px) {
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 2rem;
    height: 1.5rem;
    cursor: pointer;
    background: transparent;
    z-index: 1100;
  }
  .menu-toggle span {
    width: 100%;
    height: 0.25rem;
    background-color: white;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1100;
  }
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.4rem, 0.4rem);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.4rem, -0.4rem);
  }
  nav ul {
    display: none;
    position: absolute;
    top: 60px;
    right: 5vw;
    background-color: black;
    flex-direction: column;
    width: 200px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }
  nav ul.active {
    display: flex;
  }
  nav ul li {
    margin: 0.5rem 0;
    text-align: right;
  }
}

/* Large Screens - Normal Menu */
@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
  nav ul {
    display: flex !important;
  }
  #toggleContrast {
    display: block;
  }
}

.carousel {
  position: relative;
  width: 100%;
  max-width: 1000px;
  height: auto;
  margin: 60px auto;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.carousel-images {
  display: flex;
  width: 400%;
  transition: transform 0.5s ease-in-out;
  height: 100%;
  overflow: hidden;
}

.carousel-item {
  flex: 0 0 25%;
  height: 100%;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: 100%;
}

div.carousel input[type="radio"] {
  display: none;
}

.carousel-navigation {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.carousel-navigation label {
  width: 2em;
  height: 2em;
  line-height: 2em;
  background: white;
  color: black;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
  text-align: center;  
}

input#slide1:checked~.carousel-navigation label[for="slide1"],
input#slide2:checked~.carousel-navigation label[for="slide2"],
input#slide3:checked~.carousel-navigation label[for="slide3"],
input#slide4:checked~.carousel-navigation label[for="slide4"] {
  background: lightblue;
  font-weight: bold;
}

input#slide1:checked~.carousel-images {
  transform: translateX(0);
}

input#slide2:checked~.carousel-images {
  transform: translateX(-25%);
}

input#slide3:checked~.carousel-images {
  transform: translateX(-50%);
}