* {
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #020617, #000);
  color: white;
  overflow: hidden;
}

/* HEADER */
.gallery-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;

  display: flex;
  flex-direction: column;   /* ⭐ INI KUNCINYA */
  align-items: center;
  justify-content: center;

  padding: 14px 20px 18px;
  background: linear-gradient(to bottom, rgba(2,6,23,.85), transparent);
  z-index: 20;
}

.gallery-header h2 {
  font-size: 24px;
}

.gallery-header p {
  font-size: 13px;
  opacity: .7;
}

/* WRAPPER */
.gallery-wrapper {
  position: fixed;
  inset: 0;
  top: 80px;
  overflow: hidden;

  /* ⬇️ TAMBAHAN INI */
  background:
    radial-gradient(
      circle at 30% 20%,
      #0b1a33,
      #020617 70%
    );
}


/* TRACK (IMMERSIVE CANVAS) */
.gallery-track {
  position: absolute;
  width: 3000px;
  height: 2000px;
  cursor: grab;
  transform: translate(0px, 0px);
}

/* CARD */
.gallery-card {
  position: absolute;
  width: 260px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
  border-radius: 26px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-card:hover {
  transform: scale(1.08);
  box-shadow: 0 30px 70px rgba(0,0,0,.6);
}

/* AVATAR */
.avatar {
  width: 110px;
  height: 110px;
  margin: auto;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.5);
  background: #e5e7eb;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* TEXT */
.gallery-card h3 {
  margin-top: 14px;
  font-size: 18px;
}

.jabatan {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  background: #0f766e;
  border-radius: 999px;
  font-size: 12px;
}

.meta {
  margin-top: 12px;
  font-size: 13px;
  opacity: .8;
}

/* DETAIL OVERLAY */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.detail-overlay.active {
  display: flex;
}

.detail-card {
  background: #020617;
  padding: 40px;
  border-radius: 28px;
  width: 90%;
  max-width: 420px;
  text-align: center;
}

/* POSTER STRUKTUR RESPONSIVE (FINAL) */
.detail-card img {
  width: 240px;                 /* DESKTOP BASE */
  aspect-ratio: 5.5 / 8.5;      /* KUNCI RASIO */
  height: auto;

  max-height: 70vh;             /* ANTI KEPANJANGAN */
  max-width: 90%;

  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 20px;

  box-shadow:
    0 25px 60px rgba(0,0,0,.6),
    0 0 0 1px rgba(255,255,255,.08);
}



.close-detail {
  margin-top: 20px;
  cursor: pointer;
  opacity: .7;
}

.jabatan.ketua {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  font-weight: 700;
}

/* ===== VIDEO EFEK ML ===== */
.effect-video {
  position: absolute;
  inset: -140px;           /* bikin efek keluar card */
  width: calc(100% + 280px);
  height: calc(100% + 280px);

  object-fit: cover;
  z-index: 0;
  pointer-events: none;

  filter:
    blur(2px)
    brightness(1.1)
    saturate(1.3);
}

/* ===== CARD ===== */
.detail-card {
  position: relative;
  overflow: visible;
  background: #fafafa;
}

/* ===== ISI CARD ===== */
.card-content {
  position: relative;
  z-index: 5;
}

/* =========================
   HEADER WITH BACK BUTTON
========================= */
.gallery-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(to bottom, rgba(2,6,23,.85), transparent);
  z-index: 20;
}

/* JUDUL TENGAH */
.header-title {
  text-align: center;
}

.header-title h2 {
  margin: 0;
  font-size: 20px;
}

.header-title p {
  margin: 0;
  font-size: 12px;
  opacity: .7;
}

/* TOMBOL BACK */
.back-btn {
  position: absolute;
  left: 14px;

  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,.08);
  border-radius: 12px;

  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);

  text-decoration: none;
}

.back-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
  stroke-width: 2.5;
  fill: none;
}




