/* ==========================================================================
   1. DESIGN TOKENS (BAB III HURUF B SK 2722/2026)
   Primary #056e4f | Secondary #ff9900
   ========================================================================== */
:root {
  --pa-primary: #056e4f;
  --pa-primary-dark: #034d37;
  --pa-primary-light: #e6f3ef;
  --pa-secondary: #ff9900;
  --pa-secondary-hover: #e68a00;
  /* Oranye resmi gagal kontras WCAG AA untuk TEKS di atas putih (2.1:1).
     Token ini dipakai khusus untuk teks oranye kecil (5.4:1). */
  --pa-secondary-text: #9a5b00;
  --bs-font-sans-serif: 'Inter', sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-bg: #f8f9fa;
  --base-font-size: 16px;
}
html { font-size: var(--base-font-size); }

.bg-pa-primary { background-color: var(--pa-primary) !important; }
.text-pa-primary { color: var(--pa-primary) !important; }
.border-pa-primary { border-color: var(--pa-primary) !important; }
.bg-pa-secondary { background-color: var(--pa-secondary) !important; }
.text-pa-secondary { color: var(--pa-secondary-text) !important; }
.bg-pa-primary .text-pa-secondary,
.bg-dark .text-pa-secondary,
.top-bar .text-pa-secondary { color: var(--pa-secondary) !important; }
.border-pa-secondary { border-color: var(--pa-secondary) !important; }

.font-display { font-family: 'Montserrat', sans-serif; }

/* Tombol */
.btn-pa-secondary {
  background-color: var(--pa-secondary); color: #111827; border-color: var(--pa-secondary);
  font-weight: 700; transition: all .2s ease;
}
.btn-pa-secondary:hover, .btn-pa-secondary:focus {
  background-color: var(--pa-secondary-hover); border-color: var(--pa-secondary-hover);
  color: #000; transform: translateY(-1px);
}
.btn-pa-primary {
  background-color: var(--pa-primary); color: #fff; border-color: var(--pa-primary);
  font-weight: 600; transition: all .2s ease;
}
.btn-pa-primary:hover, .btn-pa-primary:focus {
  background-color: var(--pa-primary-dark); border-color: var(--pa-primary-dark); color: #fff;
}
/* "success" Bootstrap diarahkan ke warna brand */
.btn-outline-success {
  --bs-btn-color: var(--pa-primary); --bs-btn-border-color: var(--pa-primary);
  --bs-btn-hover-bg: var(--pa-primary); --bs-btn-hover-border-color: var(--pa-primary);
  --bs-btn-active-bg: var(--pa-primary-dark); --bs-btn-active-border-color: var(--pa-primary-dark);
  --bs-btn-focus-shadow-rgb: 5, 110, 79;
}
.table-success { --bs-table-bg: var(--pa-primary-light); --bs-table-border-color: #b9d9cf; }

/* Fokus keyboard terlihat jelas (WCAG 2.4.7) */
:focus-visible { outline: 3px solid var(--pa-primary-dark); outline-offset: 2px; }
.bg-pa-primary :focus-visible, footer :focus-visible { outline-color: #fff; }
.skip-link:focus { position: fixed; top: .5rem; left: .5rem; z-index: 2000; }
body.admin-bar .sticky-top { top: 32px; }
@media (max-width: 782px) { body.admin-bar .sticky-top { top: 46px; } }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--pa-primary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--pa-primary-dark); }

.line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.hover-underline:hover { text-decoration: underline !important; }

/* Kontras teks putih-50 pada latar hijau/hero */
.bg-pa-primary .text-white-50, #hero-carousel .text-white-50 { color: rgba(255,255,255,.90) !important; }

/* ==========================================================================
   2. HEADER & BRANDING (KUSTOMISASI LOGO & RESPONSIVE)
   ========================================================================== */
