/**
 * TinyMCE article body styles
 * IMPORTANT: Only HTML tag selectors — no classes or IDs from editor content.
 * All rules scoped to .blog-content wrapper.
 */

.blog-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--dm-ink);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Headings */
.blog-content h1 {
    font-family: "Cormorant Garamond", "Manrope", serif;
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 2.5rem 0 1.25rem;
    color: var(--dm-ink);
}

.blog-content h2 {
    font-family: "Cormorant Garamond", "Manrope", serif;
    font-size: clamp(1.65rem, 2.8vw, 2.15rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 2.25rem 0 1rem;
    color: var(--dm-ink);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--dm-mist);
}

.blog-content h3 {
    font-family: "Cormorant Garamond", "Manrope", serif;
    font-size: clamp(1.4rem, 2.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 2rem 0 0.85rem;
    color: var(--dm-ink);
}

.blog-content h4 {
    font-family: "Manrope", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 1.75rem 0 0.75rem;
    color: var(--dm-primary-dark);
}

.blog-content h5 {
    font-family: "Manrope", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 1.5rem 0 0.65rem;
    color: var(--dm-ink);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.blog-content h6 {
    font-family: "Manrope", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 1.25rem 0 0.5rem;
    color: var(--dm-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* First heading should not have excessive top margin */
.blog-content > h1:first-child,
.blog-content > h2:first-child,
.blog-content > h3:first-child,
.blog-content > h4:first-child,
.blog-content > h5:first-child,
.blog-content > h6:first-child {
    margin-top: 0;
}

/* Paragraphs */
.blog-content p {
    margin: 0 0 1.25rem;
    max-width: 72ch;
}

.blog-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.blog-content a {
    color: var(--dm-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.blog-content a:hover,
.blog-content a:focus {
    color: var(--dm-primary-dark);
}

/* Text emphasis */
.blog-content strong,
.blog-content b {
    font-weight: 700;
    color: var(--dm-ink);
}

.blog-content em,
.blog-content i {
    font-style: italic;
}

.blog-content u {
    text-underline-offset: 3px;
}

.blog-content mark {
    background: rgba(240, 199, 94, 0.45);
    color: var(--dm-ink);
    padding: 0 4px;
    border-radius: 3px;
}

.blog-content small {
    font-size: 0.875rem;
    color: var(--dm-muted);
}

.blog-content sup,
.blog-content sub {
    font-size: 0.75em;
    line-height: 0;
}

/* Inline and block code */
.blog-content code {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
    background: var(--dm-soft);
    color: var(--dm-primary-dark);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(176, 26, 105, 0.12);
}

.blog-content pre {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: #1a2332;
    color: #e8edf5;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.blog-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
    border-radius: 0;
}

/* Blockquote */
.blog-content blockquote {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--dm-primary);
    background: linear-gradient(135deg, rgba(176, 26, 105, 0.06), rgba(240, 199, 94, 0.08));
    border-radius: 0 12px 12px 0;
}

.blog-content blockquote p {
    margin-bottom: 0;
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(12, 27, 42, 0.85);
    max-width: none;
}

/* Lists */
.blog-content ul,
.blog-content ol {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
    max-width: 72ch;
}

.blog-content ul {
    list-style-type: disc;
}

.blog-content ol {
    list-style-type: decimal;
}

.blog-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.blog-content li > ul,
.blog-content li > ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Definition lists */
.blog-content dl {
    margin: 1.5rem 0;
    max-width: 72ch;
}

.blog-content dt {
    font-weight: 700;
    color: var(--dm-primary-dark);
    margin-top: 1rem;
}

.blog-content dt:first-child {
    margin-top: 0;
}

.blog-content dd {
    margin: 0.35rem 0 0 0;
    padding-left: 1rem;
    border-left: 2px solid var(--dm-mist);
    color: var(--dm-muted);
}

/* Images and figures */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 1.5rem 0;
}

.blog-content figure {
    margin: 2rem 0;
}

.blog-content figure img {
    margin: 0;
    width: 100%;
}

.blog-content figcaption {
    font-size: 0.9rem;
    color: var(--dm-muted);
    text-align: center;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Tables */
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.95rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.blog-content thead {
    background: var(--dm-mist);
}

.blog-content th,
.blog-content td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid rgba(12, 27, 42, 0.1);
    min-width: 120px;
}

.blog-content th {
    font-weight: 700;
    color: var(--dm-primary-dark);
    white-space: nowrap;
}

.blog-content tbody tr:nth-child(even) {
    background: rgba(247, 241, 246, 0.5);
}

.blog-content tbody tr:hover {
    background: rgba(176, 26, 105, 0.04);
}

/* Horizontal rule */
.blog-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dm-mist), transparent);
    margin: 2.5rem 0;
}

/* Embedded media */
.blog-content iframe,
.blog-content video {
    max-width: 100%;
    width: 100%;
    border: none;
    border-radius: 12px;
    margin: 1.5rem 0;
    aspect-ratio: 16 / 9;
}

.blog-content audio {
    width: 100%;
    margin: 1.5rem 0;
}

/* Mobile typography adjustments */
@media (max-width: 767px) {
    .blog-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .blog-content pre {
        font-size: 0.82rem;
        padding: 1rem;
    }

    .blog-content blockquote {
        padding: 1rem 1.15rem;
    }

    .blog-content blockquote p {
        font-size: 1rem;
    }

    .blog-content th,
    .blog-content td {
        padding: 10px 12px;
        font-size: 0.88rem;
    }
}

@media (max-width: 480px) {
    .blog-content ul,
    .blog-content ol {
        padding-left: 1.25rem;
    }
}
