body {
  margin: 0;
  font-family: "Public Sans", serif;
  /*background: linear-gradient(to left, white, rgb(52, 36, 61));*/
  background: white;
  overflow-x: hidden;
}

.project-header-container {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
  margin-top: 100px;
  position: relative;
}

.project-header-container p {
  text-align: center;
  font-size: 68px;
  font-weight: 300;
  letter-spacing: 4px;
  margin: 25px;
  margin-bottom: 20px;
}

.gallery-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  font-size: 1.35rem;
  text-align: center;
  color: rgb(94, 94, 94);
}
.gallery-text span {
  padding: 2px 5px;
  width: 85%;
}

.gallery-nav-container {
  width: 100vw;
  display: flex;
  position: relative;
  margin: 0 auto;
  justify-content: center;
  align-items: flex-end;
}

.gallery-nav {
  display: flex;
  align-items: start;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  max-width: 1475px;
  opacity: 1;
  height: fit-content;
}

.options {
  display: flex;
  align-items: start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 20px;
  margin-left: 10px;
}
.op-head {
  margin-right: 10px;
  border: 2px solid black;
  padding: 8px 10px;
  font-weight: 600;
  border-radius: 25px;
  color: rgb(255, 255, 255);
  background-color: black;
}

.op1-line {
  background-color: black;
  height: 2px;
  width: 100%;
}

.option1,
.option2 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
  text-decoration: none;
}

.option1 a {
  font-size: 18px;
  color: rgb(20, 20, 20);
  font-family: "Inter", sans-serif;
  text-decoration: none;
  border-radius: 25px;
  border: 2px solid rgb(56, 56, 56);
  padding: 8px 10px;
}

.option1 a:hover {
  cursor: pointer;
  color: rgb(255, 255, 255);
  background-color: black;
}

.op-divider {
  width: 1px;
  height: 20px;
  background-color: black;
}

.project-container {
  width: 100%;
  margin: 0 auto;

  box-sizing: border-box;
  overflow-x: hidden;
  overflow: hidden;
  position: relative;
  padding-bottom: 90px;
}

.top-container {
  display: flex;
  flex-direction: row;
  margin-top: 50px;
  overflow: hidden;
  justify-content: center; /* centers .top-text-container horizontally */
  align-items: center; /* centers vertically (optional) */
  text-align: left;
  margin: 30px auto 30px;
  height: 500px;
  gap: 20px;
  width: 95%;
}

.top-photo {
  width: 55%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.top-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills the area while maintaining aspect ratio */
  object-position: center;
}

/* Keyframes for smooth fade-in and slide-in */
@keyframes fadeInSlide2 {
  from {
    opacity: 0;
    transform: translateX(-60px); /* Start slightly to the left */
  }
  to {
    opacity: 1;
    transform: translateX(0); /* Move to normal position */
  }
}

.top-text-container {
  display: flex;
  flex-direction: column;
  text-align: left;
  justify-content: flex-start;
  align-items: left;
  width: 100%;
  background-color: black;
  color: white;
  height: 100%;
}