@media (max-width: 420px) {

  .effect-video {
    inset: -70px;
    width: calc(100% + 140px);
    height: calc(100% + 140px);
    filter: blur(4px) brightness(1.2);
  }

}
@media (max-width: 768px) {

  .detail-card {
    width: 92vw;
    padding: 22px;
    border-radius: 20px;
  }

  /* VIDEO EFEK DI HP */
  .effect-video {
    inset: -90px;
    width: calc(100% + 180px);
    height: calc(100% + 180px);

    filter: blur(3px) brightness(1.15) saturate(1.4);
    opacity: 0.85;
  }

  /* POSTER / FOTO */
  .detail-card img {
    width: 72vw;
    max-width: 260px;
  }

}

/* =========================
   HEADER (GLOBAL)
========================= */
.gallery-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(to bottom, rgba(2,6,23,.85), transparent);
  z-index: 20;
}

/* JUDUL */
.header-title {
  text-align: center;
}

.header-title h2 {
  margin: 0;
  font-size: 20px;
}

.header-title p {
  margin: 0;
  font-size: 12px;
  opacity: .7;
}

/* TOMBOL BACK (DESKTOP & HP BASE) */
.back-btn {
  position: absolute;
  top: 14px;
  left: 14px;

  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,.45);
  border-radius: 10px;

  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  text-decoration: none;
}

.back-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
  stroke-width: 2.5;
  fill: none;
}

/* =========================
   MOBILE FIX
========================= */

