/* Elementor Table Builder – Frontend CSS */

/* ── Wrapper ─────────────────────────────────────────────── */
.etb-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Base Table ──────────────────────────────────────────── */
.etb-table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.etb-table-wrap table th,
.etb-table-wrap table td {
    word-break: break-word;
    hyphens: auto;
}

/* ── Sort Icons ──────────────────────────────────────────── */
.etb-sortable-col {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.etb-sort-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.75em;
    opacity: 0.5;
}
.etb-sort-icon::after {
    content: '↕';
}
.etb-sortable-col[aria-sort="ascending"]  .etb-sort-icon::after { content: '↑'; opacity: 1; }
.etb-sortable-col[aria-sort="descending"] .etb-sort-icon::after { content: '↓'; opacity: 1; }

/* ── Cell Elements ───────────────────────────────────────── */
.etb-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 3px;
    font-size: 0.82em;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.etb-cell-link {
    text-decoration: underline;
    text-underline-offset: 2px;
    color: inherit;
    transition: opacity 0.15s;
}
.etb-cell-link:hover { opacity: 0.75; }

.etb-cell-img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

.etb-cell-code {
    display: inline-block;
    background: rgba(0,0,0,0.07);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.etb-cell-heading {
    display: block;
    font-size: 1.05em;
}

/* ── Accordion in Cell ───────────────────────────────────── */
.etb-accordion {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    overflow: hidden;
}
.etb-accordion-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 6px 10px;
    background: rgba(0,0,0,0.04);
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    text-align: left;
    gap: 8px;
}
.etb-accordion-btn:hover { background: rgba(0,0,0,0.08); }
.etb-accordion-btn[aria-expanded="true"] .etb-accordion-icon { transform: rotate(45deg); }
.etb-accordion-icon {
    display: inline-block;
    font-size: 1.1em;
    line-height: 1;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.etb-accordion-body {
    padding: 8px 10px;
    font-size: 0.9em;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* ── Highlight Row ───────────────────────────────────────── */
.etb-row-highlight td {
    font-weight: 500;
}

/* ── Responsive / Stacked ────────────────────────────────── */
@media screen and (max-width: 600px) {
    .etb-responsive thead {
        display: none;
    }
    .etb-responsive tbody tr {
        display: block;
        margin-bottom: 12px;
        border-bottom: 2px solid rgba(0,0,0,0.1);
    }
    .etb-responsive tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 12px !important;
        text-align: right !important;
    }
    .etb-responsive tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        flex-shrink: 0;
        opacity: 0.75;
    }
}

/* ── Theme: Modern Dark (dark bg cells need light text) ─── */
.etb-theme-modern-dark td,
.etb-theme-modern-dark th {
    transition: background-color 0.15s;
}
