/**
 * Blog post enhancements — meta bar, TOC, end-of-article CTA, FAQ accordion,
 * comparison tables. Enqueued on single posts by
 * includes/blog-post-enhancements.php. All rules scoped under .eh-post-* /
 * .eh-comparison-table so nothing leaks into other templates.
 */

.eh-post-meta-bar,
.eh-post-toc,
.eh-post-cta,
.eh-post-faqs {
    --eh-green: #00a67e;
    --eh-green-dark: #00875f;
    --eh-text: #1a1a2e;
    --eh-text-secondary: #6b7280;
    --eh-border: #e5e7eb;
    --eh-bg-light: #f9fafb;
    --eh-radius: 12px;
}

/* ---- Meta bar (reviewed by / updated) ---- */

.eh-post-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--eh-border);
    font-size: 0.9rem;
    color: var(--eh-text-secondary);
}

.eh-post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.eh-post-reviewed svg {
    color: var(--eh-green);
    flex-shrink: 0;
}

/* ---- "On this page" TOC ---- */

.eh-post-toc {
    background: var(--eh-bg-light);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius);
    padding: 20px 24px;
    margin: 0 0 32px;
}

.eh-post-toc-title {
    margin: 0 0 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--eh-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.eh-post-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 2;
    column-gap: 32px;
}

.eh-post-toc li {
    margin: 0 0 8px;
    break-inside: avoid;
    font-size: 0.95rem;
}

.eh-post-toc a {
    text-decoration: none;
}

.eh-post-toc a:hover {
    text-decoration: underline;
}

/* Anchor targets clear the sticky header when jumped to. */
h2[id] {
    scroll-margin-top: 96px;
}

/* ---- End-of-article CTA ---- */

.eh-post-cta {
    background: var(--eh-bg-light);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius);
    padding: 32px;
    margin: 40px 0 8px;
}

.eh-post-cta-heading {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.eh-post-cta-sub {
    margin: 0 0 18px;
    color: var(--eh-text-secondary);
}

.eh-post-cta-form {
    display: flex;
    gap: 10px;
    max-width: 560px;
}

.eh-post-cta-form input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid var(--eh-border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

.eh-post-cta-form input[type="text"]:focus {
    outline: none;
    border-color: var(--eh-green);
    box-shadow: 0 0 0 3px rgba(0, 166, 126, 0.15);
}

.eh-post-cta-form button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: var(--eh-green);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.eh-post-cta-form button:hover {
    background: var(--eh-green-dark);
}

.eh-post-trust {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--eh-border);
    border-radius: 8px;
}

.eh-post-trust-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    background: #eef2ff;
    color: #3b4bd8;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.eh-post-trust p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--eh-text-secondary);
}

.eh-post-trust strong {
    color: var(--eh-text);
}

@media (max-width: 600px) {
    .eh-post-cta {
        padding: 22px 18px;
    }

    .eh-post-cta-form {
        flex-direction: column;
    }

    .eh-post-toc ul {
        columns: 1;
    }
}

/* ---- FAQ accordion ([eh_faqs]) ---- */

.eh-post-faqs {
    margin: 24px 0;
}

.eh-post-faq-item {
    border: 1px solid var(--eh-border);
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
}

.eh-post-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.eh-post-faq-item summary::-webkit-details-marker {
    display: none;
}

.eh-post-faq-item summary::after {
    content: "";
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.eh-post-faq-item[open] summary::after {
    transform: rotate(-135deg);
}

.eh-post-faq-answer {
    padding: 0 18px 14px;
}

.eh-post-faq-answer p:last-child {
    margin-bottom: 0;
}

/* ---- Comparison table (pasted into post content) ---- */

.eh-table-scroll {
    overflow-x: auto;
    margin: 24px 0;
}

.eh-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.eh-comparison-table th,
.eh-comparison-table td {
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}

.eh-comparison-table th {
    background: #f9fafb;
    font-weight: 700;
    white-space: nowrap;
}

.eh-comparison-table tbody tr:nth-child(even) {
    background: #fcfcfd;
}
