/**
 * Footer design: Compass — .esptb-ft-compass
 *
 * A rounded brand panel on the band colour (logo, about text, socials and
 * the help band with call / WhatsApp buttons) about a third wide on the
 * left; the link columns and the contact rows on the right. Every colour,
 * font and size comes from the kit tokens (the theme's settings) unless the
 * block sets its own.
 *
 * Tablets: the panel runs full width in two halves above the columns.
 * Phones: the panel is the first card, then the folded link lists and the
 * open contact rows.
 */

/* ---------------------------------------------------------------- grid */

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-grid {
	--cp-pad: 22px;
	display: grid;
	gap: calc(var(--ftc-gap) * 0.9);
	grid-template-columns: minmax(0, 1fr);
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-main {
	display: flex;
	flex-direction: column;
	gap: var(--ftc-gap);
	min-width: 0;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links {
	display: grid;
	gap: var(--ftc-gap);
	grid-template-columns: minmax(0, 1fr);
}

/* --------------------------------------------------------- brand panel */

/* The panel speaks the band colours: every kit part inside it (logo text,
   socials, buttons, links, the focus ring) reads these re-mapped tokens,
   so it stays readable whatever the band colour is. */
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel {
	--ftc-heading: var(--ftc-band-text);
	--ftc-text: color-mix(in srgb, var(--ftc-band-text) 86%, transparent);
	--ftc-muted: color-mix(in srgb, var(--ftc-band-text) 74%, transparent);
	--ftc-link: var(--ftc-band-text);
	--ftc-link-h: var(--ftc-band-text);
	--ftc-accent-ink: var(--ftc-band-text);
	--ftc-soft: color-mix(in srgb, var(--ftc-band-text) 14%, transparent);
	--ftc-line: color-mix(in srgb, var(--ftc-band-text) 22%, transparent);
	--ftc-fill: var(--ftc-band-text);
	--ftc-on-fill: var(--ftc-band-bg);
	background:
		radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--ftc-band-text) 12%, transparent), transparent 62%),
		linear-gradient(160deg, var(--ftc-band-bg) 40%, color-mix(in srgb, var(--ftc-band-bg) 80%, #000));
	border-radius: calc(var(--ftc-radius) * 1.8);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ftc-band-text) 10%, transparent), 0 22px 44px -28px rgba(0, 0, 0, 0.45);
	color: var(--ftc-text);
	display: flex;
	flex-direction: column;
	gap: var(--cp-pad);
	isolation: isolate;
	min-width: 0;
	overflow: hidden;
	padding: var(--cp-pad);
	position: relative;
}

