@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-body: #f8f9fa;       
    --bg-surface: #ffffff;    
    --text-main: #111827;     
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;  
    --primary: #2563eb;       
    --primary-hover: #1d4ed8;
}

/* ============================================
   GENEL AYARLAR
   ============================================ */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar .container {
    position: static !important; 
}
.navbar {
    width: 100%;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1050;
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.navbar-collapse {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
    position: static !important;
    width: 100%;
}

#centerMenu {
    position: absolute;       
    left: 50%;                
    transform: translateX(-50%); 
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    z-index: 1060; 
}

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.8rem !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    background-color: rgba(0, 0, 0, 0.04);
}

.navbar-collapse .navbar-nav:last-child {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.navbar-brand {
    margin-left: 0 !important;
    margin-right: 1rem !important;
}

.navbar-toggler {
    margin-right: 0 !important;
}

.navbar-brand, .nav-link {
    color: #333 !important;
}

.nav-link:hover {
    color: #000 !important;
}

/* ============================================
   MEGA MENÜ (DROPDOWN)
   ============================================ */
.dropdown-menu {
    left: 50% !important; 
    transform: translateX(-50%) !important; 
    top: 100% !important;
    margin-top: 20px !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 1rem;
    min-width: 600px;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.nav-item.dropdown {
    position: static !important;
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
    margin-bottom: 0.5rem;
    padding-left: 0.8rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    color: #444;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: normal;
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: #000;
}

.dropdown-item small {
    display: block;
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
   GENEL BİLEŞENLER
   ============================================ */
.btn-primary {
    background-color: var(--primary);
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 8px !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-primary:hover { background-color: var(--primary-hover); }

.bi-grid-fill.text-muted:hover {
    opacity: 1 !important;
    color: #111 !important;
}

/* --- GLOBAL KART --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
}

.card-img-top {
    width: 100%;
    object-fit: cover;
    object-position: center;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    border-top: 1px solid #1e293b;
    padding: 3rem 0;
    margin-top: auto;
}

footer h5, footer h4, footer h3 {
    color: #ffffff !important;
    margin-bottom: 1.5rem;
}

footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #ffffff;
}

/* Sosyal medya butonları */
.footer-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #cbd5e1 !important;
    font-size: 1.15rem;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.06);
}

.footer-social-btn:hover {
    background: var(--btn-color) !important;
    color: #fff !important;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3), 0 0 15px color-mix(in srgb, var(--btn-color) 40%, transparent);
    border-color: transparent;
}

.footer-social-btn .bi {
    font-size: 1.15rem;
    margin: 0;
    color: inherit;
    transition: none;
    display: inline;
    vertical-align: baseline;
}

.footer-social-btn svg {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.footer-social-btn:hover svg {
    opacity: 1;
}

.footer-social-btn:hover .bi {
    color: inherit;
    transform: none;
    text-shadow: none;
}

footer .small, footer .text-muted {
    color: #64748b !important;
}

/* ============================================
   ANA SAYFA — HERO KART
   ============================================ */

/* Tipografi */
.hero-title { font-size: 2.25rem; line-height: 1.2; }
/* Kategori badge — her yerde (link içinde dahil) inline renk korunsun */
.cat-badge {
    color: var(--cat-color, #2196F3) !important;
    border-color: var(--cat-color, #2196F3) !important;
}
.cat-badge i,
.cat-badge span {
    color: inherit !important;
}

.hero-badge { font-size: 0.9rem; }
.hero-excerpt { font-size: 1rem; line-height: 1.6; }
.hero-meta { font-size: 0.875rem; }

/* Hero genel */
.hero-card {
    border-radius: 12px;
}
.hero-card:hover { box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.1) !important; }
.hero-card img { transition: transform 0.4s ease; }
.hero-card:hover img { transform: scale(1.03); }

/* Hero — Landscape */
.hero-landscape-img {
    height: 320px;
    width: 100%;
    object-fit: cover;
    object-position: center;
}

/* Hero — Split */
.hero-split-img {
    object-fit: cover;
    object-position: center;
}

/* ============================================
   ANA SAYFA — SPOTLIGHT KART
   ============================================ */

/* Tipografi */
.spotlight-title { font-size: 1.35rem; line-height: 1.3; }
.spotlight-badge { font-size: 0.8rem; }
.spotlight-excerpt { font-size: 0.95rem; line-height: 1.5; }
.spotlight-meta { font-size: 0.85rem; }

/* Spotlight genel */
.spotlight-card { border-radius: 10px; }
.spotlight-card:hover { box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.1) !important; }

/* Spotlight — Landscape (always stacked) */
.spotlight-landscape-img {
    height: 320px;
    width: 100%;
    object-fit: contain;
    object-position: center;
    background-color: #f8f9fa;
}

/* Spotlight — Split */
.spotlight-split-img {
    object-fit: cover;
    object-position: center;
}

/* ============================================
   ANA SAYFA — CSS GRID MASONRY SİSTEMİ
   ============================================
   
   Mantık:
   - grid-auto-rows: 10px → her satır 10px birim
   - Portrait (split) kartlar: span 34 = 340px
   - Landscape (stacked) kartlar: span 30 = 300px
   - gap: 0 column-gap: 24px → satır boşluğu row-span içinde
   - Kartlar %100 dolduruyor, overflow yok
   
   ============================================ */

/* --- Grid Container --- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 10px;
    column-gap: 24px;
    row-gap: 0;  /* Boşluk row-span ile kontrol ediliyor */
}

/* --- Grid Item Boyutları --- */
.grid-item {
    padding-bottom: 24px;  /* Dikey boşluk — column-gap (24px) ile eşit */
}

.grid-item--portrait {
    /* grid-row: span → INLINE hesaplanıyor (kitap kapağı boyutuna göre) */
}

.grid-item--landscape {
    grid-row: span 42;  /* 420px total — 6 satır excerpt için yeterli alan */
}

/* --- Grid Kart (her iki tür için ortak) --- */
.grid-card {
    height: 100%;  /* padding hariç content alanını doldurur */
    border-radius: 10px;
}

.grid-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3);
}

