/* ===========================
   NAVBAR + LANGUAGE SWITCHER
   =========================== */

/* Üst bar */
.topnav {
    width: 100%;
    height: 52px;
    background: #333333;
    color: #ffffff;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Brand (logo + yazı) */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f9fafb;
}

.brand-tagline {
    font-size: 11px;
    color: #e5e7eb;
}

.brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(249, 250, 251, 0.8);
    position: relative;
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    border-radius: 4px;
    border: 1px solid rgba(249, 250, 251, 0.7);
}

.brand-mark::before {
    inset: 4px 9px;
}

.brand-mark::after {
    inset: 9px 4px;
}

/* Menü linkleri (orta kısım) */

.topnav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
}

.topnav-link {
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    color: #ffffff;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.topnav-link:hover {
    background-color: #575757;
}

.topnav-link.is-active {
    background-color: #007bff;
    color: #ffffff;
}

/* Sağ taraf (dil + hamburger) */

.topnav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dil seçici */

.lang-switch {
    position: relative;
}

.lang-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(156, 163, 175, 0.7);
    background: #111827;
    color: #f9fafb;
    font-size: 12px;
    cursor: pointer;
}

.lang-button:hover {
    background: #0f172a;
}

.lang-flag {
    font-size: 16px;
}

.lang-name {
    font-size: 12px;
}

.lang-caret {
    font-size: 10px;
    opacity: 0.8;
}

/* Dil açılır menüsü */
.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 150px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    padding: 4px 0;
    z-index: 40;
    display: none;
}

.lang-menu.open {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: #111827;
    text-decoration: none;
}

.lang-option:hover {
    background: #f3f4f6;
}

.lang-option.is-active {
    font-weight: 500;
    background: #eff6ff;
}

/* Hamburger button – masaüstünde gizli */

.topnav-toggle {
    display: none;
    /* desktop'ta gizli */
    margin-left: 4px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(249, 250, 251, 0.6);
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 20px;
    /* ☰ boyutu */
    line-height: 1;
    color: #f9fafb;
}



/* ===========================
   Mobil görünüm
   =========================== */

@media (max-width: 768px) {
    .topnav {
        position: relative;
        height: auto;
        padding: 8px 10px;
        align-items: center;
    }

    .topnav-left {
        flex: 1;
    }

    /* Hamburger mobilde görünsün, sağ üstte dursun */

    .topnav-toggle {
        display: inline-flex;
        position: absolute;
        top: 8px;
        right: 10px;
    }


    /* Başlangıçta menü ve dil gizli */
    .topnav-menu,
    .topnav-right .lang-switch {
        display: none;
    }

    /* 🔹 MENÜ AÇIKKEN (body.nav-open) TÜM NAV DİKEY OLSUN */
    body.nav-open .topnav {
        flex-direction: column;
        /* kritik kısım */
        align-items: stretch;
        gap: 8px;
        padding-bottom: 12px;
    }

    /* Menü: tam genişlik, dikey */
    body.nav-open .topnav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
        gap: 4px;
    }

    body.nav-open .topnav-link {
        width: 100%;
        text-align: left;
    }

    /* Sağ taraf (dil) da artık alt blok */
    body.nav-open .topnav-right {
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    body.nav-open .topnav-right .lang-switch {
        display: flex;
        width: 100%;
        margin-top: 4px;
    }

    body.nav-open .lang-button {
        width: 100%;
        justify-content: space-between;
        background: #0b1120;
        border-radius: 999px;
    }
}