/* Mega Menu hanya tampil besar di desktop */
/* Custom Styles for Jadwal Section */
/* ==== STRUKTUR & Z-INDEX ==== */
.sticky-top {
    z-index: 1030;
}
.navbar .nav-link {
    white-space: nowrap;
}
.mega-menu-column {
    min-width: 280px;
}
.mega-menu-column h6 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.4rem;
}
.dropdown-item {
    padding: 0.5rem 1rem;
    white-space: normal;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.dropdown-item:hover {
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

/* ======================================================= */
/* ==== PERILAKU & STYLE DESKTOP (DI ATAS 992px) ==== */
/* ======================================================= */
@media (min-width: 992px) {
    /* --- [BAGIAN 1: Layout Mega Menu Anda] --- */
    .nav-item.dropdown.position-static .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 100vw;
        border: 0;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
        background: #fff;
    }

    .nav-item.dropdown.position-static .dropdown-menu .row {
        width: min(1320px, calc(100vw - 2rem));
        margin-left: auto;
        margin-right: auto;
        padding: 1.5rem 0;

        /* ▼▼▼ PENGATURAN SCROLL HORIZONTAL ▼▼▼ */
        flex-wrap: nowrap; /* 1. Paksa kolom tetap satu baris */
        overflow-x: auto; /* 2. Tampilkan scrollbar X jika perlu */
        padding-bottom: 1.5rem; /* Memberi ruang untuk scrollbar */
    }

    /* --- [BAGIAN 2: Animasi Dropdown] --- */
    .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(10px);
        transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    }
    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* --- [BAGIAN 3: Pengaturan Scroll Kolom] --- */
    .mega-menu-column {
        min-width: 280px;

        /* ▼▼▼ PENGATURAN SCROLL VERTIKAL ▼▼▼ */
        max-height: 65vh; /* 1. Batasi tinggi maksimal kolom */
        overflow-y: auto; /* 2. Tampilkan scrollbar Y jika perlu */
        padding-bottom: 1rem; /* Opsional: beri ruang di bawah */
    }
}

/* ======================================================= */
/* ==== PERILAKU & STYLE MOBILE (DI BAWAH 992px) ==== */
/* ======================================================= */
@media (max-width: 991.98px) {
    /* Aturan untuk dropdown menu di mobile */
    .navbar .dropdown-menu {
        /* Reset style desktop agar kembali normal di mobile */
        position: static;
        transform: none;
        transition: none;
        box-shadow: none;
        width: 100%;
        border-radius: 0;
        border-top: 1px solid #eee;
        background-color: #f8f9fa;
        margin-top: 0 !important;

        /* ▼▼▼ TAMBAHKAN INI UNTUK SCROLL MOBILE ▼▼▼ */
        max-height: 60vh; /* 1. Batasi tinggi submenu, misal 60% dari tinggi layar */
        overflow-y: auto; /* 2. Tampilkan scrollbar jika daftar linknya panjang */
    }

    /* Reset kolom mega menu */
    .mega-menu-column {
        min-width: auto;
        margin-bottom: 1rem;
    }
}

.galeri-main-img {
    height: 500px;
    object-fit: cover;
}
.caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}
.thumbnail-container {
    max-height: 500px;
}
.thumb-item img {
    height: 100px;
    width: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
.thumb-item:hover img {
    opacity: 1;
}
.nav-pills .nav-link {
    /* Gaya untuk filter */
    background-color: #f1f1f1;
    color: #333;
    margin: 0 5px 10px 5px;
    border-radius: 50px;
    transition: all 0.3s;
}
.nav-pills .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.bg-light {
    background-color: #f9f9fc !important;
}
ul li {
    margin-bottom: 0.5rem;
}

.jadwal-filter {
    border: 1px solid #ddd;
}
.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}
.upcoming-events {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 15px;
}
.event-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 5px solid #ccc;
}
.event-date {
    background-color: #fff;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-right: 15px;
    font-weight: bold;
    color: #333;
    min-width: 60px;
}
.event-date span {
    font-size: 1.8rem;
    display: block;
    line-height: 1;
}
.event-details .event-title {
    font-weight: bold;
    margin-bottom: 5px;
}
.event-details .event-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
    line-height: 1.5;
}

