/* =========================================
   GALERI PAGE - GLOBAL
========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: white;
  background: #080808;
  overflow-x: hidden;
}

/* =========================
           ANIMATED MESH BACKGROUND
        ========================== */

.mesh-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #f2d77a;
}

.mesh-background::before,
.mesh-background::after {
  content: "";
  position: absolute;
  width: 75vw;
  height: 75vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.8;
  animation: meshMove 13s ease-in-out infinite alternate;
}

.mesh-background::before {
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9),
    transparent 70%
  );
  top: -30%;
  left: -20%;
}

.mesh-background::after {
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.5),
    transparent 70%
  );
  bottom: -35%;
  right: -20%;
  animation-delay: -6s;
  animation-direction: alternate-reverse;
}

@keyframes meshMove {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(15%, 20%) scale(1.2);
  }
  100% {
    transform: translate(-10%, 10%) scale(0.9);
  }
}

@keyframes darkMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-20%, 15%);
  }
}

/* =========================================
   GALLERY MAIN CONTAINER
========================================= */

.gallery-container {
  position: relative;
  z-index: 2;

  width: 100%;

  min-height: 100vh;

  padding: 120px 0 70px;

  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 30px;
}

/* =========================================
   GALLERY HEADING
========================================= */

.gallery-heading {
  position: relative;

  width: min(565px, 90%);

  min-height: 57px;

  display: flex;

  justify-content: center;

  align-items: center;

  padding: 15px 20px;

  margin-bottom: 60px;

  border: 1px solid rgba(255, 255, 255, 0.65);

  border-radius: 22px;

  background: rgba(46, 46, 46, 0.15);

  backdrop-filter: blur(15px);

  -webkit-backdrop-filter: blur(15px);

  overflow: hidden;
}

.gallery-heading h1 {
  position: relative;

  z-index: 1;

  font-family: "DM Sans", sans-serif;

  font-size: 17px;

  font-weight: 800;

  text-align: center;

  color: white;
}

/* =========================================
   MAIN GLASS BOX
========================================= */

.gallery-box {
  position: relative;

  z-index: 3;

  width: min(1120px, 90%);

  padding: 32px 25px;

  display: flex;
  flex-direction: column;

  gap: 25px;

  overflow: hidden;

  background: rgba(46, 46, 46, 0.15);

  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);

  border: 1px solid rgba(255, 255, 255, 0.45);

  border-radius: 25px;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -1px 1px rgba(255, 255, 255, 0.1);
}

/* GLASS LIGHT */

.gallery-box::before {
  content: "";

  position: absolute;
  inset: 0;

  z-index: 0;

  pointer-events: none;

  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14),
    transparent 45%,
    rgba(255, 255, 255, 0.04)
  );
}

/* =========================================
   GALLERY ROW
========================================= */

.gallery-row {
  position: relative;

  z-index: 1;

  width: 100%;

  overflow: hidden;

  border-radius: 15px;

  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 2%,
    black 98%,
    transparent
  );

  mask-image: linear-gradient(
    to right,
    transparent,
    black 2%,
    black 98%,
    transparent
  );
}

/* =========================================
   GALLERY TRACK
========================================= */

.gallery-track {
  display: flex;

  width: 200%;

  gap: 0;

  will-change: transform;
}

/* =========================================
   GALLERY GROUP
========================================= */

.gallery-group {
  flex: 0 0 50%;

  min-width: 0;

  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 18px;

  padding: 8px 9px;

  box-sizing: border-box;
}

/* =========================================
   ANIMATION
========================================= */

/* BARIS 1 DAN 3 - KE KANAN */

.row-right .gallery-track {
  animation: moveRight 35s linear infinite;
}

/* BARIS 2 - KE KIRI */

.row-left .gallery-track {
  animation: moveLeft 35s linear infinite;
}

/* RIGHT */

@keyframes moveRight {
  from {
    transform: translateX(-50%);
  }

  to {
    transform: translateX(0);
  }
}

/* LEFT */

@keyframes moveLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* PAUSE WHEN HOVER */

.gallery-box:hover .gallery-track {
  animation-play-state: paused;
}

/* =========================================
   GALLERY CARD
========================================= */

.gallery-card {
  position: relative;

  width: 100%;

  aspect-ratio: 1 / 0.85;

  overflow: hidden;

  border-radius: 18px;

  border: 1px solid rgba(255, 255, 255, 0.55);

  background: rgba(255, 255, 255, 0.12);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);

  cursor: pointer;

  transition:
    transform 0.25s ease,
    box-shadow 0.45s ease,
    border-color 0.45s ease;
}

/* IMAGE */

.gallery-card img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transition:
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.5s ease;
}

.gallery-card.no-image {
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.18),
      transparent 50%
    ),
    rgba(34, 34, 34, 0.22);
}

.gallery-card.no-image .photo-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08));
}

/* =========================================
   HOVER EFFECT
========================================= */

.gallery-card:hover {
  z-index: 10;

  transform: translateY(-4px);

  border-color: rgba(255, 255, 255, 1);

  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.35),
    0 0 25px rgba(255, 255, 255, 0.2);
}

.gallery-card:hover img {
  transform: scale(1.12);

  filter: brightness(0.65);
}

/* =========================================
   PHOTO OVERLAY
========================================= */

.photo-overlay {
  position: absolute;

  inset: 0;

  padding: 18px;

  display: flex;
  flex-direction: column;

  justify-content: flex-end;

  opacity: 0;

  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent 75%);

  transform: translateY(10px);

  transition: 0.4s ease;
}

.gallery-card:hover .photo-overlay {
  opacity: 1;

  transform: translateY(0);
}

.photo-overlay h3 {
  font-family: "DM Sans", sans-serif;

  font-size: 14px;

  font-weight: 800;

  color: white;

  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.photo-overlay p {
  font-family: "DM Sans", sans-serif;

  font-size: 11px;

  color: rgba(255, 255, 255, 0.8);
}

/* =========================================
   FOOTER
========================================= */

footer {
  padding: 40px 10%;
  text-align: center;
  color: #888;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  letter-spacing: 2px;
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 800px) {
  .gallery-container {
    padding-top: 110px;
  }

  .gallery-box {
    width: 94%;

    padding: 25px 15px;

    gap: 20px;

    border-radius: 20px;
  }

  .gallery-group {
    gap: 12px;

    padding: 7px;
  }

  .gallery-card {
    border-radius: 13px;
  }

  .row-right .gallery-track,
  .row-left .gallery-track {
    animation-duration: 28s;
  }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 500px) {
  .gallery-container {
    padding-top: 100px;

    gap: 22px;
  }

  .gallery-heading h1 {
    font-size: 26px;
  }

  .gallery-heading p {
    font-size: 8px;

    line-height: 1.7;

    letter-spacing: 2px;
  }

  .gallery-box {
    width: 95%;

    padding: 17px 7px;

    gap: 14px;

    border-radius: 17px;
  }

  .gallery-group {
    gap: 7px;

    padding: 5px;
  }

  .gallery-card {
    aspect-ratio: 1 / 1;

    border-radius: 9px;
  }

  .photo-overlay {
    padding: 6px;
  }

  .photo-overlay h3 {
    font-size: 8px;
  }

  .photo-overlay p {
    font-size: 7px;
  }

  .row-right .gallery-track,
  .row-left .gallery-track {
    animation-duration: 24s;
  }
}

/* =========================================
   ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {
  .gallery-track {
    animation: none !important;
  }

  .gallery-card,
  .gallery-card img,
  .photo-overlay {
    transition: none !important;
  }
}
