/* BENTO IZGARASI (2028 Standardı) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px; /* Daha fazla yükseklik için 240 pikselden artırıldı */
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Öne Çıkan Öğe (2x2 kaplar) */
.bento-grid .article-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

/* Orta Öğe (2x1 kaplar) */
.bento-grid .article-card:nth-child(2),
.bento-grid .article-card:nth-child(3) {
    grid-column: span 2;
    grid-row: span 1;
}

/* Normal Öğeler (1x1 kaplar) - 3'ten fazlaysa */
.bento-grid .article-card:nth-child(n+4) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Duyarlı (Responsive) Bento */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }
    .bento-grid .article-card:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }
    .bento-grid .article-card:nth-child(n+2) {
        grid-column: span 1;
        grid-row: span 1;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .bento-grid .article-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        aspect-ratio: 16/11;
    }
}

/* Standart Izgara */
.standard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Gelişmiş Makale Kartı */
.article-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
}

.card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

/* Metnin okunabilir olması için görsel içinde degrade katmanı */
.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(3,3,5,1) 0%, rgba(3,3,5,0.4) 50%, rgba(3,3,5,0.1) 100%);
    transition: background var(--transition-base);
}

.article-card:hover .card-image::after {
    background: linear-gradient(to top, rgba(3,3,5,1) 0%, rgba(3,3,5,0.6) 60%, rgba(3,3,5,0.2) 100%);
}

.card-title a {
    color: inherit;
}

/* Yayılmış bağlantı tüm kartı kaplar */
.card-title a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
}

.card-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 15; /* Tıklanabilir olması için yayılmış bağlantıdan (z-index 5) daha yüksek OLMALIDIR */
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Badge'i ezmemesi için kapsayıcıyı %100 yapıyoruz */
    padding: 4rem 1.5rem 1.5rem 1.5rem; /* Üstten 4rem boşluk (Badge alanı) KESİNLİKLE korunur */
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
}

.card-title {
    color: white;
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast);
    
    /* Mükemmel Kısıtlama: Başlıklar 2 satırı geçerse kesilir (...) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card:nth-child(1) .card-title {
    font-size: 2.2rem;
    -webkit-line-clamp: 3;
    line-clamp: 3; /* İlk ana haberde 3 satıra kadar izin ver */
}

.article-card:hover .card-title {
    color: var(--primary-300);
}

.card-excerpt {
    color: #cbd5e1; /* Kontrast için çok daha parlak */
    font-size: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
    opacity: 0;
    max-height: 0;
    transition: all var(--transition-base);
}

/* 1. Kutu (En büyük) - Her zaman göster */
.bento-grid .article-card:nth-child(1) .card-excerpt {
    opacity: 1;
    max-height: 80px;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Sadece geniş ekranlarda 2. ve 3. kutuların içeriği açılsın */
@media (min-width: 1025px) {
    .bento-grid .article-card:nth-child(2):hover .card-excerpt,
    .bento-grid .article-card:nth-child(3):hover .card-excerpt {
        opacity: 1;
        max-height: 60px;
        margin-bottom: 1rem;
    }
}

/* Küçük kartlarda veya dar ekranlarda excerpt HİÇ açılmasın, başlık kaybolmasın */
.article-card .card-content {
    transition: transform var(--transition-base);
}

.article-card:hover .card-content {
    transform: translateY(-5px); /* Sadece hafifçe yukarı kaysın, metin açılmasın */
}

/* 1., 2. ve 3. Bento kartlarında hover olunca tüm content bloğu yukarı kaymasın çünkü zaten excerpt açılıyor */
@media (min-width: 1025px) {
    .bento-grid .article-card:nth-child(1):hover .card-content,
    .bento-grid .article-card:nth-child(2):hover .card-content,
    .bento-grid .article-card:nth-child(3):hover .card-content {
        transform: none;
    }
}

.card-meta {
    display: flex;
    gap: 1.5rem;
    color: #94a3b8; /* Daha iyi kontrast için daha parlak gri tonu */
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Kayan Yazı / Son Dakika Bandı yükseltmesi */
.breaking-banner {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0;
    height: 48px;
    display: flex;
    align-items: center;
    overflow: hidden; /* KRİTİK: Yatay taşmayı önle */
    width: 100%;
}

.breaking-inner {
    display: flex;
    align-items: center;
    height: 100%;
    overflow: hidden;
    width: 100%;
    gap: 0;
    padding: 0 !important; /* Tam genişlik hissi için genel konteyner dolgusunu geçersiz kılma */
}

.breaking-inner marquee {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.breaking-label {
    background: linear-gradient(135deg, #ec4899, #6366f1);
    color: white;
    font-weight: 800;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    box-shadow: 10px 0 20px rgba(0,0,0,0.9);
}

/* Canlı Nabız Animasyonu */
.breaking-label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fff;
    margin-right: 10px;
    box-shadow: 0 0 10px #fff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 1; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1); opacity: 0.8; box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.95); opacity: 1; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.header-search {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    max-width: 250px;
}

.header-search input {
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    border: 1px solid var(--dark-border);
    background: var(--dark-surface-elevated);
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
    width: 100%;
}

.header-search button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .header-search {
        max-width: 100%;
        width: 100%;
    }
}

/* Yan Menü (Sidebar) Yükseltmesi */
.sidebar-item {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.sidebar-item:hover {
    transform: translateX(5px);
}

.sidebar-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--dark-surface);
}

.sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark-border), var(--dark-bg));
}

.sidebar-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.sidebar-info h4 {
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.3rem;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-item:hover h4 {
    color: var(--primary-300);
}

.sidebar-info span {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}