/* ================= ROYAL CARD ================= */
.ornate-royal {
  position: absolute;
  width: 280px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= OUTER FRAME ================= */
.royal-outer {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 10px;
  border-radius: 26px;

  background: linear-gradient(145deg,#020617,#000);

  box-shadow:
    0 40px 80px rgba(0,0,0,.95),
    inset 0 0 18px rgba(147,197,253,.22);

  overflow: hidden;
  animation: outer-glow 5s ease-in-out infinite;
}

@keyframes outer-glow {
  0%   { box-shadow: 0 0 16px rgba(147,197,253,.25); }
  50%  { box-shadow: 0 0 32px rgba(191,219,254,.45); }
  100% { box-shadow: 0 0 16px rgba(147,197,253,.25); }
}

/* ================= GLINT BERJALAN ================= */
.royal-outer::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 26px;

  background: linear-gradient(
    120deg,
    transparent 35%,
    rgba(191,219,254,.75) 48%,
    rgba(147,197,253,.35) 55%,
    transparent 70%
  );

  animation: royal-glint 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

@keyframes royal-glint {
  from { transform: translateX(-140%); opacity: .3; }
  50%  { opacity: 1; }
  to   { transform: translateX(140%); opacity: .3; }
}

/* ================= INNER FRAME ================= */
.royal-inner {
  position: relative;
  z-index: 5;

  width: 100%;
  height: 100%;
  padding: 60px 26px 30px;
  text-align: center;

  background: radial-gradient(circle at top,#020617 0%,#000 75%);
  border-radius: 20px;

  border: 2px solid rgba(147,197,253,.55);

  box-shadow:
    inset 0 0 0 2px rgba(147,197,253,.25),
    inset 0 0 32px rgba(147,197,253,.15);
}

/* ================= AVATAR ================= */
.avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;

  border: 4px solid #93c5fd;

  box-shadow:
    0 0 22px rgba(147,197,253,.8),
    inset 0 0 18px rgba(0,0,0,.9);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= TEXT ================= */
.royal-inner h3 {
  color: #f5e6a0;
  font-size: 15px;
  margin-bottom: 8px;
}

.meta p {
  color: #e2c96d;
  font-size: 14px;
}

.meta small {
  color: #aaa;
}

/* ================= BADGE KETUA ================= */
.jabatan.ketua {
  display: inline-block;
  background: linear-gradient(135deg,#93c5fd,#60a5fa);
  color: #020617;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: bold;

  box-shadow: 0 0 16px rgba(147,197,253,.6);
}

.kabinet-nama {
  margin: 6px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #7fd6ff;
  letter-spacing: .5px;
  text-transform: uppercase;
}








/* ===== FRAME PUTIH ===== */
.detail-frame {
  position: relative;
  width: 90%;
  max-width: 1100px;
  height: 600px;

  border-radius: 28px;
  border: 4px solid white;
  padding: 18px;

  z-index: 2;
}







/* ================= DETAIL OVERLAY FINAL ================= */
.detail-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.detail-overlay.active {
  display: flex;
}

/* ================= DETAIL CARD CONTENT ================= */
.detail-card {
  position: absolute;
  top: 10px;
  bottom: 10px;

  left: 50%;
  transform: translateX(-50%);

  width: 95%;                 /* 🔥 panjang kiri & kanan */
  max-width: 1040px;          /* 🔥 biar ga nabrak frame */

  display: flex;
  gap: 32px;
  padding: 48px;

  background: rgba(0,0,0,.65);
  backdrop-filter: blur(10px);

  border-radius: 22px;
  z-index: 2;
}


/* ================= DETAIL OVERLAY FINAL ================= */
.detail-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.6);
  z-index: 9999;
}
.detail-overlay.active { display: flex; }

.detail-frame {
  position: relative;
  width: 90%;
  max-width: 1100px;
  height: 600px;
  border: 4px solid #fff;
  border-radius: 28px;
  overflow: hidden;
}

.detail-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(2px) brightness(.85);
}

.detail-card {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  gap: 32px;
  padding: 32px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(1px);
}


.detail-poster img {
  max-width: 100%;
  max-height: 100%;

  width: auto;
  height: auto;

  object-fit: contain;   /* 🔥 TIDAK POTONG */
  object-position: center;

  border-radius: 18px;
}



.detail-info {
  flex: 1;
  color: white;
  text-align: left;
}
.detail-info h2 {
  margin: 0;
  font-size: 28px;
}

.badge {
  margin: 14px 0;
  padding: 6px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg,#facc15,#b45309);
  color: #1a1200;
  font-weight: bold;
}

.close-x {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 22px;
  cursor: pointer;
  z-index: 5;
}


/* ===============================
   HEADER MOBILE LAYOUT FIX
================================ */
@media (max-width: 768px) {

  .gallery-header {
    height: auto;
    padding: 14px 16px 20px;
    gap: 8px;
  }

  /* judul tetap di tengah */
  .header-title {
    order: 1;
    text-align: center;
  }

  /* dropdown pindah ke bawah */
  .nav-periode {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 6px;
  }

  .nav-periode select {
    width: 80%;
    max-width: 260px;
    padding: 8px;
    border-radius: 8px;
  }

  /* tombol back tetap kiri atas */
  .back-btn {
    position: absolute;
    left: 12px;
    top: 12px;
  }
}



/* =================================
   MOBILE SCROLL LAYOUT (NEW)
================================= */
@media (max-width: 768px) {

  /* overlay full layar */
  .detail-overlay {
    align-items: flex-start;
    overflow-y: auto;
  }

  /* frame tidak perlu kotak besar */
  .detail-frame {
    width: 100%;
    height: auto !important;
    border: none;
    padding: 0;
    border-radius: 0;
  }

  /* card jadi layout vertikal */
  .detail-card {
    display: block;
    width: 100%;
    height: auto !important;
    padding: 0;
    background: #020617;
  }

  /* ===== FOTO JADI HERO ===== */
/* ===== FOTO POSTER (RAPI SEPERTI KARTU) ===== */
.detail-poster {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.detail-poster img {
  width: 80%;
  max-width: 320px;

  aspect-ratio: 5.5 / 8.5; /* ⭐ ukuran poster */
  object-fit: cover;

  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,.5);
}
  /* ===== INFO DI BAWAH (SCROLL) ===== */
  .detail-info {
    padding: 24px 20px 40px;
    text-align: center;
  }

  .detail-info h2 {
    font-size: 26px;
    margin-bottom: 10px;
  }

  .badge {
    margin: 14px auto;
  }

  /* tombol close tetap floating */
  .close-x {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9999;
  }
}