/**
 * Dentora block styles (front end + editor).
 *
 * Rules for humans and AI agents:
 * - Use the design tokens only: var(--wp--preset--color--*), --font-size--*, --spacing--*,
 *   --shadow--*, and var(--wp--custom--radius--*). Never hard-code a colour here.
 * - Each section below is one block style or one helper class used by the patterns.
 */

/* ---------- Layout ---------- */

.wp-site-blocks > main,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Full-width sections sit edge to edge (no white strip between coloured bands). */
:where(.wp-site-blocks main, .wp-block-post-content) > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* ---------- Header ---------- */

.dentora-topbar a {
	color: inherit;
	font-weight: 600;
}

header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
}

.admin-bar header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.dentora-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	backdrop-filter: saturate(160%) blur(10px);
}

/* Brand mark in front of the site title (hidden once a logo is set). */
.dentora-header .wp-block-site-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}

.dentora-header .wp-block-site-title a::before {
	content: "";
	flex: none;
	width: 2.1rem;
	height: 2.1rem;
	border-radius: var(--wp--custom--radius--md);
	background-color: var(--wp--preset--color--primary);
	background-image: url("../images/icons/tooth.svg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 62%;
}

.dentora-header .wp-block-site-logo + .wp-block-site-title a::before {
	display: none;
}

@media (max-width: 781px) {
	.dentora-header-cta {
		display: none !important;
	}

	/* Keep the sticky header short on phones: show only the emergency phone line. */
	.dentora-topbar .wp-block-group > p:first-child {
		display: none;
	}

	.dentora-topbar .wp-block-group {
		justify-content: center !important;
	}
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50);
}

/* ---------- Footer ---------- */

.dentora-footer a {
	color: inherit;
	text-decoration: none;
}

.dentora-footer a:hover {
	text-decoration: underline;
}

.dentora-muted {
	opacity: 0.72;
}

.dentora-footer .wp-block-separator {
	opacity: 0.18;
}

/* ---------- Block style: Group "Card" ---------- */

.is-style-dentora-card {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--soft);
	padding: var(--wp--preset--spacing--50);
	box-sizing: border-box;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.is-style-dentora-card:has(a):hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--lifted);
}

/* Cards in a grid row share the same height. */
.is-layout-grid > .is-style-dentora-card {
	height: 100%;
}

/* ---------- Helper: 4-item grid (4 → 2 → 1 columns, never 3 + 1) ---------- */

@media (max-width: 1100px) {
	.wp-block-group.dentora-grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 599px) {
	.wp-block-group.dentora-grid-4 {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

/* ---------- Block style: Image "Icon tile" ---------- */

.wp-block-image.is-style-dentora-icon {
	width: 3.5rem;
	height: 3.5rem;
	padding: 0.85rem;
	margin: 0;
	box-sizing: border-box;
	border-radius: var(--wp--custom--radius--md);
	background-color: var(--wp--preset--color--primary);
}

.wp-block-image.is-style-dentora-icon img {
	display: block;
	width: 100%;
	height: 100%;
}

/* ---------- Block style: Image "Soft corners" ---------- */

.wp-block-image.is-style-dentora-soft img {
	border-radius: var(--wp--custom--radius--lg);
}

/* ---------- Block style: List "Checklist" ---------- */

.is-style-dentora-check {
	list-style: none;
	padding-left: 0;
}

.is-style-dentora-check li {
	position: relative;
	padding-left: 2rem;
	margin-block: 0.55rem;
}

.is-style-dentora-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 1.3rem;
	height: 1.3rem;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface-2);
}

.is-style-dentora-check li::after {
	content: "";
	position: absolute;
	left: 0.3rem;
	top: calc(0.2em + 0.3rem);
	width: 0.7rem;
	height: 0.7rem;
	background-color: var(--wp--preset--color--primary);
	-webkit-mask: url("../images/icons/check.svg") center / contain no-repeat;
	mask: url("../images/icons/check.svg") center / contain no-repeat;
}

/* ---------- Block style: Paragraph "Eyebrow" ---------- */

.is-style-dentora-eyebrow {
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: 0;
}

.has-primary-background-color .is-style-dentora-eyebrow,
.has-primary-deep-background-color .is-style-dentora-eyebrow,
.has-ink-background-color .is-style-dentora-eyebrow {
	color: inherit;
	opacity: 0.85;
}

/* ---------- Helper: badge / chip ---------- */

.dentora-badge {
	display: inline-block;
	width: fit-content;
	padding: 0.35rem 0.85rem;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface-2);
	color: var(--wp--preset--color--primary-deep);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

/* ---------- Helper: rows (price list, opening hours) ---------- */

.dentora-rows > .wp-block-group {
	padding-block: 0.8rem;
	border-bottom: 1px dashed var(--wp--preset--color--line);
	margin-block-start: 0;
}

.dentora-rows > .wp-block-group:last-child {
	border-bottom: 0;
}

.dentora-rows p {
	margin: 0;
}

.dentora-rows > .wp-block-group > p:last-child {
	font-weight: 600;
	white-space: nowrap;
}

/* ---------- Helper: hero booking card ---------- */

.dentora-slot {
	padding: 0.7rem 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	margin-block-start: 0.6rem !important;
}

.dentora-slot.is-picked {
	border-color: var(--wp--preset--color--primary);
	background-color: var(--wp--preset--color--surface);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--primary);
}

.dentora-slot p {
	margin: 0;
}

/* ---------- Details (FAQ) ---------- */

.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-block: var(--wp--preset--spacing--30);
}

.wp-block-details summary {
	cursor: pointer;
	list-style: none;
	position: relative;
	padding-right: 2.5rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 1.8rem;
	height: 1.8rem;
	line-height: 1.8rem;
	text-align: center;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface-2);
	color: var(--wp--preset--color--primary-deep);
	font-family: var(--wp--preset--font-family--body);
}

.wp-block-details[open] summary::after {
	content: "\2013";
}

.wp-block-details > :not(summary) {
	color: var(--wp--preset--color--ink-soft);
}

/* ---------- Posts ---------- */

.dentora-post-card .wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--md);
}

.wp-block-post-excerpt__more-link {
	font-weight: 600;
}

/* ---------- Accessibility ---------- */

:where(a, button, summary, input):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.is-style-dentora-card {
		transition: none;
	}

	.is-style-dentora-card:has(a):hover {
		transform: none;
	}
}
