/* ==========================================================================
   Adpim v2 — design-system layer inspired by ikn.go.id's visual language.
   Loaded LAST, scoped to .adpim-v2 wherever it must fight the legacy reset
   in style.css (`* { font-family:'Montserrat' }`, heading sizes, etc).
   Tailwind (CDN, preflight:false, container:false) handles utility classes;
   this file only carries what utilities can't: container width, ornament
   tiling, keyframes, and a few component styles too fiddly for inline classes.
   ========================================================================== */

html {
  scroll-behavior: auto !important;
}

section[id],
div[id] {
  scroll-margin-top: 75px;
}

.adpim-v2,
.adpim-v2 * {
  box-sizing: border-box;
}

.adpim-v2 {
  font-family: 'Inter', system-ui, sans-serif;
  color: #1D232E;
}

/* The legacy stylesheet has `* { color: var(--black) }` (style.css), which
   sets a DIRECT (non-inherited) black on every single element — including
   plain layout <div>s. That breaks color inheritance one wrapper at a time:
   a white nav's text-white cascades fine to a direct child, but a <div>
   sitting in between gets hijacked back to black, and everything below it
   starts from black again. :where() keeps this at zero specificity so it
   never fights a real Tailwind color utility (0,1,0) — it only wins the tie
   against the legacy (0,0,0) rule because this stylesheet loads after it.
   The same legacy rule also sets `font-family: 'Montserrat'` on every
   element, and Montserrat is never loaded (fonts.css only defines
   'Montserrat-Regular'), so body text fell back to the system sans (Arial)
   instead of Inter. Headings still get Fraunces from the more specific
   h1-h4 rule below; font utilities and icon fonts (.fas) win on class. */
html :where(.adpim-v2) * {
  color: inherit;
  font-family: inherit;
}

/* Page-background scope: only the content wrapper and footer get the cream
   fill — NOT the fixed header, which must stay transparent over the hero. */
.adpim-content {
  background-color: #FAF9F6;
  overflow-x: hidden;
}

/* NOTE: every selector below is wrapped in :where(.adpim-v2) rather than a
   plain .adpim-v2 descendant combinator. :where() always contributes zero
   specificity, so these resets sit BELOW every Tailwind utility class
   (0,1,0) in the cascade — they only fill in for elements that don't carry
   their own explicit class, and never fight one that does (e.g. a gold
   heading, a colored button, a bordered nav arrow). Without :where(), the
   added element-type selector (h1, a, button...) would outrank a bare
   utility class and silently override intentional colors/borders. */

html :where(.adpim-v2) h1,
html :where(.adpim-v2) h2,
html :where(.adpim-v2) h3,
html :where(.adpim-v2) h4 {
  font-family: 'Fraunces', Georgia, serif;
  margin: 0;
  line-height: 1.15;
  color: inherit;
}

html :where(.adpim-v2) p {
  font-size: inherit;
  line-height: 1.6;
  color: inherit;
}

html :where(.adpim-v2) img {
  display: block;
  max-width: 100%;
}

html :where(.adpim-v2) a {
  text-decoration: none;
  color: inherit;
}

html :where(.adpim-v2) span,
html :where(.adpim-v2) li {
  color: inherit;
}

/* Tailwind runs with preflight:false (to protect the 13 legacy pages), so
   native <button>/<summary> chrome (border, grey background, marker) is
   never stripped globally. Reset it here, scoped to the new design. */
html :where(.adpim-v2) button {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

html :where(.adpim-v2) summary {
  list-style: none;
  cursor: pointer;
  color: inherit;
}

.adpim-v2 summary::-webkit-details-marker {
  display: none;
}

/* Container — replaces Tailwind's disabled .container and legacy .container */
.adpim-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .adpim-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1024px) {
  .adpim-container--wide {
    padding-left: 5rem;
    padding-right: 5rem;
  }
}

/* Hero display type — big serif with a slightly opened optical size */
.adpim-display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 90;
  letter-spacing: -0.02em;
}

/* Horizontal snap rails (berita, sejarah, dokumen) */
.adpim-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

.adpim-rail::-webkit-scrollbar {
  display: none;
}

.adpim-rail>* {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Round outline nav buttons (rail prev/next) */
.adpim-nav-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid #0C2430;
  color: #0C2430;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.adpim-nav-btn:hover {
  background-color: #0C2430;
  color: #fff;
}

/* Photo cards that grow on hover (berita / bagian / infrastruktur style) */
.adpim-grow-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  transition: height 0.35s ease-out;
}

