/* ==========================================================================
   1. CSS Variables (Your Design System)
   ========================================================================== */
:root {
    /* Default Themes (Açık) */
    --bg-color: #FAFAFA;
    --text-main: #333333;
    --text-muted: #777777;
    --accent-color: #1C69A8;
    --border-color: #E0E0E0;
    --control-bg: #F5F5F5;

    /* Typography */
    --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-reading: 'Plus Jakarta Sans', sans-serif; /* Default */
    
    /* Layout */
    --reading-width: 680px;
    --site-width: 1000px;
}

/* Dynamic Fonts & Themes */
body[data-font="jakarta"] { --font-reading: 'Plus Jakarta Sans', sans-serif; }
body[data-font="outfit"] { --font-reading: 'Outfit', sans-serif; }

body[data-theme="sepya"] {
    --bg-color: #F4ECD8;
    --text-main: #433422;
    --border-color: #D5C6A7;
    --control-bg: #EAE0C8;
}
body[data-theme="gece"] {
    --bg-color: #1A1A1A;
    --text-main: #E0E0E0;
    --border-color: #333333;
    --control-bg: #222222;
    --text-muted: #AAAAAA;
}

/* ==========================================================================
   2. Base Reset & Typography
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease; 
}

body {
    font-family: var(--font-reading);
    font-size: 16px;
    line-height: 2;
    padding: 0 20px;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-ui);
    color: var(--text-main);
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.5em;
    font-weight: 600;
    transition: color 0.3s ease;
}

h1 { font-size: 2.2rem; margin-top: 1em; }
h2 { font-size: 1.6rem; }
p { margin-bottom: 2em; }

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.3s ease, opacity 0.3s ease;
}

a:hover {
    text-decoration: none !important;
}

/* ==========================================================================
   3. Global Elements (Header, Footer, Logo)
   ========================================================================== */
