/* --- GLOBAL HEADINGS COLOR --- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #1b382b;
}

/* Styling Header Topbar */
.site-header {
  background-color: #1b382b !important; /* Warna hijau tua khas MA/PA/Dilmil */
  border-bottom: 4px solid #c2a27c;
  font-size: 0.85rem;
}

.site-header span, 
.site-header a {
  color: #ffffff !important;
}

/* Memaksa elemen ul dari module menu Joomla menjadi flex dan rata tengah */
.navbar .nav, 
.navbar ul.mod-menu {
  display: flex !important;
  justify-content: center !important;
  list-style: none;
  margin-bottom: 0 !important;
  padding-left: 0;
}

/* Item Menu Utama (li) */
.navbar ul li {
  position: relative !important;
  margin-right: 0.25rem;
  display: flex !important;
  align-items: flex-end !important; /* Paksa link di dalam li berada di paling bawah */
}

/* Link Menu Utama */
.navbar ul li > a,
.navbar ul li > span {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.6rem 1.2rem !important;
  color: #2b3d35 !important;
  text-decoration: none !important;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease-in-out;
  line-height: 1.2;
  margin-bottom: 0 !important;
}

/* Hover & Active State Menu Utama */
.navbar ul li:hover > a,
.navbar ul li.active > a,
.navbar ul li:hover > span,
.navbar ul li.active > span {
  color: #0b5333 !important;
  background-color: #e2f0d9 !important;
}

/* --- TOMBOL PENCARIAN SERAGAM DENGAN MENU --- */
.btn-search-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem !important;
  color: #0b5333 !important;
  background-color: transparent;
  border: none !important;
  border-radius: 6px 6px 0 0 !important;
  font-size: 1.1rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  line-height: 1.2;
  margin-left: 0.25rem;
  align-self: flex-end !important; /* Rata bawah seragam dengan menu */
}

.btn-search-nav:hover,
.btn-search-nav:focus {
  color: #0b5333 !important;
  background-color: #e2f0d9 !important;
  box-shadow: none !important;
}

/* --- SUBMENU DROPDOWN STYLE --- */
.navbar ul li ul {
  display: none !important;
  position: absolute !important;
  top: 100% !important; /* Posisi tepat di bawah tombol 'Profil' */
  left: 0 !important;
  flex-direction: column !important;
  min-width: 220px;
  background-color: #ffffff !important;
  border: 1px solid #e0e0e0;
  border-top: 3px solid #0b5333 !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  z-index: 1050;
  border-radius: 0 0 6px 6px;
  padding: 0 !important;
}

/* Tampilkan Submenu Saat Hover */
.navbar ul li:hover > ul {
  display: flex !important;
}

/* Reset Alignment Khusus Elemen di Dalam Submenu */
.navbar ul li ul li {
  width: 100%;
  margin-right: 0 !important;
  display: block !important;
  align-items: initial !important;
  border-bottom: 1px solid #f0f0f0;
}

.navbar ul li ul li:last-child {
  border-bottom: none;
}

.navbar ul li ul li a {
  display: block !important;
  padding: 0.6rem 1rem !important;
  color: #333333 !important;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 0 !important;
  background-color: transparent !important;
  width: 100%;
}

.navbar ul li ul li a:hover {
  background-color: #f4f9f5 !important;
  color: #0b5333 !important;
  padding-left: 1.25rem !important;
}

/* --- ANIMASI DROPDOWN SUBMENU --- */
@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px); /* Submenu mulai dari posisi 10px lebih rendah */
  }
  to {
    opacity: 1;
    transform: translateY(0);    /* Kembali ke posisi normal secara mulus */
  }
}

/* --- SUBMENU DROPDOWN STYLE --- */
.navbar ul li ul {
  display: none !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  flex-direction: column !important;
  min-width: 220px;
  background-color: #ffffff !important;
  border: 1px solid #e0e0e0;
  border-top: 3px solid #0b5333 !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
  z-index: 1050;
  border-radius: 0 0 6px 6px;
  padding: 0 !important;
}

