/* =====================================================
   AI Content Engine — Article Styles
   Google-standard, Backlinko-inspired formatting
   ===================================================== */

/* ── Base content wrapper ─────────────────────────────────────────────────── */
.ace-article-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Georgia, serif;
    color: #1e293b;
    font-size: 17px;
    line-height: 1.8;
    max-width: 760px;
}

/* ── Paragraphs ───────────────────────────────────────────────────────────── */
.ace-article-body p {
    margin: 0 0 1.35em;
    line-height: 1.8;
}

.ace-article-body p.ace-intro {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.7;
    color: #0f172a;
    margin-bottom: 1.5em;
}

/* ── Headings — Google semantic hierarchy ─────────────────────────────────── */
.ace-article-body h2 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    color: #0f172a;
    margin: 2.2em 0 0.6em;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    letter-spacing: -0.3px;
}

.ace-article-body h2.ace-step {
    counter-increment: none;
}

.ace-article-body h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 1.8em 0 0.5em;
    line-height: 1.35;
}

.ace-article-body h4 {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    margin: 1.4em 0 0.4em;
    line-height: 1.4;
}

/* No heading deeper than H4 — style H5/H6 same as H4 if they slip through */
.ace-article-body h5,
.ace-article-body h6 {
    font-size: 16px;
    font-weight: 700;
    color: #475569;
    margin: 1.2em 0 0.4em;
}

/* ── Lists — clean, scannable ─────────────────────────────────────────────── */
.ace-article-body ul,
.ace-article-body ol,
.ace-article-body ul.ace-list,
.ace-article-body ol.ace-list {
    margin: 0 0 1.5em 0;
    padding-left: 26px;
}

.ace-article-body ul {
    list-style-type: disc;
}

.ace-article-body ul ul {
    list-style-type: circle;
    margin-top: 0.4em;
    margin-bottom: 0.4em;
}

.ace-article-body ol {
    list-style-type: decimal;
}

.ace-article-body li {
    margin-bottom: 0.55em;
    line-height: 1.7;
    font-size: 16px;
}

.ace-article-body li > p {
    margin-bottom: 0.3em;
}

/* ── Inline code ──────────────────────────────────────────────────────────── */
.ace-article-body code:not(pre code) {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    background: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* ── Code blocks ──────────────────────────────────────────────────────────── */
.ace-code-block {
    margin: 1.8em 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #334155;
    background: #0f172a;
    font-size: 14px;
}

.ace-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e293b;
    padding: 8px 16px;
    border-bottom: 1px solid #334155;
}

.ace-code-header span {
    color: #94a3b8;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ace-copy-btn {
    background: #334155;
    color: #94a3b8;
    border: none;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}

.ace-copy-btn:hover {
    background: #475569;
    color: #f1f5f9;
}

.ace-copy-btn.copied {
    background: #166534;
    color: #bbf7d0;
}

.ace-code-block pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    background: transparent;
    border: none;
}

.ace-code-block pre code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    color: #e2e8f0;
    background: transparent;
    padding: 0;
    border: none;
    white-space: pre;
    line-height: 1.65;
}

/* ── Images ───────────────────────────────────────────────────────────────── */
.ace-article-body figure.ace-image,
.ace-article-body .ace-image {
    margin: 2em 0;
    max-width: 100%;
}

.ace-article-body .ace-image img,
.ace-article-body figure.ace-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    display: block;
}

.ace-article-body figcaption,
.ace-article-body .ace-image figcaption {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
}

/* ── Pro Tip boxes ────────────────────────────────────────────────────────── */
.ace-article-body .ace-pro-tip {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 2em 0;
    font-size: 15.5px;
    line-height: 1.7;
}

.ace-article-body .ace-pro-tip strong {
    color: #1d4ed8;
    display: block;
    margin-bottom: 4px;
}

/* ── Blockquotes (pull quotes) ────────────────────────────────────────────── */
.ace-article-body blockquote {
    border-left: 4px solid #6366f1;
    margin: 2em 0;
    padding: 12px 20px;
    background: #f8f7ff;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #374151;
    font-size: 18px;
    line-height: 1.7;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.ace-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 15px;
}

.ace-article-body th {
    background: #f1f5f9;
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.ace-article-body td {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    vertical-align: top;
}

.ace-article-body tr:nth-child(even) td {
    background: #f8fafc;
}

/* ── Step headings special style ──────────────────────────────────────────── */
.ace-article-body h2.ace-step {
    color: #1e40af;
    border-bottom-color: #bfdbfe;
}

/* ── Bottom Line / Conclusion section ─────────────────────────────────────── */
.ace-article-body h2:last-of-type {
    margin-top: 2.5em;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ace-article-body { font-size: 16px; }
    .ace-article-body h2 { font-size: 22px; }
    .ace-article-body h3 { font-size: 19px; }
    .ace-article-body h4 { font-size: 16px; }
    .ace-code-block { font-size: 13px; border-radius: 6px; }
}