.adpim-grow-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(29, 35, 46, 0.75), rgba(29, 35, 46, 0.05) 55%, transparent);
  transition: opacity 0.3s ease;
}

.adpim-grow-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.adpim-grow-card:hover img {
  transform: scale(1.04);
}

/* Ornament hairline strip — tiled gold motif used as a section divider */
.adpim-ornament {
  background-image: url('../../img/ornament/hairline.svg');
  background-repeat: repeat-x;
  background-position: center;
  background-size: 120px 28px;
  height: 28px;
  opacity: 0.9;
}

.adpim-corner {
  position: absolute;
  width: 120px;
  height: 72px;
  background-image: url('../../img/ornament/corner.svg');
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

@media (min-width: 768px) {
  .adpim-corner {
    width: 160px;
    height: 96px;
  }
}

.adpim-corner--tl {
  top: 0;
  left: 0;
}

.adpim-corner--tr {
  top: 0;
  right: 0;
  transform: scaleX(-1);
}

.adpim-corner--bl {
  bottom: 0;
  left: 0;
  transform: scaleY(-1);
}

.adpim-corner--br {
  bottom: 0;
  right: 0;
  transform: scale(-1);
}

/* Hero progress-bar slide indicators */
.adpim-hero-dot {
  position: relative;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  transition: width 0.3s ease;
  cursor: pointer;
}

.adpim-hero-dot.is-active {
  width: 2.5rem;
}

.adpim-hero-dot__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background-color: #DBAF6C;
  border-radius: 9999px;
}

.adpim-hero-dot.is-active .adpim-hero-dot__fill {
  animation: adpim-hero-progress 6s linear forwards;
}

@keyframes adpim-hero-progress {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

.adpim-hero-slide {
  opacity: 0;
  transition: opacity 0.8s ease;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.adpim-hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

/* Header: IKN (Nusantara) warm dark translucent frosted glass -> deeper frosted on scroll */
.adpim-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 40 !important;
  overflow: visible !important;
}

.adpim-header-bg {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  pointer-events: none;
  z-index: -1;
  background-color: rgba(18, 20, 24, 0.25);
  background-image: linear-gradient(to bottom, rgba(18, 20, 24, 0.45) 0%, rgba(18, 20, 24, 0.12) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 0.35s ease, background-image 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.adpim-header.is-scrolled .adpim-header-bg {
  background-color: rgba(18, 20, 24, 0.40);
  background-image: linear-gradient(to bottom, rgba(18, 20, 24, 0.55) 0%, rgba(18, 20, 24, 0.25) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.25);
}

/* Nav links & chevron transitions */
.adpim-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  transition: color 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
}

.adpim-nav-item:hover {
  color: #ffffff;
}

.adpim-nav-chevron {
  font-size: 0.55rem;
  opacity: 0.75;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.group:hover .adpim-nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown card styles */
.adpim-dropdown-panel {
  position: absolute;
  top: 100%;
  padding-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
  pointer-events: none;
  z-index: 50;
}

.group:hover .adpim-dropdown-panel,
.adpim-dropdown-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.adpim-dropdown-menu-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 1rem !important;
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.28), 0 0 1px rgba(0, 0, 0, 0.12) !important;
  padding: 0.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.2rem !important;
}

.adpim-dropdown-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.6rem 0.85rem !important;
  border-radius: 0.6rem !important;
  font-size: 0.825rem !important;
  font-weight: 500 !important;
  color: #1F2937 !important;
  text-decoration: none !important;
  transition: all 0.18s ease !important;
}

.adpim-dropdown-link span {
  color: #1F2937 !important;
  transition: color 0.18s ease !important;
}

.adpim-dropdown-link:hover {
  background-color: #F8F5EE !important;
  color: #0C2430 !important;
  padding-left: 1.1rem !important;
}

.adpim-dropdown-link:hover span {
  color: #0C2430 !important;
}

.adpim-dropdown-link i.arrow-icon {
  font-size: 0.7rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.18s ease;
  color: #DBAF6C;
}

.adpim-dropdown-link:hover i.arrow-icon {
  opacity: 1;
  transform: translateX(0);
}

/* Search Modal Overlay */
#adpimSearchModal {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#adpimSearchModal.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#adpimSearchBox {
  transform: translateY(-16px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

#adpimSearchModal.is-open #adpimSearchBox {
  transform: translateY(0);
}

/* Floating cream card used on Sejarah / Dokumen sections */
.adpim-float-card {
  background-color: #F4E6D1;
  border-radius: 0.75rem;
  box-shadow: 0 20px 45px -20px rgba(29, 35, 46, 0.35);
}

