/**
 * Entry Content — Post/Page typography, tables, images, dark mode
 *
 * Applies to .entry-content inside single posts, pages, and WP editor.
 * Uses var(--pi-*) for all colors.
 */

/* ── Images ── */
.entry-content img {
    display: block;
    margin: 1.5rem auto;
    border-radius: 1rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    max-height: 70vh;
    object-fit: contain;
    width: auto;
    max-width: 100%;
    height: auto;
}
.entry-content figure { margin-left: auto; margin-right: auto; text-align: center; }
.entry-content .wp-block-image { display: flex; flex-direction: column; align-items: center; }
.entry-content .wp-caption-text,
.entry-content figcaption { font-size: 0.875rem; color: var(--pi-text-3, #94a3b8); margin-top: 0.5rem; }

/* ── Headings ── */
.entry-content h2 {
    font-size: 1.75rem; font-weight: 800; color: var(--pi-text, #0f172a);
    margin-top: 2.5rem; margin-bottom: 1rem;
    padding-left: 1rem; border-left: 4px solid var(--pi-primary, #007d3d);
    line-height: 1.3;
}
.entry-content h3 {
    font-size: 1.35rem; font-weight: 700; color: var(--pi-text, #0f172a);
    margin-top: 2rem; margin-bottom: 0.75rem; line-height: 1.35;
}
.entry-content h4 {
    font-size: 1.15rem; font-weight: 700; color: var(--pi-text, #0f172a);
    margin-top: 1.5rem; margin-bottom: 0.5rem;
}

/* ── Text ── */
.entry-content p { margin-bottom: 1rem; text-align: justify; color: var(--pi-text-2, #334155); }
.entry-content strong { color: var(--pi-text, #0f172a); font-weight: 700; }
.entry-content a { color: var(--pi-primary, #007d3d); font-weight: 600; }
.entry-content a:hover { text-decoration: underline; }

/* ── Lists ── */
.entry-content ul, .entry-content ol { padding-left: 1.5em; margin-bottom: 1rem; }
.entry-content li { margin-bottom: 0.35rem; color: var(--pi-text-2, #334155); }
.entry-content li::marker { color: var(--pi-primary, #007d3d); }

/* ── Blockquote ── */
.entry-content blockquote {
    border-left: 4px solid var(--pi-primary, #007d3d);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--pi-text-2, #334155);
    font-style: italic;
}

/* ── Code ── */
.entry-content code {
    background: var(--pi-bg-alt, #f1f5f9);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}
.entry-content pre {
    background: var(--pi-bg-alt, #f1f5f9) !important;
    border: 1px solid var(--pi-border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

/* ── HR ── */
.entry-content hr { border: none; border-top: 1px solid var(--pi-border, #e2e8f0); margin: 2rem 0; }

/* ── Tables ── */
table:not(#sh-pricing-table table),
.entry-content table:not(#sh-pricing-table table),
.wp-block-table table:not(#sh-pricing-table table),
article table:not(#sh-pricing-table table) {
    width: 100% !important; border-collapse: collapse !important;
    border-radius: 0.5rem !important; overflow: hidden !important;
    margin: 1.5rem 0 !important; font-size: 14px !important;
    border: 1px solid var(--pi-border, #e2e8f0) !important;
}

table:not(#sh-pricing-table table) th,
.entry-content table:not(#sh-pricing-table table) th,
article table:not(#sh-pricing-table table) th {
    background: var(--pi-primary, #007d3d) !important;
    color: #fff !important; font-weight: 700 !important;
    padding: 12px 16px !important; text-align: left !important;
    text-transform: uppercase !important; font-size: 12px !important;
    letter-spacing: 0.05em !important;
}

table:not(#sh-pricing-table table) td,
.entry-content table:not(#sh-pricing-table table) td,
article table:not(#sh-pricing-table table) td {
    padding: 12px 16px !important; border-bottom: 1px solid var(--pi-border, #e2e8f0) !important;
    color: var(--pi-text-2, #334155) !important; vertical-align: top !important;
    background-color: var(--pi-bg-card, #ffffff) !important;
}

/* Hover */
table:not(#sh-pricing-table table) tbody tr:hover td,
.entry-content table:not(#sh-pricing-table table) tbody tr:hover td,
article table:not(#sh-pricing-table table) tbody tr:hover td {
    background-color: var(--pi-bg-alt, #f1f5f9) !important;
    transition: background-color 0.2s ease !important;
}

/* Caption */
table caption, .entry-content table caption {
    font-size: 14px !important; color: var(--pi-text-3, #94a3b8) !important;
    margin-bottom: 8px !important; text-align: left !important; font-style: italic !important;
}

@media (max-width: 768px) {
    table:not(#sh-pricing-table table) th,
    table:not(#sh-pricing-table table) td { padding: 8px 10px !important; white-space: nowrap; }
}

/* ── SVG in content ── */
.entry-content svg:not([width]):not([class]) { max-width: 3rem; max-height: 3rem; }
.entry-content svg { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════ */
.dark .entry-content h2,
.dark .entry-content h3,
.dark .entry-content h4 { color: var(--pi-text, #f1f5f9) !important; }
.dark .entry-content p,
.dark .entry-content li,
.dark .entry-content td { color: var(--pi-text-2, #e2e8f0); }
.dark .entry-content strong { color: var(--pi-text, #f1f5f9); }
.dark .entry-content a { color: var(--pi-primary, #007d3d); }
.dark .entry-content a:hover { color: var(--pi-secondary, #fcd34d); }
.dark .entry-content blockquote { border-left-color: var(--pi-primary, #007d3d); color: var(--pi-text-2, #e2e8f0); }
.dark .entry-content code { background: var(--pi-bg-elevated, #334155); color: #f472b6; }
.dark .entry-content pre { background: var(--pi-bg-card, #1e293b) !important; border-color: var(--pi-border, #334155); }
.dark .entry-content hr { border-color: var(--pi-border, #334155); }
.dark .entry-content .wp-caption-text,
.dark .entry-content figcaption { color: var(--pi-text-3, #94a3b8); }
.dark .entry-content svg { color: var(--pi-text-2, #e2e8f0); }

/* Dark tables */
.dark .entry-content table th { background: var(--pi-bg-elevated, #334155) !important; color: var(--pi-text, #f1f5f9) !important; }
.dark .entry-content table td,
.dark table:not(#sh-pricing-table table) tbody td,
.dark article table tbody td { background-color: var(--pi-bg-card, #1e293b) !important; border-color: var(--pi-border, #334155) !important; }
.dark .entry-content table tbody tr:hover td,
.dark table:not(#sh-pricing-table table) tbody tr:hover td,
.dark article table tbody tr:hover td { background-color: var(--pi-bg-elevated, #334155) !important; }

/* Dark prose-project */
.dark .prose-project blockquote { background: rgba(0, 125, 61, 0.08); border-left-color: var(--pi-primary, #007d3d); }
.dark .prose-project blockquote p { color: var(--pi-text-2, #e2e8f0); }
.dark .prose-project img { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
