/**
 * Footer design: Bento — .esptb-ft-bento
 *
 * Two card grids that share one column rhythm: the top row (a wide brand
 * card, the hotline card on the band colour, the opening-hours card) and the
 * link row (link cards, category chips, the app card). The layout tells each
 * row how many cards it holds (has-N, has-brand, has-cats), so the spans
 * below always fill the row — a missing part never leaves a hole.
 *
 * Desktop: four columns (brand 2 + hotline + hours / links + links +
 * categories 2). Tablet: two columns. Phones: one column; the link cards
 * fold (footer.js) into one grouped card, hotline and hours stay open.
 *
 * Every colour, font and size comes from the kit tokens (the theme's
 * settings) unless the block sets its own. Cards are size containers, so a
 * wide card re-flows its own contents (link lists in columns, the brand
 * card side by side) whatever the grid gives it.
 */

.espt-block-footer .esptb-ft-bento {
	--ftbn-gap: max(10px, calc(var(--ftc-gap) * 0.5));
	--ftbn-r: calc(var(--ftc-radius) * 1.8);
	--ftbn-pad: 18px;
}

/* ---------------------------------------------------------------- grids */

.espt-block-footer .esptb-ft-bento .esptb-ft-bn,
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-top,
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-links {
	display: grid;
	gap: var(--ftbn-gap);
	grid-template-columns: minmax(0, 1fr);
}

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

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-card {
	background: var(--ftc-card);
	border: 1px solid var(--ftc-line);
	border-radius: var(--ftbn-r);
	container: ftbn / inline-size;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: var(--ftbn-pad);
	position: relative;
}

