/**
 * emadbrz – Header: transparent (site background shows through).
 */

.emadbrz-header {
    position: relative;
    width: calc(100% - 2 * var(--emadbrz-header-margin, 24px));
    max-width: 100%;
    margin: var(--emadbrz-header-margin, 24px) auto 0;
    padding: 0.9rem 1.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 20px;
    box-shadow: none;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease, position 0s;
}

/* بعد از 50px اسکرول: فیکس + گلس نئومورفیسم دارک با فاصله از لبه و بوردر رادیوس */
.emadbrz-header.emadbrz-header--scrolled {
    position: fixed;
    top: var(--emadbrz-header-margin, 24px);
    left: var(--emadbrz-header-margin, 24px);
    right: var(--emadbrz-header-margin, 24px);
    width: auto;
    margin: 0;
    z-index: 1000;
    background: linear-gradient(
        135deg,
        rgba(20, 20, 22, 0.85) 0%,
        rgba(12, 12, 14, 0.9) 50%,
        rgba(18, 18, 20, 0.85) 100%
    );
    backdrop-filter: blur(20px) saturate(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.2) inset,
        0 1px 0 0 rgba(255, 255, 255, 0.04),
        0 4px 24px rgba(0, 0, 0, 0.35);
}

.emadbrz-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 2.5rem;
    min-width: 0;
}

/* Logo – large, white, left */
.emadbrz-header__logo {
    flex-shrink: 0;
}

.emadbrz-header__logo-link {
    font-family: inherit;
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.03em;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
    transition: opacity 0.25s ease, color 0.25s ease, text-shadow 0.25s ease;
}

.emadbrz-header__logo-link:hover {
    opacity: 1;
    color: #fff;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.emadbrz-header__logo-img {
    display: block;
    max-height: 2.35rem;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.12));
    transition: filter 0.25s ease;
}

.emadbrz-header__logo-link:hover .emadbrz-header__logo-img {
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.2));
}

/* Tagline – smaller, all-caps, center-right */
.emadbrz-header__tagline {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    padding-inline: 0.5rem;
}

.emadbrz-header__tagline-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: inherit;
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: color 0.25s ease;
}

/* Hamburger – right, 3 lines (bottom shorter) */
.emadbrz-header__menu-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.emadbrz-header__menu-toggle:hover,
.emadbrz-header__menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.emadbrz-header__menu-toggle:active {
    transform: scale(0.96);
}

.emadbrz-header__hamburger {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    width: 20px;
}

