/**
 * Boucherie Damel blocks. Values come from the KeliPress design tokens, with
 * fallbacks so the blocks stay readable under any theme.
 */

.damel-block {
	--damel-red: var(--wp--preset--color--primary, #c91820);
	--damel-red-deep: var(--wp--preset--color--accent, #9e1119);
	--damel-ink: var(--wp--preset--color--foreground, #171717);
	--damel-soft: var(--wp--preset--color--muted-foreground, #5c5c5c);
	--damel-line: var(--wp--preset--color--outline, #e4e0d9);
	--damel-paper: var(--wp--preset--color--muted, #f8f7f4);
	--damel-radius: var(--wp--custom--radius--md, 4px);
	--damel-heading: var(--wp--preset--font-family--heading, inherit);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.damel-icon {
	flex: none;
	width: 1.15em;
	height: 1.15em;
}

/* --- Contact details ------------------------------------------------------ */

.damel-contact {
	display: grid;
	gap: 0.85rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.damel-contact li {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	line-height: 1.45;
}

.damel-contact .damel-icon {
	margin-top: 0.15em;
	color: var(--damel-red);
}

.damel-contact a {
	color: inherit;
	text-decoration-color: color-mix(in srgb, currentcolor 35%, transparent);
	text-underline-offset: 0.2em;
}

.damel-contact a:hover {
	color: var(--damel-red);
}

.damel-contact--inline {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.5rem;
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
}

.damel-contact--inline li {
	align-items: center;
	gap: 0.45rem;
}

.damel-contact--inline .damel-icon {
	margin: 0;
}

.damel-tone--dark .damel-icon,
.damel-tone--dark.damel-contact a:hover {
	color: #ff9a9e;
}

/* --- Action buttons ------------------------------------------------------- */

.damel-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.damel-actions.is-content-justification-center {
	justify-content: center;
}

.damel-actions .wp-block-button__link,
.damel-form__submit .wp-block-button__link {
	display: inline-flex;
	gap: 0.55rem;
	align-items: center;
	min-height: 48px;
}

.damel-actions .is-style-outline .wp-block-button__link {
	border: 2px solid currentcolor;
	background: transparent;
	color: var(--damel-ink);
}

.damel-actions .is-style-outline .wp-block-button__link:hover {
	border-color: var(--damel-ink);
	background: var(--damel-ink);
	color: #fff;
}

.wp-block-button.is-style-whatsapp .wp-block-button__link {
	background: #128c4b;
	color: #fff;
}

.wp-block-button.is-style-whatsapp .wp-block-button__link:hover {
	background: #0b6b38;
}

/* On a dark or red band: the main action turns white, the others outline. */
.damel-tone--dark .wp-block-button:not(.is-style-outline, .is-style-whatsapp) .wp-block-button__link {
	background: #fff;
	color: var(--damel-red-deep);
}

.damel-tone--dark .wp-block-button:not(.is-style-outline, .is-style-whatsapp) .wp-block-button__link:hover {
	background: var(--damel-ink);
	color: #fff;
}

.damel-tone--dark .is-style-outline .wp-block-button__link {
	color: #fff;
}

.damel-tone--dark .is-style-outline .wp-block-button__link:hover {
	border-color: #fff;
	background: #fff;
	color: var(--damel-ink);
}

/* --- Map ------------------------------------------------------------------ */

.damel-map {
	display: grid;
	overflow: hidden;
	border: 1px solid var(--damel-line);
	border-radius: var(--damel-radius);
	background: #fff;
}

.damel-map__frame {
	display: block;
	width: 100%;
	height: 340px;
	border: 0;
}

.damel-map__card {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	padding: 1.5rem;
}

.damel-map__card > .damel-icon {
	width: 2.25rem;
	height: 2.25rem;
	padding: 0.45rem;
	border-radius: 50%;
	background: var(--damel-red);
	color: #fff;
}

.damel-map__card p {
	margin: 0;
}

.damel-map__label {
	color: var(--damel-soft);
	font-size: 0.9375rem;
}

.damel-map__address {
	margin-bottom: 0.75rem !important;
	font-family: var(--damel-heading);
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.2;
}

.damel-map__link {
	display: inline-flex;
	gap: 0.5rem;
	align-items: center;
	font-weight: 600;
}

/* --- Category tiles --------------------------------------------------------- */

.damel-cards {
	display: grid;
	gap: clamp(1rem, 2vw, 1.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.damel-cards--categories {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.damel-card--category .damel-card__link {
	position: relative;
	display: flex;
	overflow: hidden;
	min-height: 420px;
	border-radius: var(--damel-radius);
	background: #2a1a1a;
	color: #fff;
	text-decoration: none;
	isolation: isolate;
}

.damel-card--category .damel-card__media,
.damel-card--category .damel-card__media img {
	position: absolute;
	z-index: -2;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.damel-card--category .damel-card__link::after {
	position: absolute;
	z-index: -1;
	inset: 0;
	background: linear-gradient(180deg, rgb(23 23 23 / 0) 30%, rgb(23 23 23 / 0.88) 78%);
	content: "";
}

.damel-card--category .damel-card__body {
	display: grid;
	align-self: flex-end;
	gap: 0.4rem;
	padding: 1.5rem;
}

.damel-card--category .damel-card__title {
	margin: 0;
	color: #fff;
	font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
	line-height: 1;
}

.damel-card--category .damel-card__text {
	color: rgb(255 255 255 / 0.86);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.damel-card--category .damel-card__more {
	display: inline-flex;
	gap: 0.4rem;
	align-items: center;
	margin-top: 0.35rem;
	font-weight: 600;
}

.damel-card--category .damel-card__more .damel-icon {
	color: #ff9a9e;
	transition: transform 0.2s ease;
}

.damel-card--category .damel-card__link:hover img,
.damel-card--category .damel-card__link:focus-visible img {
	transform: scale(1.04);
}

.damel-card--category .damel-card__link:hover .damel-card__more .damel-icon {
	transform: translateX(3px);
}

/* --- Product cards ---------------------------------------------------------- */

.damel-cards--products {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.damel-card--product {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--damel-line);
	border-radius: var(--damel-radius);
	background: #fff;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.damel-card--product:hover {
	border-color: var(--damel-ink);
}

.damel-card--product .damel-card__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--damel-paper);
}

.damel-card--product .damel-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.damel-card--product:hover .damel-card__media img {
	transform: scale(1.03);
}

.damel-card--product .damel-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem 1.25rem 1.1rem;
}

.damel-card--product .damel-card__title {
	margin: 0;
	font-size: 1.5rem;
	line-height: 1.1;
}

.damel-card--product .damel-card__title a {
	color: inherit;
	text-decoration: none;
}

.damel-card--product .damel-card__title a:hover {
	color: var(--damel-red);
}

.damel-card--product .damel-card__text {
	flex: 1;
	margin: 0;
	color: var(--damel-soft);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.damel-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	justify-content: space-between;
	margin: 0.5rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid var(--damel-line);
	font-size: 0.9375rem;
	font-weight: 600;
}

.damel-card__actions a {
	display: inline-flex;
	gap: 0.35rem;
	align-items: center;
	min-height: 32px;
}

.damel-card--product .damel-card__more {
	color: var(--damel-ink);
	text-decoration: none;
}

.damel-card__inquiry {
	color: var(--damel-red-deep);
}

.damel-badge {
	display: inline-block;
	align-self: flex-start;
	margin: 0;
	padding: 0.2rem 0.6rem;
	border-radius: var(--damel-radius);
	background: #fdeceb;
	color: var(--damel-red-deep);
	font-size: 0.8125rem;
	font-weight: 600;
}

.damel-chip {
	display: inline-block;
	padding: 0.2rem 0.65rem;
	border: 1px solid var(--damel-line);
	border-radius: var(--damel-radius);
	color: var(--damel-ink);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
}

.damel-chip:hover {
	border-color: var(--damel-red);
	color: var(--damel-red);
}

.damel-product-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

/* --- Catalogue -------------------------------------------------------------- */

.damel-catalogue__nav {
	position: sticky;
	z-index: 5;
	top: var(--damel-header-height, 0px);
	margin-bottom: var(--wp--preset--spacing--lg, 2.5rem);
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--damel-line);
	background: #fff;
}

.damel-catalogue__nav ul {
	display: flex;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

.damel-catalogue__nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 1rem;
	border: 1px solid var(--damel-line);
	border-radius: var(--damel-radius);
	color: var(--damel-ink);
	font-family: var(--damel-heading);
	font-size: 1.125rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.damel-catalogue__nav a:hover {
	border-color: var(--damel-red);
	color: var(--damel-red);
}

.damel-catalogue__section {
	scroll-margin-top: calc(var(--damel-header-height, 0px) + 5rem);
}

.damel-catalogue__section + .damel-catalogue__section {
	margin-top: var(--wp--preset--spacing--xl, 4rem);
}

.damel-catalogue__head {
	display: grid;
	gap: 0.5rem 3rem;
	align-items: end;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 3px solid var(--damel-ink);
}

@media (min-width: 782px) {

	.damel-catalogue__head {
		grid-template-columns: auto 1fr;
	}
}

.damel-catalogue__head h2 {
	margin: 0;
}

.damel-catalogue__head p {
	max-width: 60ch;
	margin: 0;
	color: var(--damel-soft);
}

/* --- Form --------------------------------------------------------------------- */

.damel-form-wrap {
	scroll-margin-top: calc(var(--damel-header-height, 0px) + 1.5rem);
}

.damel-form__intro {
	margin: 0 0 1.25rem;
	color: var(--damel-soft);
	font-size: 0.9375rem;
}

.damel-form__grid {
	display: grid;
	gap: 1.1rem 1.25rem;
}

@media (min-width: 640px) {

	.damel-form__grid {
		grid-template-columns: 1fr 1fr;
	}

	.damel-field--type,
	.damel-field--message {
		grid-column: 1 / -1;
	}
}

.damel-field {
	display: grid;
	gap: 0.35rem;
}

.damel-field label {
	font-size: 0.9375rem;
	font-weight: 600;
}

.damel-field input,
.damel-field select,
.damel-field textarea {
	width: 100%;
	min-height: 48px;
	border-color: #8a8580;
	border-radius: var(--damel-radius);
	font-size: 1rem;
}

.damel-field textarea {
	min-height: 160px;
	resize: vertical;
}

.damel-field [aria-invalid="true"] {
	border-width: 2px;
	border-color: var(--wp--preset--color--error, #b91c1c);
}

.damel-required {
	color: var(--damel-red);
}

.damel-optional {
	color: var(--damel-soft);
	font-weight: 400;
}

.damel-field__error {
	margin: 0;
	color: var(--wp--preset--color--error, #b91c1c);
	font-size: 0.875rem;
	font-weight: 600;
}

.damel-field--consent {
	grid-template-columns: auto 1fr;
	gap: 0.75rem;
	align-items: start;
	margin-top: 1.25rem;
}

.damel-field--consent input {
	width: 1.25rem;
	min-height: 0;
	height: 1.25rem;
	margin-top: 0.15rem;
}

.damel-field--consent label {
	font-weight: 400;
	line-height: 1.5;
}

.damel-field--consent .damel-field__error {
	grid-column: 2;
}

.damel-form__submit {
	margin-top: 1.5rem;
}

.damel-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.damel-notice {
	margin-bottom: 1.5rem;
	padding: 1rem 1.25rem;
	border-left: 4px solid;
	border-radius: var(--damel-radius);
}

.damel-notice:focus {
	outline: 2px solid currentcolor;
	outline-offset: 2px;
}

.damel-notice p,
.damel-notice ul {
	margin: 0;
}

.damel-notice ul {
	margin-top: 0.4rem;
	padding-left: 1.2rem;
}

.damel-notice__title {
	font-weight: 600;
}

.damel-notice--success {
	border-color: #15803d;
	background: #ecf7ef;
	color: #14532d;
}

.damel-notice--error {
	border-color: var(--wp--preset--color--error, #b91c1c);
	background: #fdeceb;
	color: #7f1d1d;
}

.damel-notice--error a {
	color: inherit;
}

/* --- Footer bits, social ------------------------------------------------------ */

.damel-copyright,
.damel-credit {
	margin: 0;
	font-size: 0.875rem;
}

.damel-social {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.damel-social a {
	color: inherit;
	font-weight: 600;
}

/* --- Floating WhatsApp button --------------------------------------------- */

.damel-whatsapp-float {
	position: fixed;
	z-index: 50;
	right: 1rem;
	bottom: 1rem;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #128c4b;
	box-shadow: 0 6px 18px rgb(0 0 0 / 0.22);
	color: #fff;
}

.damel-whatsapp-float .damel-icon {
	width: 28px;
	height: 28px;
}

.damel-whatsapp-float:hover {
	background: #0b6b38;
	color: #fff;
}

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

	.damel-card--category .damel-card__media img,
	.damel-card--product .damel-card__media img {
		transition: none;
	}
}

/* --- Empty category ------------------------------------------------------------ */

.damel-empty {
	max-width: 62ch;
	padding: 2rem;
	border-left: 4px solid var(--damel-red);
	background: var(--damel-paper);
}

.damel-empty p {
	margin-top: 0;
	font-size: 1.125rem;
}
