/* "Dark" page template: dark page (theme ink), white text and links.
   Body class is added in functions.php; :has() is a no-PHP fallback. */
body.tsom-dark-page,
body:has(main.tsom-dark) {
	background-color: var(--wp--preset--color--ink, #1a1a1a);
}

main.tsom-dark {
	background-color: var(--wp--preset--color--ink, #1a1a1a);
	color: var(--wp--preset--color--paper, #fafafa);
}

/* Links: white and underlined (the theme red is too dim on black).
   Plugin anchors (a[class*="tsom-"]) and buttons style themselves. */
main.tsom-dark a:not(.wp-element-button, .wp-block-button__link, [class*="tsom-"]) {
	color: #fff;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}
main.tsom-dark a:not(.wp-element-button, .wp-block-button__link, [class*="tsom-"]):is(:hover, :focus-visible) {
	text-decoration-thickness: 3px;
}

/* Light surfaces keep dark text and the normal accent links. */
main.tsom-dark :is(.tsom-booking-block, .tsom-service-row, .tsom-booking-modal, .tsom-pay-modal),
main.tsom-dark .has-background:not(.has-text-color, .wp-element-button, .wp-block-button__link) {
	color: var(--wp--preset--color--ink, #1a1a1a);
}
main.tsom-dark :is(.tsom-booking-block, .tsom-service-row, .tsom-booking-modal, .tsom-pay-modal) a:not(.wp-element-button, .wp-block-button__link, [class*="tsom-"]),
main.tsom-dark .has-background:not(.has-text-color) a:not(.wp-element-button, .wp-block-button__link, [class*="tsom-"]) {
	color: var(--wp--preset--color--accent, #c8362e);
}
main.tsom-dark :is(.tsom-booking-block, .tsom-service-row) {
	background-color: var(--wp--preset--color--paper, #fafafa);
	border-radius: 6px;
	padding: 1rem;
}

/* Default buttons: the parent's contrast/base tokens don't exist in this
   palette, so a plain button would be see-through. Give it the accent red.
   Outline buttons stay outlined, in white. */
main.tsom-dark .wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background) {
	background-color: var(--wp--preset--color--accent, #c8362e);
	color: #fff;
	text-decoration: none;
}
main.tsom-dark .wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background):hover {
	background-color: #a82b24;
}
main.tsom-dark .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: #fff;
	text-decoration: none;
}

/* Groups with their own text colour: links follow it. */
main.tsom-dark .has-background.has-text-color a:not(.wp-element-button, .wp-block-button__link, [class*="tsom-"]) {
	color: inherit;
}

/* Outline buttons on light surfaces follow that surface's text colour. */
main.tsom-dark :is(.has-background, .tsom-booking-block, .tsom-service-row) .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: inherit;
}