.site-header, .site-footer {
    font-family: var(--font-ui);
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 40px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.site-footer {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 60px;
}

.main-nav a {
    color: var(--text-main);
    margin-left: 20px;
    font-weight: 500;
}

body.is-reader .site-header {
    display: none !important;
}

body.is-reader .layout-single-column {
    margin-top: 80px;
}


/* Dinamik Nano Saat Logosu */
#nano-clock {
    font-family: monospace;
    font-weight: 500;
    letter-spacing: -0.5px;
    display: inline-block;
    min-width: 120px;
    text-transform: lowercase;
    background: linear-gradient(to right, var(--text-main) 0%, var(--text-main) 70%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    user-select: none;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

/* Fare ile üzerine gelindiğinde (Hover) */
#nano-clock:hover {
    transform: scale(1.1); /* %10 oranında büyüme sağlar */
    
    /* Renk geçişini turuncuya (accent color) çevirir */
    background: var(--accent-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    /* Gölgeli bir parıltı hissi (opsiyonel) */
    text-shadow: 0 0 10px rgba(28, 105, 168, 0.1);
}

/* ==========================================================================
   4. Layouts (Index vs. Single)
   ========================================================================== */
.layout-two-column {
    max-width: var(--site-width);
    margin: 10px auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
}

.layout-single-column {
    max-width: var(--reading-width);
    margin: 60px auto;
}

/* ==========================================================================
   5. Sidebar & Edebi Alıntı Widget'ı
   ========================================================================== */
.site-sidebar {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    padding-top: 0; /* Alignment Fix */
}

.site-sidebar h3 {
    margin-top: 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.site-sidebar .sidebar-widget:first-child h3 {
    margin-top: 0; /* Alignment Fix */
}

.sidebar-widget {
    padding-bottom: 50px;
}

/* Edebi Alıntı Bloğu */
.quote-sidebar {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    padding-left: 15px;
    margin-bottom: 20px;
    font-style: normal;
    letter-spacing: -0.3px;
    display: flex;
    flex-direction: column;
}

.quote-author {
    font-size: 0.75rem;
    font-weight: 500;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.8;
}

.site-sidebar p { margin-bottom: 0em; }

.sidebar-more {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-color);
    text-decoration: none !important;
    border-bottom: none !important;
}

.sidebar-more:hover {
    opacity: 0.7;
}

/* ==========================================================================
   6. Home Page (Study Cards & Lists)
   ========================================================================== */
.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.study-list .section-title:first-child {
    margin-top: 5px; /* Alignment Fix */
}

.study-card {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease backwards;
}

body[data-theme="gece"] .study-card {
    border-bottom-color: rgba(255,255,255,0.05);
}

.study-card:hover .card-title a {
    color: var(--accent-color);
}

.card-date {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

.card-title {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    line-height: 1.2;
}

.card-title a {
    color: var(--text-main);
    text-decoration: none;
    border: none;
}

.card-preview {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 2;
    margin-bottom: 20px;
    max-width: 90%;
}

.read-more {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
}

/* ==========================================================================
   7. Featured Slider Animations (Index)
   ========================================================================== */
#featured-slider-container {
    position: relative;
    min-height: 310px;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out;
    transform: translateX(15px); 
    padding-left: 30px;
}

.slide.active-slide {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 2;
}

.slide.exit-slide {
    opacity: 0;
    visibility: visible;
    transform: translateX(-15px);
    z-index: 1;
}

.slider-dots {
    text-align: left;
    margin-top: 20px;
}

.dot {
    cursor: pointer;
    height: 8px;
    width: 8px;
    margin: 0 5px;
    background-color: var(--border-color);
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: var(--accent-color);
    width: 20px;
    border-radius: 4px;
}

/* ==========================================================================
   8. Study Content Formatting (Reader View)
   ========================================================================== */
.study-content .date {
    font-family: var(--font-ui);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: -10px;
    margin-bottom: 40px;
    transition: color 0.3s ease;
}

blockquote {
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
    font-style: italic;
    color: var(--text-muted);
    margin: 0em 0;
    transition: color 0.3s ease, border-color 0.3s ease;
}

hr {
    border: 0;
    text-align: center;
    margin: 3em 0;
}

hr::before {
    content: "...";
    letter-spacing: 1em;
    color: var(--text-muted);
    font-size: 1.5rem;
}

#story-body p {
    letter-spacing: 0.5px;
	
}

/* Dropcap for first paragraph */
#story-body p:first-of-type::first-letter {
    font-weight: 700;
    font-size: 2rem;
    color: var(--accent-color);
    text-transform: uppercase;
}

#story-body p:first-of-type {
    overflow: hidden; 
	text-indent: 0;
}

/* Dialogue List Fix */
#story-body ul {
    list-style-type: none;
    padding-left: 2em;
    margin-bottom: 2rem;
}

#story-body li {
    margin-bottom: 0.5rem;
    font-family: inherit;
    font-size: inherit;
    text-indent: -1.2em;
    padding-left: 1.2em;
}

#story-body li::before {
    content: "— "; 
    color: var(--text-main);
} 

#story-body h4 {
    font-family: var(--font-ui);
    font-size: 1.2rem;
    margin: 2em 0 1em 0;
    color: var(--text-main);
    letter-spacing: 1px;
    text-indent: 0 !important; /* Başlıklarda girinti olmaz */
}

/* ==========================================================================
   9. Reader Metadata & Controls
   ========================================================================== */
.study-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -10px;
    margin-bottom: 40px;
    font-family: var(--font-ui);
    color: var(--text-muted);
    font-size: 0.9rem;
	line-height: 1;
}
.study-meta .date {
    margin: 0;           /* Varsa dış boşlukları sıfırlar */
}
.meta-divider { color: var(--border-color); display: flex; align-items: center; }
.read-time { padding-left: 0em; font-weight: 500; }

.reader-controls {
    position: sticky;
    top: 20px;
    z-index: 1000;
    display: flex;
    align-items: center; /* Dikeyde grupları ortalar */
    
    background-color: var(--control-bg);
    border: 1px solid var(--border-color);
    padding: 15px 25px;
    margin: 30px 0;
    border-radius: 8px;
    font-family: var(--font-ui);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    width: fit-content;
    max-width: 100%;
    overflow: visible; /* Scroll'u tamamen kapatır */
}

/* Dikey hiyerarşi sağlayan yeni sınıf */
.control-group.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-buttons {
    display: flex;
    gap: 5px;
}

