/* ---------- reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- section --------- */
/* Background images */
.prevb-background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.prevb-mobile-background-image {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

@media (max-width: 480px) {
  .prevb-background-image {
    display: none;
  }
  
  .prevb-mobile-background-image {
    display: block;
  }
}

.volumes-section-b {
  min-height: 65vh;
  display: flex;
  padding-bottom: 0.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* background-image: url("/assets/images/prevb-background.png"); */
  position: relative;
  overflow: visible;
  text-align: center;
  overflow: hidden;
}

.volumes-section-b h2 {
  font-weight: 800;
  font-size: 2.25rem;
  color: #f3f3f3;
  margin-bottom: 1.75rem;
  -webkit-font-smoothing: antialiased;
  z-index: 10;
  font-family: "Sora", sans-serif;
}

/* ---------- cards grid ------ */
.cards-container {
  display: grid;
  grid-template-columns: repeat(4, 223px);
  gap: 16px !important;
  justify-content: center;
  align-items: center;
  width: 60%;
  max-width: 100%;
  position: relative;
  z-index: 100;
}

/* ---------- card  ---------- */
.card {
  width: 223px;
  height: 312px;
  border-radius: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  transform-origin: 50% 50%;
  cursor: pointer;

  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0)
    rotate(var(--rot, 0deg)) scale(var(--scale, 1));
  transition: transform 1.8s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

.card-overlay .volume:nth-of-type(2) {
  font-size: 0.85rem; 
  font-weight: 500;   
}

/* Gradient blur overlay that appears on hover */
.card::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(246, 155, 108, 0) 0%,
    rgba(246, 155, 108, 0) 20%,
    rgba(246, 155, 108, 0.1) 35%,
    rgba(246, 155, 108, 0.25) 50%,
    rgba(246, 155, 108, 0.45) 65%,
    rgba(246, 155, 108, 0.7) 80%,
    #f69b6c 100%
  );
  backdrop-filter: blur(0.8px);
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  pointer-events: none;
  z-index: 1;
}

.card:hover::before {
  opacity: 1;
}

.card-overlay {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 2;
  text-align: left;
}

.volume {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
  font-family: "Sora", sans-serif;
}

.card:hover .volume {
  opacity: 1;
  transform: translateY(0);
}

.read {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 400;
  color: #fff !important;
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease-in-out 0.1s, transform 0.4s ease-in-out 0.1s;
  font-family: "Poppins", sans-serif;
}

.card:hover .read {
  opacity: 1;
  transform: translateY(0);
}

.read:hover {
  text-decoration: underline;
}

/* ---------- spread ---------- */
.cards-container.spread .card {
  transform: translate3d(0px, 0px, 0) rotate(0deg) scale(1);
}

.cards-container.spread .card {
  transition-delay: calc(var(--i, 0) * 0.08s);
}

.card {
  z-index: var(--z, 1);
}

@media (max-width: 1200px) and (min-width: 1024px) {
  .cards-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* tablets: 2 cards per row */
@media (max-width: 1023px) and (min-width: 481px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-items: center;
  }

  .volumes-section-b {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* mobile: 1 card per row */
@media (max-width: 480px) {
  .volumes-section-b {
    padding-top: 3rem;
    padding-bottom: 3rem;
    /* background-image: url("/assets/images/prevb-mobile-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent; */
  }
  .cards-container {
    grid-template-columns: 1fr;
    gap: 5px;
    justify-items: center;
  }

  .volumes-section-b h2 {
    font-size: 2rem;
  }
}

/* EXTRA ASSERTS */

.right-side {
  position: absolute;
  bottom: -10%;
  right: -9%;
  width: 29%;
  z-index: 1;
}

.left-side {
  position: absolute;
  top: -10%;
  left: -9%;
  width: 29%;
  z-index: 1;
}

/* tablets */
@media (max-width: 1023px) and (min-width: 481px) {
  .right-side {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 37%;
    z-index: 1;
  }

  .left-side {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 37%;
    z-index: 1;
  }
}

/* mobile: 1 card per row */
@media (max-width: 480px) {
  .left-side {
    display: none;
  }

  .right-side {
    display: none;
  }
}