.site-brand-title {
  font-size: clamp(0.95rem, 1.8vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.site-brand-tagline {
  font-size: 0.785rem;
  line-height: 1.2;
}
.site-logo {
  max-width: 100%;
  transition: transform .2s ease;
}
@media (max-width: 575.98px) {
  .site-logo {
    max-height: 40px !important;
  }
  .site-logo-icon {
    font-size: 1.8rem !important;
  }
}

.navbar-nav .nav-link {
  color: #374151; font-weight: 600; font-size: .925rem; padding: .5rem .75rem;
  border-bottom: 3px solid transparent; transition: all .2s ease;
}
.navbar-nav .nav-link:hover { color: var(--pa-primary); }
.navbar-nav .nav-link.active { color: var(--pa-primary) !important; font-weight: 700; border-bottom-color: var(--pa-secondary); }
.dropdown-menu { border-top: 3px solid var(--pa-secondary); border-radius: .375rem; }
.dropdown-item { font-size: .9rem; font-weight: 500; }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--pa-primary-light); color: var(--pa-primary); }
.dropdown-item.active, .dropdown-item:active { background-color: var(--pa-primary); color: #fff; }
.dropdown-item.menu-highlight { font-weight: 700; color: var(--pa-primary); }

@media (max-width: 1199.98px) {
  .navbar-collapse {
    max-height: 75vh;
    overflow-y: auto;
    padding-top: .75rem;
    padding-bottom: .75rem;
    border-top: 1px solid #f1f1f1;
  }
  .navbar-nav .nav-link {
    padding: .6rem .5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .navbar-nav .nav-link.active {
    border-left-color: var(--pa-secondary);
    background-color: var(--pa-primary-light);
  }
  .dropdown-menu {
    border-top: none;
    background-color: #f9fafb;
    padding-left: 1rem;
    box-shadow: none !important;
  }
}

/* Sidebar sub-navigasi */
.sidebar-nav-link { color: #374151; border-left: 4px solid transparent; border-radius: .375rem; transition: all .2s ease; }
.sidebar-nav-link:hover { background-color: var(--pa-primary-light); color: var(--pa-primary); }
.sidebar-nav-link.active { background-color: var(--pa-primary); color: #fff !important; border-left: 4px solid var(--pa-secondary); }

/* ==========================================================================
   3. HERO SLIDER KONSISTEN (UKURAN TETAP & TIDAK BERUBAH UKURAN)
   ========================================================================== */
#hero-carousel {
  position: relative;
  overflow: hidden;
  background-color: var(--pa-primary-dark);
}

/* Ketinggian terkunci untuk mencegah layout shift (CLS) saat berganti slide */
#hero-carousel .carousel-inner {
  height: 520px;
  position: relative;
  width: 100%;
}
#hero-carousel.hero-preset-compact .carousel-inner {
  height: 440px;
}
#hero-carousel.hero-preset-tall .carousel-inner {
  height: 600px;
}

@media (min-width: 1400px) {
  #hero-carousel .carousel-inner { height: 540px; }
  #hero-carousel.hero-preset-tall .carousel-inner { height: 620px; }
}

@media (max-width: 991.98px) {
  #hero-carousel .carousel-inner,
  #hero-carousel.hero-preset-tall .carousel-inner,
  #hero-carousel.hero-preset-compact .carousel-inner {
    height: 480px;
  }
}

@media (max-width: 575.98px) {
  #hero-carousel .carousel-inner,
  #hero-carousel.hero-preset-tall .carousel-inner,
  #hero-carousel.hero-preset-compact .carousel-inner {
    height: 420px;
  }
}

#hero-carousel .carousel-item {
  height: 100% !important;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: var(--pa-primary);
  position: relative;
}
#hero-carousel .carousel-item.hero-dark {
  background-color: var(--pa-primary-dark);
}
#hero-carousel .carousel-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3,77,55,.94) 0%, rgba(5,110,79,.88) 55%, rgba(3,77,55,.68) 100%);
  z-index: 1;
}

#hero-carousel .hero-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#hero-carousel .hero-title {
  font-size: clamp(1.4rem, 3.2vw, 2.75rem);
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

#hero-carousel .hero-badge {
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

#hero-carousel .hero-desc {
  font-size: clamp(0.925rem, 1.4vw, 1.15rem);
  line-height: 1.55;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

#hero-carousel .carousel-indicators {
  margin-bottom: 1.25rem;
  z-index: 15;
}
#hero-carousel .carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  border: 2px solid #fff;
  background-color: transparent;
  opacity: .7;
  transition: all .2s ease;
}
#hero-carousel .carousel-indicators .active {
  background-color: var(--pa-secondary);
  border-color: var(--pa-secondary);
  opacity: 1;
  transform: scale(1.2);
}

#hero-carousel .carousel-control-prev,
#hero-carousel .carousel-control-next {
  width: 5%;
  z-index: 15;
}

/* ==========================================================================
   4. PINTASAN LAYANAN UTAMA (HINGGA 8 KARTU)
   ========================================================================== */
.card-shortcut {
  transition: all .25s ease-in-out;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  border-radius: .75rem;
  position: relative;
}
.card-shortcut:hover, .card-shortcut:focus-visible {
  background-color: var(--pa-primary) !important;
  border-color: var(--pa-primary);
  color: #fff;
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(5,110,79,.2) !important;
}
.card-shortcut .shortcut-icon {
  color: var(--pa-primary);
  transition: color .25s ease, transform .25s ease;
}
.card-shortcut:hover .shortcut-icon,
.card-shortcut:focus-visible .shortcut-icon {
  color: var(--pa-secondary);
  transform: scale(1.1);
}
.card-shortcut .shortcut-title {
  transition: color .25s ease;
}
.card-shortcut:hover .shortcut-title,
.card-shortcut:focus-visible .shortcut-title {
  color: #fff !important;
}
.card-shortcut .shortcut-desc {
  transition: color .25s ease;
}
.card-shortcut:hover .shortcut-desc,
.card-shortcut:focus-visible .shortcut-desc {
  color: #e5e7eb !important;
}

