/**
 * Torque 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 ---------- */

.torque-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);
}

.torque-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). */
.torque-header .wp-block-site-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}

.torque-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/wrench.svg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 62%;
}

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

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

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

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

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

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

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

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

.torque-muted {
	opacity: 0.72;
}

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

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

.is-style-torque-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-torque-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-torque-card {
	height: 100%;
}

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

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

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

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

.wp-block-image.is-style-torque-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-torque-icon img {
	display: block;
	width: 100%;
	height: 100%;
}

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

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

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

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

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

.is-style-torque-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-torque-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-torque-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-torque-eyebrow,
.has-primary-deep-background-color .is-style-torque-eyebrow,
.has-ink-background-color .is-style-torque-eyebrow {
	color: inherit;
	opacity: 0.85;
}

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

.torque-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) ---------- */

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

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

.torque-rows p {
	margin: 0;
}

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

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

.torque-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;
}

.torque-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);
}

.torque-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 ---------- */

.torque-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-torque-card {
		transition: none;
	}

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

/* ================= Torque: auto repair look ================= */

/* Dark hero with subtle diagonal stripes */
.torque-hero {
	position: relative;
	overflow: hidden;
}

.torque-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--wp--preset--color--base) 4%, transparent) 0 2px, transparent 2px 22px);
	pointer-events: none;
}

.torque-hero > * {
	position: relative;
}

.torque-hero a:not(.wp-element-button) {
	color: inherit;
}

/* Cards get a primary accent bar on top */
.is-style-torque-card {
	border-top: 4px solid var(--wp--preset--color--primary);
}

/* Coupon / special offer card */
.torque-coupon {
	border: 2px dashed var(--wp--preset--color--primary);
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--base);
	padding: var(--wp--preset--spacing--50);
	height: 100%;
	box-sizing: border-box;
}

.torque-coupon__value {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--primary);
	text-transform: uppercase;
	margin: 0;
}

/* Numbered steps */
.torque-step-number {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var(--wp--custom--radius--sm);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	margin: 0;
}

/* Chips (makes we service) */
.torque-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 0;
}

.torque-chips span {
	display: inline-block;
	padding: .45rem .9rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--base);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
}

/* Trust row in the hero */
.torque-trust p {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin: 0;
	font-weight: 600;
}

.torque-trust p::before {
	content: "";
	width: 1.1rem;
	height: 1.1rem;
	flex: none;
	background-color: var(--wp--preset--color--accent);
	-webkit-mask: url("../images/icons/check.svg") center / contain no-repeat;
	mask: url("../images/icons/check.svg") center / contain no-repeat;
}

.torque-hero .is-style-torque-eyebrow {
	color: var(--wp--preset--color--accent);
	opacity: 1;
}
