/**
 * WyConsent — cookie table (privacy-policy shortcode / editor block).
 *
 * Front-facing and theme-friendly: inherits the page typography and colours,
 * driving only a few neutral, override-friendly --wyco-ct-* custom properties.
 * Self-contained so it never clashes with the host theme. On narrow screens the
 * table collapses into stacked cards using each cell's data-label. No animation,
 * so no reduced-motion layer is needed.
 *
 * Loaded only where the shortcode/block is present (see Module::maybe_enqueue_*).
 */

.wyco-cookie-table {
	--wyco-ct-border: #e2e4e7;
	--wyco-ct-header-bg: #f6f7f7;
	--wyco-ct-muted: #646970;
	--wyco-ct-radius: 6px;

	margin: 1.5em 0;
	color: inherit;
	font-size: inherit;
}

.wyco-cookie-table__group {
	margin: 0 0 2em;
}

.wyco-cookie-table__title {
	margin: 0 0 0.5em;
	font-size: 1.15em;
	line-height: 1.3;
}

.wyco-cookie-table__table {
	width: 100%;
	border: 1px solid var(--wyco-ct-border);
	border-radius: var(--wyco-ct-radius);
	border-collapse: collapse;
	font-size: 0.95em;
}

.wyco-cookie-table__table th,
.wyco-cookie-table__table td {
	padding: 0.6em 0.8em;
	border-bottom: 1px solid var(--wyco-ct-border);
	text-align: left;
	vertical-align: top;
	word-break: break-word;
}

.wyco-cookie-table__table thead th {
	background: var(--wyco-ct-header-bg);
	font-weight: 600;
}

.wyco-cookie-table__table tbody th[scope="row"] {
	font-weight: 600;
}

.wyco-cookie-table__table tbody tr:last-child th,
.wyco-cookie-table__table tbody tr:last-child td {
	border-bottom: 0;
}

.wyco-cookie-table__updated {
	margin: 0.5em 0 0;
	color: var(--wyco-ct-muted);
	font-size: 0.85em;
}

.wyco-cookie-table--empty {
	color: var(--wyco-ct-muted);
}

.wyco-cookie-table__none {
	margin: 0 0 1em;
	color: var(--wyco-ct-muted);
	font-size: 0.9em;
	font-style: italic;
}

/* Stacked cards on narrow screens: each cell shows its column label. */
@media (max-width: 600px) {
	.wyco-cookie-table__table,
	.wyco-cookie-table__table tbody,
	.wyco-cookie-table__table tbody tr,
	.wyco-cookie-table__table th,
	.wyco-cookie-table__table td {
		display: block;
		width: 100%;
	}

	.wyco-cookie-table__table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.wyco-cookie-table__table tbody tr {
		margin-bottom: 1em;
		border: 1px solid var(--wyco-ct-border);
		border-radius: var(--wyco-ct-radius);
		overflow: hidden;
	}

	.wyco-cookie-table__table tbody th[scope="row"] {
		background: var(--wyco-ct-header-bg);
	}

	.wyco-cookie-table__table td::before {
		content: attr(data-label) ": ";
		display: inline-block;
		min-width: 6em;
		color: var(--wyco-ct-muted);
		font-weight: 600;
	}

	.wyco-cookie-table__table tbody tr td:last-child {
		border-bottom: 0;
	}
}