.control-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

/* Anasayfa butonu hizalaması (yazı tipiyle aynı hizada durması için) */
.home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-main) !important;
    text-decoration: none !important;
    padding: 8px 15px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.control-divider {
    height: 40px; /* Dikey kutuda ayırıcıyı uzatıyoruz */
    width: 1px;
    background-color: var(--border-color);
}

.home-btn:hover {
    color: var(--accent-color) !important;
}

.control-group { display: flex; align-items: center; gap: 8px; }
.control-label { letter-spacing: 1px; margin-right: 0px; text-transform: uppercase; }
.control-divider { width: 1px; height: 20px; background-color: var(--border-color); margin: 0 20px; transition: background-color 0.3s ease; }

.ctrl-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: all 0.2s ease;
}

.ctrl-btn:hover { border-color: var(--text-muted); }
.ctrl-btn.active { background-color: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }



/* Sidebar specific button adjustment */
.sidebar-widget .ctrl-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.sidebar-widget .ctrl-btn:hover {
    background-color: var(--accent-color);
    color: #FFF;
    border-color: var(--accent-color);
    text-decoration: none !important;
    border-bottom: 1px solid transparent !important;
}

/* Rastgele butonu için özel pastel mor stil */
.btn-random {
    background-color: #E9D4FF !important; /* İstediğiniz pastel açık mor */
    border: 1px solid #D8BFFF !important; /* Uyumlu, hafif koyu mor kenarlık */
    color: #433422 !important;            /* Okunabilirlik için koyu metin */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Üzerine gelindiğinde (Hover) */
.btn-random:hover {
    color: #000000 !important;            /* Yazı rengi mor aksan olur */
    transform: translateY(-2px);           /* Hafif yukarı zıplama efekti */
    box-shadow: 0 4px 15px rgba(194, 122, 255, 0.2); /* Morumsu yumuşak gölge */
    opacity: 1 !important;
}

/* Progress Bar */
#progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: transparent; z-index: 9999; }
#progress-bar { height: 100%; background-color: var(--accent-color); width: 0%; transition: width 0.1s ease-out; }

/* Read Badges */
.read-badge {
    display: inline-block;
    background-color: #CAD5E2;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.study-card:has(.read-badge) .card-title a { opacity: 0.7; }

.read-confirmation {
    margin: 80px 0 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
}

#mark-read-btn { padding: 12px 24px; font-size: 1rem; font-weight: 600; letter-spacing: 0.5px; border-radius: 50px; }
#mark-read-btn.active { cursor: default; background-color: var(--control-bg); color: var(--text-muted); border-color: var(--border-color); }

/* ==========================================================================
   10. Extra Modules (Archive, Popular Strips & Lists)
   ========================================================================== */
.archive-btn {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.archive-btn .arrow { transition: transform 0.3s ease; }
.archive-btn:hover { color: var(--accent-color); text-decoration: none; }
.archive-btn:hover .arrow { transform: translateX(5px); }

/* Sidebar Popüler Listesi */
.popular-list { list-style: none; padding: 0; margin: 0; }
.popular-list li { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); transition: border-color 0.3s ease; }
.popular-list li:last-child { border-bottom: none; }

.popular-link {
    display: block; font-size: 0.95rem; font-weight: 500; line-height: 1.4;
    color: var(--text-main); text-decoration: none !important;
    margin-bottom: 4px; transition: color 0.3s ease;
}

.popular-link:hover { color: var(--accent-color); text-decoration: none !important; }

.popular-views { font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; }

/* Yatay Popüler Strip (Index) */
.popular-strip { margin: 10px 0; padding: 30px; background-color: var(--control-bg); border-radius: 8px; }
.strip-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-top: 0; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.strip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.strip-item { text-decoration: none !important; display: flex; flex-direction: column; gap: 5px; }
.strip-item-title { font-size: 1.05rem; font-weight: 600; color: var(--text-main); line-height: 1.3; transition: color 0.3s ease; }
.strip-count { font-size: 0.7rem; font-weight: 700; color: var(--accent-color); text-transform: uppercase; }
.strip-item:hover .strip-item-title { color: var(--accent-color); }

/* ==========================================================================
   11. Animations Framework
   ========================================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInFromLeft {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
}

.study-card:nth-child(1) { animation-delay: 0.1s; }
.study-card:nth-child(2) { animation-delay: 0.2s; }
.study-card:nth-child(3) { animation-delay: 0.3s; }
.study-card:nth-child(4) { animation-delay: 0.4s; }
.study-card:nth-child(5) { animation-delay: 0.5s; }

.featured-card {
    animation: slideInFromLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    border-left: 4px solid var(--accent-color);
    padding-left: 30px; background-color: transparent;
}

.animated-card {
    opacity: 0; 
    animation: slideInRight 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
    padding-left: 25px; margin-bottom: 50px; transition: border-color 0.3s ease;
}

.animated-card:hover { border-left-color: var(--accent-color); }
.animated-card:nth-child(2) { animation-delay: 0.1s; }
.animated-card:nth-child(3) { animation-delay: 0.2s; }
.animated-card:nth-child(4) { animation-delay: 0.3s; }
.animated-card:nth-child(5) { animation-delay: 0.4s; }
.animated-card:nth-child(6) { animation-delay: 0.5s; }

.view-all-container { opacity: 0; animation: fadeInUp 0.6s ease 0.8s forwards; margin-top: 20px; }

/* ==========================================================================
   12. Mobile Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
    .layout-two-column {
        grid-template-columns: 1fr;
    }
    .site-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 20px; /* Saat ve menü arasındaki boşluk */
        padding: 20px 0;
    }
	
	/* Logo (Saat) alanının altındaki gereksiz boşlukları temizle */
    .site-title {
        margin: 0 auto;
    }
	
    /* Menü linklerini yan yana tut ama ortala */
    .main-nav {
        display: flex;
        justify-content: center;
        gap: 25px; /* Linkler arası ferah bir boşluk */
        margin-left: 0 !important; /* Varsa eski offsetleri sıfırla */
    }

    /* Linklerin stilini mobil için optimize et */
    .main-nav a {
        margin: 0 !important;
        padding: 5px 0;
        font-size: 0.95rem; /* Parmakla basıma uygun boyut */
    }
	
	/* Nano saat büyüklüğünü mobilde biraz daha kontrollü yap */
    #nano-clock {
        min-width: auto;
        font-size: 1.1rem;
    }
    .reader-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        width: 100%;
    }
    .home-text {
        display: none; /* Mobilde sadece oku göstererek yer kazandırır */
    }
    .control-divider {
        display: none;
    }
	
	.control-divider {
        margin: 0 10px;
    }

    /* Mobile-specific enhancements */
    .strip-grid {
        grid-template-columns: 1fr;
    }
    #story-body p:first-of-type::first-letter {
        font-size: 1.5rem; /* Better scaling for mobile */
    }
	
	#featured-slider-container {
        display: grid;         /* Slaytları aynı alana hapsetmek için grid */
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        min-height: auto !important;
        height: auto !important;

    }

    .slide {
        grid-area: 1 / 1 / 2 / 2; /* Tüm slaytlar aynı hücrede üst üste biner */
        position: relative !important; 
        opacity: 0;
        visibility: hidden;
        display: block !important; /* Artık display:none yapmıyoruz, yer kaplasınlar */
        transform: none !important;
        padding-left: 0;
        transition: opacity 0.8s ease-in-out; /* Daha hızlı bir geçiş sarsıntıyı azaltır */
    }

    .slide.active-slide {
        opacity: 1;
        visibility: visible;
        z-index: 2;
    }

    /* Çıkış yapan slaytın yavaşça kaybolurken yer kaplamaya devam etmesi */
    .slide.exit-slide {
        opacity: 0;
        visibility: visible;
        z-index: 1;
    }

    /* "Tüm Çalışmaları Gör" butonunun slider tarafından itilmesini sağlar */
    .archive-link-container {
        margin-top: 20px;
        clear: both;
        display: block;
    }

    /* Mobilde okuma alanının üstten boşluğunu ayarla (Header gittiği için) */
    .layout-single-column {
        margin-top: 40px;
    }
}

