/* ==========================================================================
   HUB4STUDY UNIFIED EDITOR & VIEW STYLES (Marginalia Architecture)
   ================ ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.editor-content {
    font-family: 'Inter', sans-serif !important;
    font-size: 16px;
    line-height: 1.6;
    word-wrap: break-word;
    counter-reset: exCounter ntCounter hnCounter wrCounter eqCounter figCounter;
    position: relative;
    width: 100% !important;
}

/* Normal metinler ve bloklar %66.6'lık alanda kalacak */
.editor-content h1, 
.editor-content h2, 
.editor-content h3, 
.editor-content h4, 
.editor-content h5, 
.editor-content h6,
.editor-content p, 
.editor-content ul, 
.editor-content ol, 
.editor-content blockquote, 
.editor-content table, 
.editor-content hr, 
.editor-content figure.img-under {
    max-width: calc(66.666% - 1.5rem) !important;
}

.editor-content h1, 
.editor-content h2, 
.editor-content h3, 
.editor-content h4, 
.editor-content h5, 
.editor-content h6 {
    color: inherit;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.2;
    font-family: 'Inter', sans-serif !important;
    font-weight: 800 !important;
}

.editor-content h1 { font-size: 2.25em; }
.editor-content h2 { font-size: 1.75em; }
.editor-content h3 { font-size: 1.5em; }
.editor-content h4 { font-size: 1.25em; }
.editor-content h5 { font-size: 1.1em; }
.editor-content h6 { font-size: 1em; }

.editor-content strong, 
.editor-content b {
    font-weight: 800 !important;
    color: inherit;
}

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

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

.editor-content p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.editor-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.editor-content ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.editor-content a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.editor-content a:hover {
    text-decoration: underline;
}

.editor-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    color: #6b7280;
    font-style: italic;
    margin: 1rem 0;
}

html.dark .editor-content blockquote, 
.dark .editor-content blockquote {
    border-left-color: #4b5563;
    color: #9ca3af;
}

.editor-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.editor-content th, 
.editor-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
}

html.dark .editor-content th, html.dark .editor-content td,
.dark .editor-content th, .dark .editor-content td {
    border-color: #374151;
}

.editor-content figure.img-figure {
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
    counter-increment: figCounter;
}

html.dark .editor-content figure.img-figure,
.dark .editor-content figure.img-figure {
    background: #111827;
    border-color: #374151;
}

.editor-content .img-under {
    display: block;
    margin: 2rem 0;
    box-sizing: border-box;
}

.editor-content .img-right {
    float: right;
    width: 33.333%;
    max-width: 300px;
    margin: 0 0 1.5rem 1.5rem;
    clear: right;
}

.editor-content figcaption {
    text-align: center;
    font-size: 0.85em;
    color: #64748b;
    margin-top: 10px;
    line-height: 1.4;
}

html.dark .editor-content figcaption,
.dark .editor-content figcaption {
    color: #9ca3af;
}

.editor-content figcaption::before {
    content: 'Figure ' counter(figCounter) '. ';
    font-weight: 800;
    color: #3b82f6;
    margin-right: 4px;
}

html.dark .editor-content figcaption::before,
.dark .editor-content figcaption::before {
    color: #60a5fa;
}

/* ==========================================================================
   CALLOUT KUTULARI (Note, Example vb. - %66.6 Sütun Genişliği, İç Metin %100)
   ================ ========================================================== */

.editor-content .callout {
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    border-left: 4px solid;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    
    /* Kutu genişliği normal paragraflarla aynı olacak: %66.6 */
    max-width: calc(66.666% - 1.5rem) !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Kutu içindeki metinler ve başlıklar, kutunun kendi genişliğini (%100) tam dolduracak */
.editor-content .callout p,
.editor-content .callout ul,
.editor-content .callout ol,
.editor-content .callout div,
.editor-content .callout .callout-p,
.editor-content .callout-title {
    max-width: 100% !important;
    width: 100% !important;
}

.editor-content .callout-title {
    font-weight: 800 !important;
    margin-bottom: 0.75rem;
    display: block;
    font-size: 1.05em;
}

.editor-content .callout-p {
    margin: 0 !important;
}

.editor-content .c-example { counter-increment: exCounter; background: #f5f3ff; border-color: #8b5cf6; color: #5b21b6; }
.editor-content .c-example .callout-title::before { content: 'Example ' counter(exCounter); }
html.dark .editor-content .c-example, .dark .editor-content .c-example { background: #5b21b633; border-color: #8b5cf6; color: #ddd6fe; }

.editor-content .c-note { counter-increment: ntCounter; background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }
.editor-content .c-note .callout-title::before { content: 'Note ' counter(ntCounter); }
html.dark .editor-content .c-note, .dark .editor-content .c-note { background: #1e3a8a33; border-color: #3b82f6; color: #bfdbfe; }

.editor-content .c-hint { counter-increment: hnCounter; background: #f0fdf4; border-color: #10b981; color: #065f46; }
.editor-content .c-hint .callout-title::before { content: 'Hint ' counter(hnCounter); }
html.dark .editor-content .c-hint, .dark .editor-content .c-hint { background: #065f4633; border-color: #10b981; color: #a7f3d0; }

.editor-content .c-warning { counter-increment: wrCounter; background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.editor-content .c-warning .callout-title::before { content: 'Warning ' counter(wrCounter); }
html.dark .editor-content .c-warning, .dark .editor-content .c-warning { background: #991b1b33; border-color: #ef4444; color: #fecaca; }

.editor-content .c-formula { counter-increment: eqCounter; background: #f3f4f6; border-color: #6366f1; color: #3730a3; }
.editor-content .c-formula .callout-title::before { content: 'Equation ' counter(eqCounter); }
html.dark .editor-content .c-formula, .dark .editor-content .c-formula { background: #3730a333; border-color: #6366f1; color: #c7d2fe; }

@media (max-width: 1024px) {
    .editor-content h1, .editor-content h2, .editor-content h3, .editor-content h4, .editor-content h5, .editor-content h6, 
    .editor-content p, .editor-content ul, .editor-content ol, .editor-content blockquote, .editor-content table, 
    .editor-content hr, .editor-content .callout, .editor-content figure.img-under { 
        max-width: 100% !important; 
    }
    .editor-content .img-right { float: none; width: 100%; max-width: 100%; margin: 1.5rem 0; clear: both; }
}