/* Tampilkan Submenu Saat Hover + Terapkan Animasi Keren */
.navbar ul li:hover > ul {
  display: flex !important;
  animation: dropdownFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Item Submenu */
.navbar ul li ul li {
  width: 100%;
  margin-right: 0 !important;
  display: block !important;
  align-items: initial !important;
  border-bottom: 1px solid #f0f0f0;
}

.navbar ul li ul li:last-child {
  border-bottom: none;
}

.navbar ul li ul li a {
  display: block !important;
  padding: 0.65rem 1rem !important;
  color: #333333 !important;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 0 !important;
  background-color: transparent !important;
  width: 100%;
  transition: all 0.2s ease-in-out !important; /* Transisi halus saat item di-hover */
}

/* Efek Hover Item Submenu */
.navbar ul li ul li a:hover {
  background-color: #f4f9f5 !important;
  color: #0b5333 !important;
  padding-left: 1.35rem !important; /* Efek geser ke kanan yang elegan */
}

/* --- FIX SUB-SUB MENU RESPONSIF (DESKTOP & MOBILE) --- */

/* 1. KUSUS TAMPILAN DESKTOP (Layar >= 992px) */
@media (min-width: 992px) {
  .metismenu li,
  .nav li,
  .dropdown-menu li {
    position: relative !important;
  }

  /* Sub-menu melayang ke kiri sejajar */
  .metismenu li ul,
  .nav li ul li ul,
  .dropdown-menu .dropdown-menu {
    position: absolute !important;
    top: 0 !important;
    left: auto !important;
    right: 100% !important; /* Ke kiri khusus desktop */
    margin-top: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

/* 2. KHUSUS TAMPILAN MOBILE & TABLET (Layar <= 991px) */
@media (max-width: 991.98px) {
  /* Kembalikan sub-menu agar bertumpuk di bawah induknya */
  .metismenu li ul,
  .nav li ul li ul,
  .dropdown-menu .dropdown-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    box-shadow: none !important;
    padding-left: 1rem !important; /* Beri jarak masuk ke dalam agar rapi */
    background-color: rgba(0, 0, 0, 0.03) !important; /* Warna beda tipis untuk sub-menu */
  }
}

/* --- SLIDESHOW CAROUSEL STYLING --- */
.slideshow-container {
  position: relative;
  width: 100%;
}

.slide-img {
  height: 480px;
  object-fit: cover;
  object-position: center;
}

/* Overlay Gradasi Gelap Khusus Bagian Bawah */
/*
.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0) 100%);
  z-index: 1;
}
  */

.carousel-caption {
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 5%;
  right: 5%;
  padding-bottom: 2.5rem !important; /* Jarak teks dari dasar indikator titik */
}

.slide-title {
  font-size: 2.2rem;
  letter-spacing: 1.5px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

.slide-subtitle {
  font-weight: 400;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

/* Memposisikan indikator titik sedikit lebih manis */
.carousel-indicators {
  margin-bottom: 0.8rem;
  z-index: 3;
}

/* Responsif untuk Layar HP */
@media (max-width: 768px) {
  .slide-img {
    height: 280px;
  }
  .slide-title {
    font-size: 1.4rem;
  }
  .slide-subtitle {
    font-size: 0.85rem !important;
  }
  .carousel-caption {
    padding-bottom: 1.8rem !important;
  }
}

/* --- SECTION LAYANAN UNGGULAN --- */
.section-layanan {
  background-color: #ffffff;
}

/* Container Lingkaran Ikon */
.layanan-icon-wrapper {
  width: 150px;
  height: 150px;
  border: 6px solid #2b3d35;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2b3d35;
  font-size: 3.3rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background-color: #d7f3e6;
}

/* Judul Layanan */
.layanan-title {
  color: #2b3d35;
  font-size: 0.95rem;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

/* Efek Hover Lingkaran & Kartu */
.layanan-card:hover .layanan-icon-wrapper {
  background-color: #c2a27c;
  border-color: #7a664d;
  color: #ffffff;
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(11, 83, 51, 0.25);
}

.layanan-card:hover .layanan-title {
  color: #0b5333;
}

/* Responsif untuk Layar HP */
@media (max-width: 576px) {
  .layanan-icon-wrapper {
    width: 75px;
    height: 75px;
    font-size: 1.8rem;
  }
  .layanan-title {
    font-size: 0.85rem;
  }
}

/* --- SECTION PENGUMUMAN & BERITA --- */
.header-title-section {
  color: #2b3d35;
  letter-spacing: 0.5px;
  font-size: 1.1rem;
}

/* Badge tanggal pengumuman ala desain CorelDraw */
.badge.bg-warning {
  background-color: #c2a27c !important;
  color: #ffffff !important;
  font-weight: 500;
  border-radius: 12px;
  padding: 0.35em 0.8em;
  font-size: 0.75rem;
}

/* Hover link hijau MA */
.hover-green:hover {
  color: #0b5333 !important;
}

/* Gambar Thumbnail Berita */
.news-thumb {
  width: 100%;
  height: 75px;
  object-fit: cover;
}

.news-item-title {
  font-size: 0.9rem;
  line-height: 1.35;
}

/* Efek Hover Card Berita */
.hover-card {
  transition: all 0.2s ease-in-out;
}

.hover-card:hover {
  background-color: #e2f0d9 !important;
  transform: translateX(4px);
}

/* --- SECTION STATISTIK PERKARA --- */
.section-statistik {
  background-color: #1b382b; /* Hijau gelap khas banner */
}

.tracking-wide {
  letter-spacing: 2px;
}

/* Card Statistik */
.stat-card {
  background-color: #142a20; /* Hijau lebih gelap untuk kontras card */
  border-radius: 8px;
  border-top: 3px solid #d4a017; /* Aksen garis kuning/emas di atas */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* Lingkaran Ikon */
.stat-icon-circle {
  width: 45px;
  height: 45px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
}

/* Label & Angka */
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #d1d5db;
}

.stat-number {
  font-size: 2.5rem;
  line-height: 1;
}

/* Responsif Mobile */
@media (max-width: 576px) {
  .stat-number {
    font-size: 2rem;
  }
  .stat-label {
    font-size: 0.68rem;
  }
  .stat-icon-circle {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* --- SECTION MAKLUMAT PELAYANAN --- */
.section-maklumat {
  background-color: #ffffff;
}

.img-maklumat {
  max-width: 100%;
  height: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.img-maklumat:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* --- SECTION ARTIKEL & POJOK KETUA --- */
.article-item {
  transition: all 0.2s ease-in-out;
  background-color: transparent;
}

.article-item:hover {
  background-color: #f8f9fa !important;
  padding-left: 12px !important;
}

.article-item .title-text {
  font-size: 0.95rem;
  line-height: 1.4;
}

.article-item:hover .title-text {
  color: #0b5333 !important; /* Warna hijau MA saat hover */
}

/* --- SECTION TAUTAN SOSIAL MEDIA --- */
.sosmed-item {
  transition: all 0.3s ease-in-out;
}

.sosmed-item:hover {
  transform: translateY(-5px);
  background-color: #f8f9fa;
  transform: scale(1.15);
}

.sosmed-icon-wrap i {
  transition: transform 0.3s ease;
}

/* Warna Khas Instagram */
.text-instagram {
  color: #e1306c;
  background: -webkit-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sosmed-title {
  color: #333333;
  letter-spacing: 0.3px;
}

/* --- SECTION HASIL SURVEY --- */
.survey-card {
  background-color: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.survey-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.fs-7 {
  font-size: 0.75rem;
}

/* --- SECTION INOVASI UNGGULAN --- */
.inovasi-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-color: #ffffff;
}

.inovasi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1) !important;
  border-color: #0b5333 !important;
}

.inovasi-icon-box {
  width: 42px;
  height: 42px;
  min-width: 42px;
}

/* Membatasi teks deskripsi maksimal 2 baris */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

/* --- FOOTER STYLING --- */
.footer-section {
  background-color: #1b382b !important; /* Warna hijau khas Pengadilan Agama/Militer */
  border-top: 5px solid #c2a27c; /* Garis emas penyekat di bagian atas footer */
}

.footer-link {
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #f1c40f !important;
  text-decoration: underline !important;
}

/* --- LIGHTBOX IMAGE HOVER EFFECT --- */
.img-lightbox-trigger {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.img-lightbox-trigger:hover {
  opacity: 0.9;
  transform: scale(1.01);
}

/* --- CUSTOM CATEGORY LIST STYLE --- */
.custom-category-list {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-category-list thead th {
  border: none;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.custom-category-list tbody tr {
  transition: background-color 0.2s ease-in-out;
}

.custom-category-list tbody tr:hover {
  background-color: #f4f7f5 !important;
}

.article-list-link:hover {
  color: #0b5333 !important;
  text-decoration: underline !important;
}

/* --- FIX & STYLING PAGINASI BOOTSTRAP 5 --- */
.pagination-wrapper .pagination {
  margin-bottom: 0;
  gap: 4px;
}

.pagination-wrapper .page-item .page-link {
  color: #1b382b;
  border-radius: 6px !important;
  border: 1px solid #dee2e6;
  padding: 0.4rem 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Hover State */
.pagination-wrapper .page-item .page-link:hover {
  background-color: #0b5333;
  color: #ffffff;
  border-color: #0b5333;
}

/* Active State (Halaman Aktif) */
.pagination-wrapper .page-item.active .page-link {
  background-color: #1b382b !important;
  border-color: #1b382b !important;
  color: #ffffff !important;
  font-weight: bold;
}

/* Disabled State (Tombol Non-Aktif seperti 'Awal' saat di Hal 1) */
.pagination-wrapper .page-item.disabled .page-link {
  color: #a0a0a0;
  background-color: #f8f9fa;
  border-color: #e9ecef;
  opacity: 0.7;
}

/* Menampilkan Kembali Teks / Ikon Paginasi Joomla jika tersembunyi */
.pagination-wrapper .page-link [class^="icon-"], 
.pagination-wrapper .page-link [class*=" icon-"] {
  display: inline-block;
  font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome", sans-serif;
  font-weight: 900;
}

/* Fallback teks/ikon simbol panah jika icon font Joomla tidak terbaca */
.pagination-wrapper .page-item:first-child .page-link:empty::before { content: "«"; }
.pagination-wrapper .page-item:nth-child(2) .page-link:empty::before { content: "‹"; }
.pagination-wrapper .page-item:nth-last-child(2) .page-link:empty::before { content: "›"; }
.pagination-wrapper .page-item:last-child .page-link:empty::before { content: "»"; }

/* Font Family Font Awesome 5/6 Free Solid */
.pagination-wrapper [class^="icon-angle-"],
.pagination-wrapper [class*=" icon-angle-"] {
  font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome" !important;
  font-weight: 900 !important;
  font-style: normal;
  display: inline-block;
  line-height: 1;
}

/* Mapping Class Joomla ke Unicode Font Awesome */
.pagination-wrapper .icon-angle-double-left::before {
  content: "\f100" !important; /* fa-angles-left / fa-angle-double-left */
}

.pagination-wrapper .icon-angle-left::before {
  content: "\f104" !important; /* fa-chevron-left / fa-angle-left */
}

.pagination-wrapper .icon-angle-right::before {
  content: "\f105" !important; /* fa-chevron-right / fa-angle-right */
}

.pagination-wrapper .icon-angle-double-right::before {
  content: "\f101" !important; /* fa-angles-right / fa-angle-double-right */
}

/* --- STYLING GRID IKON PERADILAN (TANPA LINGKARAN PUTIH) --- */

.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  text-decoration: none !important;
  text-align: center;
  height: 100%;
  min-height: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  
  /* Garis Emas di Atas Kartu */
  border-top: 7px solid #e1b248; 
  background-color: #1b382b; 
}

/* Hover Animation Effect */
.icon-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  border-top-color: #f1c453;
}

/* Area Ikon (Tanpa Lingkaran Putih) */
.icon-card .icon-circle {
  background-color: transparent !important; /* Menghilangkan background putih */
  width: auto;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0.85rem;
  transition: transform 0.3s ease;
}

/* Ukuran & Warna Ikon Langsung Putih Polos */
.icon-card .icon-circle i {
  color: #ffffff !important; /* Ikon warna putih */
  font-size: 2.2rem !important; /* Diperbesar sedikit agar makin jelas */
}

.icon-card:hover .icon-circle {
  transform: scale(1.15);
}

/* Teks Judul Ikon */
.icon-card .icon-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.825rem;
  letter-spacing: 0.5px;
  line-height: 1.3;
  text-transform: uppercase;
}

/* --- KELAS VARIASI WARNA BACKGROUND --- */

/* 1. Hijau Gelap Dinas */
.icon-hijau-gelap {
  background-color: #1b382b;
}

/* 2. Coklat Gelap (Sangat kontras dengan ikon & teks putih) */
.icon-coklat-gelap {
  background-color: #8c6d3f; 
}

/* Jika class sebelumnya bernama 'icon-coklat-terang', disesuaikan juga agar tidak perlu ubah HTML */
.icon-coklat-terang {
  background-color: #c2a27c; 
}

/* Gaya Angka Romawi Selaras dengan FontAwesome */
.icon-card .icon-circle .roman-icon {
  color: #ffffff !important;
  font-family: 'Times New Roman', Times, 'Georgia', serif; /* Font Serif klasik khas Angka Romawi */
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  display: inline-block;
  letter-spacing: 1px;
}

/* Styling Kartu Pegawai */
.pegawai-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-color: #f3f0f0;
  border-top: 3px solid #1b382b !important; /* Warna Hijau Peradilan */
  max-width: 320px; /* Membatasi lebar card agar foto tidak melar ke samping */
  margin: 0 auto;   /* Memastikan card berada di tengah */
}

.pegawai-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Mengunci Rasio Foto Portrait (3:4) */
.pegawai-img {
  width: 100%;
  aspect-ratio: 3 / 4; /* Otomatis menjaga rasio pas foto 3:4 */
  object-fit: cover;    /* Foto pas tanpa gepeng */
  object-position: center 20%; /* Fokus sedikit lebih tinggi agar area wajah pas di tengah */
  border-radius: 6px;
}

/* Border Garis Putus-putus & Hover Effect */
.pdf-card {
  transition: all 0.2s ease-in-out;
}

.pdf-card:hover {
  border-color: #1b382b !important; /* Hijau Peradilan */
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1) !important;
}

.pdf-icon {
  transition: transform 0.2s ease-in-out;
}

.pdf-card:hover .pdf-icon {
  transform: scale(1.05);
}

/* Container Tombol WhatsApp Melayang */
.whatsapp-float-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
}

/* Styling Tombol Ikon WhatsApp */
.whatsapp-float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: #ffffff;
  border-radius: 50%;
  font-size: 32px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease-in-out;
  text-decoration: none !important;
}

/* Efek Hover saat kursor mendekat */
.whatsapp-float-btn:hover {
  background-color: #20ba5a;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}