a:link, a:visited {
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 1.5rem;
}

a:hover, a:active {
  text-decoration: underline;
  text-decoration-color: rgba(0, 47, 96, 0.518);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* Stops any horizontal movement */
}

body {
  font-family: 'Roboto Mono', monospace;
  max-width: 50%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
}

#contentWrapper {
  padding: 8rem 0;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

#header-container {
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: flex-start;
  padding: 5rem 2rem 0rem 2rem;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  z-index: 1000;
  box-sizing: border-box;
  background-color: white;
  border-bottom: 1px solid #eee; /* Optional: adds definition */
  gap: 2rem;
}

.main-menu {
  display: flex !important;    /* Always visible */
  flex-direction: row;        /* Horizontal line */
  list-style: none;           /* No bullet points */
  padding: 0;
  margin: 0;
  gap: 5rem;                  /* Space between links */
  position: static;           /* Removes it from 'floating' over content */
  align-items: center;
  justify-content: end;
}

.separator {
  margin: 0.5rem; 
}

#name {
  z-index: 1000;
}

#name a {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: black;
  white-space: nowrap; /* Prevents name from breaking into two lines */
}

.main-menu {
  display: flex !important; /* Force visibility */
  flex-direction: row;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem; /* Space between links and separators */
  align-items: center;
}

.main-menu a {
  font-size: 1rem;
  text-transform: lowercase; /* Matches your list style */
  background-color: transparent; /* Removes button background */
}

#second-row-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  flex-grow: 1;
  padding: 6rem 0;
}

.galleryContainer {
  display: grid;
  /* The magic line for responsiveness */
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  width: 100%;
  margin: auto;
  touch-action: pan-y; 
  overflow-x: hidden;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-self: start;
  justify-content: flex-start;
  gap: 1rem; /* Space between the image and the credits */
  max-width: 100%;
  height: auto;
  padding: 0;
  margin: 0;
}

.video-item {
  grid-column: 1 / -1; 
  width: 100%;
  margin-bottom: 1rem; /* Adds space before the image grid starts */
}

.video-item iframe {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9; 
  border: none;
}

.video-item p {
  position: static;
  width: 100%;
  height: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  background: transparent;
  color: black;
  font-size: 0.8rem; /* Increased for readability */
  text-align: left;
  padding: 1rem 0;
  opacity: 1;
  line-height: 1.5rem;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Prevents image distortion */
  transition: transform 0.3s ease;
  display: block;
  aspect-ratio: auto;
  margin: 0;
}

.gallery-item p {
  position: static;
  width: 100%;
  height: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  background: transparent;
  color: black;
  font-size: 0.8rem; /* Increased for readability */
  text-align: left;
  padding: 0;
  opacity: 1;
  line-height: 1.5rem;
}

.divisor {
  border: none;
  border-top: 0.1rem solid #000000;
  margin: 0;
}

.footer-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.5rem 0; 
  position: fixed; 
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%; 
  z-index: 1000;
  box-sizing: border-box;
  background-color: white;
}

.signature {
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.social-links a {
  background-color: transparent !important;
  display: inline !important;
  padding: 0 !important;
  gap: 1rem;
}

.social {
  width: 1.2rem;
  height: auto;
  padding: 0 0.2rem;
  display: block;
}

/* Tablet Fix: Expands the center column so content isn't squeezed and visually offset */
@media (min-width: 250px) and (max-width: 720px) {

  body {
    max-width: 100%;
  }

  #header-container {
    display: flex !important;
    align-items: flex-start;
    padding: 2rem 1rem 0; /* Reduced top padding for mobile */
    position: fixed;
    /* Resetting the desktop positioning to ensure full visibility */
    left: 0;
    transform: none; 
    width: 100%;
    gap: 0;
  }

  .main-menu {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start; 
    width: max-content; 
    gap: 0; 
    margin: 0;
    padding: 0;
  }

  .name {
    padding-bottom: 1rem;
  }

  /* Force Name scaling down from its 1.5rem desktop size */
  .name a {
    font-size: clamp(1rem, 6vw, 1.2rem) !important; /* Scales down from 1.5rem */
    text-align: left;
    display: block;
  }

  /* Force Menu scaling down from its 1rem desktop size */
  .main-menu a, .separator {
    font-size: clamp(0.6rem, 3.1vw, 1rem); 
  }

  /* Scaling for the second row content */

  #second-row-container {
    width: 100%;
    padding: 1rem 1rem 2rem 1rem; /* Adjust padding to fit below fixed header */
  }

  .video-item p, 
  .gallery-item p {
    font-size: clamp(0.6rem, 3.1vw, 0.8rem);
    line-height: 1.3rem; /* Slightly tighter for mobile readability */
    padding: 0.5rem 0;
  }

  /* Ensures the horizontal line divider stays consistent */
  .divisor {
    margin: 0.5rem 0;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    width: 100%;
    left: 0;
    transform: none;
  }
  
  .signature {
    font-size: clamp(0.6rem, 3.1vw, 0.9rem);
  }
  
  .social-links {
    padding-bottom: 1rem;
    width: clamp(0.9rem, 4vw, 1em);
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 721px) and (max-width: 1023px) {

  html {
    /* Globally scales up all 'rem' measurements by 20% to fill the high-resolution screens */
    font-size: 120%; 
  }
  
  body {
    max-width: 85%; 
  }

  #contentWrapper {
    padding: 5rem 0;
  }

  #header-container {
    width: 85%; /* Keeps the header exactly aligned with the expanded body */
    max-width: 100%;
    padding: 3rem 2rem 0rem 2rem;
  }

  .main-menu {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start; 
    width: max-content; 
    gap: 0; 
    margin: 0;
    padding: 0;
  }

  .footer-container {
    width: 85%; /* Keeps the header exactly aligned with the expanded body */
  } 
}

@media (min-width: 1024px) and (max-width: 1400px) {

  html {
    /* Globally scales up all 'rem' measurements by 20% to fill the high-resolution screens */
    font-size: 150%; 
  }
  
  body {
    max-width: 85%; 
  }

  #header-container {
    width: 85%; /* Keeps the header exactly aligned with the expanded body */
    max-width: 100%;
  }

  .main-menu {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start; 
    width: max-content; 
    gap: 0; 
    margin: 0;
    padding: 0;
  }

  .footer-container {
    width: 85%; /* Keeps the header exactly aligned with the expanded body */
  } 
}