/* Frontend polish for generated content blocks (camera/lens/accessories). */
body.single-camera :is(.entry-content, .wp-block-post-content, article),
body.single-lens :is(.entry-content, .wp-block-post-content, article),
body.single-accessories :is(.entry-content, .wp-block-post-content, article) {
    --cpa-sec-bg: #131b32;
    --cpa-sec-bg-soft: #1b2442;
    --cpa-sec-br: rgba(124, 155, 255, 0.25);
    --cpa-sec-text: #eaf0ff;
    --cpa-sec-muted: #b8c6ee;
    --cpa-pro: #22c55e;
    --cpa-con: #ef4444;
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="technical-spec"], h2[id*="key-spec"], h2[id*="pros-cons"], h2[id*="pros-and-cons"]),
body.single-lens :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="technical-spec"], h2[id*="key-spec"], h2[id*="pros-cons"], h2[id*="pros-and-cons"]),
body.single-accessories :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="technical-spec"], h2[id*="key-spec"], h2[id*="pros-cons"], h2[id*="pros-and-cons"]),
body.single-camera :is(.entry-content, .wp-block-post-content, article) h2:has(+ table),
body.single-lens :is(.entry-content, .wp-block-post-content, article) h2:has(+ table),
body.single-accessories :is(.entry-content, .wp-block-post-content, article) h2:has(+ table) {
    margin: 1.6rem 0 0.9rem;
    padding: 0.8rem 1rem;
    border-left: 4px solid #5f86ff;
    border-radius: 0 12px 12px 0;
    background: linear-gradient(90deg, rgba(95, 134, 255, 0.22), rgba(95, 134, 255, 0.08));
    color: var(--cpa-sec-text);
    letter-spacing: 0.01em;
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) table,
body.single-lens :is(.entry-content, .wp-block-post-content, article) table,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0.95rem 0 1.5rem;
    background: var(--cpa-sec-bg);
    border: 1px solid var(--cpa-sec-br);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(6, 10, 24, 0.32);
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) table thead th,
body.single-lens :is(.entry-content, .wp-block-post-content, article) table thead th,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) table thead th,
body.single-camera :is(.entry-content, .wp-block-post-content, article) table th,
body.single-lens :is(.entry-content, .wp-block-post-content, article) table th,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) table th {
    background: var(--cpa-sec-bg-soft);
    color: var(--cpa-sec-text);
    font-weight: 700;
    text-align: left;
    padding: 0.82rem 0.9rem;
    border-bottom: 1px solid var(--cpa-sec-br);
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) table td,
body.single-lens :is(.entry-content, .wp-block-post-content, article) table td,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) table td {
    padding: 0.75rem 0.9rem;
    color: var(--cpa-sec-muted);
    border-bottom: 1px solid rgba(124, 155, 255, 0.12);
    vertical-align: top;
    line-height: 1.45;
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) table tbody tr:nth-child(even) td,
body.single-lens :is(.entry-content, .wp-block-post-content, article) table tbody tr:nth-child(even) td,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) table tbody tr:last-child td,
body.single-lens :is(.entry-content, .wp-block-post-content, article) table tbody tr:last-child td,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) table tbody tr:last-child td {
    border-bottom: 0;
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="pros-cons"], h2[id*="pros-and-cons"]) + table th:first-child,
body.single-lens :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="pros-cons"], h2[id*="pros-and-cons"]) + table th:first-child,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="pros-cons"], h2[id*="pros-and-cons"]) + table th:first-child {
    color: var(--cpa-pro);
}

body.single-camera :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="pros-cons"], h2[id*="pros-and-cons"]) + table th:last-child,
body.single-lens :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="pros-cons"], h2[id*="pros-and-cons"]) + table th:last-child,
body.single-accessories :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="pros-cons"], h2[id*="pros-and-cons"]) + table th:last-child {
    color: var(--cpa-con);
}

@media (max-width: 760px) {
    body.single-camera :is(.entry-content, .wp-block-post-content, article) table,
    body.single-lens :is(.entry-content, .wp-block-post-content, article) table,
    body.single-accessories :is(.entry-content, .wp-block-post-content, article) table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    body.single-camera :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="technical-spec"], h2[id*="key-spec"], h2[id*="pros-cons"], h2[id*="pros-and-cons"]),
    body.single-lens :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="technical-spec"], h2[id*="key-spec"], h2[id*="pros-cons"], h2[id*="pros-and-cons"]),
    body.single-accessories :is(.entry-content, .wp-block-post-content, article) :is(h2[id*="technical-spec"], h2[id*="key-spec"], h2[id*="pros-cons"], h2[id*="pros-and-cons"]),
    body.single-camera :is(.entry-content, .wp-block-post-content, article) h2:has(+ table),
    body.single-lens :is(.entry-content, .wp-block-post-content, article) h2:has(+ table),
    body.single-accessories :is(.entry-content, .wp-block-post-content, article) h2:has(+ table) {
        padding: 0.7rem 0.8rem;
        font-size: 1.06rem;
    }
}
