/* Sakarya Üniversitesi Kurumsal Renkleri ve Şehir Hafızası Teması */
:root {
    --sau-green: #004d40;
    --sau-light-green: #00695c;
    --text-dark: #2c3e50;
    --text-light: #546e7a;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --border: #cfd8dc;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
}

/* Üst Menü */
header {
    background-color: var(--white);
    border-bottom: 4px solid var(--sau-green);
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--sau-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo span {
    font-size: 0.9rem;
    color: var(--text-light);
    display: block;
    font-weight: 400;
}

/* Düzen */
.layout {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    gap: 40px;
    padding: 0 20px;
}

/* Yan Menü (Sticky) */
aside {
    flex: 1;
    min-width: 250px;
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0; /* Sayfanın en üstüne yapışması için eklendi */
}

.sidebar-menu {
    position: sticky;
    top: 40px;
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid var(--border);
}

.sidebar-menu h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--sau-green);
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 12px;
}

.sidebar-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: color 0.2s;
    display: block;
}

.sidebar-menu a:hover {
    color: var(--sau-green);
    opacity: 0.7;
}

/* Ana İçerik */
main {
    flex: 3;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

/* Tipografi */
h1.page-title {
    color: var(--sau-green);
    font-size: 2.2rem;
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

h2 {
    color: var(--sau-light-green);
    font-size: 1.8rem;
    margin-top: 50px;
    margin-bottom: 20px;
}

h3 {
    color: var(--text-dark);
    font-size: 1.4rem;
    margin-top: 35px;
    margin-bottom: 15px;
    border-left: 4px solid var(--sau-green);
    padding-left: 15px;
}

p {
    margin-bottom: 1.5em;
    text-align: justify;
}

/* Açılır/Kapanır Kaynakça Stili */
details.bibliography {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-top: 20px;
    margin-bottom: 40px;
    overflow: hidden;
}

details.bibliography summary {
    background-color: #e9ecef;
    padding: 12px 20px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details.bibliography summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--sau-green);
}

details.bibliography[open] summary::after {
    content: '-';
}

details.bibliography ul {
    list-style-type: disc;
    margin: 0;
    padding: 20px 40px;
    font-size: 0.9rem;
    color: #555;
}

details.bibliography li {
    margin-bottom: 8px;
}

/* --- Sidebar Hızlı Kaynakça (Tam Fixlenmiş Sürüm) --- */

details.bibliography-menu {
    display: block;
    width: 100%;
    /* Üste binmeyi önlemek için margin-top ve bottom netleştirildi */
    margin: 10px 0 15px 0 !important; 
    border-radius: 4px;
    background-color: #f0f2f5; 
    border: 1px solid #e9ecef;
    box-sizing: border-box;
    position: relative; /* Üste binme çakışmalarını önlemek için */
    clear: both;
}

details.bibliography-menu summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Klasik sidebar paddingi ile eşitlemek için padding: 10px; */
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    list-style: none;
    transition: background 0.2s, color 0.2s;
    
    /* Hover'da kaymayı önleyen ayarlar */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Chrome/Safari varsayılan okunu gizle */
details.bibliography-menu summary::-webkit-details-marker {
    display: none;
}

/* Üzerine gelince yazı büyümesini (bold) kaldırarak kaymayı engelliyoruz */
details.bibliography-menu summary:hover {
    background-color: #e9ecef;
    color: var(--sau-green);
    font-weight: normal; /* Kaymayı önlemek için bold yapılmadı */
}

/* Sağdaki ok işareti */
details.bibliography-menu summary::after {
    content: '▾';
    font-size: 0.8rem;
    color: var(--text-light);
    margin-left: 8px;
    flex-shrink: 0;
}

/* Menü açıldığında liste yapısı */
details.bibliography-menu ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 5px 0 !important; 
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    width: 100%;
}

details.bibliography-menu li {
    /* Sidebar-menu'den gelen margin-bottom:12px'i burada sıfırlıyoruz */
    margin: 0 !important;
    padding: 6px 15px !important;
    line-height: 1.4;
}

details.bibliography-menu li a {
    font-size: 0.88rem;
    color: var(--text-light);
    text-decoration: none;
    display: block;
    /* Alt başlıklar çok uzunsa alt satıra geçebilsin */
    white-space: normal;
    padding: 0 !important;
}

details.bibliography-menu li a:hover {
    color: var(--sau-green) !important;
    background: transparent !important;
    font-weight: 500;
}

