/* =========================================================
   MEDYABİR PRO - GÜNCEL HABERLER MODÜLÜ
   Dosya: modules/guncel_haberler/style.css
   Amaç:
   - Eski tasarım korunur
   - Ana sayfa genişliği bozulmaz
   - Haber.php / son dakika alanıyla aynı ölçüde ortalanır
   - content-wrapper güvenli hale getirilir
   - Haber kartları mobilde düzgün görünür
========================================================= */

/* =========================================================
   ANA İÇERİK + SAĞ SÜTUN DÜZENİ
   Not:
   Bu genel class olduğu için genişlik mutlaka sınırlandırıldı.
========================================================= */

.content-wrapper {
    width: 100% !important;
    max-width: 1280px !important;
    margin: 40px auto 0 auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    align-items: start;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Aynı elemanda container classı varsa ölçüyü yine haber.php ile aynı tut */
.container.content-wrapper {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.content-wrapper *,
.content-wrapper *::before,
.content-wrapper *::after {
    box-sizing: border-box;
}

/* Sol içerik alanı varsa taşma yapmasın */
.main-content,
.left-content,
.news-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Sağ sütun varsa taşma yapmasın */
.sidebar,
.right-sidebar,
.side-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* =========================================================
   BÖLÜM BAŞLIĞI
========================================================= */

.section-header {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 8px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
    text-transform: uppercase;
    position: relative;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.section-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.section-link:hover {
    color: var(--primary);
}

/* =========================================================
   HABER GRID
========================================================= */

.news-grid {
    width: 100% !important;
    max-width: 100% !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* =========================================================
   HABER KARTI
========================================================= */

.news-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Görsel */
.news-card-img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
}

.news-card-img img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    display: block;
}

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

/* Kart içerik */
.news-card-body {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.news-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    max-width: 100%;
}

.news-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {
    .content-wrapper,
    .container.content-wrapper {
        max-width: 100% !important;
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 32px !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

/* =========================================================
   MOBİL
========================================================= */

@media (max-width: 768px) {
    .content-wrapper,
    .container.content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 26px auto 0 auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        gap: 22px;
        overflow: hidden !important;
    }

    .section-header {
        gap: 12px;
        margin-bottom: 14px;
    }

    .section-header h2 {
        font-size: 1.05rem;
    }

    .section-link {
        font-size: 0.78rem;
    }

    .news-grid {
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: 1fr;
        gap: 14px;
        overflow: hidden !important;
    }

    .news-card {
        display: flex;
        flex-direction: row;
        height: 100px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .news-card:hover {
        transform: none;
    }

    .news-card-img {
        width: 130px;
        min-width: 130px;
        max-width: 130px;
        height: 100%;
        flex-shrink: 0;
        aspect-ratio: auto;
    }

    .news-card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .news-card:hover img {
        transform: none;
    }

    .news-card-body {
        padding: 10px;
        display: flex;
        align-items: center;
        min-width: 0;
        flex: 1;
    }

    .news-card-title {
        font-size: 0.95rem;
        margin: 0;
        line-height: 1.32;
        -webkit-line-clamp: 3;
    }

    .news-card-meta {
        display: none;
    }
}

/* =========================================================
   KÜÇÜK MOBİL
========================================================= */

@media (max-width: 420px) {
    .news-card {
        height: 94px;
    }

    .news-card-img {
        width: 118px;
        min-width: 118px;
        max-width: 118px;
    }

    .news-card-title {
        font-size: 0.88rem;
        line-height: 1.3;
    }
}