/* ==========================================================
   Responsive tables — blog content (.blog-content) and tool
   pages (.table-custom). Works with /assets/js/responsive-tables.js,
   which adds .rt-wrap / .rt-stack and data-label attributes.
   ========================================================== */

/* Wrapper: card frame + horizontal scroll fallback */
.blog-content figure.table,
.blog-content .rt-wrap,
.table-responsive.rt-wrap {
    display: block;
    width: 100% !important;
    max-width: 100%;
    margin: 1.75rem 0 !important;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #001935;
    border: 1px solid rgba(86, 188, 138, 0.28);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
}

.blog-content figure.table > table,
.rt-wrap > table {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.blog-content figure.table figcaption {
    padding: .75rem 1.1rem;
    font-size: .85rem;
    color: #9fb3c2;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Table */
.blog-content table,
table.table-custom {
    width: 100% !important;
    max-width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    table-layout: auto;
    background: transparent;
    font-size: .95rem;
    line-height: 1.55;
}

.blog-content th,
.blog-content td,
table.table-custom th,
table.table-custom td {
    padding: .85rem 1.1rem !important;
    text-align: left;
    vertical-align: top;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    overflow-wrap: anywhere;
    hyphens: none;
}

.blog-content th + th,
.blog-content td + td,
table.table-custom th + th,
table.table-custom td + td {
    border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Header */
.blog-content thead th,
.blog-content th {
    background: #56bc8a;
    color: #001935;
    font-weight: 800;
    vertical-align: middle;
}
.blog-content th strong,
.blog-content th b { color: inherit; }

table.table-custom thead th {
    background: rgba(86, 188, 138, 0.15);
    color: #56bc8a;
    font-weight: 800;
    vertical-align: middle;
}

/* Body */
.blog-content td { color: #e2e8f0; }
table.table-custom td { color: #cbd5e1; }

.blog-content tbody tr:nth-child(even) td,
table.table-custom tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.blog-content tbody tr:hover td,
table.table-custom tbody tr:hover td {
    background: rgba(86, 188, 138, 0.08);
}

.blog-content tbody tr:last-child td,
table.table-custom tbody tr:last-child td {
    border-bottom: 0 !important;
}

.blog-content tbody td:first-child,
table.table-custom tbody td:first-child {
    color: #ffffff;
    font-weight: 600;
}

/* Tablet */
@media (max-width: 900px) {
    .blog-content th,
    .blog-content td,
    table.table-custom th,
    table.table-custom td {
        padding: .75rem .9rem !important;
        font-size: .92rem;
    }
}

/* Phone: each row becomes a card with its column label */
@media (max-width: 640px) {
    table.rt-stack thead {
        position: absolute !important;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    table.rt-stack,
    table.rt-stack tbody,
    table.rt-stack tr,
    table.rt-stack td {
        display: block;
        width: 100% !important;
    }

    table.rt-stack tr {
        padding: .4rem 0;
        border-bottom: 1px solid rgba(86, 188, 138, 0.25);
    }
    table.rt-stack tbody tr:last-child { border-bottom: 0; }

    table.rt-stack tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
    table.rt-stack tbody tr:nth-child(even) td,
    table.rt-stack tbody tr:hover td { background: transparent; }

    table.rt-stack td {
        padding: .45rem 1rem !important;
        border: 0 !important;
        font-size: .95rem;
    }
    table.rt-stack td + td { border-left: 0 !important; }

    table.rt-stack td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .15rem;
        font-size: .72rem;
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #56bc8a;
    }

    table.rt-stack td:first-child {
        padding-top: .8rem !important;
        font-size: 1rem;
        font-weight: 700;
        color: #ffffff;
    }
    table.rt-stack td:last-child { padding-bottom: .8rem !important; }

    /* Tables that stay tabular on phones (short values) */
    .blog-content table:not(.rt-stack) th,
    .blog-content table:not(.rt-stack) td,
    table.table-custom:not(.rt-stack) th,
    table.table-custom:not(.rt-stack) td {
        padding: .65rem .75rem !important;
        font-size: .88rem;
    }

    .blog-content figure.table,
    .blog-content .rt-wrap,
    .table-responsive.rt-wrap {
        margin: 1.5rem 0 !important;
        border-radius: 12px;
    }
}