/* ==========================================================================
   5. KONTEN BERITA, PENGUMUMAN & ARTIKEL
   ========================================================================== */
.card-img-top {
  border-top-left-radius: calc(.375rem - 1px);
  border-top-right-radius: calc(.375rem - 1px);
  object-fit: cover;
}
.entry-content { line-height: 1.8; color: #495057; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: 'Montserrat', sans-serif; font-weight: 700; color: #111827; margin: 1.75rem 0 .75rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content a:not(.btn):not(.wp-block-button__link) { color: var(--pa-primary); text-decoration: underline; text-underline-offset: 2px; }
.entry-content a:not(.btn):not(.wp-block-button__link):hover { color: var(--pa-primary-dark); }
.entry-content img, .entry-content video { max-width: 100%; height: auto; border-radius: .375rem; }
.entry-content blockquote {
  background: #f8f9fa; border-left: 4px solid var(--pa-secondary); border-radius: .375rem;
  padding: 1rem 1.25rem; margin: 0 0 1.5rem; color: var(--pa-primary); font-weight: 600;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content .wp-block-table, .entry-content figure.wp-block-table { overflow-x: auto; margin: 0 0 1.25rem; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; }
.entry-content th, .entry-content td { border: 1px solid #dee2e6; padding: .5rem .75rem; vertical-align: middle; }
.entry-content thead th, .entry-content table > tbody > tr:first-child > th { background: var(--pa-primary-light); color: #111827; }
.entry-content tbody tr:hover { background: rgba(0,0,0,.03); }
.entry-content .wp-block-button__link { background: var(--pa-primary); color: #fff; border-radius: .375rem; font-weight: 600; padding: .5rem 1rem; }
.entry-content .wp-block-button__link:hover { background: var(--pa-primary-dark); color: #fff; }
.entry-content .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--pa-primary); border: 1px solid var(--pa-primary); }
.alignleft { float: left; margin: 0 1rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1rem; }
.aligncenter { display: block; margin: 0 auto 1rem; }
.wp-caption-text, figcaption { font-size: .875rem; color: #6c757d; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

.pagination .page-link { color: var(--pa-primary); }
.pagination .page-item.active .page-link { background: var(--pa-primary); border-color: var(--pa-primary); color: #fff; }

/* ==========================================================================
   6. AKSESIBILITAS & RESPONSIVITAS TAMBAHAN
   ========================================================================== */
.a11y-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1055; }
.a11y-panel { width: 280px; display: none; }
.a11y-panel.show { display: block; }
@media (max-width: 575.98px) {
  .a11y-widget { bottom: 1rem; right: 1rem; }
  .a11y-panel { width: calc(100vw - 2rem); }
}

body.high-contrast, body.high-contrast .bg-light { background-color: #000 !important; color: #ff0 !important; }
body.high-contrast header, body.high-contrast nav, body.high-contrast section, body.high-contrast .card,
body.high-contrast .bg-white, body.high-contrast .bg-light, body.high-contrast .bg-dark, body.high-contrast .bg-pa-primary,
body.high-contrast .modal-content, body.high-contrast .dropdown-menu, body.high-contrast .list-group-item,
body.high-contrast .carousel-item, body.high-contrast footer, body.high-contrast .entry-content blockquote {
  background-color: #000 !important; color: #ff0 !important; border: 1px solid #ff0 !important;
}
body.high-contrast .carousel-item { background-image: none !important; }
body.high-contrast .carousel-item::before { display: none; }
body.high-contrast a, body.high-contrast button, body.high-contrast h1, body.high-contrast h2, body.high-contrast h3,
body.high-contrast h4, body.high-contrast p, body.high-contrast span, body.high-contrast td, body.high-contrast th,
body.high-contrast li, body.high-contrast small, body.high-contrast .bi { color: #ff0 !important; }
body.high-contrast a:not(.btn) { text-decoration: underline; }
body.high-contrast .btn-pa-secondary, body.high-contrast .btn-pa-primary, body.high-contrast .badge {
  background-color: #ff0 !important; color: #000 !important; border: 2px solid #fff !important;
}
body.high-contrast .entry-content th, body.high-contrast .entry-content td { border-color: #ff0; }
body.high-contrast .navbar-nav .nav-link.active, body.high-contrast .sidebar-nav-link.active { background: #ff0 !important; color: #000 !important; }