.top-heading {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  text-align: left;
  text-transform: uppercase;
  padding: 25px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.top-heading h1 {
  letter-spacing: 2px;
  font-weight: 400;
  margin: 0;
  width: 100%;
  font-size: clamp(20px, calc(6px + (1.6vw)), 38px);
}

@keyframes fadeInSlide1 {
  from {
    opacity: 0;
    transform: translateX(60px); /* Start slightly to the left */
  }
  to {
    opacity: 1;
    transform: translateX(0); /* Move to normal position */
  }
}

.top-text {
  font-family: "Public Sans", sans-serif;
  opacity: 1; /* Start invisible */
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 300;
  padding: 30px;
  padding-top: 0px;
  font-size: clamp(15px, calc(15px + 0.007 * (100vw - 1000px)), 22px);
  line-height: 1.6;
  align-items: center;
  justify-content: center;
}

.top-text p {
  margin: 0;
}

@keyframes slideDown {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gallery Styling */

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 100000;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
}

.lightbox-counter,
.lightbox-title {
  position: absolute;
  top: 10px;
  font-family: "Public Sans", sans-serif;
  font-size: 16px;
  color: white;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 12px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  z-index: 100001;
}

/* counter centered at top */
.lightbox-counter {
  left: 50px;
  transform: translateX(-50%);
  font-weight: 400;
}

/* project title right next to counter */
.lightbox-title {
  left: 50%; /* adjust gap between number and title */
  transform: translateX(-50%);
  font-weight: 300;
}

.close {
  position: absolute;
  top: 10px;
  right: 30px;
  font-size: 50px;
  color: white;
  cursor: pointer;
}

.prev,
.next {
  position: absolute;
  top: 50%;
  font-size: 40px;
  color: white;
  cursor: pointer;
  user-select: none;
  transform: translateY(-50%);
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

/* Hide arrows when at the start/end */
.prev:disabled,
.next:disabled {
  display: none;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  grid-auto-rows: 50px;
  gap: 25px;
  width: 95%;
  margin: 0 auto 60px;
  position: relative;
  grid-auto-flow: dense;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  contain: layout paint;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
  cursor: pointer;
  z-index: 2;

  transform: translateZ(0); /* create its own GPU layer */
  will-change: transform, filter; /* tell browser to prep GPU compositing */
  backface-visibility: hidden; /* avoid flicker on transform */
}

.gallery-item:hover img {
  transform: scale(1.03);
  filter: brightness(0.9);
}

/* Size variants */
.large-70 {
  grid-column: span 6;
  grid-row: span 6;
}
.small-34 {
  grid-column: span 3;
  grid-row: span 3;
}
.small-for-long {
  grid-column: 1 / 3; /* left half */
  grid-row: 7 / 9;
}
.small-for-long2 {
  grid-column: 1 / 3; /* same width, next row down */
  grid-row: 9 / 11;
}

.large-long {
  grid-column: 3 / 10; /* right half (spanning 5 of your 10 columns) */
  grid-row: 7 / 11; /* spans two rows tall */
}

.small-for-long-v2 {
  grid-column: 1 / 4; /* left half */
  grid-row: 7 / 10;
}
.small-for-long2-v2 {
  grid-column: 1 / 4; /* same width, next row down */
  grid-row: 10 / 13;
}

.large-long-v2 {
  grid-column: 5 / 10; /* right half (spanning 5 of your 10 columns) */
  grid-row: 7 / 12; /* spans two rows tall */
}

.small-thin {
  grid-column: 1 / 5;
  grid-row: 7 / 12;
}

.normal {
  grid-column: span 3;
  grid-row: span 3;
}

.solo {
  grid-column: span 6;
  grid-row: span 3;
}

.landscape {
  grid-column: span 6;
  grid-row: span 3;
}
.portrait {
  grid-column: span 3;
  grid-row: span 3;
}

.landscape-2 {
  grid-column: span 7;
  grid-row: span 4;
}

.portrait-2 {
  grid-column: span 2;
  grid-row: span 2;
}

.double-landscape-portrait {
  grid-column: span 4;
  grid-row: span 4;
}

.double-landscape {
  grid-column: span 5;
  grid-row: span 2;
}

.left-2-auto {
  grid-column: span 4;
  grid-row: span 2;
}

.right-auto {
  grid-column: span 5;
  grid-row: span 4;
}

.l2 {
  grid-column: span 2;
}
.l3 {
  grid-column: span 3;
}
.l4 {
  grid-column: span 4;
}
.l5 {
  grid-column: span 5;
}
.l6 {
  grid-column: span 6;
}
.l7 {
  grid-column: span 7;
}
.l8 {
  grid-column: span 8;
}
.l9 {
  grid-column: span 9;
}
.l10 {
  grid-column: span 10;
}
.l11 {
  grid-column: span 11;
}
.l12 {
  grid-column: span 12;
}
.l13 {
  grid-column: span 13;
}
.l14 {
  grid-column: span 14;
}
.l15 {
  grid-column: span 15;
}
.l16 {
  grid-column: span 16;
}
.l17 {
  grid-column: span 17;
}

.h2 {
  grid-row: span 2;
}
.h3 {
  grid-row: span 3;
}
.h4 {
  grid-row: span 4;
}
.h5 {
  grid-row: span 5;
}
.h6 {
  grid-row: span 6;
}
.h7 {
  grid-row: span 7;
}
.h8 {
  grid-row: span 8;
}
.h9 {
  grid-row: span 9;
}
.h10 {
  grid-row: span 10;
}
.h15 {
  grid-row: span 15;
}
.h11 {
  grid-row: span 11;
}
.h12 {
  grid-row: span 12;
}
.h13 {
  grid-row: span 13;
}
.h14 {
  grid-row: span 14;
}
.h16 {
  grid-row: span 16;
}

/* Responsive behavior */

.end-btn {
  padding: 20px;
  margin-left: 50px;
  border: 2px solid black;
  background-color: white;
  font-family: "Public Sans", serif;
  color: rgb(34, 34, 34);
  font-size: 17px;
  font-weight: 600;
}

.end-btn:hover {
  cursor: pointer;
  background-color: rgb(209, 219, 228);
}

#montrose-p {
  padding-right: 20px;
  font-size: 20.5px;
}
.link-arrow {
  text-decoration: underline;
  cursor: pointer;
  font-weight: 400;
}
.link-arrow:hover {
  color: #0000ee;
}
@media (max-width: 1850px) {
  #montrose-p {
    font-size: 20px;
  }
}
@media (max-width: 1680px) {
  #montrose-p {
    font-size: 19px;
  }
}
@media (max-width: 1550px) {
  #montrose-p {
    font-size: 17.7px;
  }
}
@media (max-width: 1375px) {
  #montrose-p {
    font-size: 17px;
  }
}
@media (max-width: 1100px) {
  #montrose-p {
    font-size: 16px;
  }
}

