/*
 * Content blocks (tables, quotes): loaded on the site and in the block editor (functions.php), so writers see
 * the published look while they write. Colors are the site tokens; in the editor (no tokens) the light values.
 *
 * Table styles (Table block -> Styles):   default: header row + row lines
 *   Blue header / سربرگ آبی                is-style-traia-blue   blue header, all cells bordered, bold first column
 *   Card / کارتی                           is-style-traia-card   rounded card, blue top edge, striped rows
 *   Stripes (WordPress)                    is-style-stripes      striped rows
 * Quote styles (Quote block -> Styles):   default: blue edge on a soft background
 *   Golden tip / نکته طلایی                is-style-traia-tip    yellow edge; pattern "Golden tip" adds the title
 */

/* ---- Tables ---- */
.wp-block-table { margin: 1.6em 0; overflow-x: auto; }
.wp-block-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.8; }
.wp-block-table table thead, .wp-block-table table tfoot { border: 0; }
.wp-block-table table th, .wp-block-table table td { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border, hsl(220 13% 91%)); text-align: start; vertical-align: top; }
.wp-block-table table th { background: var(--soft, hsl(220 14.3% 95.9%)); color: var(--text, hsl(220 20% 14%)); font-weight: 700; white-space: nowrap; }
.wp-block-table figcaption { margin-top: 8px; color: var(--muted, hsl(220 8.9% 46.1%)); font-size: 13px; text-align: center; }

/* Blue header */
.wp-block-table.is-style-traia-blue table { border: 1px solid var(--border, hsl(220 13% 91%)); }
.wp-block-table.is-style-traia-blue table th { background: var(--primary, hsl(217.2 91.2% 59.8%)); color: #fff; border-inline-start: 1px solid rgb(255 255 255 / .25); }
.wp-block-table.is-style-traia-blue table th:first-child { border-inline-start: 0; }
.wp-block-table.is-style-traia-blue table td { border: 1px solid var(--border, hsl(220 13% 91%)); }
.wp-block-table.is-style-traia-blue table tbody td:first-child { font-weight: 700; }

/* Card */
.wp-block-table.is-style-traia-card table { border: 1px solid var(--border, hsl(220 13% 91%)); border-top: 4px solid var(--primary, hsl(217.2 91.2% 59.8%)); border-radius: 16px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.wp-block-table.is-style-traia-card table th { background: var(--surface, #fff); }
.wp-block-table.is-style-traia-card table th + th, .wp-block-table.is-style-traia-card table td + td { border-inline-start: 1px solid var(--border, hsl(220 13% 91%)); }
.wp-block-table.is-style-traia-card table tbody tr:nth-child(even) { background: var(--soft, hsl(220 14.3% 95.9%)); }
.wp-block-table.is-style-traia-card table tbody tr:last-child td { border-bottom: 0; }

/* Stripes (WordPress's own style, in the site colors) */
.wp-block-table.is-style-stripes { border-bottom: 0; }
.wp-block-table.is-style-stripes table tbody tr:nth-child(odd) { background: var(--soft, hsl(220 14.3% 95.9%)); }
.wp-block-table.is-style-stripes table th { background: transparent; border-bottom: 2px solid var(--border, hsl(220 13% 91%)); }
.wp-block-table.is-style-stripes table td { border-bottom: 0; }

/* ---- Quotes ---- */
blockquote, .wp-block-quote { margin: 1.6em 0; padding: 16px 20px; border: 0; border-inline-start: 4px solid var(--primary, hsl(217.2 91.2% 59.8%)); border-start-end-radius: 12px; border-end-end-radius: 12px; background: var(--soft, hsl(220 14.3% 95.9%)); color: var(--text, hsl(220 20% 14%)); font-size: 16px; line-height: 1.9; }
.wp-block-quote > :first-child { margin-top: 0; }
.wp-block-quote > :last-child { margin-bottom: 0; }
.wp-block-quote p { margin: 0 0 .6em; }
.wp-block-quote cite { display: block; margin-top: 8px; color: var(--muted, hsl(220 8.9% 46.1%)); font-size: 13px; font-style: normal; }
.wp-block-quote cite::before { content: "— "; }

/* Golden tip */
.wp-block-quote.is-style-traia-tip { border: 1px solid hsl(45 90% 82%); border-inline-start: 4px solid hsl(45 95% 50%); background: hsl(45 100% 96%); }
.wp-block-quote.is-style-traia-tip > p:first-child strong { display: inline-block; font-size: 17px; font-weight: 800; }
:root[data-theme="dark"] .wp-block-quote.is-style-traia-tip { border-color: hsl(45 60% 30%); border-inline-start-color: hsl(45 95% 50%); background: hsl(45 60% 12% / .55); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) .wp-block-quote.is-style-traia-tip { border-color: hsl(45 60% 30%); border-inline-start-color: hsl(45 95% 50%); background: hsl(45 60% 12% / .55); }
}

/* WordPress's "Plain" quote style: no box. */
.wp-block-quote.is-style-plain { padding: 0; border: 0; background: none; }
