/*
 * AESV Components — FAQ, Pros/Cons, Plain Links, Editor Note, Tables
 * Version 1.3.0
 */

/* --- FAQ Accordion --- */
.aesv-faq details {
    border: 1px solid #dfe8e2 !important;
    border-radius: 12px !important;
    margin: 10px 0 !important;
    background: #fff !important;
    overflow: hidden !important;
}
.aesv-faq summary {
    cursor: pointer !important;
    font-weight: 700 !important;
    padding: 14px 64px 14px 16px !important;
    background: #f4f8f6 !important;
    color: #12352a !important;
    position: relative !important;
    list-style: none !important;
    transition: background 0.15s, box-shadow 0.15s !important;
}
.aesv-faq summary::-webkit-details-marker { display: none !important; }
.aesv-faq summary::marker { display: none !important; content: "" !important; }
.aesv-faq summary::after {
    content: "+" !important;
    position: absolute !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 30px !important;
    background: #173d2d !important;
    color: #fff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    transition: background 0.15s !important;
}
.aesv-faq details[open] summary::after {
    content: "\2212" !important;
    background: #173d2d !important;
}
.aesv-faq summary:hover {
    background: #e8f4ec !important;
    box-shadow: inset 0 0 0 1px rgba(47,125,79,0.25) !important;
}
.aesv-faq details .aesv-answer,
.entry-content .aesv-faq details .aesv-answer {
    padding: 14px 16px 16px !important;
}
.aesv-faq .aesv-answer p {
    margin: 0 !important;
    line-height: 1.65 !important;
    color: #243b35 !important;
}

/* --- Pros/Cons Boxes --- */
.aesv-pros-cons.aesv-pros-cons {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin: 18px 0 24px !important;
}
.aesv-pros-cons .aesv-pros,
.aesv-pros-cons .aesv-cons {
    background: #fff !important;
    border: 1px solid #dfe8e2 !important;
    border-radius: 12px !important;
    padding: 16px !important;
}

/*
 * H4 badge styles — must beat theme specificity (0,4,2)
 * via body.single-post .entry-content h4 !important
 */
body.single-post .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-pros h4,
body.single-post .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-cons h4,
body.page-template-default .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-pros h4,
body.page-template-default .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-cons h4,
body.blog .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-pros h4,
body.blog .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-cons h4 {
    margin: 0 0 12px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    display: inline-block !important;
    padding: 5px 14px !important;
    border-radius: 6px !important;
    border: 0 !important;
    font-family: inherit !important;
}
body.single-post .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-pros h4,
body.page-template-default .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-pros h4,
body.blog .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-pros h4 {
    color: #fff !important;
    background: #1a7a3a !important;
}
body.single-post .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-cons h4,
body.page-template-default .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-cons h4,
body.blog .entry-content .aesv-pros-cons.aesv-pros-cons .aesv-cons h4 {
    color: #fff !important;
    background: #b45309 !important;
}
.aesv-pros-cons ul, .aesv-pros-cons .aesv-visible-list {
    list-style: outside disc !important;
    padding-left: 1.25rem !important;
    margin: 0 !important;
}
.aesv-pros-cons li {
    display: list-item !important;
    margin: 7px 0 !important;
    line-height: 1.45 !important;
}

/* --- Responsive Tables --- */
.aesv-rwd-wrap,
.aesv-rwd-table-wrap,
figure.wp-block-table {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 18px 0 !important;
    max-width: 100% !important;
}
.aesv-comparison-table,
.aesv-projects-table,
.aesv-rwd-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.95rem !important;
}
.aesv-comparison-table th,
.aesv-projects-table th,
.aesv-rwd-table th {
    background: #173d2d !important;
    color: #fff !important;
    padding: 10px 14px !important;
    text-align: left !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}
.aesv-comparison-table td,
.aesv-projects-table td,
.aesv-rwd-table td {
    padding: 9px 14px !important;
    border-bottom: 1px solid #e5e7eb !important;
}
.aesv-comparison-table tr:nth-child(even),
.aesv-projects-table tr:nth-child(even),
.aesv-rwd-table tr:nth-child(even) {
    background: #f9fafb !important;
}

/* Mobile stacked cards */
@media (max-width: 768px) {
    .aesv-pros-cons,
    .aesv-pros-cons.aesv-pros-cons { grid-template-columns: 1fr !important; }

    .aesv-comparison-table,
    .aesv-projects-table,
    .aesv-rwd-table,
    .aesv-mobile-card-table {
        display: block !important;
        width: 100% !important;
    }
    .aesv-comparison-table thead,
    .aesv-projects-table thead,
    .aesv-rwd-table thead,
    .aesv-mobile-card-table thead {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0,0,0,0) !important;
    }
    .aesv-comparison-table tbody,
    .aesv-projects-table tbody,
    .aesv-rwd-table tbody,
    .aesv-mobile-card-table tbody {
        display: block !important;
    }
    .aesv-comparison-table tr,
    .aesv-projects-table tr,
    .aesv-rwd-table tr,
    .aesv-mobile-card-table tr {
        display: block !important;
        margin-bottom: 14px !important;
        border: 1px solid #dfe8e2 !important;
        border-radius: 10px !important;
        padding: 12px !important;
        background: #fff !important;
    }
    .aesv-comparison-table td,
    .aesv-projects-table td,
    .aesv-rwd-table td,
    .aesv-mobile-card-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: baseline !important;
        padding: 6px 0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
        text-align: right !important;
    }
    .aesv-comparison-table td::before,
    .aesv-projects-table td::before,
    .aesv-rwd-table td::before,
    .aesv-mobile-card-table td::before {
        content: attr(data-label) !important;
        font-weight: 700 !important;
        text-align: left !important;
        margin-right: 12px !important;
        flex-shrink: 0 !important;
        color: #173d2d !important;
    }
}

/* --- Plain Link Override --- */
.aesv-plain-link {
    background: transparent !important;
    color: #1a73e8 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: inline !important;
    text-decoration: underline !important;
    font-weight: inherit !important;
}

/* --- Editor Note Box --- */
.aesv-editor-note {
    background: #f0f7ff !important;
    border-left: 4px solid #0066cc !important;
    padding: 16px 20px !important;
    margin-bottom: 32px !important;
    border-radius: 4px !important;
}

/* --- Button Fix --- */
.entry-content .wp-block-button {
    display: inline-block !important;
    height: auto !important;
    padding-bottom: 20px !important;
    overflow: visible !important;
}
.entry-content .wp-block-buttons {
    overflow: visible !important;
    align-items: flex-start !important;
}
