/**
 * Hermes Writers Studio - Frontend content styles
 * Keeps HWS-generated tables consistent in published/previewed WordPress posts.
 */

.entry-content .hws-content-table-wrap,
.post-content .hws-content-table-wrap,
.wp-site-blocks .hws-content-table-wrap,
.hws-content-table-wrap {
    width: 100%;
    max-width: 100%;
    margin: 1.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    clear: both;
}

.entry-content .hws-content-table,
.post-content .hws-content-table,
.wp-site-blocks .hws-content-table,
.hws-content-table {
    --hws-front-table-border-width: 1px;
    --hws-front-table-border-color: #cbd5e1;
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    border-spacing: 0;
    direction: rtl;
    background: #ffffff;
    color: #0f172a;
    line-height: 1.9;
    text-align: right;
}

.entry-content .hws-content-table caption,
.post-content .hws-content-table caption,
.wp-site-blocks .hws-content-table caption,
.hws-content-table caption {
    caption-side: top;
    text-align: right;
    padding: 12px 14px;
    font-size: 0.95em;
    font-weight: 900;
    color: #334155;
    background: #f8fafc;
    border: var(--hws-front-table-border-width) solid var(--hws-front-table-border-color);
    border-bottom: 0;
}

.entry-content .hws-content-table th,
.entry-content .hws-content-table td,
.post-content .hws-content-table th,
.post-content .hws-content-table td,
.wp-site-blocks .hws-content-table th,
.wp-site-blocks .hws-content-table td,
.hws-content-table th,
.hws-content-table td {
    border: var(--hws-front-table-border-width) solid var(--hws-front-table-border-color);
    padding: 10px 12px;
    vertical-align: top;
    text-align: right;
}

.entry-content .hws-content-table th,
.post-content .hws-content-table th,
.wp-site-blocks .hws-content-table th,
.hws-content-table th {
    background: #f8fafc;
    font-weight: 900;
    color: #0f172a;
}

.entry-content .hws-content-table--striped tbody tr:nth-child(even) td,
.post-content .hws-content-table--striped tbody tr:nth-child(even) td,
.wp-site-blocks .hws-content-table--striped tbody tr:nth-child(even) td,
.hws-content-table--striped tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.entry-content .hws-content-table--striped tbody tr:nth-child(odd) td,
.post-content .hws-content-table--striped tbody tr:nth-child(odd) td,
.wp-site-blocks .hws-content-table--striped tbody tr:nth-child(odd) td,
.hws-content-table--striped tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.entry-content .hws-content-table--card,
.post-content .hws-content-table--card,
.wp-site-blocks .hws-content-table--card,
.hws-content-table--card {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.entry-content .hws-content-table--card th,
.post-content .hws-content-table--card th,
.wp-site-blocks .hws-content-table--card th,
.hws-content-table--card th {
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    color: #1e3a8a;
}

.entry-content .hws-content-table--card td,
.post-content .hws-content-table--card td,
.wp-site-blocks .hws-content-table--card td,
.hws-content-table--card td {
    background: #ffffff;
}

.hws-content-table.hws-table-border-0 { --hws-front-table-border-width: 0; }
.hws-content-table.hws-table-border-1 { --hws-front-table-border-width: 1px; }
.hws-content-table.hws-table-border-2 { --hws-front-table-border-width: 2px; }
.hws-content-table.hws-table-border-3 { --hws-front-table-border-width: 3px; }
.hws-content-table.hws-table-border-4 { --hws-front-table-border-width: 4px; }
.hws-content-table.hws-table-border-5 { --hws-front-table-border-width: 5px; }
.hws-content-table.hws-table-border-6 { --hws-front-table-border-width: 6px; }

.hws-content-table.hws-table-color-slate { --hws-front-table-border-color: #cbd5e1; }
.hws-content-table.hws-table-color-blue { --hws-front-table-border-color: #bfdbfe; }
.hws-content-table.hws-table-color-green { --hws-front-table-border-color: #bbf7d0; }
.hws-content-table.hws-table-color-amber { --hws-front-table-border-color: #fde68a; }
.hws-content-table.hws-table-color-red { --hws-front-table-border-color: #fecaca; }
.hws-content-table.hws-table-color-violet { --hws-front-table-border-color: #ddd6fe; }

@media (max-width: 720px) {
    .entry-content .hws-content-table,
    .post-content .hws-content-table,
    .wp-site-blocks .hws-content-table,
    .hws-content-table {
        min-width: 620px;
    }
}


/* v0.7.43: avoid theme/Gutenberg heavy black header borders on HWS tables */
.entry-content .hws-content-table-wrap.wp-block-table thead,
.post-content .hws-content-table-wrap.wp-block-table thead,
.wp-site-blocks .hws-content-table-wrap.wp-block-table thead,
.hws-content-table-wrap.wp-block-table thead,
.entry-content .hws-content-table thead,
.post-content .hws-content-table thead,
.wp-site-blocks .hws-content-table thead,
.hws-content-table thead {
    border-bottom: 0 !important;
}

.entry-content .hws-content-table caption.is-hidden,
.post-content .hws-content-table caption.is-hidden,
.wp-site-blocks .hws-content-table caption.is-hidden,
.hws-content-table caption.is-hidden {
    display: none !important;
}