/* Oku → hover ışıldama */
.grid-footer .grid-meta {
    transition: color 0.2s, text-shadow 0.2s;
}
.grid-card:hover .grid-footer .grid-meta:last-child {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

.grid-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

/* Tipografi */
.grid-title { font-size: 1.1rem; line-height: 1.3; }
.grid-badge { font-size: 0.75rem; }
.grid-excerpt { font-size: 0.875rem; line-height: 1.5; color: var(--text-secondary); }
.grid-meta { font-size: 0.8rem; }

.grid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.35rem;
    flex-shrink: 0;  /* Footer asla ezilmesin */
}

/* ============================================
   SPLIT KART (Portrait / Kitap Kapağı)
   ============================================
   
   Resim sol (%42), metin sağ (%58).
   Kartın tüm yüksekliğini dolduruyor.
   Metin alanı flex-column, excerpt flex-grow-1
   ile boşluğu dolduruyor. Overflow yok.
   
   ============================================ */

.grid-card-split {
    display: flex;
    flex-direction: row;
    height: 100%;
}

.grid-card-split__img {
    flex: 0 0 42%;
    max-width: 42%;
    overflow: hidden;
    background-color: #f8f9fa;
    padding: 12px;  /* Kapak etrafında eşit çerçeve */
}

.grid-card-split__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 4px;  /* Hafif yuvarlatma */
}

.grid-card-split__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.85rem;
    min-width: 0;
}

.grid-card-split__body .grid-excerpt {
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    /* line-clamp yok — flex-grow ile kalan alanı dolduruyor */
    -webkit-line-clamp: unset;
}

/* ============================================
   STACKED KART (Landscape / Normal)
   ============================================
   
   Görsel üstte (genişliği dolduruyor, 180px),
   metin altta. Excerpt flex-grow ile kalan
   alanı dolduruyor.
   
   ============================================ */

.grid-card-stacked {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid-card-stacked__img {
    flex: 0 0 auto;
    height: 180px;
    overflow: hidden;
}

.grid-card-stacked__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.grid-card-stacked__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.85rem;
    min-width: 0;
}

