/* ==========================
HEADER
========================== */

.main-header{
    height:72px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 35px;
    background:#fff;
    border-bottom:1px solid #ececec;
    position:sticky;
    top:0;
    z-index:999;
}

.header-left{
    flex:1;
}

.logo img{
    height:50px;
    width:auto;
}

.header-center{
    flex:2;
    display:flex;
    justify-content:center;
}

.menu{
    display:flex;
    list-style:none;
    gap:35px;
    margin:0;
    padding:0;
}

.menu li{
    list-style:none;
}

.menu li a{
    text-decoration:none;
    color:#111;
    font-weight:500;
    transition:.3s;
}

.menu li a:hover{
    color:#4D1C89;
}

.header-right{
    flex:1;
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:18px;
}

.user-avatar{
    width:42px;
    height:42px;
    border-radius:50%;
    object-fit:cover;
}

.header-profile{
    position:relative;
}

.dropdown{
    position:absolute;
    top:55px;
    right:0;
    width:180px;
    background:#fff;
    border-radius:10px;
    display:none;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.dropdown a{
    display:block;
    padding:12px 18px;
    color:#333;
    text-decoration:none;
}

.dropdown a:hover{
    background:#f7f7f7;
}

.header-profile:hover .dropdown{
    display:block;
}

/* ==========================
WRITE CTA
========================== */

.header-write-btn{
    display:inline-flex;
    align-items:center;
    background:#111827;
    color:#fff;
    font-size:14px;
    font-weight:500;
    padding:9px 18px;
    border-radius:20px;
    text-decoration:none;
    white-space:nowrap;
}

.header-write-btn:hover{
    background:#000;
    color:#fff;
}

/* ==========================
HEADER SEARCH
========================== */

.custom-search-wrapper{
    display:flex;
    align-items:center;
    position:relative;
}

.custom-search-icon{
    width:38px;
    height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    color:#555;
    cursor:pointer;
    transition:background .2s, color .2s;
}

.custom-search-icon:hover{
    background:#f4f1fa;
    color:#4D1C89;
}

.custom-search-box{
    max-width:0;
    overflow:hidden;
    transition:max-width .25s ease;
}

.custom-search-wrapper.active .custom-search-box{
    max-width:220px;
}

.custom-search-box form{
    margin:0;
}

.custom-search-box input{
    width:200px;
    height:38px;
    border:1px solid #e2e2e2;
    border-radius:20px;
    padding:0 16px;
    font-size:14px;
    outline:none;
    transition:border-color .2s;
}

.custom-search-box input:focus{
    border-color:#4D1C89;
}

/* ==========================
HAMBURGER TOGGLE (mobile only)
========================== */

.rt-nav-toggle{
    display:none;
    flex-direction:column;
    justify-content:center;
    gap:5px;
    width:38px;
    height:38px;
    background:none;
    border:none;
    cursor:pointer;
    padding:0;
    margin-left:6px;
}

.rt-nav-toggle span{
    display:block;
    width:24px;
    height:2px;
    background:#111;
    border-radius:2px;
    transition:.25s ease;
}

.rt-nav-toggle[aria-expanded="true"] span:nth-child(1){
    transform:translateY(7px) rotate(45deg);
}
.rt-nav-toggle[aria-expanded="true"] span:nth-child(2){
    opacity:0;
}
.rt-nav-toggle[aria-expanded="true"] span:nth-child(3){
    transform:translateY(-7px) rotate(-45deg);
}

.rt-nav-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    z-index:998;
}

.rt-nav-overlay.active{
    display:block;
}

/* ==========================
RESPONSIVE
========================== */

@media (max-width:900px){

    .main-header{
        padding:0 20px;
    }

    .rt-nav-toggle{
        display:flex;
    }

    .header-center{
        position:fixed;
        top:0;
        right:0;
        height:100vh;
        width:min(78vw, 300px);
        background:#fff;
        flex:none;
        justify-content:flex-start;
        padding:90px 30px 30px;
        box-shadow:-10px 0 30px rgba(0,0,0,.12);
        transform:translateX(100%);
        transition:transform .3s ease;
        z-index:999;
        overflow-y:auto;
    }

    .header-center.active{
        transform:translateX(0);
    }

    .menu{
        flex-direction:column;
        gap:22px;
        width:100%;
    }

    .menu li a{
        font-size:17px;
        display:block;
    }

    .custom-search-wrapper.active .custom-search-box{
        max-width:150px;
    }

    .custom-search-box input{
        width:130px;
    }
}

@media (max-width:480px){

    .main-header{
        height:64px;
        padding:0 14px;
    }

    .logo img{
        height:38px;
    }

    .user-avatar{
        width:36px;
        height:36px;
    }

    .header-write-btn{
        padding:7px 12px;
        font-size:13px;
    }
}