/* ==========================================================================
   PERTINA HOME PAGE - SMOOTH & INTERACTIVE ANIMATIONS
   Powered by Modern Web Motion & Impeccable Design Standards
   ========================================================================== */

:root {
  --anim-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --anim-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --anim-speed-fast: 180ms;
  --anim-speed-normal: 320ms;
  --anim-speed-smooth: 550ms;
  --pertina-green: #0B9B4B;
  --pertina-gold: #fbef00;
  --pertina-dark: #000000;
}

/* 1. Global Smooth Scroll & Selection */
html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--pertina-green);
  color: #ffffff;
}

/* 2. Hero Section Animations */
@keyframes heroEntrance {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
  }
}

@keyframes heroFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.55));
  }
  50% {
    transform: translateY(-8px) scale(1.012);
    filter: drop-shadow(0 25px 45px rgba(11, 155, 75, 0.28));
  }
}

.full .logo {
  animation: heroEntrance 1s var(--anim-ease-out) forwards, heroFloat 6s ease-in-out 1s infinite;
  will-change: transform;
  transition: transform 0.4s var(--anim-ease-out);
}

/* Scroll Down Indicator */
.hero-scroll-btn {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: var(--pertina-gold);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  font-family: kanit-italic, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 2px;
  opacity: 0.8;
  transition: all var(--anim-speed-normal) var(--anim-ease-out);
  cursor: pointer;
}

.hero-scroll-btn:hover {
  opacity: 1;
  color: #ffffff;
  transform: translateX(-50%) translateY(4px);
}

@keyframes arrowSmoothPulse {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: translateY(7px);
    opacity: 1;
  }
}

.hero-scroll-btn .arrow-icon {
  display: inline-block;
  margin-top: 6px;
  font-size: 1.1rem;
  animation: arrowSmoothPulse 2.4s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Navbar Dynamic Transition */
.navbar-custom {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1030;
  transition: transform 0.38s var(--anim-ease-out),
              background-color 0.4s var(--anim-ease-out),
              backdrop-filter 0.4s var(--anim-ease-out),
              box-shadow 0.4s var(--anim-ease-out),
              padding 0.3s var(--anim-ease-out) !important;
  transform: translateY(0);
  will-change: transform;
}

.navbar-custom.hide {
  transform: translateY(-100%) !important;
}

.navbar-custom.navbar-scrolled {
  background: rgba(8, 8, 8, 0.88) !important;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(11, 155, 75, 0.35);
  padding: 2px 0 !important;
}

.navbar-custom .nav-link {
  position: relative;
  transition: color var(--anim-speed-normal) var(--anim-ease-out);
}

.navbar-custom .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pertina-green), var(--pertina-gold));
  transition: width var(--anim-speed-normal) var(--anim-ease-out),
              left var(--anim-speed-normal) var(--anim-ease-out);
  border-radius: 2px;
}

.navbar-custom .nav-link:hover::after,
.navbar-custom .nav-link.active::after {
  width: 80%;
  left: 10%;
}

.navbar-custom .navbar-brand img {
  transition: transform var(--anim-speed-normal) var(--anim-ease-out);
}

.navbar-custom .navbar-brand:hover img {
  transform: scale(1.03);
}

/* 4. Section Headings Reveal */
.sub-title {
  transition: transform var(--anim-speed-normal) var(--anim-ease-out);
}

.sub-title:hover {
  transform: translateY(-2px);
}

.sub-title img {
  transition: filter 0.4s ease;
}

.sub-title:hover img {
  filter: drop-shadow(0 0 6px rgba(11, 155, 75, 0.5));
}

/* 5. Bento News Grid Interactive Cards */
.bento-item {
  transition: transform 0.4s var(--anim-ease-out),
              box-shadow 0.4s var(--anim-ease-out),
              border-color 0.4s ease !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  will-change: transform;
}

.bento-item:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(11, 155, 75, 0.28) !important;
  border-color: rgba(11, 155, 75, 0.5) !important;
}

.bento-item img {
  transition: transform 0.6s var(--anim-ease-out) !important;
  will-change: transform;
}

.bento-item:hover img {
  transform: scale(1.07) !important;
}

.bento-meta {
  transition: transform var(--anim-speed-fast) var(--anim-ease-out);
}

.bento-item:hover .bento-meta {
  transform: translateX(3px);
}

/* 6. Galeri Foto Cards */
#galeri .col-4 {
  transition: transform 0.35s var(--anim-ease-out);
}

#galeri .col-4:hover {
  transform: translateY(-5px);
}

#galeri .col-4 a {
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color var(--anim-speed-normal) ease,
              box-shadow var(--anim-speed-normal) var(--anim-ease-out);
}

#galeri .col-4 a:hover {
  border-color: var(--pertina-green);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 0 16px rgba(11, 155, 75, 0.25);
}

#galeri .col-4 img.img-fluid:first-child {
  transition: transform 0.5s var(--anim-ease-out);
  will-change: transform;
}

#galeri .col-4 a:hover img.img-fluid:first-child {
  transform: scale(1.06);
}