.adpim-float-divider {
  border-bottom: 2px solid #E7C99D;
}

/* Leadership photo cluster (Pimpinan section) */
.adpim-cluster-photo {
  position: absolute;
  border-radius: 9999px;
  overflow: hidden;
  border: 8px solid #FDFCEC;
  background: #fff;
  transition: opacity 0.7s ease;
}

.adpim-quote-card {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.adpim-quote-card.is-hidden {
  opacity: 0;
  transform: translateY(2.5rem) scale(0.92);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

/* Mobile drawer */
.adpim-drawer {
  transition: transform 0.3s ease-in-out;
}

.adpim-drawer.is-closed {
  transform: translateX(100%);
}

#adpimDrawer a,
#adpimDrawer summary,
#adpimDrawer span {
  color: #ffffff !important;
}

#adpimDrawer a:hover,
#adpimDrawer summary:hover {
  color: #DBAF6C !important;
}

/* Counter numerals */
.adpim-counter {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 90;
}

@media (max-width: 767px) {
  .adpim-display {
    letter-spacing: -0.01em;
  }
}

/* Hero entrance text animations (fade-right for subtitle, fade-left for title, matching live site reference) */
@keyframes adpimFadeRight {
  0% {
    opacity: 0;
    transform: translateX(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes adpimFadeLeft {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.adpim-animate-fade-right {
  animation: adpimFadeRight 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.adpim-animate-fade-left {
  animation: adpimFadeLeft 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes adpimFadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.adpim-animate-fade-up {
  animation: adpimFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.adpim-delay-150 {
  animation-delay: 0.15s;
}

.adpim-delay-300 {
  animation-delay: 0.3s;
}

.adpim-delay-450 {
  animation-delay: 0.45s;
}

.adpim-delay-600 {
  animation-delay: 0.6s;
}

.adpim-delay-750 {
  animation-delay: 0.75s;
}

/* ============================================================
   ADPIM-V2 FOOTER — override legacy global.css footer rules.
   ============================================================ */
.adpim-v2 footer,
.adpim-v2 footer.adpim-footer {
  float: none !important;
  clear: both;
  background: linear-gradient(180deg, #0C2430 0%, #071720 100%) !important;
  background-image: linear-gradient(180deg, #0C2430 0%, #071720 100%) !important;
  padding: 0 !important;
  width: 100%;
}

/* ============================================================
   ADPIM-V2 BACK-TO-TOP BUTTON — override legacy teal #1D5167.
   ============================================================ */
#backtop,
body #backtop {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #0C2430 !important;
  background-color: #0C2430 !important;
  border: 1px solid rgba(219, 175, 108, 0.4) !important;
  border-radius: 9999px !important;
  width: 44px !important;
  height: 44px !important;
  text-align: center !important;
  position: fixed !important;
  bottom: 30px !important;
  right: 25px !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  z-index: 9999 !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(219, 175, 108, 0.2) !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

#backtop.show,
body #backtop.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

#backtop:not(.show),
body #backtop:not(.show) {
  transform: translateY(14px) scale(0.9) !important;
}

#backtop:hover,
body #backtop:hover {
  background: #DBAF6C !important;
  background-color: #DBAF6C !important;
  border-color: #DBAF6C !important;
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow: 0 12px 28px -4px rgba(219, 175, 108, 0.45), 0 0 14px rgba(219, 175, 108, 0.3) !important;
}

#backtop::before,
body #backtop:before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  left: 50% !important;
  top: 50% !important;
  transform: translateX(-50%) translateY(-50%) !important;
  display: block !important;
  width: 44px !important;
  height: 44px !important;
  background: rgba(219, 175, 108, 0.25) !important;
  border-radius: 50% !important;
  animation: pulse-border-adpim 2s ease-out infinite !important;
}

@keyframes pulse-border-adpim {
  0% {
    transform: translateX(-50%) translateY(-50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translateX(-50%) translateY(-50%) scale(1.45);
    opacity: 0;
  }
}

#backtop::after,
body #backtop:after {
  content: "" !important;
  background-image: url('../../img/backtop.svg') !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 13px !important;
  transform: rotate(-180deg) !important;
  position: absolute !important;
  width: 18px !important;
  height: 13px !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  margin: auto !important;
  transition: transform 0.2s ease, filter 0.2s ease !important;
}

#backtop:hover::after,
body #backtop:hover:after {
  transform: rotate(-180deg) translateY(-2px) !important;
  filter: brightness(0.1) !important;
}