/* Custom overrides - loaded after template CSS */

/* Topbar: Blue */
.navbar-area .topbar-area {
    background-color: #262092 !important;
    padding: 10px 0 !important;
}

/* Navbar: White */
.navbar-area .navbar {
    padding: 0 !important;
    background-color: #ffffff !important;
}

/* Navbar links color adjustment since background is now white */
.navbar-area .navbar-nav li a {
    color: #333333 !important;
    font-size: 13px !important;
}

.navbar-area .navbar-nav li a:hover {
    color: #262092 !important;
}

/* Reduce spacing between menu items so they fit in 1 line */
.navbar-area .nav-container .navbar-collapse .navbar-nav>li+li {
    margin-left: 4px !important;
    padding-left: 8px !important;
}

/* Reduce logo right margin to bring menu closer */
.navbar-area .navbar .main-logo {
    margin-right: 10px !important;
}

.navbar-area .navbar .main-logo img {
    max-height: 65px !important;
}


@media (max-width: 991px) {

    /* Prevent horizontal overflow causing white gap on right */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Always-fixed navbar on mobile — no animation on scroll */
    .navbar-area {
        position: fixed !important;
        top: 0 !important;
        left: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        z-index: 9999 !important;
        background-color: #ffffff !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    /* Disable the slideDown animation on mobile */
    .navbar-area.navbar-area-fixed {
        animation: none !important;
    }

    /* Smaller logo on mobile */
    .navbar-area .navbar .main-logo img {
        height: 50px !important;
        max-width: 180px !important;
    }

    /* Nav container layout: logo left, toggle right */
    .navbar-area .nav-container {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 15px !important;
        max-width: 100% !important;
        overflow: hidden;
    }

    /* Make hamburger toggle icon dark (visible on white bg) */
    .navbar-area .toggle-btn .icon-left,
    .navbar-area .toggle-btn .icon-left:before,
    .navbar-area .toggle-btn .icon-left:after,
    .navbar-area .toggle-btn .icon-right,
    .navbar-area .toggle-btn .icon-right:before,
    .navbar-area .toggle-btn .icon-right:after {
        background-color: #333333 !important;
    }

    /* Toggle button positioning */
    .navbar-area .toggle-btn {
        position: relative !important;
        right: 0 !important;
        top: 0 !important;
    }

    /* Mobile right part: push to far right */
    .nav-right-part-mobile {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Mobile search icon color */
    .nav-right-part-mobile .header-search {
        color: #333333 !important;
        font-size: 16px !important;
    }

    /* Menu hidden on mobile - we use the custom drawer instead */
    .navbar-area .navbar-collapse,
    .navbar-area .navbar-collapse.sopen {
        display: none !important;
    }

    /* Menu items styling */
    .navbar-area .navbar-nav li a {
        font-size: 14px !important;
        padding: 10px 5px !important;
        display: block !important;
    }
}

@media (min-width: 992px) {
    .navbar-area .navbar .nav-container {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .navbar-area .navbar .navbar-collapse {
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: center !important;
        z-index: 9999 !important;
    }

    .navbar-area .navbar .navbar-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
}

/* =============================================
   Desktop Dropdown — React-controlled
   (Visibility is handled via React state; only reset template overrides here)
   ============================================= */
@media (min-width: 992px) {

    /* Ensure dropdown li items stack vertically (template may flex them) */
    .nav-dropdown-list li,
    .nav-dropdown-list-l3 li {
        display: block !important;
        float: none !important;
        width: 100% !important;
    }
}

/* Hide any CSS-generated pseudo-element arrow/icon on desktop menu items */
.navbar-area .nav-container .navbar-collapse .navbar-nav li.menu-item-has-children::before,
.navbar-area .nav-container .navbar-collapse .navbar-nav li.menu-item-has-children::after,
.navbar-area .nav-container .navbar-collapse .navbar-nav li.menu-item-has-children>a::after,
.navbar-area .nav-container .navbar-collapse .navbar-nav li.menu-item-has-children>span::after {
    display: none !important;
    content: none !important;
}

/* Sticky Navbar Styles */
.navbar-area-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    width: 100%;
    z-index: 9999 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-in-out forwards;
    background-color: #ffffff !important;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* =============================================
   Mobile Menu Drawer Styles
   ============================================= */

/* Dark overlay behind the drawer */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
}

/* Drawer panel - slides in from right */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80vw;
    max-width: 320px;
    height: 100%;
    background: #ffffff;
    z-index: 10001;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease-in-out;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-drawer.open {
    right: 0;
}

/* Menu Header: "Menu" title + X close */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e8e8e8;
}

.mobile-menu-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.3px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.mobile-menu-close:hover {
    color: #1a1a1a;
}

/* Menu list */
.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
}

/* Parent menu item */
.mobile-menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    overflow: hidden;
}

/* Parent menu label - bold & dark */
.mobile-menu-label {
    display: block;
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.mobile-menu-label:hover {
    color: #262092;
}

/* Chevron toggle button */
.mobile-submenu-toggle {
    background: none;
    border: none;
    padding: 14px 15px;
    flex-shrink: 0;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s, transform 0.3s;
}

.mobile-submenu-toggle:hover {
    color: #333;
}

/* Sub menu - hidden by default (accordion) */
.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    background: #fafafa;
}

.mobile-submenu.open {
    max-height: 500px;
}