#galeri .labelPraka {
  transition: color var(--anim-speed-normal) ease,
              background-color var(--anim-speed-normal) ease;
}

#galeri .col-4 a:hover .labelPraka {
  color: var(--pertina-gold);
}

/* 7. Tables & Management Hover Micro-interactions */
.table-hover tbody tr {
  transition: background-color var(--anim-speed-fast) ease,
              color var(--anim-speed-fast) ease;
}

.table-hover tbody tr:hover {
  background-color: rgba(11, 155, 75, 0.16) !important;
}

#profile {
  transition: transform 0.5s var(--anim-ease-out),
              filter 0.5s var(--anim-ease-out);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
  will-change: transform;
}

#profile:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 15px 30px rgba(11, 155, 75, 0.35));
}

/* 8. Social Buttons Transition */
.social-btn {
  transition: transform var(--anim-speed-normal) var(--anim-ease-out),
              background-color var(--anim-speed-normal) ease,
              box-shadow var(--anim-speed-normal) var(--anim-ease-out) !important;
}

.social-btn:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 20px rgba(11, 155, 75, 0.35) !important;
}

/* 9. Floating Back to Top Button */
.btn-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pertina-green), #087538);
  color: #ffffff;
  border: 2px solid var(--pertina-gold);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all var(--anim-speed-normal) var(--anim-ease-out);
  z-index: 999;
  text-decoration: none;
}

.btn-back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.btn-back-to-top:hover {
  background: var(--pertina-gold);
  color: #000000;
  border-color: var(--pertina-green);
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 10px 25px rgba(251, 239, 0, 0.4);
}

/* 10. AOS Calibrated Speed Override (snappy 700ms instead of 2000ms) */
[data-aos] {
  transition-duration: 700ms !important;
  transition-timing-function: var(--anim-ease-out) !important;
}

/* 11. Accessibility: Intentional Prefers-Reduced-Motion (Preserves State Feedback) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  /* Retain fast, calm state change transitions without jarring motion jumps */
  * {
    transition-duration: 0.1s !important;
  }
  .full .logo,
  .hero-scroll-btn .arrow-icon,
  .section-lightbar-img,
  .bento-item img,
  .secondary-img img,
  .card-img-cover {
    animation: none !important;
    transform: none !important;
    will-change: auto !important;
  }
}

/* Section Padding & Clearance for Fixed Navbar */
.module {
  min-height: 100vh;
  padding-top: 135px !important;
  padding-bottom: 70px;
}

.news-section,
#berita {
  padding-top: 135px !important;
  padding-bottom: 80px;
}

/* Modern CSS Scroll Margin for all Section Targets */
section[id],
div[id="visimisi"],
div[id="tentangkami"],
div[id="program"],
div[id="galeri"],
div[id="berita"],
div[id="kontak"] {
  scroll-margin-top: 90px;
}

@media (max-width: 991px) {
  .module,
  .news-section,
  #berita {
    padding-top: 115px !important;
  }
  
  section[id],
  div[id="visimisi"] {
    scroll-margin-top: 80px;
  }
}

/* ==========================================================================
   PER-TITLE ADAPTIVE GLOWING LIGHTBAR EFFECT
   Strictly sized to match the exact width of the title text above it
   ========================================================================== */

/* ==========================================================================
   PER-TITLE ADAPTIVE GLOWING LIGHTBAR EFFECT
   Strictly sized to match the exact width of the title text above it
   ========================================================================== */
.section-title-wrap {
  text-align: center;
  margin-bottom: 2.2rem;
  position: relative;
}

.section-title-glow-box {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: fit-content !important;
  max-width: 100%;
}

.section-title-glow-box.text-start {
  align-items: flex-start !important;
  text-align: left !important;
}

.section-title-text {
  display: inline-block;
  width: auto;
  position: relative;
  z-index: 2;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff !important;
  margin: 0 !important;
  padding: 0 4px !important;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(11, 155, 75, 0.8), 0 0 32px rgba(11, 155, 75, 0.45);
  line-height: 1.15;
}

.section-lightbar-container {
  display: block;
  width: 100%;
  height: 26px;
  margin-top: -6px;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.section-lightbar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 0 14px rgba(11, 155, 75, 0.95)) brightness(1.25);
  mix-blend-mode: screen;
  animation: lightbarPulse 3s ease-in-out infinite alternate;
}

@keyframes lightbarPulse {
  0% {
    opacity: 0.85;
    transform: scaleY(0.95);
    filter: drop-shadow(0 0 10px rgba(11, 155, 75, 0.7)) brightness(1.15);
  }
  100% {
    opacity: 1;
    transform: scaleY(1.08);
    filter: drop-shadow(0 0 20px rgba(11, 155, 75, 1)) brightness(1.35);
  }
}

@media (max-width: 767px) {
  .section-title-text {
    font-size: 1.85rem !important;
    letter-spacing: 1px;
  }
  .section-lightbar-container {
    height: 18px;
    margin-top: -4px;
  }
}
