/*
 * Salon Booking display blocks (spaces, pricing, amenities, testimonials, hours, branches,
 * house rules). Same token contract as booking.css (docs/02-theme-contract.md): every
 * colour, font, size, radius, shadow and control height is a theme token with a fallback,
 * so the blocks also look right under any other theme. No external fonts or images.
 * Card cuts (is-style-sbk-cut-*) and the site-wide card look come from the theme's looks.css.
 */

/* Bundled face (OFL), same file as the booking form. */
@font-face {
	font-family: "SBK Vazirmatn";
	src: url("../fonts/Vazirmatn-wght.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

.sbk-blk {
	--sbk-blk-bg: var(--wp--preset--color--base, #fff);
	--sbk-blk-surface: var(--wp--preset--color--surface, #f3f6f6);
	--sbk-blk-surface-2: var(--wp--preset--color--surface-2, #e7eded);
	--sbk-blk-ink: var(--wp--preset--color--contrast, #1b2227);
	--sbk-blk-muted: var(--wp--preset--color--muted, #55626a);
	--sbk-blk-line: var(--wp--preset--color--line, #d9e0e2);
	--sbk-blk-accent: var(--wp--preset--color--accent, #0f766e);
	--sbk-blk-accent-ink: var(--wp--preset--color--accent-ink, #fff);
	--sbk-blk-accent-soft: var(--wp--preset--color--accent-soft, #e3f3f1);
	--sbk-blk-border: var(--wp--custom--border--width, 1px);
	--sbk-blk-radius-sm: var(--wp--custom--radius--small, 6px);
	--sbk-blk-radius: var(--wp--custom--radius--medium, 10px);
	--sbk-blk-radius-lg: var(--wp--custom--sbk--card-radius, var(--wp--custom--radius--large, 14px));
	--sbk-blk-radius-pill: var(--wp--custom--radius--pill, 999px);
	--sbk-blk-shadow-card: var(--wp--custom--shadow--card, none);
	--sbk-blk-shadow-raised: var(--wp--custom--shadow--raised, 0 1px 3px rgb(0 0 0 / 12%));
	--sbk-blk-control: var(--wp--custom--sbk--control-height, 48px);
	--sbk-blk-font: var(--wp--preset--font-family--body, "SBK Vazirmatn"), "SBK Vazirmatn", tahoma, sans-serif;
	--sbk-blk-font-heading: var(--wp--preset--font-family--heading, var(--wp--preset--font-family--body, "SBK Vazirmatn")), "SBK Vazirmatn", tahoma, sans-serif;
	--sbk-blk-cols: 3;

	font-family: var(--sbk-blk-font);
	font-size: var(--wp--preset--font-size--medium, 1rem);
	line-height: 1.8;
	color: var(--sbk-blk-ink);
	direction: rtl;
	text-align: right;
}

.sbk-blk *,
.sbk-blk *::before,
.sbk-blk *::after {
	box-sizing: border-box;
}

/* Never inherit the host theme's typography: no spaced-out Persian, no uppercase. */
.sbk-blk,
.sbk-blk :is(h1, h2, h3, h4, p, span, a, li, th, td, caption, cite, blockquote, figcaption, strong, bdi) {
	letter-spacing: 0;
	text-transform: none;
	word-spacing: normal;
}

.sbk-blk :is(h2, h3, h4) {
	font-family: var(--sbk-blk-font-heading);
	line-height: 1.5;
	margin: 0;
}

.sbk-blk bdi {
	unicode-bidi: isolate;
}

.sbk-blk p {
	margin: 0;
}

.sbk-blk :is(ul, ol)[role="list"] {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sbk-vh {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.sbk-blk-name {
	display: block;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium, 1.05rem);
	font-style: normal;
}

.sbk-blk-desc,
.sbk-blk-meta {
	display: block;
	color: var(--sbk-blk-muted);
	font-size: var(--wp--preset--font-size--small, 0.92rem);
}

.sbk-blk-kicker {
	color: var(--sbk-blk-accent);
	font-size: var(--wp--preset--font-size--small, 0.88rem);
	font-weight: 600;
}

.sbk-blk-price {
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.sbk-blk-unit {
	color: var(--sbk-blk-muted);
	font-size: var(--wp--preset--font-size--small, 0.88rem);
	white-space: nowrap;
}

.sbk-blk-group {
	margin: 20px 0 8px;
}

.sbk-blk-group:first-child {
	margin-top: 0;
}

/* Capacity · session length. */
.sbk-blk-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	color: var(--sbk-blk-muted);
	font-size: var(--wp--preset--font-size--small, 0.88rem);
}

.sbk-blk-fact::before {
	content: "";
	display: inline-block;
	inline-size: 0.5em;
	block-size: 0.5em;
	margin-inline-end: 0.45em;
	border-radius: 50%;
	background: var(--sbk-blk-accent);
	vertical-align: 0.1em;
}

/* Booking link: a real button-sized target. */
.sbk-blk-book {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-block-size: max(44px, calc(var(--sbk-blk-control) - 4px));
	min-inline-size: 88px;
	padding: 6px 18px;
	border-radius: var(--sbk-blk-radius);
	background: var(--sbk-blk-accent);
	color: var(--sbk-blk-accent-ink);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	flex: none;
}

.sbk-blk-book:hover,
.sbk-blk-book:focus {
	color: var(--sbk-blk-accent-ink);
	background: color-mix(in srgb, var(--sbk-blk-accent) 88%, var(--sbk-blk-ink));
}

.sbk-blk :is(a, input, button):focus-visible {
	outline: 2px solid var(--sbk-blk-accent);
	outline-offset: 2px;
	box-shadow: 0 0 0 4px var(--sbk-blk-bg);
}

/* Chips: amenities on cards and the chips layout. */
.sbk-blk-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sbk-blk-chip {
	display: inline-flex;
	align-items: center;
	min-block-size: 36px;
	padding: 4px 14px;
	border: var(--sbk-blk-border) solid var(--sbk-blk-line);
	border-radius: var(--sbk-blk-radius-pill);
	background: var(--sbk-blk-bg);
	font-size: var(--wp--preset--font-size--small, 0.92rem);
}

.sbk-blk-chip::before {
	content: "";
	display: inline-block;
	inline-size: 0.4em;
	block-size: 0.75em;
	margin-inline-end: 0.55em;
	border: solid var(--sbk-blk-accent);
	border-width: 0 0.15em 0.15em 0;
	transform: rotate(45deg) translateY(-0.1em);
}

.sbk-blk-chips.is-small {
	gap: 6px;
}

.sbk-blk-chips.is-small .sbk-blk-chip {
	min-block-size: 28px;
	padding: 1px 10px;
	background: var(--sbk-blk-surface);
	border-color: transparent;
	font-size: var(--wp--preset--font-size--x-small, 0.8rem);
}

.sbk-blk-chips.is-small .sbk-blk-chip::before,
.sbk-blk-chip.is-more::before {
	display: none;
}

.sbk-blk-chip.is-more {
	color: var(--sbk-blk-muted);
}

/* Rows: a price list, not a grid of identical cards. */
.sbk-blk-rows {
	border-top: var(--sbk-blk-border) solid var(--sbk-blk-line);
}

.sbk-blk-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 4px;
	border-bottom: var(--sbk-blk-border) solid var(--sbk-blk-line);
}

.sbk-blk-row-main {
	flex: 1;
	min-inline-size: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sbk-blk-row-price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: left;
}

.sbk-blk-row-img {
	inline-size: 72px;
	block-size: 72px;
	flex: none;
	border-radius: var(--sbk-blk-radius);
	object-fit: cover;
}

@media (max-width: 600px) {

	.sbk-blk-spaces .sbk-blk-row {
		flex-wrap: wrap;
	}

	.sbk-blk-spaces .sbk-blk-row-main {
		flex-basis: calc(100% - 88px);
	}

	.sbk-blk-spaces .sbk-blk-row-price {
		align-items: flex-start;
		margin-inline-end: auto;
		text-align: right;
	}
}

/* Cards. */
.sbk-blk-cards {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(var(--sbk-blk-cols), minmax(0, 1fr));
}

.sbk-blk.has-cols-1 {
	--sbk-blk-cols: 1;
}

.sbk-blk.has-cols-2 {
	--sbk-blk-cols: 2;
}

.sbk-blk.has-cols-3 {
	--sbk-blk-cols: 3;
}

.sbk-blk.has-cols-4 {
	--sbk-blk-cols: 4;
}

@media (max-width: 900px) {

	.sbk-blk.has-cols-3,
	.sbk-blk.has-cols-4 {
		--sbk-blk-cols: 2;
	}
}

@media (max-width: 600px) {

	.sbk-blk-cards {
		grid-template-columns: minmax(0, 1fr);
	}
}

.sbk-blk-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px;
	background: var(--sbk-blk-bg);
	border: var(--sbk-blk-border) solid var(--sbk-blk-line);
	border-radius: var(--sbk-blk-radius-lg);
	box-shadow: var(--sbk-blk-shadow-card);
}

.sbk-blk-card-img {
	inline-size: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--sbk-blk-radius);
	background: var(--sbk-blk-surface);
	margin-bottom: 4px;
}

/* Bundled line art in place of a photo, recoloured by the palette. */
.sbk-blk-art {
	display: grid;
	place-items: center;
	padding: 8%;
	color: var(--sbk-blk-accent);
	background: var(--sbk-blk-accent-soft);
	overflow: hidden;
}

.sbk-blk-art svg {
	display: block;
	inline-size: 100%;
	block-size: 100%;
}

.sbk-blk-row-img.sbk-blk-art {
	padding: 8px;
}

.sbk-blk-card-action {
	margin-top: auto !important;
	padding-top: 8px;
}

.sbk-blk-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
}

/* Tags. */
.sbk-blk-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sbk-blk-tag {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-block-size: 44px;
	padding: 6px 16px;
	border: var(--sbk-blk-border) solid var(--sbk-blk-line);
	border-radius: var(--sbk-blk-radius-pill);
	background: var(--sbk-blk-bg);
	color: var(--sbk-blk-ink);
	text-decoration: none;
}

.sbk-blk-tag:hover {
	border-color: var(--sbk-blk-accent);
	background: var(--sbk-blk-accent-soft);
	color: var(--sbk-blk-ink);
}

.sbk-blk-tag .sbk-blk-name {
	font-size: inherit;
	font-weight: 600;
}

.sbk-blk-tag-meta {
	color: var(--sbk-blk-muted);
	font-size: var(--wp--preset--font-size--small, 0.88rem);
}

/* Tables. */
.sbk-blk-scroll {
	overflow-x: auto;
}

.sbk-blk-table {
	inline-size: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.sbk-blk-table :is(th, td) {
	padding: 12px 8px;
	border-bottom: var(--sbk-blk-border) solid var(--sbk-blk-line);
	text-align: right;
	vertical-align: middle;
	font-weight: 400;
}

.sbk-blk-table thead th {
	color: var(--sbk-blk-muted);
	font-size: var(--wp--preset--font-size--small, 0.88rem);
	font-weight: 600;
}

.sbk-blk-table tbody th {
	font-weight: 600;
}

.sbk-blk-table .sbk-blk-cat th {
	background: var(--sbk-blk-surface);
	color: var(--sbk-blk-ink);
	font-weight: 700;
}

.sbk-blk-table .sbk-blk-action {
	text-align: left;
	inline-size: 1%;
}

.sbk-blk-table .sbk-blk-name {
	font-size: inherit;
}

/* Narrow screens: the spaces and price tables become stacked rows instead of scrolling sideways. */
@media (max-width: 600px) {

	:is(.sbk-blk-spaces, .sbk-blk-pricing) .sbk-blk-table thead {
		position: absolute;
		inline-size: 1px;
		block-size: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	:is(.sbk-blk-spaces, .sbk-blk-pricing) .sbk-blk-table :is(tbody, tr, th, td) {
		display: block;
	}

	:is(.sbk-blk-spaces, .sbk-blk-pricing) .sbk-blk-table tr {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 16px;
		padding: 12px 4px;
		border-bottom: var(--sbk-blk-border) solid var(--sbk-blk-line);
	}

	:is(.sbk-blk-spaces, .sbk-blk-pricing) .sbk-blk-table :is(th, td) {
		padding: 0;
		border: 0;
		background: none;
	}

	:is(.sbk-blk-spaces, .sbk-blk-pricing) .sbk-blk-table tbody th,
	.sbk-blk-pricing .sbk-blk-table td:last-child {
		flex-basis: 100%;
	}

	:is(.sbk-blk-spaces, .sbk-blk-pricing) .sbk-blk-table .sbk-blk-cat {
		background: var(--sbk-blk-surface);
		padding-inline: 8px;
	}

	.sbk-blk-spaces .sbk-blk-table .sbk-blk-action {
		inline-size: auto;
		margin-inline-start: auto;
	}
}

/* Pricing. */
.sbk-blk-price-big .sbk-blk-price {
	font-family: var(--sbk-blk-font-heading);
	font-size: var(--wp--preset--font-size--x-large, 1.6rem);
	line-height: 1.4;
	color: var(--sbk-blk-accent);
}

.sbk-blk-price-big .sbk-blk-unit {
	display: block;
}

.sbk-blk-price-rules {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: var(--wp--preset--font-size--small, 0.92rem);
}

.sbk-blk-price-rules li {
	position: relative;
	padding-inline-start: 1.1em;
}

.sbk-blk-price-rules li::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 0.75em;
	inline-size: 0.45em;
	block-size: 0.45em;
	border-radius: 50%;
	background: var(--wp--preset--color--secondary, var(--sbk-blk-accent));
}

.sbk-blk-price-col .sbk-blk-price-rules {
	padding-top: 10px;
	border-top: var(--sbk-blk-border) dashed var(--sbk-blk-line);
}

.sbk-blk-pricing .sbk-blk-table td:nth-child(2) .sbk-blk-unit {
	display: block;
}

/* Amenities. */
.sbk-blk-amenity {
	flex-direction: row;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
}

.sbk-blk-amenity .sbk-blk-name {
	font-weight: 600;
	font-size: inherit;
}

.sbk-blk-check {
	position: relative;
	flex: none;
	inline-size: 36px;
	block-size: 36px;
	border-radius: 50%;
	background: var(--sbk-blk-accent-soft);
}

.sbk-blk-check::after {
	content: "";
	position: absolute;
	inset-block-start: 9px;
	inset-inline-start: 14px;
	inline-size: 8px;
	block-size: 15px;
	border: solid var(--sbk-blk-accent);
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

/* House rules. */
.sbk-blk-rules-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sbk-blk-rule {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.sbk-blk-rule.sbk-blk-card {
	flex-direction: column;
}

.sbk-blk-rule-num {
	display: grid;
	place-items: center;
	flex: none;
	inline-size: 2.25rem;
	block-size: 2.25rem;
	border-radius: 50%;
	background: var(--sbk-blk-accent-soft);
	color: var(--sbk-blk-accent);
	font-family: var(--sbk-blk-font-heading);
	font-weight: 700;
	line-height: 1;
}

.sbk-blk-rule-text {
	padding-top: 0.2rem;
}

/* Testimonials. */
.sbk-blk-quote {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sbk-blk-quote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: var(--wp--preset--font-size--medium, 1.05rem);
}

.sbk-blk-quote blockquote p + p {
	margin-top: 8px;
}

.sbk-blk-quote figcaption {
	display: flex;
	flex-direction: column;
}

.sbk-blk-quotes {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.sbk-blk-quotes .sbk-blk-quote {
	padding-inline-start: 18px;
	border-inline-start: 3px solid var(--sbk-blk-accent);
}

.sbk-blk-highlight {
	margin-bottom: 20px;
	padding: clamp(20px, 5vw, 40px);
	background: var(--sbk-blk-accent-soft);
	border-radius: var(--sbk-blk-radius-lg);
}

.sbk-blk-quote.is-featured blockquote {
	font-family: var(--sbk-blk-font-heading);
	font-size: var(--wp--preset--font-size--x-large, 1.5rem);
	line-height: 1.7;
}

.sbk-blk-quote.is-featured blockquote::before {
	content: "«";
	display: block;
	color: var(--sbk-blk-accent);
	font-size: var(--wp--preset--font-size--huge, 3rem);
	line-height: 1;
}

/* Hours. */
.sbk-blk-hours-table {
	max-inline-size: 520px;
}

.sbk-blk-hours-table th {
	inline-size: 40%;
}

.sbk-blk-hours-table .is-today :is(th, td) {
	background: var(--sbk-blk-accent-soft);
	font-weight: 700;
}

.sbk-blk-closed {
	color: var(--sbk-blk-muted);
}

.sbk-blk-hours-compact li {
	padding: 4px 0;
}

.sbk-blk-days {
	font-weight: 600;
}

.sbk-blk-days::after {
	content: ":";
}

.sbk-blk-branches .sbk-blk-hours-compact {
	margin-top: 8px;
	font-size: var(--wp--preset--font-size--small, 0.92rem);
}

/* Booking form block, compact layout: a narrower card. */
.sbk-booking.sbk-booking--compact {
	max-inline-size: 560px;
}

/* Editor-only empty state. */
.sbk-blk-empty {
	padding: 20px;
	border: var(--sbk-blk-border) dashed var(--sbk-blk-line);
	border-radius: var(--sbk-blk-radius);
	background: var(--sbk-blk-surface);
	color: var(--sbk-blk-muted);
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {

	.sbk-blk * {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