.emadbrz-header__hamburger-line {
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.emadbrz-header__hamburger-line {
    width: 100%;
}

.emadbrz-header__hamburger-line--short {
    width: 14px;
}

.emadbrz-header__menu-toggle:hover .emadbrz-header__hamburger-line,
.emadbrz-header__menu-toggle[aria-expanded="true"] .emadbrz-header__hamburger-line {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

/* RTL */
[dir="rtl"] .emadbrz-header__hamburger {
    align-items: flex-start;
}

/* ----- Header: responsive ----- */
@media (max-width: 767px) {
    .emadbrz-header {
        width: calc(100% - 2 * var(--emadbrz-header-margin-mobile, 16px));
        margin: var(--emadbrz-header-margin-mobile, 16px) auto 0;
        padding: 0.65rem 1rem;
    }

    .emadbrz-header__inner {
        min-height: 2.25rem;
        gap: 0.5rem;
    }

    .emadbrz-header__tagline {
        display: none !important;
    }

    .emadbrz-header__logo-link {
        font-size: clamp(1.15rem, 5vw, 1.45rem);
    }

    .emadbrz-header__logo-img {
        max-height: 2rem;
    }

    .emadbrz-header__menu-toggle {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 44px;
        min-height: 44px;
    }

    .emadbrz-header__hamburger {
        width: 18px;
    }

    .emadbrz-header__hamburger-line--short {
        width: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .emadbrz-header {
        padding: 0.75rem 1.25rem;
    }

    .emadbrz-header__inner {
        min-height: 2.35rem;
    }

    .emadbrz-header__tagline-text {
        font-size: 0.7rem;
        letter-spacing: 0.18em;
    }
}

@media (min-width: 1024px) {
    .emadbrz-header {
        padding: 0.9rem 1.75rem;
    }
}

/* ----- Sidebar overlay: blur + darken for focus ----- */
.emadbrz-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

body.emadbrz-sidebar-open .emadbrz-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ----- Sidebar panel (no scrollbar, content fits viewport) ----- */
.emadbrz-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    width: min(380px, 90vw);
    max-width: 100%;
    height: 100vh;
    background: #1a1a1a;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    pointer-events: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.emadbrz-sidebar::-webkit-scrollbar {
    display: none;
}

body.emadbrz-sidebar-open .emadbrz-sidebar {
    transform: translateX(0);
    pointer-events: auto;
}

[dir="rtl"] .emadbrz-sidebar {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

body.emadbrz-sidebar-open [dir="rtl"] .emadbrz-sidebar {
    transform: translateX(0);
}

/* Content appearance: staggered fade + slide when sidebar opens */
@keyframes emadbrz-sidebar-item {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emadbrz-sidebar__inner {
    padding: 1.5rem 1.5rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.emadbrz-sidebar-open .emadbrz-sidebar .emadbrz-sidebar__inner > * {
    animation: emadbrz-sidebar-item 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

body.emadbrz-sidebar-open .emadbrz-sidebar .emadbrz-sidebar__inner > *:nth-child(1) { animation-delay: 0.06s; }
body.emadbrz-sidebar-open .emadbrz-sidebar .emadbrz-sidebar__inner > *:nth-child(2) { animation-delay: 0.12s; }
body.emadbrz-sidebar-open .emadbrz-sidebar .emadbrz-sidebar__inner > *:nth-child(3) { animation-delay: 0.18s; }
body.emadbrz-sidebar-open .emadbrz-sidebar .emadbrz-sidebar__inner > *:nth-child(4) { animation-delay: 0.24s; }
body.emadbrz-sidebar-open .emadbrz-sidebar .emadbrz-sidebar__inner > *:nth-child(5) { animation-delay: 0.30s; }
body.emadbrz-sidebar-open .emadbrz-sidebar .emadbrz-sidebar__inner > *:nth-child(6) { animation-delay: 0.36s; }

/* Close: text + large X (top right) */
.emadbrz-sidebar__close {
    position: absolute;
    top: 1.25rem;
    inset-inline-end: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.emadbrz-sidebar__close:hover {
    color: rgba(255, 255, 255, 0.9);
}

.emadbrz-sidebar__close-x {
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 300;
    margin-inline-start: 0.25rem;
}

/* Main nav – compact so content fits without scroll */
.emadbrz-sidebar__nav {
    margin-top: 2.5rem;
    margin-bottom: 0;
    flex-shrink: 0;
}

.emadbrz-sidebar__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.emadbrz-sidebar__menu li {
    margin: 0;
}

.emadbrz-sidebar__menu a {
    display: block;
    padding: 0.4rem 0;
    color: #fff;
    text-decoration: none;
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.emadbrz-sidebar__menu a:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* Separator line */
.emadbrz-sidebar__sep {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 1rem 0;
    flex-shrink: 0;
}

/* Bottom: contact then social – takes remaining space, no scroll */
.emadbrz-sidebar__bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
    min-height: 0;
    flex: 1 1 auto;
}

/* Contact – compact */
.emadbrz-sidebar__contact {
    font-size: 0.875rem;
    font-weight: 400;
    color: #fff;
    line-height: 1.5;
    flex-shrink: 0;
}

.emadbrz-sidebar__contact-line,
.emadbrz-sidebar__contact-address {
    margin: 0 0 0.35rem;
}

.emadbrz-sidebar__contact-line:last-child,
.emadbrz-sidebar__contact-address:last-child {
    margin-bottom: 0;
}

.emadbrz-sidebar__contact a {
    color: #fff;
    text-decoration: none;
}

.emadbrz-sidebar__contact a:hover {
    text-decoration: underline;
}

/* Social – minimal icon row, side by side */
.emadbrz-sidebar__social {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.emadbrz-sidebar__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.emadbrz-sidebar__social-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.08);
}

.emadbrz-sidebar__social-link svg {
    width: 20px;
    height: 20px;
}


/* Language toggle */
.emadbrz-sidebar__lang {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.emadbrz-sidebar__lang-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.emadbrz-sidebar__lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emadbrz-sidebar__lang-link {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.emadbrz-sidebar__lang-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.emadbrz-sidebar__lang-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.emadbrz-sidebar__lang-sep {
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}
