/*
Theme Name: Twenty Twenty-Three Child
Theme URI: https://example.com
Description: Child theme của Twenty Twenty-Three
Author: Hoang Thang
Template: twentytwentythree
Version: 1.0
Text Domain: twentytwentythree-child
*/

/* Thêm CSS tùy chỉnh ở dưới */

ul.betterdocs-articles-list a:hover, ul.betterdocs-articles-list a.active {
    background: #e4e2df !important;
    width: 100%;
    border-radius: 8px;
}

ul.betterdocs-articles-list a {
    width: 100%;
}

#betterdocs-single-content h1,
#betterdocs-single-content h2,
#betterdocs-single-content h3,
#betterdocs-single-content h4,
#betterdocs-single-content h5,
#betterdocs-single-content h6 {
    color: #161616;
    margin-top: 1.4em;
    margin-bottom: .2em;
}

#betterdocs-single-content img {
    border: 1px solid #777777;
    border-radius: 4px;
}

.fg-filtering-container, .foogallery-container {
    max-width: 100% !important;
}

@media screen and (max-width: 768px) {
    .content-docs-padding {
        padding: 0 !important;
    }

    .sidebar-docs-sticky .betterdocs-full-sidebar-left.betterdocs-sidebar-layout-7 {
        display: block !important
    }
}

.betterdocs-toc {
    border-radius: 0 !important;
}

.betterdocs-toc .toc-list li a, .betterdocs-toc .toc-list li {
    width: 100%;
}

/* code sidebar cho mobile docs */

/* Nút hamburger - chỉ hiện trên mobile */
.sidebar-hamburger-btn {
    display: none;
    position: sticky;
    top: 2%;
    left: 85%;
    z-index: 3;
    background: #f2f4f7;
    border: 2px solid #f2f4f7;
    border-radius: 50%;
    padding: 10px 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sidebar-hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: 0.3s;
}

/* Animation chuyển hamburger thành X */
.sidebar-hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.sidebar-hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Overlay khi mở menu */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Nút đóng */
.sidebar-close-btn {
    display: none !important;
}

.sidebar-docs-sticky .betterdocs-sidebar {
    left: 0 !important
}

/* Responsive cho mobile */
@media (max-width: 768px) {

    .toc-docs-sticky .betterdocs-toc {
        box-sizing: border-box;
    }

    /* Đảm bảo container cha có position relative */
    .wp-block-columns.alignwide.content-docs-padding {
        position: relative;
    }

    .sidebar-hamburger-btn {
        display: block;
    }

    .wp-block-column.sidebar-docs-sticky {
        position: fixed !important;
        left: 100%;
        top: 0;
        width: 80vw;
        height: 100vh;
        background: #f1f0ee;
        z-index: 3;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .wp-block-column.sidebar-docs-sticky.active {
        left: 0;
    }
}

/* enddd */


/* code sidebar cho mobile TOC */

@media (max-width: 768px) {
    .toc-docs-sticky {
        position: fixed;
        bottom: 0;
        background: #f1f0ee;
        width: 100%;
        padding: 12px;
        box-sizing: border-box;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        max-height: 300px;
        overflow-y: auto;
    }
    .toc-docs-sticky .betterdocs-toc {
        width: 100%;
    }
    .toc-docs-sticky .betterdocs-toc .toc-title {
    z-index: 2;
    position: relative;
    right: 8px;
}
}

/* End */

/* toc docs scroll */

/* Style cho link active trong TOC */
.betterdocs-toc .toc-list li a.active {
    color: #4CAF50 !important;
    font-weight: 600;
}

.betterdocs-toc .toc-list li.active>a {
    color: #4CAF50 !important;
    font-weight: 600;
}

/* Highlight cho heading đang active */
.betterdocs-content .betterdocs-content-heading.active-section {
    border-left: 3px solid #4CAF50;
    padding-left: 10px;
    transition: all 0.3s ease;
}

/* end */

/* menu navigation */

@media screen and (max-width: 768px) {
    ul.wp-block-navigation__container.is-responsive.items-justified-center.wp-block-navigation {
        width: 100%;
        font-size: 28px;
    }
    .wp-block-navigation ul, .wp-block-navigation ul li {
        width: 100%;
    }
}

/* end */

li.wp-block-post:hover .wp-block-post-featured-image img {
    filter: brightness(0.8);
}

