/**
 * TREJKA Tables — front-end (and shared) table styles.
 * Self-contained: brand variables are declared locally so the table looks
 * correct on the front end without loading the admin stylesheet.
 */
.trejka-table-wrap {
	--tt-red:        #bc0000;
	--tt-head:       #bc0000;
	--tt-head-text:  #ffffff;
	--tt-border:     #e0e0e0;
	--tt-stripe:     #fff5f5;
	--tt-hover:      #fce8e8;
	--tt-text:       #1d2327;

	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0 0 1rem;
}

.trejka-table {
	border-collapse: collapse;
	width: 100%;
	background: #fff;
	color: var(--tt-text);
	font-size: 15px;
	line-height: 1.5;
}

.trejka-table caption {
	caption-side: top;
	text-align: left;
	font-weight: 600;
	padding: 0 0 8px;
	color: var(--tt-text);
}

.trejka-table th,
.trejka-table td {
	padding: 12px 16px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--tt-border);
}

.trejka-table thead th {
	background: var(--tt-head);
	color: var(--tt-head-text);
	font-weight: 600;
	border-bottom: none;
	white-space: nowrap;
}

.trejka-table.is-striped tbody tr:nth-child(even) {
	background: var(--tt-stripe);
}

.trejka-table.is-hover tbody tr:hover {
	background: var(--tt-hover);
}

.trejka-table.is-bordered {
	border: 1px solid var(--tt-border);
}
.trejka-table.is-bordered th,
.trejka-table.is-bordered td {
	border: 1px solid var(--tt-border);
}

.trejka-table.is-compact th,
.trejka-table.is-compact td {
	padding: 7px 10px;
	font-size: 14px;
}

/* ------------------------------------------------------------------
   Mobile stacking: each row becomes a card, cells labelled by header.
   Applies only to .is-stack tables on narrow screens.
------------------------------------------------------------------ */
@media screen and ( max-width: 600px ) {
	.trejka-table.is-stack {
		border: 0;
	}
	.trejka-table.is-stack thead {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect( 0 0 0 0 );
		border: 0;
	}
	.trejka-table.is-stack tbody tr {
		display: block;
		margin: 0 0 14px;
		border: 1px solid var(--tt-border);
		border-radius: 8px;
		overflow: hidden;
		background: #fff;
	}
	.trejka-table.is-stack.is-striped tbody tr:nth-child(even) {
		background: var(--tt-stripe);
	}
	.trejka-table.is-stack tbody td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 14px;
		width: auto;
		border: 0;
		border-bottom: 1px solid var(--tt-border);
		padding: 10px 14px;
		text-align: right;
	}
	.trejka-table.is-stack tbody tr td:last-child {
		border-bottom: 0;
	}
	.trejka-table.is-stack tbody td::before {
		content: attr( data-label );
		flex: 0 0 42%;
		font-weight: 600;
		text-align: left;
		color: var(--tt-text);
	}
	/* Cells without a header label span the full width. */
	.trejka-table.is-stack tbody td:not([data-label])::before {
		content: "";
		flex: 0;
	}
}