@media (max-width: 550px) {
  #montrose-p {
    font-size: 15px;
  }
}
@media (max-width: 500px) {
  #montrose-p {
    font-size: 18px;
  }
}

@media (max-width: 1300px) {
  .top-text {
    padding: 25px;
    padding-top: 0px;
  }
}

@media (max-width: 900px) {
  .top-container {
    flex-direction: column;
    height: fit-content;
  }
  .top-photo,
  .top-text-container {
    width: 100%;
    height: 100%;
  }

  .top-photo {
    height: 250px;
  }

  .gallery-nav-container {
    height: fit-content;
    overflow: hidden;
    max-width: 100%;
    margin: auto 0;
    display: flex;
    justify-content: center;
  }
  .gallery-nav {
    width: 75%;
    display: flex;
    justify-content: center;
    align-items: center;

    margin: 30px 0px 0px 0px;
  }
  .options {
    font-size: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .option1 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .op-divider {
    display: none;
  }
  .op-head {
    margin: 0px;
  }
  .header-slider p {
    font-size: 38px;
  }
}
@media (max-width: 800px) {
  .gallery {
    column-count: 2; /* Reduce columns for tablets */
  }
}

@media (max-width: 1250px) and (min-width: 751px) {
  .gallery {
    display: grid !important;
    grid-template-columns: repeat(20, 1fr) !important;
    grid-auto-rows: 40px !important; /* Set consistent row height */
    gap: 15px !important;
    width: 95%;
    margin: 0 auto;
  }

  .gallery-item {
    grid-column: span 10 !important;
    grid-row: span 10 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Crops consistently */
  }
  .end-btn {
    margin-top: 30px;
    margin-left: 30px;
  }
}

@media (max-width: 900px) {
  .longtext-2 {
    grid-row: span 11 !important;
  }
  .long-text {
    grid-row: span 13 !important;
  }
}

@media (max-width: 750px) {
  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 25px;
  }
  .gallery-item {
    grid-column: span 1 !important;
    grid-row: span 10 !important;
  }
  .end-btn {
    align-self: center;
    justify-self: center;
    margin-left: 15px;
  }
}

@media (max-width: 600px) {
  .project-header-container {
    margin-top: 0px;
  }
  .project-header-container p {
    margin-top: 80px;
    font-size: 42px;
  }
  .gallery-text {
    line-height: 1.4;
  }
  .option1 a {
    font-size: 16px;
  }
}

@media (max-width: 500px) {
  .top-text p {
    font-size: 16px;
  }
  .prev,
  .next {
    display: none !important;
  }
  .lightbox img {
    max-width: 98% !important;
    height: auto;
  }
  .longtext-2 {
    grid-row: span 11 !important;
  }
  .long-text {
    grid-row: span 13 !important;
  }
}
@media (max-width: 425px) {
  .gallery-item {
    grid-column: span 1 !important;
    grid-row: span 11 !important;
  }
  .long-text {
    grid-row: span 14 !important;
  }
}
@media (max-width: 380px) {
  .long-text {
    grid-row: span 15 !important;
  }
}
