/* [table=…] shortcode — matches the warm brand palette */

.dri-table-shortcode {
    width: 100%;
    max-width: 100%;
    margin: 32px 0;
    border: 1px solid var(--brand-border, #e8d5be);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 16px 40px rgba(var(--brand-rgb, 212, 146, 42), .10);
}

.dri-table-shortcode__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--brand-border, #e8d5be);
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--brand-rgb, 212, 146, 42), .14) 0%, rgba(var(--brand-rgb, 212, 146, 42), 0) 45%),
        var(--brand-surface, #fdf8f1);
}

.dri-table-shortcode__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    min-width: 0;
}

.dri-table-shortcode__title {
    position: relative;
    margin: 0;
    padding-left: 16px;
    color: var(--brand-plum, #2c1a0e);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}

.dri-table-shortcode__title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 999px;
    background: var(--brand-action, #b87a1e);
}

.dri-table-shortcode__count {
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--brand-border, #e8d5be);
    color: var(--brand-hover, #9a6618);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    padding: 3px 12px;
    white-space: nowrap;
}

.dri-table-shortcode__search {
    position: relative;
    flex: 0 1 300px;
    margin: 0;
}

.dri-table-shortcode__search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-muted, #7a6a58);
    font-size: 13px;
    pointer-events: none;
}

.dri-table-shortcode__search input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--brand-border, #e8d5be);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-ink, #33261a);
    font-size: 14px;
    padding: 0 16px 0 38px;
    outline: 0;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.dri-table-shortcode__search input:focus {
    border-color: var(--brand-action, #b87a1e);
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb, 212, 146, 42), .15);
}

.dri-table-shortcode__empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--brand-muted, #7a6a58);
    font-size: 15px;
}

.dri-table-shortcode__scroll {
    max-width: 100%;
    max-height: 640px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.dri-table-shortcode__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    margin: 0;
}

.dri-table-shortcode__table th,
.dri-table-shortcode__table td {
    padding: 13px 18px;
    border-bottom: 1px solid #f1e6d7;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: normal;
}

.dri-table-shortcode__table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fbf3e6;
    color: var(--brand-hover, #9a6618);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--brand-border, #e8d5be);
}

.dri-table-shortcode__table td {
    color: var(--brand-ink, #33261a);
    font-size: 15px;
    line-height: 1.6;
}

.dri-table-shortcode__table tbody tr:nth-child(even) {
    background: #fffcf7;
}

.dri-table-shortcode__table tbody tr {
    transition: background-color .15s ease;
}

.dri-table-shortcode__table tbody tr:hover {
    background: #fdf1df;
}

.dri-table-shortcode__table th:first-child,
.dri-table-shortcode__table td:first-child {
    width: 66px;
    text-align: center;
    white-space: nowrap;
}

.dri-table-shortcode__table td:first-child {
    color: var(--brand-action, #b87a1e);
    font-weight: 800;
}

.dri-table-shortcode__table tbody tr:last-child td {
    border-bottom: 0;
}

/* Neutralise the generic `.builder-block-text table …` rules (4px borders, 15px padding) */
.dri-table-shortcode .dri-table-shortcode__table {
    width: 100%;
    margin: 0;
}

.dri-table-shortcode .dri-table-shortcode__table :is(thead, tbody, tfoot, tr) {
    border-width: 0;
    padding: 0;
}

.dri-table-shortcode .dri-table-shortcode__table :is(th, td) {
    border-width: 0 0 1px;
    border-style: solid;
    border-color: #f1e6d7;
    padding: 13px 18px;
}

.dri-table-shortcode .dri-table-shortcode__table th {
    border-color: var(--brand-border, #e8d5be);
}

.dri-table-shortcode .dri-table-shortcode__table tbody tr:last-child td {
    border-bottom-width: 0;
}

.dri-table-shortcode .dri-table-shortcode__title {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
}

.dri-table-shortcode__table tr[hidden],
.dri-table-shortcode__empty[hidden] {
    display: none !important;
}

.dri-table-shortcode__error {
    padding: 18px 20px;
    color: var(--brand-muted, #7a6a58);
    background: var(--brand-surface, #fdf8f1);
    text-align: center;
}

@media (max-width: 767px) {
    .dri-table-shortcode {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    .dri-table-shortcode__header {
        border: 1px solid var(--brand-border, #e8d5be);
        border-radius: 16px;
        margin-bottom: 14px;
        padding: 16px;
    }

    .dri-table-shortcode .dri-table-shortcode__title {
        font-size: 19px;
    }

    .dri-table-shortcode .dri-table-shortcode__table tr {
        border: 1px solid var(--brand-border, #e8d5be);
    }

    .dri-table-shortcode .dri-table-shortcode__table :is(th, td) {
        padding: 10px 14px;
    }

    .dri-table-shortcode .dri-table-shortcode__table tr td:last-child {
        border-bottom-width: 0;
    }

    .dri-table-shortcode__search {
        flex-basis: 100%;
    }

    .dri-table-shortcode__scroll {
        max-height: none;
        overflow: visible;
    }

    .dri-table-shortcode__table thead {
        display: none;
    }

    .dri-table-shortcode__table,
    .dri-table-shortcode__table tbody,
    .dri-table-shortcode__table tr,
    .dri-table-shortcode__table td {
        display: block;
        width: 100%;
    }

    .dri-table-shortcode__table tr {
        margin-bottom: 12px;
        border: 1px solid var(--brand-border, #e8d5be);
        border-radius: 14px;
        background: #fff !important;
        overflow: hidden;
        box-shadow: 0 8px 20px rgba(44, 26, 14, .05);
    }

    .dri-table-shortcode__table td {
        display: flex;
        gap: 16px;
        justify-content: space-between;
        align-items: flex-start;
        padding: 10px 14px;
        font-size: 14px;
        text-align: right;
    }

    .dri-table-shortcode__table td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        color: var(--brand-muted, #7a6a58);
        font-weight: 700;
        text-align: left;
    }

    .dri-table-shortcode__table td:first-child {
        width: auto;
        background: var(--brand-surface, #fdf8f1);
        text-align: right;
    }
}
