/*
 * article.css
 * Shared styles for CMS-rendered HTML content (.cms-content).
 * Applied to help articles, API docs, and any page that renders
 * raw HTML from the CMS via @Html.Raw().
 */

/* ── Base ─────────────────────────────────────────────── */
.cms-content {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.75;
}

/* ── Headings ─────────────────────────────────────────── */
.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4,
.cms-content h5,
.cms-content h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.75rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

/* First heading needs no extra top space */
.cms-content > h1:first-child,
.cms-content > h2:first-child,
.cms-content > h3:first-child {
    margin-top: 0;
}

.cms-content h1 {
    font-size: 1.6rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.cms-content h2 {
    font-size: 1.3rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.4rem;
}

.cms-content h3 {
    font-size: 1.05rem;
    color: #374151;
}

.cms-content h4 {
    font-size: 0.975rem;
    color: #4b5563;
}

/* ── Paragraphs & lists ───────────────────────────────── */
.cms-content p {
    margin-bottom: 1rem;
}

.cms-content ul,
.cms-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.cms-content li {
    margin-bottom: 0.4rem;
}

.cms-content li > ul,
.cms-content li > ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* ── Inline code ──────────────────────────────────────── */
.cms-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85em;
    background-color: #f3f4f6;
    color: #d63384;
    padding: 0.15em 0.45em;
    border-radius: 5px;
    border: 1px solid #e5e7eb;
    word-break: break-word;
}

/* ── Code blocks ──────────────────────────────────────── */
.cms-content pre {
    position: relative;
    background-color: #0f1117;
    color: #e2e8f0;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.7;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Terminal-style header bar */
.cms-content pre::before {
    content: "";
    display: flex;
    align-items: center;
    background-color: #1e2130;
    height: 2.5rem;
    padding: 0 1rem;
    display: block;
    border-bottom: 1px solid #2d3148;
    background-image:
        radial-gradient(circle, #ff5f57 6px, transparent 6px),
        radial-gradient(circle, #febc2e 6px, transparent 6px),
        radial-gradient(circle, #28c840 6px, transparent 6px);
    background-repeat: no-repeat;
    background-size: 12px 12px;
    background-position: 14px center, 34px center, 54px center;
}

.cms-content pre code {
    display: block;
    padding: 1.25rem 1.5rem;
    background-color: transparent;
    color: inherit;
    border: none;
    border-radius: 0;
    font-size: inherit;
    word-break: normal;
    overflow-x: auto;
}

/* ── Blockquote ───────────────────────────────────────── */
.cms-content blockquote {
    border-left: 4px solid #818cf8;
    background-color: #f5f3ff;
    margin: 1.5rem 0;
    padding: 0.875rem 1.25rem;
    border-radius: 0 8px 8px 0;
    color: #374151;
}

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

/* ── Tables ───────────────────────────────────────────── */
.cms-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e5e7eb;
    display: block;
    overflow-x: auto;
}

.cms-content thead {
    background-color: #f8fafc;
}

.cms-content th {
    font-weight: 600;
    color: #374151;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.cms-content td {
    padding: 0.65rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}

.cms-content tr:last-child td {
    border-bottom: none;
}

.cms-content tbody tr:hover td {
    background-color: #f8fafc;
}

/* ── Links ────────────────────────────────────────────── */
.cms-content a {
    color: #6c63ff;
    text-decoration: none;
    font-weight: 500;
}

.cms-content a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Horizontal rule ──────────────────────────────────── */
.cms-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2.5rem 0;
}

/* ── Images ───────────────────────────────────────────── */
.cms-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 0.5rem 0;
}

/* ── Strong & em ──────────────────────────────────────── */
.cms-content strong {
    font-weight: 600;
    color: #111827;
}
