/* Page-specific styles for facilities.html */

.facilities-hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 84% 18%, rgba(212, 175, 55, 0.18), transparent 24%), linear-gradient(108deg, #105130 0%, #105130 58%, #105130 100%);
}

.facilities-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.16) 0%, transparent 38%), radial-gradient(circle at 90% 80%, rgba(24, 82, 66, 0.3) 0%, transparent 52%);
  pointer-events: none;
  z-index: 0;
}

/* ===== HERO DECOR (sulur daun, sparkle, kelopak, bulan sabit) ===== */
.facilities-hero .container {
  position: relative;
  z-index: 2;
}

.facilities-hero .hero-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.facilities-hero .hero-decor svg {
  position: absolute;
  display: block;
}

/* Sulur daun & bunga */
.facilities-hero .hero-leaf-tl {
  top: -34px;
  left: -26px;
  width: clamp(130px, 14vw, 215px);
  color: #1e8a50;
  opacity: 0.55;
  transform-origin: 0 0;
  animation: heroSway 8s ease-in-out infinite;
}

.facilities-hero .hero-leaf-bl {
  bottom: -28px;
  left: -30px;
  width: clamp(140px, 15vw, 250px);
  color: #2ea86a;
  opacity: 0.5;
  transform-origin: 0 100%;
  animation: heroSway 9.5s ease-in-out infinite reverse;
}

.facilities-hero .hero-leaf-tr {
  top: -30px;
  right: -34px;
  width: clamp(120px, 12vw, 200px);
  color: #1e8a50;
  opacity: 0.6;
  transform-origin: 100% 0;
  animation: heroSway 9s ease-in-out infinite reverse;
}

.facilities-hero .hero-leaf-br {
  bottom: -22px;
  right: -26px;
  width: clamp(110px, 11vw, 190px);
  color: #2ea86a;
  opacity: 0.55;
  transform-origin: 100% 100%;
  animation: heroSway 11s ease-in-out infinite;
  z-index: 2;
}

/* Kilau bintang */
.facilities-hero .hero-sparkle {
  color: #e9c46a;
  opacity: 0.9;
  animation: heroTwinkle 3.4s ease-in-out infinite;
}

.facilities-hero .hero-sparkle-1 {
  top: 18%;
  left: 30%;
  width: 22px;
}
.facilities-hero .hero-sparkle-2 {
  top: 12%;
  left: 52%;
  width: 15px;
  color: #f6e7b2;
  animation-delay: 0.9s;
}
.facilities-hero .hero-sparkle-3 {
  top: 46%;
  right: 8%;
  width: 18px;
  animation-delay: 1.6s;
}
.facilities-hero .hero-sparkle-4 {
  bottom: 14%;
  right: 26%;
  width: 13px;
  color: #ffffff;
  opacity: 0.75;
  animation-delay: 2.3s;
}
.facilities-hero .hero-sparkle-5 {
  bottom: 18%;
  left: 44%;
  width: 16px;
  color: #f6e7b2;
  animation-delay: 0.4s;
}
.facilities-hero .hero-sparkle-6 {
  top: 30%;
  left: 16%;
  width: 12px;
  color: #ffffff;
  opacity: 0.8;
  animation-delay: 1.2s;
}
.facilities-hero .hero-sparkle-7 {
  bottom: 22%;
  left: 66%;
  width: 14px;
  color: #e9c46a;
  animation-delay: 2.8s;
}
.facilities-hero .hero-sparkle-8 {
  top: 40%;
  right: 20%;
  width: 10px;
  color: #f6e7b2;
  animation-delay: 0.2s;
}

/* Bulan sabit */
.facilities-hero .hero-moon {
  top: 14%;
  right: 14%;
  width: clamp(52px, 6vw, 88px);
  color: rgba(233, 196, 106, 0.5);
  animation: heroFloat 7s ease-in-out infinite;
}

/* Kelopak bunga jatuh melayang */
.facilities-hero .hero-petal {
  position: absolute;
  top: -30px;
  display: block;
  background: #e9c46a;
  border-radius: 62% 0 62% 0;
  opacity: 0;
  animation: petalFall linear infinite;
  will-change: transform;
}

.facilities-hero .hero-petal-1 {
  left: 10%;
  width: 13px;
  height: 13px;
  animation-duration: 11s;
  animation-delay: -3s;
}
.facilities-hero .hero-petal-2 {
  left: 24%;
  width: 10px;
  height: 10px;
  background: #f6e7b2;
  animation-duration: 14s;
  animation-delay: -8s;
}
.facilities-hero .hero-petal-3 {
  left: 41%;
  width: 15px;
  height: 15px;
  background: #d4af37;
  animation-duration: 12s;
  animation-delay: -5s;
}
.facilities-hero .hero-petal-4 {
  left: 58%;
  width: 11px;
  height: 11px;
  background: #f6e7b2;
  animation-duration: 13.5s;
  animation-delay: -10s;
}
.facilities-hero .hero-petal-5 {
  left: 73%;
  width: 14px;
  height: 14px;
  animation-duration: 10.5s;
  animation-delay: -6.5s;
}
.facilities-hero .hero-petal-6 {
  left: 88%;
  width: 9px;
  height: 9px;
  background: #f6e7b2;
  animation-duration: 15s;
  animation-delay: -7s;
}

/* Gelembung cahaya naik perlahan */
.facilities-hero .hero-bubble {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(246, 231, 178, 0.9), rgba(233, 196, 106, 0.35) 60%, rgba(233, 196, 106, 0.08));
  filter: blur(1px);
  opacity: 0;
  animation: bubbleRise linear infinite;
  will-change: transform;
}

