
.wpcm-grid__card {
  position: relative;
  aspect-ratio: 1 / 1;
  perspective: 1200px;
}

.wpcm-grid__media-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s ease;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.wpcm-grid__item.is-flipped .wpcm-grid__media-inner {
  transform: rotateY(180deg);
}

.wpcm-grid__front,
.wpcm-grid__back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.wpcm-grid__front {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.wpcm-grid__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wpcm-grid__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.wpcm-grid__title {
  display: block;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
  text-align: center;
  padding: 20px;
      position: relative;
    z-index: 3;

}

.wpcm-grid__back {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(180deg);
}

.wpcm-grid__back-content {
  padding: 20px;
  text-align: center;
}
.wpcm-grid {
  display: grid !important;
  grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
  gap: 0 !important;
}

.wpcm-grid__item {
  display: block;
}

.wpcm-grid__card {
  position: relative;
  aspect-ratio: 1 / 1;
  perspective: 1200px;
  cursor: pointer;
}

.wpcm-grid__media-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s ease;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.wpcm-grid__item.is-flipped .wpcm-grid__media-inner {
  transform: rotateY(180deg);
}

.wpcm-grid__front,
.wpcm-grid__back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.wpcm-grid__front {
  z-index: 2;
}

.wpcm-grid__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wpcm-grid__back {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(180deg);
  text-align: center;
}

.wpcm-grid__back-content {
  padding: 20px;
}

.wpcm-grid__title {
  display: block;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.wpcm-grid__button {
  display: inline-block;
  padding: 10px 16px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.35);
}

.wpcm-grid__item:nth-child(6n+1) .wpcm-grid__back { background: #ff0066; }
.wpcm-grid__item:nth-child(6n+2) .wpcm-grid__back { background: #00c2ff; }
.wpcm-grid__item:nth-child(6n+3) .wpcm-grid__back { background: #00ff88; }
.wpcm-grid__item:nth-child(6n+4) .wpcm-grid__back { background: #ffcc00; }
.wpcm-grid__item:nth-child(6n+5) .wpcm-grid__back { background: #8a2be2; }
.wpcm-grid__item:nth-child(6n+6) .wpcm-grid__back { background: #ff6600; }

@media (max-width: 1024px) {
  .wpcm-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .wpcm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .wpcm-grid {
    grid-template-columns: 1fr !important;
  }
}