.yearbook-page {
  height: auto;
  width: 100%;
  background-color: #000000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: height 0.4s ease-in-out;
  overflow: hidden;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
}

.yearbook-header {
  height: 20vh;
  color: white;
  font-family: "Open Sans";
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding-top: 2rem !important;
}

.yearbook-header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  text-align: center;
  justify-content: space-evenly;
  width: 100%;
}

.yearbook-title {
  margin: 0;
  font-size: 24px;
}

.yearbook-header-text {
  width: 100%;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.yearbook-subtitle {
  margin: 0;
  font-size: 18px;
  margin-top: 12px;
  padding-left: 16px;
  padding-right: 16px;
}

.yearbook-lines {
  position: absolute;
  display: flex;
  width: 100%;
  height: 20vh;
  top: 0;
  align-items: center;

}

.yearbook-header-line {
  background-color: white;
  height: 1px;
  width: 30%;
}


.card-container {
  display: flex;
  flex-wrap: wrap; 
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.maincontainer {
  width: clamp(250px, 20vw, 350px); 
  aspect-ratio: 403 / 498;
  perspective: 1000px;
  margin: 10px; 
  flex-shrink: 0;
}



/* Flip card logic */
.thecard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  border-radius: 12px;
}

.thecard:hover {
  transform: rotateY(180deg);
}


.thefront,
.theback {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0; 
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.theback {
  transform: rotateY(180deg);
}

.thefront img,
.theback img {
  width: 100%;
  height: 100%; 
  object-fit: cover; 
  border-radius: 12px;
  display: block; 
}

.button-container {
  display: flex; 
  justify-content: center; 
  margin-top: 15px;
}

.view-ybs {
  background-color: #353535; 
  color: white;
  border: none;
  border-radius: 20px; 
  padding: 10px 20px; 
  font-size: 16px; 
  cursor: pointer; 
  width: 150px;
  transition: background-color 0.3s; 
}

.view-ybs:hover {
  background-color: #505458;
}


@media (max-width: 1024px) {
  .maincontainer {
    width: 45%; 
  }

  /*.maincontainer:nth-child(n+3) {*/
  /*  display: none;*/
  /*}*/
}

/* Mobile  */
@media (max-width: 600px) {
  .card-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
  }

  .maincontainer {
    width: 90%; 
    max-width: 350px;
    display: flex;
    justify-content: center;
    margin-bottom: 20px; 
  }

  .thecard {
    height: auto;
  }

  .thefront img,
  .theback img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

.section-container {
  position: relative;
}

.rectangle {
  position: sticky;
  bottom: 0;
  width: 100%;
  background-color: black;
    padding-top: 30px;
    padding-bottom: 30px;  
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
  box-shadow:
    0 -4px 12px rgba(255, 255, 255, 0.13), 
    0 4px 12px rgba(255, 255, 255, 0.13); 

    flex-wrap: wrap;
}

.rectangle-text {
  margin: 0;
  font-size: 23px;
  flex: 1;
  color: #333;
  padding-left: 4%;
}


.rectangle-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-right: 4%;
}

.rectangle button {
  padding: 15px 15px;
  border: none;
  background-color: #D9D9D9;
  color: black;
  border-radius: 30px;
  font-size: 17px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

.rectangle button:hover {
  background-color: rgb(41, 41, 41);
  color: white;
}

.rectangle-text {
  color: white;
}


.thefront::after,
.theback::after {
  content: "View Yearbook";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 16px;
  font-family: 'Open Sans', sans-serif;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  pointer-events: none;
  z-index: 2;
  backface-visibility: hidden;
}

.thecard:hover .thefront::after,
.thecard:hover .theback::after {
  opacity: 1;
}

.thefront,
.theback {
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.2),
    0 0 20px rgba(255, 255, 255, 0.15),
    0 0 30px rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {

  .yearbook-header-line {
    width: 130px;
    height: 0.5px;
  }
  
    .yearbook-title{
      font-size: 20px;
  }

  .rectangle {
    text-align: center;
  }

.rectangle-text {
    margin-bottom: 10px;
    padding-right: 5%;
    text-align: center; 
  }


  .rectangle-buttons {
    justify-content: center;
    padding-left: 10%;  
    padding-right: 10%;
    display: flex;
  justify-content: center;  
  align-items: center;
  }

  .rectangle button {
    width: 80%;
    font-size: 15px;
    width: 230px;
  }

  .yearbook-page {
    height: 140%;
  }

}

@media (max-width: 1024px) {
  .maincontainer {
    width: 30%;
  }

  /*.maincontainer:nth-child(n+4) {*/
  /*  display: none;*/
  /*}*/
}


@media (max-width: 600px) {
    .rectangle-buttons {
      gap: 20px;
  }
  .yearbook-header-line {
    width: 60px;
    height: 0.5px;
  }

  .rectangle-buttons {
    justify-content: center;
    padding-left: 10%;  
    padding-right: 10%;
  }

  .card-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
  }

  .maincontainer {
    width: 55%;
    max-width: 350px;
    display: flex;
    justify-content: center;

  }

  /*.maincontainer:nth-child(n+3) {*/
  /*  display: none;*/
  /*}*/

  .thecard {
    height: auto;
  }

  .thefront img,
  .theback img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .yearbook-subtitle {
    font-size: 15px;
  }

}

/*@media (max-width: 1190px) {*/

/*  .maincontainer:nth-child(n+4) {*/
/*    display: none;*/
/*  }*/
/*}*/

@media (max-width: 375px){
    .yearbook-header-line{
        width: 30px;
    }
}
