:root {
    --site-header-space: 67px;
}

body {
    padding-top: var(--site-header-space);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(135deg, #d06b6b 0%, #9f596f 44%, #6e4a7e 100%);
    box-shadow: 0 2px 14px rgba(75, 19, 79, 0.18);
}

.header-inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    color: white;
    text-decoration: none;
}

.brand .logo {
    width: 46px;
    height: 46px;
    margin: 0;
    object-fit: contain;
    flex: 0 0 46px;
}

.brand-name {
    font-family: 'Great Vibes';
    font-size: 1.62rem;
    line-height: 1;
    color: white;
    white-space: nowrap;
}

.search-bar {
    width: min(100%, 520px);
    justify-self: center;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 4px 5px 4px 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(75, 19, 79, 0.12);
}

.search-bar form {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto 34px;
    align-items: center;
    gap: 7px;
}

.search-bar input {
    all: unset;
    min-width: 0;
    height: 34px;
    padding: 0 4px;
    color: #3f3444;
    font-size: 14px;
    line-height: 1;
}

.search-bar input::placeholder {
    color: #8b7d91;
    font-size: 14px;
}

.search-intent-filter {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid #eadfea;
    border-radius: 999px;
    background: #faf7fb;
}

.search-intent-filter label {
    margin: 0;
    cursor: pointer;
}

.search-intent-filter input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.search-intent-filter span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    color: #6e4a7e;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.search-intent-filter input:checked + span {
    background: #6e4a7e;
    color: white;
    box-shadow: 0 3px 10px rgba(75, 19, 79, 0.18);
}

.search-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #6e4a7e;
    cursor: pointer;
}

.search-btn img {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) invert(1);
}

.nav-main {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: max-content;
}

.nav-action {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    color: white;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.nav-action:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.nav-action .nav-icon {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: transform 0.18s ease;
}

.nav-action:hover .nav-icon {
    transform: scale(1.06);
}

.mobile-search-toggle {
    display: none;
}

.global-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff4d4d;
    color: white;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(75, 19, 79, 0.28);
}

.btn-post {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: white;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.btn-post:hover {
    background: rgba(255, 255, 255, 0.22);
    color: white;
    transform: translateY(-1px);
}

.btn-post-short {
    display: none;
}

.avatar-menu {
    overflow: visible;
}

.avatar-menu-photo {
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: transparent;
}

.avatar-menu-photo:hover {
    background: transparent;
}

.avatar-menu-photo .avatar-nav-img {
    width: 36px;
    height: 36px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    min-width: 176px;
    overflow: hidden;
    background: white;
    border: 1px solid #eadfea;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(75, 19, 79, 0.18);
}

.dropdown a,
.dropdown button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    color: #333;
    background: transparent;
    border: 0;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.dropdown form {
    margin: 0;
}

.dropdown a:hover,
.dropdown button:hover {
    background: #f7f0f8;
}

.dropdown.show {
    display: block;
}

@media (max-width: 920px) {
    :root {
        --site-header-space: 98px;
    }

    body.search-open {
        --site-header-space: 206px;
    }

    .header {
        padding: 8px 0;
    }

    .header-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 8px;
        padding: 0 10px;
    }

    .brand {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .brand .logo {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .brand-name {
        font-size: 1.22rem;
    }

    .nav-main {
        order: 2;
        width: 100%;
        min-width: 0;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-action {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .nav-action .nav-icon {
        width: 20px;
        height: 20px;
    }

    .avatar-menu-photo .avatar-nav-img {
        width: 32px;
        height: 32px;
    }

    .btn-post {
        height: 34px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .btn-post-full {
        display: none;
    }

    .btn-post-short {
        display: inline;
    }

    .mobile-search-toggle {
        display: inline-flex;
    }

    .search-bar {
        display: none;
        order: 3;
        width: min(100%, 420px);
        justify-self: center;
        margin: 0 auto;
        padding: 8px;
        border-radius: 16px;
        background: rgba(255,255,255,0.98);
        box-shadow: 0 10px 24px rgba(75,19,79,0.18);
    }

    .search-open .search-bar {
        display: flex;
    }

    .search-bar form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px;
        width: 100%;
        gap: 7px;
    }

    .search-bar input {
        min-width: 0;
        height: 38px;
        padding: 0 4px;
        font-size: 16px;
    }

    .search-btn {
        width: 38px;
        height: 38px;
        grid-column: 2;
        grid-row: 1;
    }

    .search-intent-filter {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .search-intent-filter span {
        justify-content: center;
        padding: 0 6px;
    }

    .search-btn img {
        width: 17px;
        height: 17px;
    }
}
