/* =============================================
   QUILL CONTENT RENDERER
   Styles Quill-generated HTML on the blog detail
   page WITHOUT breaking existing layout classes.
   ============================================= */

/* ── Scope everything under .blog-summary ── */

/* Headings */
.blog-summary h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #0a0a0a;
    margin: 2rem 0 1rem;
}

.blog-summary h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.4rem, 3.2vw, 2rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.01em;
    color: #0a0a0a;
    margin: 1.6rem 0 0.45rem;
}

.blog-summary h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.3;
    color: #111;
    margin: 1.3rem 0 0.35rem;
}

.blog-summary h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin: 1.1rem 0 0.3rem;
}

/* Paragraphs — line-height here is a default; Quill inline styles override it */
.blog-summary p {
    font-size: 1.02rem;
    line-height: 1.82;
    color: rgba(0, 0, 0, 0.74);
    margin-bottom: 1rem;
}

/* Empty lines (Enter key in Quill produces <p><br></p>) render as visible spacing */
.blog-summary p:has(> br:only-child) {
    min-height: 1.4em;
    margin-bottom: 0;
}

/* Strong & emphasis */
.blog-summary strong {
    font-weight: 700;
    color: #111;
}

.blog-summary em {
    font-style: italic;
}

.blog-summary u {
    text-underline-offset: 3px;
}

.blog-summary s {
    text-decoration: line-through;
    color: rgba(0, 0, 0, 0.5);
}

/* Links */
.blog-summary a {
    color: #0a0a0a;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 0, 0, 0.25);
    transition: text-decoration-color 0.2s ease;
}

.blog-summary a:hover {
    text-decoration-color: #0a0a0a;
}

/* Lists */
.blog-summary ul,
.blog-summary ol {
    padding-left: 1.6rem;
    margin-top: 0.35rem;
    margin-bottom: 0.9rem;
}

.blog-summary ul {
    list-style: disc;
}

.blog-summary ol {
    list-style: decimal;
}

.blog-summary li {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.72);
    margin-bottom: 0.18rem;
}

/* Quill sometimes wraps <li> content in <p> — strip that margin */
.blog-summary li p {
    margin-bottom: 0;
    line-height: inherit;
}

.blog-summary li::marker {
    color: #0a0a0a;
}

/* Tighten gap between a heading and the list that immediately follows it */
.blog-summary h1 + ul,
.blog-summary h1 + ol,
.blog-summary h2 + ul,
.blog-summary h2 + ol,
.blog-summary h3 + ul,
.blog-summary h3 + ol,
.blog-summary h4 + ul,
.blog-summary h4 + ol {
    margin-top: 0.1rem;
}

/* Nested lists */
.blog-summary ul ul,
.blog-summary ol ol,
.blog-summary ul ol,
.blog-summary ol ul {
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
}

/* Blockquotes */
.blog-summary blockquote {
    border-left: 4px solid #0a0a0a;
    margin: 1.8rem 0;
    padding: 1rem 0 1rem 1.5rem;
    background: transparent;
}

.blog-summary blockquote p {
    font-size: 1.08rem;
    font-style: italic;
    color: #444;
    line-height: 1.75;
    margin-bottom: 0;
}

/* Code blocks (Quill's pre.ql-syntax) */
.blog-summary pre,
.blog-summary pre.ql-syntax {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1.3rem 1.6rem;
    border-radius: 10px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Inline code */
.blog-summary code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.88em;
    color: #c7254e;
}

/* Don't double-style code inside pre */
.blog-summary pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

/* Images */
.blog-summary img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    display: block;
}

/* Videos (Quill embeds iframes) */
.blog-summary iframe,
.blog-summary .ql-video {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    border: none;
    margin: 1.5rem 0;
    display: block;
}

/* Horizontal rules */
.blog-summary hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

/* ── Quill alignment classes ── */
.blog-summary .ql-align-center {
    text-align: center;
}

.blog-summary .ql-align-right {
    text-align: right;
}

.blog-summary .ql-align-justify {
    text-align: justify;
}

/* ── Quill size classes ── */
.blog-summary .ql-size-small {
    font-size: 0.82rem;
}

.blog-summary .ql-size-large {
    font-size: 1.25rem;
}

.blog-summary .ql-size-huge {
    font-size: 1.6rem;
}

/* ── Quill indent classes ── */
.blog-summary .ql-indent-1 { padding-left: 2em; }
.blog-summary .ql-indent-2 { padding-left: 4em; }
.blog-summary .ql-indent-3 { padding-left: 6em; }
.blog-summary .ql-indent-4 { padding-left: 8em; }

/* ── Quill font classes ── */
.blog-summary .ql-font-serif {
    font-family: Georgia, 'Times New Roman', serif;
}

.blog-summary .ql-font-monospace {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Sub/Superscript ── */
.blog-summary sub {
    vertical-align: sub;
    font-size: 0.78em;
}

.blog-summary sup {
    vertical-align: super;
    font-size: 0.78em;
}

/* ── Tables (if Quill table module is added later) ── */
.blog-summary table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.blog-summary th,
.blog-summary td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.95rem;
}

.blog-summary th {
    background: #f5f5f3;
    font-weight: 700;
    color: #111;
}

/* ── First element margin reset ── */
.blog-summary > *:first-child {
    margin-top: 0;
}

.blog-summary > *:last-child {
    margin-bottom: 0;
}

/* ── Mobile adjustments ── */
@media (max-width: 640px) {
    .blog-summary h1 {
        font-size: 1.8rem;
    }

    .blog-summary h2 {
        font-size: 1.5rem;
    }

    .blog-summary h3 {
        font-size: 1.15rem;
    }

    .blog-summary p,
    .blog-summary li {
        font-size: 0.95rem;
    }

    .blog-summary pre {
        padding: 1rem;
        font-size: 0.82rem;
    }

    .blog-summary blockquote {
        padding-left: 1rem;
    }

    .blog-summary img {
        border-radius: 8px;
    }
}
