/**
 * Buk.ng front-end styles.
 *
 * The accent comes from --buk-ng-accent, set on each root by the plugin from
 * the site's setting or the block's own colour. Type is inherited from the
 * theme. Nothing here uses !important; a theme's own rules win.
 */

.buk-ng {
	--buk-ng-accent: #e8543f;
	--buk-ng-line: color-mix(in srgb, currentColor 16%, transparent);
	--buk-ng-radius: 0.75rem;
	margin: 0 0 1.5rem;
}

.buk-ng-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.buk-ng-heading {
	margin: 0 0 1rem;
}

.buk-ng-empty {
	margin: 0;
	opacity: 0.85;
}

/* Grids */

.buk-ng-services,
.buk-ng-staff,
.buk-ng-gallery,
.buk-ng-reviews,
.buk-ng-locations {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.buk-ng-cols-1 { grid-template-columns: minmax(0, 1fr); }
.buk-ng-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.buk-ng-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.buk-ng-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 56.25rem) {
	.buk-ng-cols-3,
	.buk-ng-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 37.5rem) {
	.buk-ng-cols-2,
	.buk-ng-cols-3,
	.buk-ng-cols-4 { grid-template-columns: minmax(0, 1fr); }
}

/* Buttons */

.buk-ng-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375em;
	min-height: 2.75rem;
	padding: 0.625em 1.5em;
	border: 1px solid var(--buk-ng-accent);
	border-radius: 0.5rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	color: var(--buk-ng-accent);
	background: transparent;
	transition: background-color 150ms ease-out, color 150ms ease-out;
}

.buk-ng-btn--solid {
	color: #fff;
	background: var(--buk-ng-accent);
}

.buk-ng-btn--link {
	min-height: 0;
	padding: 0;
	border: 0;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.buk-ng-btn--theme {
	border-color: transparent;
}

.buk-ng-btn--small { min-height: 2.25rem; padding: 0.375em 1em; font-size: 0.9375em; }
.buk-ng-btn--large { min-height: 3.25rem; padding: 0.875em 2em; font-size: 1.0625em; }
.buk-ng-btn--pill { border-radius: 999px; }
.buk-ng-btn--square { border-radius: 0; }
.buk-ng-btn--full { display: flex; width: 100%; }

@media (hover: hover) {
	.buk-ng-btn:hover { background: color-mix(in srgb, var(--buk-ng-accent) 12%, transparent); }
	.buk-ng-btn--solid:hover { color: #fff; background: color-mix(in srgb, var(--buk-ng-accent) 88%, #000); }
	.buk-ng-btn--link:hover { background: transparent; }
}

.buk-ng-btn:active { transform: scale(0.96); }

.buk-ng-btn:focus-visible {
	outline: 2px solid var(--buk-ng-accent);
	outline-offset: 2px;
}

.buk-ng-booking-wrap { margin: 0; }
.buk-ng-align-center { text-align: center; }
.buk-ng-align-right { text-align: right; }

/* Services */

.buk-ng-service {
	display: flex;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--buk-ng-line);
	border-radius: var(--buk-ng-radius);
}

.buk-ng-services--list .buk-ng-service {
	flex-direction: row;
}

.buk-ng-service__photo {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.buk-ng-services--list .buk-ng-service__photo {
	width: 7rem;
	aspect-ratio: 1;
	flex-shrink: 0;
}

.buk-ng-service__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
	padding: 1rem 1.125rem;
}

.buk-ng-service__name,
.buk-ng-member__name,
.buk-ng-location__name,
.buk-ng-card__name {
	margin: 0;
	font-size: 1.0625em;
	line-height: 1.3;
}

.buk-ng-service__category,
.buk-ng-member__title,
.buk-ng-card__meta {
	margin: 0;
	font-size: 0.8125em;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0.8;
}

/* Body text is left at full strength: dimming it can drop the rendered
   contrast below 4.5:1 on themes this plugin cannot measure. */
.buk-ng-service__description,
.buk-ng-card__description,
.buk-ng-review__comment,
.buk-ng-location__address {
	margin: 0;
	font-size: 0.9375em;
	line-height: 1.5;
	overflow-wrap: break-word;
}

.buk-ng-service__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem 0.875rem;
	margin: auto 0 0;
	padding-top: 0.5rem;
	font-size: 0.9375em;
}