/* WARNA UNTUK SETIAP JENIS KEGIATAN */
.event-green {
    border-color: #28a745;
}
.event-green .event-date {
    color: #28a745;
}

.event-blue {
    border-color: #007bff;
}
.event-blue .event-date {
    color: #007bff;
}

.event-pink {
    border-color: #e83e8c;
}
.event-pink .event-date {
    color: #e83e8c;
}

.event-yellow {
    border-color: #ffc107;
}
.event-yellow .event-date {
    color: #ffc107;
}
/* ====== Section Heading ====== */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* ====== Card Layout ====== */
.card {
    border-radius: 0.5rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ====== Jadwal Event (Daftar) ====== */
.event-item {
    background-color: #f9f9f9;
    border-left: 4px solid #0d6efd;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: background-color 0.3s;
}

.event-item:hover {
    background-color: #f1f1f1;
}

.event-date {
    width: 60px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #198754;
}

.event-info h6 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* ====== Warna Berdasarkan Jenis Kegiatan (Daftar) ====== */
.event-green {
    border-color: #28a745;
}
.event-blue {
    border-color: #007bff;
}
.event-pink {
    border-color: #d63384;
}
.event-yellow {
    border-color: #ffc107;
}

/* ====== Kalender FullCalendar (Styled) ====== */
.fc {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: "Poppins", sans-serif;
    font-size: 0.875rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.fc-toolbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.fc-button {
    background-color: #0d6efd;
    border: none;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
    border-radius: 0.25rem;
}

.fc-button-primary:not(:disabled):hover {
    background-color: #0b5ed7;
}

.fc-button-primary:disabled {
    background-color: #c0c0c0;
}

.fc-daygrid-event {
    background-color: #f8f9fa;
    color: #212529;
    border-left: 4px solid #0d6efd;
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    margin: 2px 0;
    border-radius: 0.25rem;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.05);
}

/* ====== Warna Kalender Berdasarkan Jenis Kegiatan ====== */
.fc-event-posyandu-balita {
    border-color: #28a745 !important;
}
.fc-event-posyandu-lansia {
    border-color: #007bff !important;
}
.fc-event-posyandu-remaja {
    border-color: #d63384 !important;
}
.fc-event-posbindu-ptm {
    border-color: #ffc107 !important;
}

/* ====== Tooltip Style ====== */
.tooltip-inner {
    background-color: #333;
    color: #fff;
    font-size: 0.75rem;
    max-width: 220px;
    padding: 6px 10px;
    border-radius: 0.25rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #333;
}

.nakes-item {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
    text-align: center;

    /* KUNCI UTAMA: Batasi lebar maksimum kartu */
    max-width: 200px;
    margin: 0 auto; /* Otomatis tengahkan kartu di dalam slider */
}

.nakes-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.nakes-img {
    aspect-ratio: 4 / 6;
    margin: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.nakes-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nakes-content {
    padding: 0 20px 20px 20px;
}

/* Custom Berita & Pengumuman Styles */
.berita-img {
    height: 240px;
}
.berita-img img {
    height: 110%;
    object-fit: cover;
}
.badge.badge-primary-soft {
    color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}
.pengumuman-list .pengumuman-item {
    display: flex;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.pengumuman-list .pengumuman-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
/* Custom Styles for Layanan Section */
.layanan-item {
    border: 1px solid #eee;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

.layanan-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(
        --bs-primary
    ); /* Menggunakan warna primary dari template */
}

.layanan-card-link {
    text-decoration: none;
    color: inherit;
}

.layanan-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.layanan-icon img {
    width: 80px; /* Sesuaikan ukuran ikon */
    height: 80px; /* Sesuaikan ukuran ikon */
    object-fit: contain;
}
/* Custom Banner Carousel Styles */
.banner-carousel-item {
    height: 60vh;
    min-height: 400px;
    display: flex;
    background-color: #f8f9fa;
}

.banner-carousel-item img {
    height: 100%; /* Biarkan gambar mengisi tinggi wadah */
    width: 100%; /* Biarkan gambar mengisi lebar wadah */
    object-fit: contain;
}

.sinergi-item {
    /* Hapus border, box-shadow, dan background */
    border: none;
    background-color: transparent;
    transition: all 0.3s ease-in-out;
    height: 50%;
    min-height: 100px; /* Sesuaikan tinggi minimal jika perlu */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sinergi-item:hover {
    /* Ganti efek hover menjadi sedikit membesar saja */
    transform: scale(1.1);
}

.sinergi-card-link {
    text-decoration: none;
    color: inherit;
}

.sinergi-icon img {
    /* Perkecil ukuran gambar/icon */
    width: 50px;
    height: 50px;
    object-fit: contain;
    /* Menambahkan filter grayscale yang akan hilang saat di-hover */
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease-in-out;
}

.sinergi-item:hover .sinergi-icon img {
    /* Efek saat di-hover, gambar menjadi berwarna */
    filter: grayscale(0%);
    opacity: 1;
}

/*** Spinner Start ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-out, visibility 0s linear 0.5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity 0.8s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}
/*** Spinner End ***/

.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: flex;
    width: 45px;
    height: 45px;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
    z-index: 99;
}

.fw-thin {
    font-weight: 100;
}

.text-uppercase {
    font-size: 14px;
}

/*** Button Start ***/
.btn {
    font-weight: 600;
    transition: 0.5s;
}

.btn-square {
    width: 32px;
    height: 32px;
}

.btn-sm-square {
    width: 34px;
    height: 34px;
}

.btn-md-square {
    width: 44px;
    height: 44px;
}

.btn-lg-square {
    width: 56px;
    height: 56px;
}

.btn-square,
.btn-sm-square,
.btn-md-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.link-hover {
    transition: 0.5s;
}

.link-hover:hover {
    color: var(--bs-primary) !important;
}

.img-zoomin {
    transition: 0.5s;
}

.img-zoomin:hover {
    transform: scale(1.1);
}

/*** Topbar Start ***/
.sticky-top {
    transition: 0.5s;
    background: var(--bs-white);
}

.topbar {
    padding: 10px 0;
}

.topbar .top-info {
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.topbar .top-link {
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

@media (max-width: 1400px) {
    .sticky-top .top-link {
        display: none;
    }
}

.topbar .top-link a {
    font-size: medium;
    font-weight: 400;
    font-family: "Montserrat", sans-serif;
    letter-spacing: 1px;
}

.topbar .top-link a small:hover {
    color: var(--bs-secondary) !important;
    transition: 0.5s;
}

.topbar .top-link a small:hover i {
    color: var(--bs-primary) !important;
}

#note {
    position: relative;
    animation: noteAnimate 10s infinite;
    animation-timing-function: ease-in-out;
    display: flex;
    align-items: center;
}

@keyframes noteAnimate {
    from {
        left: -735px;
    }
    to {
        left: 735px;
    }
}

/*** Topbar End ***/
/* navbar */

#searchModal .modal-content {
    background: rgba(255, 255, 255, 0.8);
}
/*** Navbar End ***/

/*** Features Start ***/
.features {
    width: 100%;
    background: linear-gradient(
            rgba(26, 125, 255, 0.5),
            rgba(255, 255, 255, 0.3)
        ),
        url(../img/features-background.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}
/*** Features End ***/

/*** Top News Start ***/
.news-2 h3 {
    position: relative;
}

.news-2 h3::after {
    content: "";
    line-height: 1.3rem;
    background: var(--bs-secondary);
    position: absolute;
    width: 68%;
    top: 50%;
    transform: translateY(-50%);
    height: 1px;
    right: 0;
    opacity: 0.2;
}
/*** Top News End ***/

/*** Latest News Start ***/
.latest-news .latest-news-carousel.owl-carousel {
    position: relative;
}

.latest-news .latest-news-carousel.owl-carousel .owl-nav .owl-prev {
    position: absolute;
    top: -65px;
    right: 70px;
    font-size: 20px;
    padding: 2px 20px;
    transition: 0.5s;
    margin-right: 10px;
    border: 1px solid var(--bs-primary);
    color: var(--bs-dark);
    border-radius: 20px;
}

.latest-news .latest-news-carousel.owl-carousel .owl-nav .owl-next {
    position: absolute;
    top: -65px;
    right: 0;
    font-size: 20px;
    margin-left: 10px;
    padding: 2px 20px;
    transition: 0.5s;
    border: 1px solid var(--bs-primary);
    color: var(--bs-dark);
    border-radius: 20px;
}

.latest-news .latest-news-carousel.owl-carousel .owl-nav .owl-prev:hover,
.latest-news .latest-news-carousel.owl-carousel .owl-nav .owl-next:hover {
    background: var(--bs-primary);
    color: var(--bs-white);
    border-radius: 10px;
}
/*** Latest News End ***/

/*** Whats New Start ***/
.populer-news .whats-carousel.owl-carousel {
    position: relative;
}

.populer-news .whats-carousel.owl-carousel .owl-nav .owl-prev {
    position: absolute;
    top: -80px;
    right: 70px;
    font-size: 20px;
    padding: 2px 20px;
    transition: 0.5s;
    margin-right: 10px;
    border: 1px solid var(--bs-primary);
    color: var(--bs-dark);
    border-radius: 20px;
}

.populer-news .whats-carousel.owl-carousel .owl-nav .owl-next {
    position: absolute;
    top: -80px;
    right: 0;
    font-size: 20px;
    margin-left: 10px;
    padding: 2px 20px;
    transition: 0.5s;
    border: 1px solid var(--bs-primary);
    color: var(--bs-dark);
    border-radius: 20px;
}

.populer-news .whats-carousel.owl-carousel .owl-nav .owl-prev:hover,
.populer-news .whats-carousel.owl-carousel .owl-nav .owl-next:hover {
    background: var(--bs-primary);
    color: var(--bs-white);
    border-radius: 10px;
}

.populer-news .tab-class .nav-item a.active {
    background: var(--bs-primary) !important;
}

.lifestyle .lifestyle-item {
    position: relative;
    overflow: hidden;
}

.lifestyle .lifestyle-item img {
    transition: 0.5s;
}

.lifestyle .lifestyle-item:hover img {
    transform: scale(1.2);
}

.lifestyle .lifestyle-item .lifestyle-content {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}
/*** Whats New End ***/

/*** Banner Section start ***/
.banner-2 {
    position: relative;
}

.banner-content-2 {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(
        rgba(26, 125, 255, 0.7),
        rgba(255, 255, 255, 0.7)
    );
    z-index: 2;
}
/*** Banner Section End ***/

/*** Footer Start ***/
.footer button:hover {
    background: var(--bs-white) !important;
    color: var(--bs-primary) !important;
}

.footer .footer-item-1 .line-h {
    line-height: 38px;
}

.footer .footer-item-1 a i {
    transition: 0.5s;
}

.footer .footer-item-1 a:hover i {
    color: var(--bs-primary) !important;
}

.footer .footer-item-3 a {
    line-height: 38px;
}

.footer .footer-item-2 a {
    transition: 0.5s;
}

.footer .footer-item-2 a:hover {
    color: var(--bs-primary) !important;
}

.footer .footer-item-3 a {
    transition: 0.5s;
}

.footer .footer-item-3 a:hover {
    color: var(--bs-primary) !important;
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
/*** Footer End ***/

.table .d-flex {
    align-items: center; /* Memastikan tombol di baris yang sama */
}

.table .btn {
    margin-bottom: 0; /* Menghapus margin bawah pada tombol */
}