/* EĞER üstteki elemanla bitişik duruyorsa zorunlu mesafe */
.sidebar-menu ul + details.bibliography-menu,
.sidebar-menu a + details.bibliography-menu {
    margin-top: 15px !important;
}

/* ÖZEL MAKALE KARTI VE DİNAMİK İÇERİK YAPISI */
.ozel-makale-karti {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ozel-makale-baslik {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.ozel-makale-altbaslik {
    font-size: 1rem;
    color: #7f8c8d;
    margin: 0 0 15px 0;
    font-weight: 400;
}

.ozel-makale-icerik {
    position: relative;
    overflow: hidden;
    max-height: 100px; 
    transition: max-height 0.5s ease-in-out;
}

.ozel-makale-icerik::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
    transition: opacity 0.3s;
}

.ozel-makale-icerik.acik {
    max-height: 2000px;
}

.ozel-makale-icerik.acik::after {
    opacity: 0; 
    visibility: hidden;
}

.ozel-buton-wrapper {
    margin-top: 15px;
    text-align: center;
}

.ozel-devam-butonu {
    background-color: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.ozel-devam-butonu:hover {
    background-color: #3498db;
    color: #fff;
}

/* Kitap Ayracı Tasarımı */
.ayrac-kutusu {
    margin: 20px 0;
}

.ayrac-kutusu h1 {
    background-color: #d32f2f;
    color: #ffffff;
    display: inline-block;
    padding: 10px 20px;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    font-size: 1.5rem;
    border-left: 8px solid #8e0000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    border-radius: 0 4px 4px 0; 
}

/*RESİMLER*/
        .resim-kapsayici {
            display: flex;
            flex-direction: column; /* Elemanları alt alta dizer */
            align-items: center;    /* Yatayda ortalar */
            justify-content: center; /* Dikeyde ortalar (isteğe bağlı) */
            text-align: center;     /* Metni ortalar */
            width: 100%;            /* Mobil uyum için genişlik */
            padding: 20px;
            box-sizing: border-box;                          /* Hücreler arası boşluk */
        }

        .resim-kapsayici img {
            max-width: 100%;        /* Resmin taşmasını engeller */
            height: auto;           /* Oranları korur */
            display: block;
            margin-bottom: 10px;    /* Resim ile yazı arasındaki boşluk */
            border-radius: 8px;     /* Görsel şıklık için (isteğe bağlı) */
        }

        .resim-kapsayici span{
            font-family: sans-serif;
            font-size: 14px;
            color: #333;
        }

/* GRİD OLACAK ŞEKİLDE BİRDEN FAZLA RESİM YANYANA İSE */

/* Ana Taşıyıcı */
    .resim-kapsayici-grid {
        display: flex;
        flex-wrap: wrap;       /* Ekran daralınca alt satıra geçmesini sağlar */
        gap: 20px;             /* Resim kutuları arasındaki boşluk */
        justify-content: center; /* Kutuları merkeze toplar */
        padding: 20px;
    }

    /* Her bir resim ve yazı ikilisini tutan kutu */
    .resim-kapsayici-grid-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 1;               /* Kutuların eşit genişlikte olmasını sağlar */
        min-width: 250px;      /* Mobilde çok küçülmemesi için alt sınır */
        max-width: 300px;      /* Çok geniş ekranlarda devasa olmaması için */
    }

    .resim-kapsayici-grid-item img {
        width: 100%;           /* Kutunun genişliğine tam yayılır */
        height: auto;          /* Oranı korur */
        border-radius: 10px;
        margin-bottom: 8px;
    }

    .resim-kapsayici-grid-item span {
        font-family: sans-serif;
        font-size: 14px;
        text-align: center;
    }

/* MOBİL UYUMLULUK (Template2'deki geliştirmelerle harmanlandı) */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
        margin: 20px auto;
        gap: 20px;
    }

    aside {
        order: -1;
        min-width: 100%;
        max-height: none;
        position: relative;
    }

    main {
        padding: 20px; /* template2'deki 0 yerine okunabilirlik için 20px daha güvenlidir */
    }

    .container {
        width: 100%;
        padding: 0 15px;
    }

    .ozel-makale-karti {
        padding: 15px;
    }

    .ozel-makale-baslik {
        font-size: 1.3rem;
    }

    .ozel-makale-icerik p {
        text-align: left; /* Mobilde kelime boşluklarını önlemek için */
    }

    .ozel-devam-butonu {
        width: 100%;
        padding: 12px 0;
        display: block;
    }

}