@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

.pg-filter-btn,
.pg-loadmore-btn,
.pg-modal,
.pg-item,
.pg-grid {
  font-family: "Outfit", sans-serif !important;
}

/* FILTER MENU */
#pg-filter {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
}
.pg-filter-btn {
  background: none;
  border: none;
  color: #afafaf;
  font-size: 18px;
  padding: 0;
  cursor: pointer;
  transition: 0.2s;
}
.pg-filter-btn.active {
  color: #fff;
  font-weight: 600;
}

/* GRID */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.pg-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #000;
}
.pg-item img.pg-thumb {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

/* PLAY ICON */
.pg-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  pointer-events: none;
}
.pg-play-icon:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  border-left: 20px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

/* LOAD MORE */
.pg-loadmore-wrapper {
  text-align: center;
  margin-top: 35px;
}
.pg-loadmore-btn {
  padding: 10px 28px;
  border-radius: 50px;
  border: 1px solid #fff;
  color: #fff;
  background: transparent;
}

/* MODAL */
.pg-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ACTIVE */
.pg-modal.active {
  display: flex;
}
.pg-modal-content {
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  background: #000;
}

/* Ratio container untuk video iframe */
.pg-video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
}

.pg-video-wrapper iframe,
.pg-video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

/* Modal video wrapper default hidden */
.pg-video-wrapper {
  display: block;
}

/* CLOSE BUTTON */
.pg-modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  font-size: 38px;
  cursor: pointer;
  color: white;
  line-height: 1;
}

.pg-filter-btn.active {
  position: relative;
}

.pg-filter-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: #fff;
}

@media (max-width: 768px) {
  .pg-grid {
    grid-template-columns: 1fr; /* turun ke bawah */
    gap: 18px;
  }

  .pg-item img.pg-thumb {
    height: auto;
    aspect-ratio: 16 / 9; /* PAKSA LANDSCAPE */
    object-fit: cover;
  }

  #pg-filter {
    overflow-x: auto;
    white-space: nowrap;
    gap: 16px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  #pg-filter::-webkit-scrollbar {
    display: none; /* hide scrollbar */
  }

  .pg-filter-btn {
    flex: 0 0 auto;
    font-size: 16px;
  }
}