.facilities-hero .hero-bubble-1 {
  left: 38%;
  bottom: -40px;
  width: 18px;
  height: 18px;
  animation-duration: 13s;
  animation-delay: -4s;
}
.facilities-hero .hero-bubble-2 {
  left: 64%;
  bottom: -30px;
  width: 12px;
  height: 12px;
  animation-duration: 16s;
  animation-delay: -9s;
}

/* Keyframes (duplikat agar facilities.css berdiri sendiri) */
@keyframes heroSway {
  0%,
  100% {
    transform: rotate(-2.5deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

@keyframes heroTwinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) rotate(18deg);
  }
}

@keyframes heroFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes petalFall {
  0% {
    transform: translate3d(0, -30px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  25% {
    transform: translate3d(34px, 190px, 0) rotate(100deg);
  }
  50% {
    transform: translate3d(-12px, 380px, 0) rotate(210deg);
    opacity: 0.8;
  }
  75% {
    transform: translate3d(30px, 570px, 0) rotate(300deg);
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translate3d(4px, 790px, 0) rotate(380deg);
    opacity: 0;
  }
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  12% {
    opacity: 0.55;
  }
  50% {
    transform: translateY(-260px) translateX(14px);
    opacity: 0.45;
  }
  88% {
    opacity: 0.25;
  }
  100% {
    transform: translateY(-540px) translateX(-10px);
    opacity: 0;
  }
}

/* Responsif: sembunyikan/sekecilkan ornamen di layar kecil */
@media (max-width: 768px) {
  .facilities-hero .hero-leaf-tl {
    display: none;
  }
  .facilities-hero .hero-leaf-bl {
    width: 118px;
  }
  .facilities-hero .hero-leaf-tr {
    width: 96px;
    opacity: 0.45;
  }
  .facilities-hero .hero-leaf-br {
    width: 92px;
  }
  .facilities-hero .hero-sparkle-3,
  .facilities-hero .hero-sparkle-6,
  .facilities-hero .hero-sparkle-7,
  .facilities-hero .hero-sparkle-8 {
    display: none;
  }
  .facilities-hero .hero-petal-4,
  .facilities-hero .hero-petal-6 {
    display: none;
  }
  .facilities-hero .hero-bubble-2 {
    display: none;
  }
  .facilities-hero .hero-moon {
    width: 56px;
    right: 8%;
  }
}

/* FILTER TABS SYSTEM */
.facilities-filter-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.facility-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--gray-light);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.facility-tab-btn:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  transform: translateY(-2px);
}

.facility-tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(15, 56, 44, 0.2);
}

.facility-tab-btn.active .tab-count {
  background: var(--accent);
  color: var(--primary-dark);
}

.tab-count {
  background: var(--gray-light);
  color: var(--gray-dark);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

/* SECTION HEADERS FOR SD & TK */
.facility-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(15, 56, 44, 0.1);
  gap: 1rem;
  flex-wrap: wrap;
}

.facility-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.facility-section-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-sd {
  background: rgba(30, 58, 138, 0.1);
  color: var(--secondary);
}

.icon-tk {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-hover);
}

.facility-section-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.facility-section-subtitle {
  font-size: 0.9rem;
  color: var(--gray-dark);
}

/* GALLERY GRID & CARDS */
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

.facility-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 280px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  background: var(--dark);
  transition: var(--transition);
}

.facility-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.facility-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
}

.badge-sd {
  background: rgba(15, 56, 44, 0.9);
  color: #a7f3d0;
  border: 1px solid rgba(167, 243, 208, 0.3);
}

.badge-tk {
  background: rgba(184, 148, 40, 0.9);
  color: #fff9e6;
  border: 1px solid rgba(255, 249, 230, 0.3);
}

.facility-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 36, 28, 0.92) 0%, rgba(15, 36, 28, 0.4) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  color: var(--white);
  transition: var(--transition);
  z-index: 1;
}

.facility-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.facility-card:hover img {
  transform: scale(1.08);
}

.facility-card:hover .facility-overlay {
  background: linear-gradient(to top, rgba(9, 36, 28, 0.96) 0%, rgba(9, 36, 28, 0.6) 100%);
}

.facility-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.facility-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.45;
  transform: translateY(8px);
  opacity: 0.9;
  transition: var(--transition);
}

.facility-card:hover .facility-desc {
  transform: translateY(0);
  opacity: 1;
}

/* LIGHTBOX MODAL PREVIEW */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 23, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 1.5rem;
}

.lightbox-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  transform: scale(0.95);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.lightbox-backdrop.active .lightbox-modal-box {
  transform: scale(1);
}

.lightbox-img-wrap {
  position: relative;
  width: 100%;
  height: 480px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  z-index: 10;
  transition: var(--transition);
}

.lightbox-close-btn:hover {
  background: var(--accent);
  color: var(--primary-dark);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.lightbox-nav-btn:hover {
  background: var(--accent);
  color: var(--primary-dark);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-details {
  padding: 1.5rem 2rem;
  background: var(--white);
}

.lightbox-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.lightbox-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.lightbox-desc {
  font-size: 0.95rem;
  color: var(--gray-dark);
  line-height: 1.6;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 1024px) {
  .facilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox-img-wrap {
    height: 380px;
  }
}

@media (max-width: 640px) {
  .facilities-grid {
    grid-template-columns: 1fr;
  }

  .facility-card {
    height: 240px;
  }

  .facility-section-title {
    font-size: 1.45rem;
  }

  .lightbox-img-wrap {
    height: 260px;
  }

  .lightbox-details {
    padding: 1.25rem;
  }
}
