/**
 * Virgo — site footer
 * Markup is produced by the virgo/site-footer block (see virgo-core plugin).
 */

.virgo-footer {
	position: relative;
	background-color: var(--wp--preset--color--surface);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	color: var(--wp--preset--color--muted);
	padding-block: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2rem);
	font-size: 0.9375rem;
}

.virgo-footer::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, rgba(139, 92, 246, 0.5) 25%, rgba(236, 72, 153, 0.4) 55%, rgba(251, 146, 60, 0.3) 80%, transparent 100%);
}

.virgo-footer__inner {
	width: var(--virgo-content-shell);
	margin-inline: auto;
}

.virgo-footer__top {
	display: grid;
	gap: clamp(2rem, 5vw, 3.5rem);
	grid-template-columns: 1fr;
	padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

@media (min-width: 48rem) {
	.virgo-footer__top {
		grid-template-columns: repeat(2, 1fr);
	}
}

/*
 * Four columns: brand, Services, Company + businesses, Contact. The brand
 * column is wider because it carries the description and the social row; the
 * other three are equal, so the link lists line up with each other.
 */
@media (min-width: 68rem) {
	.virgo-footer__top {
		grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
		gap: clamp(1.5rem, 3vw, 3rem);
	}
}

.virgo-footer__brand {
	max-width: 30rem;
}

.virgo-footer__brand .virgo-logo {
	margin-bottom: 1.1rem;
}

.virgo-footer__tagline {
	margin: 0 0 1.35rem;
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--wp--preset--color--muted);
	max-width: 34ch;
}

/* rgba(255,255,255,.45) on the footer surface is 4.2:1 at 13px. */
.virgo-footer__legalname {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.62);
}

.virgo-footer__col h2 {
	margin: 0 0 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #fff;
}

.virgo-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.6rem;
}

.virgo-footer__list a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.45;
	transition: color var(--virgo-transition);
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
}

.virgo-footer__list a:hover,
.virgo-footer__list a:focus-visible {
	color: #fff;
}

.virgo-footer__list .virgo-badge {
	font-size: 0.625rem;
	padding: 0.15rem 0.45rem;
	letter-spacing: 0.05em;
}

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

.virgo-footer__contact a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	transition: color var(--virgo-transition);
}

.virgo-footer__contact a:hover {
	color: #fff;
}

.virgo-footer__contact span {
	display: block;
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	/* .42 is 4.07:1 on the footer surface, and this is 11px uppercase. */
	color: rgba(255, 255, 255, 0.62);
	margin-bottom: 0.2rem;
}

.virgo-footer__social {
	display: flex;
	gap: 0.5rem;
	margin-top: 1.25rem;
	list-style: none;
	padding: 0;
}

.virgo-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.375rem;
	height: 2.375rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--virgo-radius-md);
	color: var(--wp--preset--color--muted);
	transition: color var(--virgo-transition), border-color var(--virgo-transition), background-color var(--virgo-transition);
}

.virgo-footer__social a:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.26);
	background-color: rgba(255, 255, 255, 0.05);
}

.virgo-footer__social svg {
	width: 1.0625rem;
	height: 1.0625rem;
}

.virgo-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.75rem;
	align-items: center;
	justify-content: space-between;
	padding-top: clamp(1.5rem, 3vw, 2rem);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.62);
}

.virgo-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.virgo-footer__legal a {
	color: rgba(255, 255, 255, 0.68);
	text-decoration: none;
}

.virgo-footer__legal a:hover {
	color: #fff;
}

.virgo-footer__copyright {
	margin: 0;
}

@media (max-width: 40rem) {
	.virgo-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* -------------------------------------------------------------------------
   Contact column additions
   ---------------------------------------------------------------------- */

.virgo-footer__col--contact {
	min-width: 0;
}

.virgo-footer__address {
	font-style: normal;
	line-height: 1.6;
	margin: 0 0 0.35rem;
	color: var(--wp--preset--color--muted);
}

.virgo-footer__wa {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.3rem;
	font-size: 0.8125rem;
	color: #6ee7b7;
}

.virgo-footer__wa:hover,
.virgo-footer__wa:focus-visible {
	color: #a7f3d0;
}

.virgo-footer__wa svg {
	flex: none;
}

.virgo-footer__contact li > a {
	display: inline-block;
	word-break: break-word;
}

/* .42 is 4.07:1 on the footer surface. */
.virgo-footer__served {
	margin: 0;
	color: rgba(255, 255, 255, 0.62);
	font-size: 0.8125rem;
	line-height: 1.5;
}

/*
 * A later five-track override lived here and silently won over the grid
 * declared above it. There are four columns now — brand, Services, Company +
 * businesses, Contact — and the contact column gets its extra room from the
 * single declaration up there rather than from a second, competing one.
 */
@media (min-width: 68rem) {
	.virgo-footer__col--contact {
		min-width: 0;
	}
}

/* Three items in the bottom bar: copyright, served-area note, legal links. */
.virgo-footer__bottom {
	justify-content: flex-start;
	gap: 0.75rem 2rem;
}

.virgo-footer__bottom nav {
	margin-left: auto;
}

@media (max-width: 48rem) {
	.virgo-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
	}

	.virgo-footer__bottom nav {
		margin-left: 0;
	}
}

/* -------------------------------------------------------------------------
   Footer — final polish
   ---------------------------------------------------------------------- */

/*
 * The email address is one long unbreakable token. Left alone it either
 * overflows the column or splits mid-word ("…solutions.co / m"). Breaking on
 * the @ and the dots keeps it readable.
 */
.virgo-footer__contact a[href^="mailto:"],
.virgo-footer a[href^="mailto:"],
.virgo-footer__value {
	overflow-wrap: anywhere;
	word-break: normal;
	line-break: anywhere;
}

/*
 * The floating WhatsApp button is fixed to the bottom-right, so at the very
 * bottom of the page it sits on top of the legal links. Reserve room for it.
 */
.virgo-footer__bottom {
	padding-bottom: 0.5rem;
}

@media (max-width: 61.999rem) {
	.virgo-footer__bottom {
		padding-bottom: 4.5rem;
	}
}

@media (min-width: 62rem) {
	.virgo-footer__legal {
		padding-right: 4.5rem;
	}
}

/*
 * The phone number and the WhatsApp link are two separate actions; inline they
 * run together into "+971 52 768 6814 Chat on WhatsApp".
 *
 * The selector has to carry the element part too: `.virgo-footer__contact li > a`
 * above is (0,1,2) and a bare `.virgo-footer__wa` (0,1,0) loses to it, which is
 * why the link kept sitting on the phone number's line.
 */
.virgo-footer__contact li > a.virgo-footer__wa {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	width: fit-content;
	margin-top: 0.35rem;
}

.virgo-footer__contact li > a.virgo-footer__wa svg {
	flex: none;
}
