/* ==========================================================================
   BestBlogTheme — Header
   ========================================================================== */

.bbt-header {
    position: relative;
    z-index: 100;
    background: var(--bbt-header-bg, var(--bbt-color-white));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.bbt-header--sticky {
    position: sticky;
    top: 0;
}

.bbt-header--sticky.is-scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* Transparent mode: opacity 0.3 on scroll, 1 on hover */
.bbt-header--transparent.is-scrolled {
    opacity: 0.3;
}

.bbt-header--transparent.is-scrolled:hover {
    opacity: 1;
}

/* -- Inner Layout --------------------------------------------------------- */
.bbt-header__inner {
    display: flex;
    align-items: center;
    min-height: var(--bbt-header-height);
    gap: 1.5rem;
}

/* Logo left — Menu right (default) */
.bbt-header--logo-left .bbt-header__inner {
    justify-content: space-between;
}

/* Logo right — Menu left */
.bbt-header--logo-right .bbt-header__inner {
    flex-direction: row-reverse;
}

/* Logo center — Menu below */
.bbt-header--logo-center .bbt-header__inner {
    flex-direction: column;
    padding-block: 1rem;
    gap: 0.5rem;
}

.bbt-header--logo-center .bbt-header__center {
    text-align: center;
}

/* -- Logo ----------------------------------------------------------------- */
.bbt-logo a {
    display: inline-flex;
    align-items: center;
}

.bbt-logo__img {
    height: 50px;
    width: auto;
}

.bbt-logo__text {
    font-family: var(--bbt-font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bbt-header-heading, var(--bbt-color-black));
    transition: color 0.2s ease;
}

.bbt-logo__text:hover {
    color: var(--bbt-color-primary);
}

/* -- Navigation ----------------------------------------------------------- */
.bbt-nav {
    display: flex;
    align-items: center;
}

.bbt-nav__list {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
}

@media (min-width: 1024px) {
    .bbt-nav__list {
        display: flex;
        gap: 0.25rem;
    }
}

.bbt-nav__list > li {
    position: relative;
}

.bbt-nav__list > li > a {
    display: block;
    padding: 0.6rem 1rem;
    font-family: var(--bbt-font-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bbt-header-heading, var(--bbt-color-dark));
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.bbt-nav__list > li > a:hover,
.bbt-nav__list > li.current-menu-item > a,
.bbt-nav__list > li.current-menu-ancestor > a {
    color: var(--bbt-color-primary);
    background: rgba(37, 99, 235, 0.06);
}

/* -- Sub-menu ------------------------------------------------------------- */
.bbt-nav__list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 0.5rem 0;
    background: var(--bbt-color-white);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    list-style: none;
    z-index: 200;
}

.bbt-nav__list > li:hover > .sub-menu,
.bbt-nav__list > li:focus-within > .sub-menu {
    display: block;
}

.sub-menu li a {
    display: block;
    padding: 0.5rem 1.25rem;
    font-family: var(--bbt-font-primary);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--bbt-header-body, var(--bbt-color-dark));
    transition: color 0.2s ease, background 0.2s ease;
}

.sub-menu li a:hover {
    color: var(--bbt-color-primary);
    background: var(--bbt-color-light);
}

/* 3rd level sub-menu */
.sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

/* -- Hamburger Toggle ----------------------------------------------------- */
.bbt-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 300;
}

@media (min-width: 1024px) {
    .bbt-nav__toggle {
        display: none;
    }
}

.bbt-nav__hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.bbt-nav__hamburger span {
    display: block;
    height: 2px;
    background: var(--bbt-header-heading, var(--bbt-color-dark));
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger open state */
.bbt-nav__toggle[aria-expanded="true"] .bbt-nav__hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.bbt-nav__toggle[aria-expanded="true"] .bbt-nav__hamburger span:nth-child(2) {
    opacity: 0;
}

.bbt-nav__toggle[aria-expanded="true"] .bbt-nav__hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* -- Mobile Menu ---------------------------------------------------------- */
@media (max-width: 1023px) {
    .bbt-nav__list.is-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        padding: calc(var(--bbt-header-height) + 1rem) 1.5rem 2rem;
        background: var(--bbt-color-white);
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        z-index: 250;
        gap: 0;
    }

    .bbt-nav__list.is-open > li > a {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .bbt-nav__list.is-open .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        display: none;
        border-radius: 0;
    }

    .bbt-nav__list.is-open > li.is-sub-open > .sub-menu {
        display: block;
    }
}

/* -- Mobile Overlay ------------------------------------------------------- */
.bbt-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 200;
}

.bbt-mobile-overlay.is-visible {
    display: block;
}

/* -- Social Icons in Header ----------------------------------------------- */
.bbt-header__social {
    display: none;
}

@media (min-width: 1024px) {
    .bbt-header__social {
        display: flex;
    }
}

.bbt-social-icons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bbt-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    color: var(--bbt-color-gray);
    transition: color 0.2s ease, background 0.2s ease;
}

.bbt-social-icon:hover {
    color: var(--bbt-color-primary);
    background: rgba(37, 99, 235, 0.06);
}

/* -- Search Icon (bonus) -------------------------------------------------- */
.bbt-header__search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--bbt-color-gray);
    cursor: pointer;
    border: none;
    background: none;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.bbt-header__search:hover {
    color: var(--bbt-color-primary);
}
