/*
 * RahkarTheme — rahkar/branches (frontend).
 *
 * Ships only on pages containing the block. Token-only: every color, radius,
 * size and weight comes from theme.json, so the section follows a sitewide
 * design change instead of drifting from it.
 *
 * Layout is one CSS grid, no JS, no map. `--rh-br-cols` is set inline by PHP.
 */

.wp-block-rahkar-branches {
	--rh-br-cols: 2;
	--rh-br-gap: var(--wp--preset--spacing--30, 1rem);
	margin-block: 0;
}

.rh-br-heading {
	margin: 0 0 var(--rh-br-gap);
	font-size: var(--wp--preset--font-size--xl, 1.5rem);
	font-weight: var(--wp--custom--fw--strong);
	color: var(--wp--preset--color--contrast, #0f1115);
}

.rh-br-grid {
	display: grid;
	grid-template-columns: repeat(var(--rh-br-cols), minmax(0, 1fr));
	gap: var(--rh-br-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rh-br-card {
	/* No global border-box in this theme — set it wherever width meets
	 * padding/border, or the card overflows its grid track. */
	box-sizing: border-box;
	overflow: hidden;
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--wp--preset--color--border, #e2e4e9);
	border-radius: var(--wp--custom--radius--lg, 0.75rem);
}

/* Fixed aspect box: the space is reserved before the (lazy) image arrives,
 * so nothing below it moves when it does. */
.rh-br-card__media {
	aspect-ratio: 16 / 9;
	background: var(--wp--preset--color--surface, #f7f7f8);
}
.rh-br-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rh-br-card__body {
	box-sizing: border-box;
	padding: var(--rh-br-gap);
}

.rh-br-card__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}
.rh-br-card__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--md, 1.125rem);
	font-weight: var(--wp--custom--fw--strong);
	color: var(--wp--preset--color--text, #1a1d23);
}
.rh-br-card__city {
	padding: 3px 8px;
	font-size: var(--wp--preset--font-size--xs, 0.75rem);
	font-weight: var(--wp--custom--fw--base);
	color: var(--wp--preset--color--primary, #0a66c2);
	background: color-mix(in srgb, var(--wp--preset--color--primary, #0a66c2) 8%, transparent);
	border-radius: var(--wp--custom--radius--pill, 9999px);
}

.rh-br-card__row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 8px;
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	font-weight: var(--wp--custom--fw--base);
	line-height: 1.9;
	color: var(--wp--preset--color--text-muted, #5b6271);
}
.rh-br-ico {
	flex-shrink: 0;
	margin-top: 6px;
	color: var(--wp--preset--color--primary, #0a66c2);
}
.rh-br-card__tel {
	color: inherit;
	text-decoration: none;
}
.rh-br-card__tel:hover {
	color: var(--wp--preset--color--primary, #0a66c2);
}
.rh-br-sep {
	margin-inline: 4px;
}

.rh-br-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}
.rh-br-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	padding: 9px 14px;
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	font-weight: var(--wp--custom--fw--strong);
	line-height: 1;
	/* Primary blue — the brand + CTA color. Never the accent red. */
	color: var(--wp--preset--color--base, #fff);
	background: var(--wp--preset--color--primary, #0a66c2);
	border: 1px solid var(--wp--preset--color--primary, #0a66c2);
	border-radius: var(--wp--custom--radius--md, 0.5rem);
	text-decoration: none;
	transition: opacity 120ms linear;
}
.rh-br-btn:hover {
	opacity: 0.88;
}
.rh-br-btn .rh-br-ico {
	margin-top: 0;
	color: currentColor;
}
.rh-br-btn--ghost {
	color: var(--wp--preset--color--text-muted, #5b6271);
	background: none;
	border-color: var(--wp--preset--color--border, #e2e4e9);
}

.rh-br-empty {
	margin: 0;
	padding: var(--rh-br-gap);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	color: var(--wp--preset--color--text-muted, #5b6271);
	background: var(--wp--preset--color--surface, #f7f7f8);
	border-radius: var(--wp--custom--radius--md, 0.5rem);
}

/* One column on phones regardless of the author's desktop setting. */
@media (max-width: 781px) {
	.rh-br-grid {
		grid-template-columns: 1fr;
	}
}
