/* ============================================
   SILAVOCA HEADER + SIDEBAR STYLES
   ============================================ */

#silavoca-header {
    background: #ffffff;
    border-bottom: 1px solid #f0ede8;
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    box-sizing: border-box;
}

.silavoca-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 72px;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

.silavoca-left {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    min-width: 0;
}

.silavoca-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.silavoca-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #1a1a1a;
    border-radius: 2px;
    transition: background 0.2s;
}

.silavoca-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.silavoca-nav a {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #1a1a1a;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.silavoca-nav a:hover { color: #c9a84c; }

.silavoca-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.silavoca-logo a { text-decoration: none; display: block; }

.silavoca-logo-img { height: 38px; width: auto; display: block; }

.silavoca-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.silavoca-register {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.silavoca-register:hover { color: #c9a84c; }

.silavoca-login {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    background-color: #2d2d2d;
    border-radius: 6px;
    padding: 9px 20px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.silavoca-login:hover { background-color: #1a1a1a; color: #ffffff; }

.silavoca-lang {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #888888;
    text-decoration: none;
    transition: color 0.2s ease;
    direction: rtl;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
}

.silavoca-lang:hover { color: #c9a84c; border-color: #c9a84c; }

/* ---- SIDEBAR ---- */
.silavoca-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 99998;
}
.silavoca-overlay.open { display: block; }

.silavoca-sidebar {
    position: fixed;
    top: 0;
    left: -420px;
    width: 400px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    overflow-y: auto;
}
.silavoca-sidebar.open { left: 0; }

html[dir="rtl"] .silavoca-sidebar,
html[lang="ar"] .silavoca-sidebar,
body.rtl .silavoca-sidebar {
    left: auto;
    right: -420px;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.08);
}
html[dir="rtl"] .silavoca-sidebar.open,
html[lang="ar"] .silavoca-sidebar.open,
body.rtl .silavoca-sidebar.open { right: 0; }

.silavoca-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 30px 20px;
}
.silavoca-sidebar-logo { height: 42px; width: auto; display: block; }
.silavoca-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.silavoca-close:hover { color: #1a1a1a; }

.silavoca-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}
.silavoca-sidebar-nav a {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: #1a1a1a;
    text-decoration: none;
    padding: 18px 30px;
    border-bottom: 1px solid #f0ede8;
    transition: color 0.2s, background 0.2s;
}
.silavoca-sidebar-nav a:first-child { border-top: 1px solid #f0ede8; }
.silavoca-sidebar-nav a:hover { color: #c9a84c; background: #faf8f4; }

.silavoca-sidebar-bottom {
    padding: 20px 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.silavoca-sidebar-btn-outline {
    display: block;
    text-align: center;
    font-size: 15px;
    color: #555;
    text-decoration: none;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    transition: all 0.2s;
}
.silavoca-sidebar-btn-outline:hover { border-color: #c9a84c; color: #c9a84c; }
.silavoca-sidebar-btn-dark {
    display: block;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    padding: 14px;
    background: #2d2d2d;
    border-radius: 10px;
    transition: background 0.2s;
}
.silavoca-sidebar-btn-dark:hover { background: #1a1a1a; color: #fff; }

/* ---- RTL ---- */
html[dir="rtl"] .silavoca-header-inner,
html[lang="ar"] .silavoca-header-inner,
body.rtl .silavoca-header-inner { flex-direction: row; }

html[dir="rtl"] .silavoca-left,
html[lang="ar"] .silavoca-left,
body.rtl .silavoca-left { flex-direction: row; }

html[dir="rtl"] .silavoca-right,
html[lang="ar"] .silavoca-right,
body.rtl .silavoca-right { flex-direction: row; }

html[dir="rtl"] .silavoca-nav,
html[lang="ar"] .silavoca-nav,
body.rtl .silavoca-nav { flex-direction: row; }

/* ---- TABLET (max 1024px) ---- */
@media (max-width: 1024px) {
    .silavoca-header-inner { padding: 0 24px; }
    .silavoca-nav { gap: 18px; }
    .silavoca-nav a { font-size: 14px; }
    .silavoca-register { font-size: 13px; }
    .silavoca-login { padding: 8px 14px; font-size: 13px; }
    .silavoca-lang { padding: 7px 12px; font-size: 13px; }
    .silavoca-right { gap: 10px; }
    .silavoca-logo-img { height: 32px; }
}

/* ---- MOBILE (max 768px) ---- */
@media (max-width: 768px) {
    .silavoca-header-inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        padding: 0 16px;
        height: 60px;
        position: static;
    }

    .silavoca-left {
        flex: unset;
        justify-content: flex-start;
        gap: 0;
    }

    .silavoca-logo {
        position: static;
        transform: none;
        text-align: center;
        justify-self: center;
    }

    .silavoca-logo-img {
        height: 30px;
        margin: 0 auto;
        display: block;
    }

    .silavoca-right {
        flex: unset;
        justify-content: flex-end;
        gap: 8px;
    }

    .silavoca-nav      { display: none; }
    .silavoca-register { display: none; }
    .silavoca-login    { display: none; }

    .silavoca-lang { padding: 7px 14px; font-size: 13px; }

    .silavoca-sidebar { width: 100%; max-width: 100%; left: -100%; }
    .silavoca-sidebar.open { left: 0; }

    html[dir="rtl"] .silavoca-sidebar,
    html[lang="ar"] .silavoca-sidebar,
    body.rtl .silavoca-sidebar { right: -100%; left: auto; }

    html[dir="rtl"] .silavoca-sidebar.open,
    html[lang="ar"] .silavoca-sidebar.open,
    body.rtl .silavoca-sidebar.open { right: 0; }

    .silavoca-sidebar-nav a  { font-size: 16px; padding: 16px 24px; }
    .silavoca-sidebar-top    { padding: 20px 24px 16px; }
    .silavoca-sidebar-bottom { padding: 16px 24px 24px; }
}
/* ---- RTL MOBILE fix ---- */
@media (max-width: 768px) {
    html[dir="rtl"] .silavoca-header-inner,
    html[lang="ar"] .silavoca-header-inner,
    body.rtl .silavoca-header-inner {
        grid-template-columns: 1fr auto 1fr;
        direction: rtl;
    }

    /* hamburger goes to the right */
    html[dir="rtl"] .silavoca-left,
    html[lang="ar"] .silavoca-left,
    body.rtl .silavoca-left {
        justify-content: flex-end;
        order: 3;
    }

    /* logo stays centered */
    html[dir="rtl"] .silavoca-logo,
    html[lang="ar"] .silavoca-logo,
    body.rtl .silavoca-logo {
        order: 2;
    }

    /* lang button goes to the left */
    html[dir="rtl"] .silavoca-right,
    html[lang="ar"] .silavoca-right,
    body.rtl .silavoca-right {
        justify-content: flex-start;
        order: 1;
    }
}
/* ---- SMALL MOBILE (max 480px) ---- */
@media (max-width: 480px) {
    .silavoca-header-inner { padding: 0 12px; height: 56px; }
    .silavoca-logo-img { height: 26px; }
    .silavoca-lang { padding: 6px 10px; font-size: 12px; }
    .silavoca-sidebar-nav a { font-size: 15px; padding: 14px 20px; }
}