.buk-ng-service__price { font-weight: 600; font-variant-numeric: tabular-nums; }
.buk-ng-service__duration { opacity: 0.85; }

.buk-ng-service__deposit {
	margin: 0;
	font-size: 0.8125em;
	opacity: 0.85;
}

.buk-ng-service__action,
.buk-ng-member__action,
.buk-ng-location__actions,
.buk-ng-card__action {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.5rem 0 0;
}

/* Business card */

.buk-ng-card {
	display: flex;
	gap: 1rem;
	padding: 1.125rem 1.25rem;
	border: 1px solid var(--buk-ng-line);
	border-radius: var(--buk-ng-radius);
}

.buk-ng-card__logo,
.buk-ng-card__initials {
	flex-shrink: 0;
	width: 4rem;
	height: 4rem;
	border-radius: 1rem;
	object-fit: cover;
}

.buk-ng-card__initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: #fff;
	background: var(--buk-ng-accent);
}

.buk-ng-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.buk-ng-card__rating {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: 0.9375em;
}

/* Stars */

.buk-ng-stars {
	display: inline-flex;
	gap: 0.125rem;
	vertical-align: middle;
}

.buk-ng-star {
	width: 1em;
	height: 1em;
	background: var(--buk-ng-accent);
	clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.buk-ng-star--half { background: linear-gradient(90deg, var(--buk-ng-accent) 50%, color-mix(in srgb, currentColor 25%, transparent) 50%); }
.buk-ng-star--empty { background: color-mix(in srgb, currentColor 25%, transparent); }

/* Opening hours */

.buk-ng-hours {
	display: grid;
	gap: 0.25rem;
	max-width: 24rem;
	margin: 0;
}

.buk-ng-hours__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.375rem 0;
	border-bottom: 1px solid var(--buk-ng-line);
}

.buk-ng-hours__row dt,
.buk-ng-hours__row dd { margin: 0; }
.buk-ng-hours__row dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.buk-ng-hours__row--today { font-weight: 600; }

.buk-ng-hours__today {
	margin-left: 0.375rem;
	padding: 0.05em 0.5em;
	border-radius: 999px;
	font-size: 0.75em;
	color: #fff;
	background: var(--buk-ng-accent);
}

.buk-ng-hours__holidays {
	margin: 0.75rem 0 0;
	font-size: 0.9375em;
}

/* Locations, team, gallery */

.buk-ng-location,
.buk-ng-member {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	padding: 1rem 1.125rem;
	border: 1px solid var(--buk-ng-line);
	border-radius: var(--buk-ng-radius);
}

.buk-ng-member { flex-direction: row; gap: 0.875rem; }

.buk-ng-member__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	font-weight: 700;
	color: #fff;
	background: var(--buk-ng-accent);
}

.buk-ng-member__body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }

.buk-ng-gallery__item { margin: 0; }

.buk-ng-gallery__item img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: var(--buk-ng-radius);
	object-fit: cover;
	outline: 1px solid rgb(0 0 0 / 0.1);
	outline-offset: -1px;
}

/* Reviews */

.buk-ng-reviews__stats {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1rem;
}

.buk-ng-review {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	padding: 1rem 1.125rem;
	border: 1px solid var(--buk-ng-line);
	border-radius: var(--buk-ng-radius);
}

.buk-ng-review__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: 0.9375em;
}

.buk-ng-review__author { font-weight: 600; }
.buk-ng-review__date { opacity: 0.8; }

.buk-ng-review__verified {
	padding: 0.05em 0.5em;
	border: 1px solid var(--buk-ng-line);
	border-radius: 999px;
	font-size: 0.75em;
}

