html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1 0 auto;
  margin-top: 3rem;
}

#footer {
  margin-top: 3rem;
}

/* =========================================
   BASE / RESET
========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

video {
  border-radius: 1rem;
}

/* =========================================
   FADE-IN ANIMATION
========================================= */

.fade-in {
  opacity: 0;
  transition: opacity 1s ease;
}

/* =========================================
   PROGRESS BAR
========================================= */

#progressBar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.375rem;
  background-color: #e8e8e8;
  z-index: 1000;
}

#progressBar::after {
  content: "";
  display: block;
  height: 100%;
  width: 0;
  background-color: #4caf50;
}

.hidden {
  display: none;
}

/* =========================================
   TOGGLE SWITCH
========================================= */

.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;

  /* desktop positioning */
  position: relative;
  z-index: 10;
  margin-top: 1.5rem;
  padding-right: 10rem;
  font-size: 0.875rem;
}

.toggle-switch {
  display: none;
}

.switch-label {
  width: 3.25rem;
  height: 1.375rem;
  border-radius: 1.375rem;
  border: 2px solid #000;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.switch-label::after {
  content: "";
  position: absolute;
  width: 1.125rem;
  height: 1.125rem;
  background-color: #000;
  border-radius: 50%;
  top: 50%;
  left: 0.125rem;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.toggle-switch:checked + .switch-label::after {
  transform: translate(1.875rem, -50%);
}

/* =========================================
   GALLERY (COLUMN VIEW)
========================================= */

#gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 900px;
  margin: 4rem auto 0; /* top spacing from header + toggle */
  padding-inline: 1rem;
  justify-items: center;
}

#gallery img {
  width: 100%;
  max-width: 900px;
}

/* =========================================
   SLIDESHOW
========================================= */

.content-hidden {
  display: none;
  pointer-events: none;
}

.content-visible {
  display: block;
  pointer-events: auto;
}

#slideshow {
  margin-top: 3rem; /* spacing from toggle */
}

.image-gallery-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem auto;
  padding-inline: 1rem;
}

.image-gallery {
  width: 100%;
  max-width: 900px;
}

.image-gallery img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.prev-button,
.next-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.prev-button img,
.next-button img {
  width: 2.75rem;
}

/* =========================================
   SPACING
========================================= */

.space {
  height: 3rem;
}

/* =========================================
   MOBILE ADJUSTMENTS
========================================= */

@media (max-width: 768px) {

  .toggle-container {
    justify-content: center;
    margin-top: 2rem;
    /* margin-bottom: 1rem;  */
    padding-right: 0;       /* remove desktop padding */
  }

  #gallery {
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
  }

  #slideshow {
    margin-top: 2rem;
  }

  .image-gallery-container {
    gap: 0.5rem;
  }

  .prev-button img,
  .next-button img {
    width: 2.25rem;
  }

  .image-gallery img {
    max-height: 75vh;
  }

  .space {
    height: 2rem;
  }
}

@media (max-width: 480px) {

  .toggle-container {
    font-size: 0.75rem;
  }

  .switch-label {
    width: 3rem;
    height: 1.25rem;
  }

  .switch-label::after {
    width: 1rem;
    height: 1rem;
  }

  .toggle-switch:checked + .switch-label::after {
    transform: translate(1.625rem, -50%);
  }
}
