/**
 * RichEditor İçerik Stilleri
 * 
 * RichEditor'da H3/H2 kullanımı, frontend'de H6/H5 boyutunda görünsün.
 * Editör tarafında değişiklik yok, sadece görsel uyarlama.
 */

/* ==========================================
   RichEditor İçerik Container
   ========================================== */
.rich-content {
    line-height: 1.7;
    color: inherit;
}

/* ==========================================
   Başlık Boyutlandırmaları
   H3 → Küçük başlık (normal metinden büyük)
   H2 → Orta başlık (H3'ten daha büyük)
   ========================================== */

.rich-content h3 {
    /* Ara başlık boyutu */
    font-size: 1.5em;         /* 24px - Ara başlık (em kullanarak parent'tan etkilensin) */
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: inherit;
}

.rich-content h2 {
    /* Ana başlık boyutu */
    font-size: 1.75em;        /* 28px - Ana başlık (em kullanarak parent'tan etkilensin) */
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: inherit;
}

/* ==========================================
   Paragraf ve Metin
   ========================================== */

.rich-content p {
    font-size: 1em;  /* Parent container'dan font-size değişikliklerini al */
    margin-bottom: 1rem;
    line-height: 1.7;
}

.rich-content p:last-child {
    margin-bottom: 0;
}

/* Boş paragraflar */
.rich-content p:empty {
    min-height: 1rem;
}

/* ==========================================
   Listeler
   ========================================== */

.rich-content ul,
.rich-content ol {
    font-size: 1em;  /* Parent container'dan font-size değişikliklerini al */
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.rich-content ul {
    list-style-type: disc;
}

.rich-content ol {
    list-style-type: decimal;
}

.rich-content li {
    margin-bottom: 0.5rem;
}

.rich-content li:last-child {
    margin-bottom: 0;
}

/* İç içe listeler */
.rich-content ul ul,
.rich-content ol ol,
.rich-content ul ol,
.rich-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ==========================================
   Alıntı (Blockquote)
   ========================================== */

.rich-content blockquote {
    font-size: 1em;  /* Parent container'dan font-size değişikliklerini al */
    border-left: 4px solid currentColor;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    opacity: 0.8;
}

.rich-content blockquote p {
    margin-bottom: 0.5rem;
}

.rich-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ==========================================
   Bağlantılar (Links)
   ========================================== */

.rich-content a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
}

.rich-content a:hover {
    opacity: 0.7;
}

/* ==========================================
   Metin Formatları
   ========================================== */

.rich-content strong,
.rich-content b {
    font-weight: 700;
}

.rich-content em,
.rich-content i {
    font-style: italic;
}

.rich-content u {
    text-decoration: underline;
}

.rich-content s,
.rich-content strike {
    text-decoration: line-through;
}

/* ==========================================
   Görseller (Attachments)
   ========================================== */

.rich-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 0.5rem;
}

/* ==========================================
   Kod Blokları (Opsiyonel)
   ========================================== */

.rich-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.rich-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.rich-content pre code {
    background: transparent;
    padding: 0;
}

/* ==========================================
   Dark Mode Uyumluluğu
   ========================================== */

@media (prefers-color-scheme: dark) {
    .rich-content code {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .rich-content pre {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Dark mode toggle ile */
.dark .rich-content code {
    background: rgba(255, 255, 255, 0.1);
}

.dark .rich-content pre {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   Responsive Ayarlar
   ========================================== */

@media (max-width: 768px) {
    .rich-content h3 {
        font-size: 1.4em;    /* 22px - Ara başlık mobil (em kullanarak parent'tan etkilensin) */
        margin-top: 1.25rem;
    }
    
    .rich-content h2 {
        font-size: 1.6em;    /* 26px - Ana başlık mobil (em kullanarak parent'tan etkilensin) */
        margin-top: 1.5rem;
    }
    
    .rich-content ul,
    .rich-content ol {
        margin-left: 1.25rem;
    }
}

/* ==========================================
   İlk Başlık Özel (Üstte boşluk olmasın)
   ========================================== */

.rich-content > h2:first-child,
.rich-content > h3:first-child {
    margin-top: 0;
}
