/* Blog post body — rich HTML from CMS */
.post-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #374151;
    word-wrap: break-word;
}

/* Nested article from pasted HTML — hero already shows title */
.post-content > article > header > h1,
.post-content article > header > h1:first-child {
    display: none;
}

.post-content > article,
.post-content article,
.post-content section {
    margin: 0;
}

.post-content > article > header,
.post-content article > header {
    margin-bottom: 1.25rem;
    padding-bottom: 0;
    border: none;
}

.post-content p.subtitle,
.post-content .subtitle {
    font-size: 1.125rem;
    line-height: 1.65;
    color: #64748b;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(90deg, rgba(28, 57, 187, 0.06), rgba(0, 166, 147, 0.05));
    border-left: 4px solid #1C39BB;
    border-radius: 0 8px 8px 0;
}

.post-content h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.post-content h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8ecf4;
    letter-spacing: -0.02em;
}

.post-content h2:first-child,
.post-content section > h2:first-child {
    margin-top: 0;
}

.post-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1C39BB;
    margin: 1.5rem 0 0.65rem;
}

.post-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 1.25rem 0 0.5rem;
}

.post-content p {
    margin: 0 0 0.75rem;
}

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

.post-content p:empty {
    display: none;
    margin: 0;
}

.post-content section {
    margin: 1.25rem 0;
}

.post-content section:last-child {
    margin-bottom: 0;
}

.post-content section + section {
    margin-top: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin: 0.75rem 0 1.25rem;
    padding-left: 1.35rem;
}

.post-content li {
    margin-bottom: 0.45rem;
}

.post-content li::marker {
    color: #1C39BB;
}

.post-content blockquote {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #1C39BB;
    background: #f8fafc;
    border-radius: 0 10px 10px 0;
    color: #475569;
    font-style: italic;
}

.post-content a {
    color: #1C39BB;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: #00A693;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.25rem 0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.post-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 2rem 0;
}

.post-content strong,
.post-content b {
    color: #0f172a;
    font-weight: 700;
}

/* Tables */
.post-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 0.75rem 0 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    -webkit-overflow-scrolling: touch;
}

.post-table-wrap:not(:has(table)) {
    display: none !important;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

.post-content table,
.post-content table.post-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.55;
    background: #fff;
    margin: 0;
}

.post-content table th,
.post-content table td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e8ecf4;
}

.post-content table thead th,
.post-content table tr:first-child th {
    background: linear-gradient(135deg, #1C39BB 0%, #153A7A 55%, #0f172a 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: none;
    white-space: nowrap;
}

.post-content table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.post-content table tbody tr:hover {
    background: #f0f4ff;
}

.post-content table tbody tr:last-child td {
    border-bottom: none;
}

.post-content table td:first-child {
    font-weight: 600;
    color: #0f172a;
    min-width: 8rem;
}

.post-content table caption {
    caption-side: bottom;
    padding: 0.65rem 1rem;
    font-size: 0.8125rem;
    color: #64748b;
    text-align: left;
}

/* Two-column div layouts sometimes used instead of tables */
.post-content div[class*="table"],
.post-content div[class*="grid"] {
    margin: 1rem 0;
}

.post-content pre,
.post-content code {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.875rem;
}

.post-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.25rem 0;
}

@media (max-width: 640px) {
    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.25rem;
    }

    .post-content table th,
    .post-content table td {
        padding: 0.65rem 0.75rem;
        font-size: 0.875rem;
    }
}
