﻿/* ====================================================
   ALS · Mega Dropdown Navbar (Bootstrap 5.3.8)
   .NET 9 Blazor Web App · app.css
   ==================================================== */

/* ---- Font Definitions ---- */
/* Bulo Font Family */
@font-face {
    font-family: 'Bulo';
    src: url('/fonts/Bulo.woff') format('woff'),
         url('/fonts/Bulo.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bulo';
    src: url('/fonts/BuloMedium.woff') format('woff'),
         url('/fonts/BuloMedium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bulo';
    src: url('/fonts/BuloBold.woff') format('woff'),
         url('/fonts/Bulo%20Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bulo';
    src: url('/fonts/BuloBlack.woff') format('woff'),
         url('/fonts/Bulo%20Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Adelle Font Family (complementary) */
@font-face {
    font-family: 'Adelle';
    src: url('/fonts/Adelle-Light.woff') format('woff'),
         url('/fonts/Adelle-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Adelle';
    src: url('/fonts/Adelle-Regular.woff') format('woff'),
         url('/fonts/Adelle-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---- Global Font Application ---- */
body {
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

.btn {
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
}

/* Optional: Use Adelle for specific elements */
.lead, blockquote {
    font-family: 'Adelle', Georgia, 'Times New Roman', serif;
}

/* ---- Marka renkleri (isteğe göre düzenle) ---- */
:root,
[data-bs-theme="light"] {
    --logo-mid: #4e8fff; /* Mid Blue */
    --logo-navy: #1b3860; /* Navy */
    /* Mega kart ortak ölçüleri */
    --mega-item-height: 112px; /* tüm kartlar aynı yükseklik */
    --mega-item-icon-w: 32px; /* ikon alanı */
    --mega-item-radius: 12px; /* köşe yumuşaklığı */
}

/* ---- Navbar link renkleri ve font ---- */
.navbar .nav-link {
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
}

    .navbar .nav-link:hover {
        color: var(--logo-mid);
    }

    .navbar .nav-link.active,
    .navbar .show > .nav-link {
        color: var(--logo-navy);
    }

/* ---- Navbar brand ---- */
.navbar-brand {
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

/* ---- Mega dropdown temel düzen ---- */
.dropdown-mega.position-static {
    position: static;
}

.dropdown-mega .dropdown-menu.mega-menu {
    width: min(1000px, 96vw); /* geniş panel */
    border-radius: .75rem;
    padding: 1rem 1rem;
    box-shadow: 0 1rem 2rem rgba(0,0,0,.08), 0 .25rem .75rem rgba(0,0,0,.04);
}

/* Başlık bloğu */
.mega-head h6 {
    margin: 0;
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

.mega-head small {
    color: var(--bs-secondary-color);
}

/* Card başlıkları */
.card-title {
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

.dropdown-menu .dropdown-item {
    font-family: 'Bulo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
}

/* ---- Mega içerik yerleşimi: CSS Grid ---- */
.mega-grid {
    display: grid;
    gap: 1rem; /* kartlar arası boşluk */
    grid-template-columns: 1fr; /* xs */
}

@media (min-width: 768px) { /* md */
    .mega-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) { /* lg+ */
    .mega-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* istersen xl’de 4 kolona aç */
@media (min-width: 1200px) {
    .mega-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- Mega item: SABİT BOYUT KUTU ---- */
.mega-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: .75rem;
    width: 100%;
    min-height: var(--mega-item-height);
    max-height: var(--mega-item-height);
    padding: 1rem .75rem;
    border-radius: var(--mega-item-radius);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background .15s ease-in-out;
}

    .mega-item:hover {
        background: var(--bs-tertiary-bg);
        text-decoration: none;
    }

    .mega-item i {
        font-size: 1.5rem;
        line-height: 1;
        margin-top: .15rem;
        flex: 0 0 var(--mega-item-icon-w); /* sabit ikon alanı */
        text-align: center;
    }

/* Metinlerin taşmasını düzgün kes */
.mega-title {
    font-weight: 600;
    margin: 0 0 .15rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mega-desc {
    font-size: .875rem;
    color: var(--bs-secondary-color);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 2 satırda kes */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Opsiyonel: seçili durumu vurgusu */
.mega-item.is-active {
    background: color-mix(in srgb, var(--logo-mid) 14%, transparent);
    outline: 1px solid color-mix(in srgb, var(--logo-mid) 25%, transparent);
}

/* ≥lg ekranlarda hover ile aç/kapa (mobilde tıkla) */
@media (min-width: 992px) {
    .dropdown-mega:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

/* Küçük ekranlarda kart yüksekliğini biraz düşür */
@media (max-width: 575.98px) {
    :root {
        --mega-item-height: 100px;
    }
}

/* ---- Card-style mega menu ---- */
.mega-menu {
    min-width: 600px;
    max-width: 800px;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Position static for mega menu */
.position-static {
    position: static !important;
}

/* Dropdown menu alignment */
.dropdown-menu-center {
    left: 50% !important;
    transform: translateX(-50%);
}

/* Text truncate for 2 lines */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    max-height: 2.8em; /* 2 lines * 1.4 line-height */
}

/* ---- Content Body Styles ---- */
.content-body,
.content-body-secondary {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.content-body img,
.content-body-secondary img {
    max-width: 100%;
    height: auto;
}

.content-body table,
.content-body-secondary table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.content-body iframe,
.content-body-secondary iframe {
    max-width: 100%;
}

/* ---- Target Languages Dropdown ---- */
.target-languages-container {
    position: relative;
}

.target-languages-dropdown {
    position: absolute;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1050;
    margin-top: 0.25rem;
}

.target-languages-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.target-languages-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.target-languages-dropdown .dropdown-item.active {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.target-language-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem;
    background-color: #6c757d;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.target-language-tag .btn-close {
    font-size: 0.65rem;
    opacity: 0.8;
}

.target-language-tag .btn-close:hover {
    opacity: 1;
}
