/**
 * Barbut theme styles that theme.json cannot express:
 * block style variations, header/footer chrome and the hero panel.
 * Colours always come from theme.json presets.
 */

/* ---------- Block style variations ---------- */

p.is-style-badge {
	display: inline-block;
	width: fit-content;
	margin-block: 0;
	padding: 0.375rem 0.75rem;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-transform: uppercase;
}

p.is-style-kicker {
	margin-block: 0;
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.06em;
}

.wp-block-group.is-style-card {
	overflow: hidden;
	border: 1px solid var(--wp--custom--border--subtle);
	border-radius: var(--wp--custom--radius--card);
	background: #fff;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--primary);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

.wp-block-button.is-style-ghost > .wp-block-button__link {
	padding-inline: 0.25rem;
	background: transparent;
	color: var(--wp--preset--color--primary);
}

.wp-block-button.is-style-ghost > .wp-block-button__link:hover {
	background: transparent;
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

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

/* Header, main and footer sit flush; sections handle their own spacing. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

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

.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 0);
}

.barbut-header {
	border-bottom: 1px solid var(--wp--custom--border--subtle);
}

.barbut-logo,
.barbut-logo img {
	display: block;
	margin: 0;
}

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

.barbut-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

/* ---------- Hero ---------- */

.barbut-hero .wp-block-columns {
	gap: 4rem;
}

.barbut-hero__visual {
	position: relative;
	aspect-ratio: 1 / 1.26;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--panel);
	background-color: var(--wp--preset--color--primary);
}

/* The scene SVG carries its own looping animation; it fills the panel behind the overlays. */
.barbut-hero__scene {
	position: absolute;
	inset: 0;
	margin: 0 !important;
}

.barbut-hero__scene img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.barbut-hero__caption {
	position: absolute;
	bottom: 1.75rem;
	left: 2rem;
	margin: 0;
	color: rgb(255 255 255 / 0.8);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.06em;
}

@media (max-width: 781px) {
	/* Mobile hero is text-only by design. */
	.barbut-hero__visual-col {
		display: none;
	}
}

/* ---------- Cards ---------- */

.barbut-card__media {
	display: grid;
	place-items: center;
	aspect-ratio: 1.618 / 1;
	margin: 0;
	background: var(--wp--preset--color--surface);
}

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

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

.barbut-footer a:hover,
.barbut-footer a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.barbut-footer__links p {
	margin: 0;
	opacity: 0.8;
}

.barbut-footer__bottom {
	padding-top: 1.5rem;
	border-top: 1px solid rgb(255 255 255 / 0.16);
}

/* ---------- Service cards ---------- */

.barbut-service-card {
	height: 100%;
}

.barbut-service-card__head {
	display: flex;
	align-items: flex-end;
	aspect-ratio: 1.618 / 1;
	margin: 0;
	padding: 1.5rem 1.75rem;
	background: var(--wp--preset--color--primary);
}

.barbut-service-card__number {
	margin: 0;
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(3.5rem, 6vw, 4.5rem);
	font-weight: 800;
	line-height: 1;
}

.barbut-service-card__body {
	flex: 1;
}

.barbut-service-card__price {
	margin-top: auto !important;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.5rem;
	font-weight: 800;
}

/* ---------- Price list ---------- */

.barbut-price-table table {
	border-collapse: collapse;
	width: 100%;
}

.barbut-price-table th,
.barbut-price-table td {
	padding: 1rem 1.25rem;
	border: 0;
	border-bottom: 1px solid var(--wp--custom--border--subtle);
	text-align: left;
}

.barbut-price-table thead th {
	border-bottom: 2px solid var(--wp--preset--color--primary);
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.barbut-price-table td:last-child,
.barbut-price-table th:last-child {
	text-align: right;
	white-space: nowrap;
}

.barbut-price-table td:last-child {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
}

.barbut-price-table tbody tr:hover {
	background: #fff;
}

@media (max-width: 600px) {
	/* The menu overlay already links to contact; keep the bar uncluttered. */
	.barbut-header .barbut-header__cta {
		display: none;
	}
}

/* Short labels never break mid-phrase ("Umów wizytę", "od 120 zł", "8:00 – 17:00"). */
.wp-block-button__link,
.barbut-service-card__price p,
.barbut-hours .wp-block-group > p:last-child {
	white-space: nowrap;
}

/* ---------- Hero live status ---------- */

.barbut-hero__status {
	position: absolute;
	margin: 0 !important; /* overrides the flow-layout block gap */
	top: 1.5rem;
	left: 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.625rem;
}

.barbut-hero__status > p.barbut-hero__status-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.625rem;
	margin: 0;
	padding: 0.625rem 0.875rem 0.625rem 0.75rem;
	border: 1px solid rgb(255 255 255 / 0.14);
	border-radius: 0.75rem;
	background: rgb(255 255 255 / 0.08);
	color: var(--wp--preset--color--on-accent);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	opacity: 0;
	animation: barbut-status-in 0.6s ease-out forwards;
	backdrop-filter: blur(6px);
}

.barbut-hero__status > p:nth-child(2) {
	animation-delay: 0.8s;
}

.barbut-hero__status > p:nth-child(3) {
	animation-delay: 1.6s;
}

.barbut-hero__status-item.is-done::before {
	content: "";
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 4.8 8.5 9.5 3.6' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
}

.barbut-hero__status-item.is-progress::before {
	content: "";
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	animation: barbut-live-dot 1.6s ease-in-out infinite;
}

/* Progress bar under the label: accent fill over a faint track. */
.barbut-hero__status-item.is-progress::after {
	content: "";
	flex-basis: 100%;
	height: 4px;
	border-radius: 2px;
	background:
		linear-gradient(var(--wp--preset--color--accent), var(--wp--preset--color--accent)) 0 0 / 72% 100% no-repeat,
		rgb(255 255 255 / 0.15);
	animation: barbut-progress 6s ease-in-out 2.2s infinite both;
}

@keyframes barbut-status-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes barbut-live-dot {
	50% {
		opacity: 0.3;
	}
}

@keyframes barbut-progress {
	0% {
		background-size: 0% 100%, auto;
	}

	60%,
	100% {
		background-size: 72% 100%, auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.barbut-hero__status > p.barbut-hero__status-item,
	.barbut-hero__status-item.is-progress::before,
	.barbut-hero__status-item.is-progress::after {
		opacity: 1;
		animation: none;
	}
}