/* The compass dial: faint rings in the panel's top corner (decorative). */
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel::before {
	background: repeating-radial-gradient(circle, transparent 0 23px, color-mix(in srgb, var(--ftc-band-text) 13%, transparent) 23px 24px);
	border-radius: 50%;
	content: "";
	height: 300px;
	-webkit-mask: radial-gradient(circle, #000 20%, transparent 68%);
	mask: radial-gradient(circle, #000 20%, transparent 68%);
	pointer-events: none;
	position: absolute;
	right: -120px;
	top: -120px;
	width: 300px;
	z-index: -1;
}

/* The kit's paragraph reset outranks its own about spacing — put it back. */
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-brand .esptb-ft-about {
	color: var(--ftc-text);
	margin-top: 16px;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-brand > .esptb-ft-about:first-child { margin-top: 0; }

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-brand .esptb-ft-social-h {
	color: var(--ftc-muted);
	opacity: 1;
}

/* The help band, restyled as the panel's foot (the panel is its band). */
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel .esptb-ft-cta {
	align-items: stretch;
	background: none;
	border-radius: 0;
	color: inherit;
	flex-direction: column;
	gap: 16px;
	justify-content: flex-start;
	margin-top: auto;
	padding: 0;
	text-align: left;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-brand + .esptb-ft-cta {
	border-top: 1px solid var(--ftc-line);
	padding-top: var(--cp-pad);
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel .esptb-ft-cta-h {
	color: var(--ftc-heading);
	font-size: clamp(18px, 1.7vw, 22px);
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel .esptb-ft-cta-x {
	color: var(--ftc-text);
	margin-top: 6px;
	opacity: 1;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel .esptb-ft-btns {
	flex: none;
	justify-content: flex-start;
	width: 100%;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel a.esptb-ft-btn { flex: 1 1 auto; }

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel a.esptb-ft-btn.is-call,
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel a.esptb-ft-btn.is-call:hover {
	background: var(--ftc-band-text);
	border-color: var(--ftc-band-text);
	color: var(--ftc-band-bg);
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel a.esptb-ft-btn.is-chat:hover { background: var(--ftc-soft); }

/* ------------------------------------------------- columns & contact */

/* The compass needle: a small accent diamond before every column title. */
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-main .esptb-ft-title span:not(.esptb-ft-caret) {
	align-items: center;
	display: inline-flex;
	gap: 10px;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-main .esptb-ft-title span:not(.esptb-ft-caret)::before {
	background: var(--ftc-accent);
	border-radius: 1px;
	content: "";
	flex: none;
	height: 7px;
	transform: rotate(45deg);
	width: 7px;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-contact {
	display: grid;
	gap: 14px 24px;
	grid-template-columns: minmax(0, 1fr);
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-crow .esptb-ft-ic {
	background: var(--ftc-accent-soft);
	height: 40px;
	width: 40px;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-contact.is-rows .esptb-ft-crow-k { display: block; }

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-contact.is-rows .esptb-ft-crow-v {
	color: var(--ftc-heading);
	font-weight: 600;
}

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-contact.is-rows .is-address .esptb-ft-crow-t,
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-contact.is-rows .is-hours .esptb-ft-crow-t { padding-top: 1px; }

.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact a.esptb-ft-crow:hover .esptb-ft-crow-v { color: var(--ftc-link-h); }

/* Contact rows under the link lists: a hairline between them. */
.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links + .esptb-ft-cp-contact {
	border-top: 1px solid var(--ftc-line);
	padding-top: var(--ftc-gap);
}

/* Phones, folded: the rows sit flush and the last fold line is the divider. */
.espt-block-footer .esptb-ft-compass.is-folded .esptb-ft-cp-grid { row-gap: 14px; }
.espt-block-footer .esptb-ft-compass.is-folded .esptb-ft-cp-links { row-gap: 0; }

.espt-block-footer .esptb-ft-compass.is-folded .esptb-ft-cp-main { gap: 26px; }

.espt-block-footer .esptb-ft-compass.is-folded .esptb-ft-cp-links + .esptb-ft-cp-contact {
	border-top: 0;
	padding-top: 0;
}

/* Phones: thumb-sized links in the opened lists and in the bottom bar. */
@media (max-width: 767px) {
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links .esptb-ft-links { gap: calc(var(--ft-link-gap, var(--fk-link-gap)) * 0.4); }

	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links .esptb-ft-links a {
		align-items: center;
		display: inline-flex;
		min-height: 40px;
	}

	.espt-block-footer .esptb-ft-compass .esptb-ft-bottom .esptb-ft-policy a,
	.espt-block-footer .esptb-ft-compass .esptb-ft-bottom .esptb-ft-credit a { padding: 10px 0; }
}

/* Phones with folding switched off: the link lists sit two by two. */
@media (min-width: 360px) and (max-width: 767px) {
	.espt-block-footer .esptb-ft-compass:not([data-ft-accordion]) .esptb-ft-cp-links:not(.has-1) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------- ≥ 768px */

@media (min-width: 768px) {
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-grid {
		--cp-pad: 28px;
		gap: calc(var(--ftc-gap) * 1.2);
	}

	/* The panel in two halves: brand | help, a hairline between them. */
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel.is-split {
		align-items: center;
		display: grid;
		gap: 0 var(--cp-pad);
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	}

	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel.is-split .esptb-ft-cp-brand + .esptb-ft-cta {
		align-self: stretch;
		border-left: 1px solid var(--ftc-line);
		border-top: 0;
		justify-content: center;
		margin-top: 0;
		padding-left: var(--cp-pad);
		padding-top: 0;
	}

	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links.has-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links.has-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

	/* One list alone flows into two close columns instead of leaving a void. */
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links.has-1 .esptb-ft-links {
		display: grid;
		gap: var(--ft-link-gap, var(--fk-link-gap)) var(--ftc-gap);
		grid-template-columns: repeat(2, minmax(0, 15em));
	}

	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-contact .esptb-ft-crow:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* -------------------------------------------------------------- ≥ 1024px */

@media (min-width: 1024px) {
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-grid {
		--cp-pad: 32px;
		gap: calc(var(--ftc-gap) * 1.6);
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.95fr);
	}

	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-grid.is-solo { grid-template-columns: minmax(0, 1fr); }

	/* A panel without the help band keeps its own height — no empty slab. */
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel:not(.is-split) { align-self: start; }

	/* Beside the columns the panel stacks again: brand on top, the help
	   band anchored to its foot. */
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-grid:not(.is-solo) .esptb-ft-cp-panel.is-split {
		align-items: stretch;
		display: flex;
		gap: var(--cp-pad);
	}

	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-grid:not(.is-solo) .esptb-ft-cp-panel.is-split .esptb-ft-cp-brand + .esptb-ft-cta {
		border-left: 0;
		border-top: 1px solid var(--ftc-line);
		justify-content: flex-start;
		margin-top: auto;
		padding-left: 0;
		padding-top: var(--cp-pad);
	}

	/* The right side lines up with the panel's content box: titles level
	   with the logo, the contact rows level with the buttons. */
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-grid:not(.is-solo) .esptb-ft-cp-main {
		padding-bottom: var(--cp-pad);
		padding-top: var(--cp-pad);
	}

	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-links + .esptb-ft-cp-contact { margin-top: auto; }
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
	.espt-block-footer .esptb-ft-compass .esptb-ft-cp-panel a.esptb-ft-btn { transition: none; }
}