/* A small icon disc in the top corner (hotline, hours). */
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-badge {
	align-items: center;
	background: var(--ftc-accent-soft);
	border-radius: 50%;
	color: var(--ftc-accent-ink);
	display: inline-flex;
	height: 40px;
	justify-content: center;
	pointer-events: none;
	position: absolute;
	right: calc(var(--ftbn-pad) - 6px);
	top: calc(var(--ftbn-pad) - 9px);
	width: 40px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-badge .esptb-ft-ic svg {
	height: 19px;
	width: 19px;
}

/* Whatever comes first after the disc keeps clear of it. */
.espt-block-footer .esptb-ft-bento .has-badge > .esptb-ft-bn-badge + * { padding-right: 46px; }

/* Bengali titles break evenly instead of leaving one word on a line. */
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-card .esptb-ft-title { text-wrap: balance; }

/* ----------------------------------------------------------- brand card */

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-brand {
	background-image: radial-gradient(120% 90% at 100% 0%, var(--ftc-accent-soft), transparent 58%);
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in > .esptb-ft-logo { align-self: flex-start; }

/* The kit's `.esptb-ft p { margin: 0 }` outranks the about text's own top
   margin — restore the air under the logo here. */
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in > .esptb-ft-about {
	font-size: 1.06em;
	line-height: 1.65;
	max-width: 44ch;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in > .esptb-ft-logo + .esptb-ft-about { margin-top: 16px; }

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-follow {
	margin-top: auto;
	min-width: 0;
	padding-top: 22px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-follow:first-child { padding-top: 0; }
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-follow .esptb-ft-social-h { margin-bottom: 10px; }

/* A wide brand card (tablets, or alone in its row): logo and text on the
   left, the socials on the right. */
@container ftbn (min-width: 640px) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in {
		align-items: end;
		column-gap: 40px;
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in > .esptb-ft-logo { justify-self: start; }
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in > .esptb-ft-logo,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in > .esptb-ft-about { grid-column: 1; }

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-in > .esptb-ft-bn-follow {
		grid-column: 2;
		grid-row: 1 / span 2;
		padding-top: 0;
		text-align: right;
	}

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-follow .esptb-ft-social { justify-content: flex-end; }
}

/* --------------------------------------------------------- hotline card */

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact {
	background-color: var(--ftc-band-bg);
	background-image: radial-gradient(110% 80% at 0% 100%, color-mix(in srgb, var(--ftc-band-text) 12%, transparent), transparent 62%);
	border-color: transparent;
	color: var(--ftc-band-text);
}

/* The card's title is a kicker over the big number: a little smaller than
   the column titles (still following their size setting), icon inline. */
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact .esptb-ft-bn-kicker {
	align-items: center;
	color: inherit;
	display: flex;
	font-size: calc(var(--ft-title-size, var(--fk-title-size)) * 0.88);
	gap: 10px;
	margin-bottom: 12px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-kicker > span:last-child { min-width: 0; }

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-kicker .esptb-ft-ic {
	align-items: center;
	background: color-mix(in srgb, var(--ftc-band-text) 16%, transparent);
	border-radius: 50%;
	height: 32px;
	justify-content: center;
	width: 32px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-kicker .esptb-ft-ic svg {
	height: 16px;
	width: 16px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-bn-phone {
	align-self: flex-start;
	color: var(--ftc-band-text);
	font-family: var(--fk-display);
	font-size: 28px;
	font-size: clamp(22px, 12.5cqi, 34px);
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.15;
	max-width: 100%;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-bn-phone:hover {
	color: var(--ftc-band-text);
	text-decoration-color: currentColor;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact .esptb-ft-bn-rows {
	gap: 8px;
	margin-top: 14px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact .esptb-ft-bn-rows:first-child { margin-top: 0; }

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-crow,
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-crow:hover { color: var(--ftc-band-text); }

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-crow:hover .esptb-ft-crow-v {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact .esptb-ft-crow .esptb-ft-ic {
	background: color-mix(in srgb, var(--ftc-band-text) 16%, transparent);
	color: var(--ftc-band-text);
	height: 32px;
	width: 32px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact .esptb-ft-crow .esptb-ft-ic svg {
	height: 16px;
	width: 16px;
}

/* The buttons close the card, whatever its height. */
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-btns {
	margin-top: auto;
	padding-top: 18px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-btns a.esptb-ft-btn {
	flex: 1 1 auto;
	padding-left: 16px;
	padding-right: 16px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-btn.is-call,
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact 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-bento .esptb-ft-bn-contact a.esptb-ft-btn.is-chat {
	background: transparent;
	border-color: color-mix(in srgb, var(--ftc-band-text) 55%, transparent);
	color: var(--ftc-band-text);
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-btn.is-chat:hover {
	background: color-mix(in srgb, var(--ftc-band-text) 12%, transparent);
	border-color: var(--ftc-band-text);
	color: var(--ftc-band-text);
}

/* ----------------------------------------------------------- hours card */

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours {
	gap: 10px;
	margin-bottom: 16px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours li {
	flex-direction: column;
	gap: 1px;
	justify-content: flex-start;
	line-height: 1.45;
	padding-bottom: 10px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours .esptb-ft-hours-d {
	color: var(--ftc-muted);
	font-size: 0.92em;
	font-weight: 500;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours .esptb-ft-hours-t {
	color: var(--ftc-heading);
	font-weight: 700;
	text-align: left;
}

@container ftbn (min-width: 380px) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours li {
		align-items: baseline;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 2px 16px;
		justify-content: space-between;
	}

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours .esptb-ft-hours-t { text-align: right; }
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours:last-child { margin-bottom: 0; }

/* Under the hours the address closes the card; alone (no hours) it sits
   right under the title instead of leaving an empty middle. */
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-hours + .esptb-ft-bn-addr {
	border-top: 1px solid var(--ftc-line);
	margin-top: auto;
	padding-top: 14px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-addr .esptb-ft-crow .esptb-ft-ic {
	background: var(--ftc-accent-soft);
	height: 32px;
	width: 32px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-addr .esptb-ft-crow .esptb-ft-ic svg {
	height: 16px;
	width: 16px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-addr.is-rows .is-address .esptb-ft-crow-t { padding-top: 5px; }

/* ------------------------------------------------------------ link cards */

/* A wide link card lays its list out in columns. */
@container ftbn (min-width: 420px) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-link .esptb-ft-links {
		column-gap: 24px;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container ftbn (min-width: 660px) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-link .esptb-ft-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container ftbn (min-width: 900px) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-link .esptb-ft-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Categories as chips. */
.espt-block-footer .esptb-ft-bento .esptb-ft-bn-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-chips li {
	margin: 0;
	max-width: 100%;
	min-width: 0;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-chips a {
	align-items: center;
	background: var(--ftc-soft);
	border: 1px solid var(--ftc-line);
	border-radius: calc(var(--ftc-radius) * 4);
	color: var(--ftc-link);
	display: inline-flex;
	line-height: 1.3;
	max-width: 100%;
	min-height: 38px;
	padding: 6px 15px;
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-chips a:hover {
	background: var(--ftc-fill);
	border-color: var(--ftc-fill);
	color: var(--ftc-on-fill);
}

/* -------------------------------------------------------------- app card */

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-apps .esptb-ft-apps-h {
	font-family: var(--fk-display);
	font-size: var(--ft-title-size, var(--fk-title-size));
	letter-spacing: 0.02em;
	line-height: 1.35;
	margin-bottom: 14px;
	text-transform: var(--fk-title-tt);
}

.espt-block-footer .esptb-ft-bento .esptb-ft-bn-apps a.esptb-ft-app {
	border-radius: var(--ftc-radius);
	flex: 1 1 150px;
	max-width: 240px;
}

/* ---------------------------------------------------------------- phones */

@media (max-width: 767px) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-link .esptb-ft-links { gap: 2px; }

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

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-chips a { min-height: 40px; }

	/* The e-mail / Messenger / address rows, the big number and the bottom
	   bar's links reach thumb size too. */
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-rows a.esptb-ft-crow,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-addr a.esptb-ft-crow,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-bn-phone { min-height: 40px; }

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

/* Folded (footer.js): the link cards become one grouped card with hairline
   rows — flush, rounded only at its two ends. */
.espt-block-footer .esptb-ft-bento.is-folded .esptb-ft-bn-links { row-gap: 0; }

.espt-block-footer .esptb-ft-bento.is-folded .esptb-ft-bn-link {
	border-radius: 0;
	border-top-width: 0;
	padding-bottom: 0;
	padding-top: 0;
}

/* A title that wraps to two lines still keeps air above and below. */
.espt-block-footer .esptb-ft-bento.is-folded .esptb-ft-bn-link .esptb-ft-toggle {
	padding-bottom: 10px;
	padding-top: 10px;
}

.espt-block-footer .esptb-ft-bento.is-folded .esptb-ft-bn-link:first-child {
	border-top-left-radius: var(--ftbn-r);
	border-top-right-radius: var(--ftbn-r);
	border-top-width: 1px;
}

.espt-block-footer .esptb-ft-bento.is-folded .esptb-ft-bn-link.is-end {
	border-bottom-left-radius: var(--ftbn-r);
	border-bottom-right-radius: var(--ftbn-r);
}

.espt-block-footer .esptb-ft-bento.is-folded .esptb-ft-bn-link:not(.is-foldable) {
	padding-bottom: 16px;
	padding-top: 16px;
}

.espt-block-footer .esptb-ft-bento.is-folded .esptb-ft-bn-link + .esptb-ft-bn-apps { margin-top: var(--ftbn-gap); }

/* --------------------------------------------------------------- tablets */

@media (min-width: 768px) {
	.espt-block-footer .esptb-ft-bento { --ftbn-pad: 22px; }

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-top,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.espt-block-footer .esptb-ft-bento .has-1 > * { grid-column: 1 / -1; }
}

@media (min-width: 768px) and (max-width: 1023px) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-top > .esptb-ft-bn-brand,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-top.has-2.has-brand > :last-child,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-links.has-3 > :last-child { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------- desktop */

@media (min-width: 1024px) {
	.espt-block-footer .esptb-ft-bento { --ftbn-pad: 24px; }

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-top,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-top.has-3 > .esptb-ft-bn-brand,
	.espt-block-footer .esptb-ft-bento .has-2 > *,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-links.has-3 > .esptb-ft-bn-cats,
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-links.has-3:not(.has-cats) > .esptb-ft-bn-apps { grid-column: span 2; }
}

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

@media (prefers-reduced-motion: reduce) {
	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-chips a,
	.espt-block-footer .esptb-ft-bento a.esptb-ft-bn-phone { transition: none; }

	.espt-block-footer .esptb-ft-bento .esptb-ft-bn-contact a.esptb-ft-btn:hover { transform: none; }
}