.grid-card-stacked__body .grid-excerpt {
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

/* ============================================
   Yardımcı sınıflar
   ============================================ */
.hover-up { transition: transform 0.2s; }
.hover-up:hover { transform: translateY(-5px); }
.object-fit-cover { object-fit: cover; }

/* ============================================
   LINE-CLAMP (Hero & Spotlight için)
   ============================================ */
.excerpt-hero-normal {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.excerpt-hero-split {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.excerpt-spotlight {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.excerpt-spotlight-stacked {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Grid line-clamp — sadece fallback, asıl kontrol flex ile */
.excerpt-grid {
    display: -webkit-box;
    -webkit-line-clamp: 10;  /* Split kartlarda: çok satır izin ver, flex keser */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.excerpt-grid-stacked {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   RESPONSIVE — TABLET (max 991px)
   ============================================ */
@media (max-width: 991.98px) {
    /* Hero & Spotlight */
    .hero-title { font-size: 2rem; }
    .hero-excerpt { font-size: 0.95rem; }
    .hero-landscape-img { height: 260px; }
    .spotlight-landscape-img { height: 260px; }

    /* Grid: 2 sütun */
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 20px;
    }
    /* Portrait span inline kalıyor — tablet'te de çalışır */
    .grid-item--landscape { grid-row: span 38; }  /* 380px */
    .grid-card-stacked__img { height: 150px; }
}

/* ============================================
   RESPONSIVE — MOBİL (max 575px)
   ============================================ */
@media (max-width: 575.98px) {
    /* Hero & Spotlight */
    .hero-title { font-size: 1.5rem; }
    .hero-excerpt { font-size: 0.9rem; }
    .hero-badge { font-size: 0.85rem; }
    .hero-landscape-img { height: 220px; }
    .spotlight-landscape-img { height: 220px; }
    .spotlight-title, .grid-title { font-size: 1.1rem; }
    .spotlight-excerpt, .grid-excerpt { font-size: 0.85rem; }

    .excerpt-hero-normal { -webkit-line-clamp: 3; }
    .excerpt-hero-split { -webkit-line-clamp: 3; }
    .excerpt-spotlight { -webkit-line-clamp: 2; }
    .excerpt-spotlight-stacked { -webkit-line-clamp: 1; }

    /* Grid: 1 sütun, auto yükseklik */
    .post-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        grid-auto-rows: auto;  /* Masonry devre dışı, doğal akış */
    }
    .grid-item--portrait,
    .grid-item--landscape {
        grid-row: span 1 !important;  /* Inline portrait span'ı da override et */
        padding-bottom: 16px;
    }
    .grid-card {
        height: auto;  /* Doğal yükseklik */
    }

    /* Mobilde split kart → üst-alt düzene geç */
    .grid-card-split {
        flex-direction: column;
    }
    .grid-card-split__img {
        flex: 0 0 auto;
        max-width: 100%;
        height: 280px;  /* Kapak görseli geniş ekranda güzel görünsün */
        padding: 16px;
    }
    .grid-card-split__img img {
        border-radius: 6px;
    }
    .grid-card-stacked__img { height: 200px; }

    .excerpt-grid { -webkit-line-clamp: 6; }
    .excerpt-grid-stacked { -webkit-line-clamp: 3; }

    /* Mobilde split kart excerpt'i de sınırla */
    .grid-card-split__body .grid-excerpt {
        flex: 0 0 auto !important;  /* flex-grow kapalı, line-clamp kontrol etsin */
        -webkit-line-clamp: 6 !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
    }

    /* Navbar mobil */
    #centerMenu {
        position: static;
        transform: none;
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        min-width: 100%;
        margin-top: 10px !important;
    }
    
    .navbar-toggler {
        margin-right: 1rem !important;
        border: none !important;
        box-shadow: none !important;
    }

    .navbar .container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    #centerMenu {
        position: static !important;
        transform: none !important;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        text-align: center;
    }

    .navbar-collapse .navbar-nav:last-child {
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .navbar-collapse {
        display: flex;
        flex-direction: column;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        min-width: 100% !important;
        margin-top: 0 !important;
        box-shadow: none !important;
        background-color: transparent !important;
        border: none !important;
    }
    
    .dropdown-item {
        padding-left: 0;
    }
}