.buk-ng-review__title { margin: 0; font-weight: 600; }
.buk-ng-review__staff { margin: 0; font-size: 0.875em; opacity: 0.85; }

.buk-ng-review__reply {
	margin: 0.25rem 0 0;
	padding: 0.5rem 0.75rem;
	border-left: 3px solid var(--buk-ng-accent);
	font-size: 0.9375em;
}

/* Contact */

.buk-ng-contact {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
}

/* Floating button */

.buk-ng-floating {
	position: fixed;
	bottom: var(--buk-ng-offset, 20px);
	z-index: 9990;
	margin: 0;
}

.buk-ng-floating--bottom-right { right: var(--buk-ng-offset, 20px); }
.buk-ng-floating--bottom-left { left: var(--buk-ng-offset, 20px); }

.buk-ng-floating .buk-ng-btn {
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 8px 24px rgb(0 0 0 / 0.18);
}

@media (max-width: 37.5rem) {
	.buk-ng-floating--no-mobile { display: none; }
}

/* Admin-only notes */

.buk-ng-admin-hint {
	padding: 0.75rem 1rem;
	border: 1px dashed color-mix(in srgb, currentColor 35%, transparent);
	border-radius: 0.375rem;
	font-size: 0.9375em;
}

.buk-ng-admin-hint p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
	.buk-ng-btn { transition: none; }
	.buk-ng-btn:active { transform: none; }
}

/* Booking on this site: the inline form and the popup */

.buk-ng-frame {
	position: relative;
	width: 100%;
}

.buk-ng-frame__iframe {
	display: block;
	width: 100%;
	min-height: 20rem;
	border: 0;
	border-radius: var(--buk-ng-radius);
	background: transparent;
	color-scheme: normal;
}

.buk-ng-booking-form .buk-ng-frame__iframe {
	border: 1px solid var(--buk-ng-line);
}

.buk-ng-frame__status {
	margin: 0.5rem 0 0;
	font-size: 0.9375em;
	font-weight: 600;
	text-align: center;
}

.buk-ng-frame__status:empty {
	display: none;
}

.buk-ng-dialog {
	width: min(44rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 1rem;
	color: #14110f;
	background: #fff;
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 24px 64px rgb(0 0 0 / 0.32);
}

.buk-ng-dialog[open] {
	display: flex;
	flex-direction: column;
}

.buk-ng-dialog::backdrop {
	background: rgb(0 0 0 / 0.55);
}

.buk-ng-dialog__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 0.75rem 0.75rem 1.25rem;
	border-bottom: 1px solid rgb(0 0 0 / 0.1);
}

.buk-ng-dialog__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
}

.buk-ng-dialog__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	font-size: 1.5rem;
	line-height: 1;
	color: inherit;
	background: transparent;
	cursor: pointer;
}

@media (hover: hover) {
	.buk-ng-dialog__close:hover { background: rgb(0 0 0 / 0.06); }
}

.buk-ng-dialog__close:focus-visible {
	outline: 2px solid var(--buk-ng-accent);
	outline-offset: 2px;
}

.buk-ng-dialog__body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.buk-ng-dialog .buk-ng-frame__iframe {
	min-height: 60vh;
	border-radius: 0;
}

.buk-ng-dialog .buk-ng-frame__status {
	padding: 0 1rem 1rem;
}

/* The page behind a modal should not scroll with it. */
.buk-ng-dialog-open {
	overflow: hidden;
}

/* On a phone the popup is the whole screen: no margins to mis-tap. */
@media (max-width: 37.5rem) {
	.buk-ng-dialog {
		width: 100vw;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.buk-ng-dialog[open] {
		animation: buk-ng-dialog-in 200ms cubic-bezier(0.2, 0, 0, 1);
	}

	@keyframes buk-ng-dialog-in {
		from { opacity: 0; transform: translateY(8px); }
	}
}
