/* styles.css */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  color: #1C1C1E;
  background-color: white;
}

h1, h2, h3 {
  margin-bottom: 0.5em;
}

p {
  line-height: 1.6;
}

.hero {
  background: url('images/background.png') no-repeat center center/cover;
  color: #1C1C1E;
  padding: 4em 2em;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: auto;
  gap: 2em;
}
.hero-content img {
  max-width: 500px;
  border-radius: 20px;
}

.hero-text h1 {
  font-size: 2em;
  margin: 0;
}

.download {
  display: inline-block;
  margin-top: 1em;
  background-color: white;
  color: #1C1C1E;
  padding: 0.5em 1em;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}

.about {
  padding: 3em 2em;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: auto;
}

.about h2 {
  font-size: 1.5em;
}

.bullets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1em;
  margin-top: 1em;
}

.bullets div {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.bullets img {
  max-width: 30px;
}

/* GALLERY SECTION */
.gallerychunk {
  width: 100vw;          /* Full viewport width */
  margin: 0;             /* Remove any margin */
  padding: 40pt 0;       /* Keep vertical padding, remove horizontal */
  background-image: url("images/background.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-container {
  position: relative;
  width: 100%;           /* Full width inside gallerychunk */
  max-width: 1200px;     /* Limit max width for carousel content */
  padding: 0 2rem;       /* Small horizontal padding */
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel {
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.carousel-track {
  display: flex;
  align-items: center;
  transition: transform 0.5s ease;
  gap: 1rem;
  justify-content: center;
  width: auto;
}

.carousel-track img {
  max-width: 300px;
  opacity: 0.3;          /* side images slightly faded */
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  border-radius: 8px;
  display: none;         /* hide by default */
  cursor: default;       /* side images not clickable */
  user-select: none;
}

.carousel-track img.center {
  opacity: 1;
  transform: scale(1.1);
  display: block;
  z-index: 2;
  cursor: pointer;       /* only center image clickable */
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.carousel-track img.side {
  opacity: 0.3;
  transform: scale(0.95);
  display: block;
  cursor: default;
  z-index: 1;
}

.arrow {
  font-size: 2.5rem;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  z-index: 10;
}

.arrow:hover {
  color: black;
}

/* ----------- MODAL GALLERY STYLES ------------- */

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent scrollbars */
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

/* Make image fill max width and height without whitespace */
.modal img {
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: auto; /* Maintain aspect ratio */
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Close and nav buttons */

.modal .close,
.modal .nav {
  position: absolute;
  top: 20px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  transition: background 0.3s ease;
}

.modal .close:hover,
.modal .nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal .close {
  right: 20px;
}

.modal .nav.left {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.modal .nav.right {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------------------------------------------- */

.materials, .process, .stage, .downloads, .utopias {
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: auto;
  padding-bottom: 50px;
}

.utopiabackground {
  background: url('images/background.png') no-repeat center center/cover;
}

.utopias {
  padding-top: 50px;
}

.utopias h2 {
  text-align: center;
  padding-bottom: 20px;
}

.process img {
  max-width: min(700px, 100%);
}

.gallerysection {
  background: url("images/background.png") no-repeat center center/cover;
  width: 100%;
  color: #000;
}

.stage3text {
  text-align: center;
  margin: auto;
  max-width: 1100px;
  padding: 48px 24px;
  box-sizing: border-box;
}

.gallery-wrap {
  position: relative;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  border-radius: 8px;
  transition: opacity 0.3s;
  display: block;
}

.gallery img:hover {
  opacity: 0.8;
}

.gallery-arrow {
  display: none;
}

/* Phones: the utopia images become a swipeable carousel inside the blue box */
@media (max-width: 700px) {
  .stage3text {
    padding: 32px 16px;
  }

  .gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding: 12px 0;
    scrollbar-width: none;
  }

  .gallery::-webkit-scrollbar {
    display: none;
  }

  .gallery img {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }

  .gallery-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #1C1C1E;
    font-size: 1.6rem;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 2;
  }

  .gallery-arrow.left { left: 4px; }
  .gallery-arrow.right { right: 4px; }
}

.materials-cards {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  margin-bottom: 1em;
}

.materials-cards img {
  max-width: min(1000px, 100%);
}

.stage-content {
  display: flex;
  align-items: center;
  gap: 1em;
}

.stage-content .icon {
  width: 40px;
  height: 40px;
}

.stage-images {
  display: flex;
  gap: 1em;
  margin-top: 1em;
}

.stage-images img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 20px;
}

.downloads ul {
  list-style: none;
  padding: 0;
}

.downloads li {
  margin: 0.5em 0;
}

.downloads ul ul {
  padding-left: 1.5em;
  font-size: 0.95em;
}

.footer {
  background: url('images/background.png') no-repeat center center/cover;
  margin-top: 40px;
  padding: 64px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 640px;
  margin: 0 auto;
}

.footer p {
  margin: 0;
  line-height: 1.6;
}

.footer .footer-university {
  font-size: 1.1em;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(28, 28, 30, 0.2);
}

.footer .footer-funding {
  font-size: 0.95em;
}

.footer a {
  color: #1C1C1E;
  text-underline-offset: 3px;
}

@media (max-width: 700px) {
  .footer {
    padding: 48px 20px;
  }
}

/* ---------- Fit the whole page on phones and narrow screens ---------- */
img {
  max-width: 100%;
}

.gallerychunk,
.carousel-container {
  width: 100%;
  box-sizing: border-box;
}

.materials, .process, .stage, .downloads {
  padding-left: 20px;
  padding-right: 20px;
}

.process img,
.materials-cards img,
.stage-images img {
  height: auto;
}

@media (max-width: 700px) {
  .hero {
    padding: 2.5em 1.25em;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-content img {
    width: 100%;
  }

  .about {
    padding: 2em 20px;
  }

  .stage-images {
    flex-direction: column;
  }

  .stage-images img {
    max-width: 100%;
  }

  .carousel-track img {
    max-width: 60vw;
  }

  .carousel-container {
    padding: 0 0.5rem;
  }
}