/* Sub menu items - indented & lighter */
.mobile-submenu-item {
    border-top: 1px solid #f0f0f0;
}

.mobile-submenu-item a {
    display: block;
    padding: 11px 20px 11px 35px;
    font-size: 14px;
    font-weight: 400;
    color: #7a8a9e !important;
    text-decoration: none !important;
    transition: color 0.2s, padding-left 0.2s;
}

.mobile-submenu-item a:hover {
    color: #262092 !important;
    padding-left: 40px;
}

/* =============================================
   Video Modal Styles (replaces Magnific Popup)
   ============================================= */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 1;
    transition: opacity 0.2s;
}

.video-modal-close:hover {
    opacity: 0.7;
}

.video-modal-iframe-wrap {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-modal-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =============================================
   Slick Slider Overrides (match owl-carousel styling)
   ============================================= */
.post-slider .slick-prev,
.post-slider .slick-next {
    z-index: 10;
    width: 30px;
    height: 30px;
}

.post-slider .slick-prev {
    left: -35px;
}

.post-slider .slick-next {
    right: -35px;
}

.post-slider .slick-slide {
    padding: 0 15px;
}

.post-slider .slick-list {
    margin: 0 -15px;
}

/* =============================================
   Rich Text Formatting (backend content)
   ============================================= */
/* Make body paragraphs default (left) so backend inline styles control alignment */
.rich-text-content {
    line-height: 1.8;
    color: #333;
    font-size: 15px;
}

.rich-text-content p {
    margin-bottom: 1.2rem;
}

/* Match CMS headings (h2) with the main post title (h3) */
.rich-text-content h2,
.rich-text-content h3 {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2F2F2F;
    /* Default heading color */
}

/* Ensure strong/bold tags are bold */
.rich-text-content b,
.rich-text-content strong {
    font-weight: bold !important;
}

/* Ensure italics tags are italicized */
.rich-text-content i,
.rich-text-content em {
    font-style: italic !important;
}

/* Make body paragraphs justified */
.rich-text-content p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

/* Ordered list styling - numbers beside text */
.rich-text-content ol {
    list-style-type: decimal !important;
    padding-left: 2rem !important;
    margin-bottom: 1.5rem;
}

.rich-text-content ol li {
    display: list-item !important;
    list-style-type: decimal !important;
    list-style-position: outside !important;
    margin-bottom: 0.5rem;
    font-weight: normal !important;
    /* pastikan list item container tidak tebal secara default */
    text-align: justify;
    /* ratakan teks ke kanan dan kiri */
}

/* Remove the global counter::before from style.css that causes sequential numbering */
.rich-text-content ol li::before,
.rich-text-content ul li::before {
    content: none !important;
    display: none !important;
}

/* Jika text dibungkus italic (i/em) dan ingin angkanya ikutan miring, 
   pastikan style marker (meskipun browser-dependent) mengikuti font-size/style */
.rich-text-content ol li::marker,
.rich-text-content ol li::before {
    font-weight: 400 !important;
    font-style: inherit !important;
}

/* Fallback if the whole li or content has italic style */
.rich-text-content ol li:has(i)::marker,
.rich-text-content ol li:has(em)::marker,
.rich-text-content ol li:has(i)::before,
.rich-text-content ol li:has(em)::before {
    font-style: italic !important;
}

/* Ensure images within rich text are centered properly */
.rich-text-content img {
    display: block;
    margin: 0 auto 1.5rem auto;
    max-width: 100%;
    height: auto;
}

/* =============================================
   Table Styling (backend content)
   ============================================= */
.rich-text-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    background-color: #fff;
}

.rich-text-content table th,
.rich-text-content table td {
    border: 1px solid #dee2e6;
    padding: 12px 15px;
    vertical-align: top;
}

.rich-text-content table th {
    background-color: #f8f9fa;
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
}

.rich-text-content table tbody tr:nth-of-type(even) {
    background-color: #f9f9f9;
}

.rich-text-content table p {
    margin-bottom: 0;
}

/* Unordered list styling - bullets beside text */
.rich-text-content ul {
    list-style-type: disc !important;
    padding-left: 2rem !important;
    margin-bottom: 1.5rem;
}

.rich-text-content ul li {
    display: list-item !important;
    list-style-type: disc !important;
    list-style-position: outside !important;
    margin-bottom: 0.5rem;
    text-align: justify;
}

/* Fix paragraphs inside list items pushing text below the number */
.rich-text-content li p {
    display: inline;
    margin: 0;
}

/* Equalize all rich text headings to match the main page title (h3) size */
.rich-text-content h1,
.rich-text-content h2,
.rich-text-content h3,
.rich-text-content h4,
.rich-text-content h5,
.rich-text-content h6 {
    font-size: 34px !important;
    font-weight: 600 !important;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #212529;
    /* or inherit from template */
}

/* Hide scrollbar on embed tabs */
.embed-tabs-scroll::-webkit-scrollbar {
    display: none;
}

/* Kategori badge hover effect on berita cards */
.single-post-wrap:hover .kategori-badge-hover {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* =============================================
   Link Styling inside rich text content
   (Override template global a { color: inherit; text-decoration: none })
   ============================================= */
.rich-text-content a {
    color: #262092 !important;
    text-decoration: underline !important;
    font-weight: 500;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.rich-text-content a:hover,
.rich-text-content a:focus {
    color: #1a1560 !important;
    text-decoration: underline !important;
    text-decoration-color: #1a1560;
}