/* Adi Clients */

.adi-cl,
.adi-cl * { box-sizing: border-box; }

.adi-cl {
	--adi-cl-ink: #111010;
	--adi-cl-muted: #5c5752;      /* 6.4:1 on white */
	--adi-cl-rule: rgba(0, 0, 0, .14);
	--adi-cl-cell: #ffffff;
	color: var(--adi-cl-ink);
}

.adi-cl ul { list-style: none; margin: 0; padding: 0; }
.adi-cl img { max-width: 100%; height: auto; }

.adi-cl a:focus-visible {
	outline: 3px solid var(--adi-cl-accent, #e03127);
	outline-offset: 3px;
	border-radius: 6px;
}

.adi-cl__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- page ---------- */

.adi-cl-page {
	max-width: 1240px;
	margin: 0 auto;
	padding: clamp(30px, 6vw, 80px) clamp(18px, 4vw, 48px) clamp(50px, 8vw, 110px);
}

.adi-cl-page__head h1 {
	margin: 0;
	font-size: clamp(32px, 5.5vw, 64px);
	line-height: 1.05;
	letter-spacing: -.02em;
}

.adi-cl-page__intro {
	margin: 14px 0 0;
	max-width: 62ch;
	font-size: 17px;
	line-height: 1.6;
	color: var(--adi-cl-muted);
}

.adi-cl-page__groups { margin-top: clamp(20px, 3vw, 32px); }
.adi-cl-page__groups ul { display: flex; flex-wrap: wrap; gap: 8px; }
.adi-cl-page__groups a {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--adi-cl-rule);
	border-radius: 999px;
	font-size: 14px;
	text-decoration: none;
	color: inherit;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.adi-cl-page__groups a:hover { border-color: var(--adi-cl-ink); }
.adi-cl-page__groups a[aria-current="page"] {
	background: var(--adi-cl-ink);
	border-color: var(--adi-cl-ink);
	color: #fff;
}

/* ---------- the wall ---------- */

.adi-cl__heading {
	margin: clamp(34px, 5vw, 60px) 0 clamp(14px, 2vw, 22px);
	padding-bottom: 12px;
	border-bottom: 1px solid var(--adi-cl-rule);
	font-size: 12px;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--adi-cl-muted);
}

.adi-cl__grid {
	display: grid;
	grid-template-columns: repeat(var(--adi-cl-cols, 4), minmax(0, 1fr));
	gap: 1px;
	background: var(--adi-cl-rule);
	border: 1px solid var(--adi-cl-rule);
	border-radius: 8px;
	overflow: hidden;
}

.adi-cl__cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: clamp(18px, 3vw, 34px);
	background: var(--adi-cl-cell);
	min-height: clamp(110px, 13vw, 160px);
}

.adi-cl__item {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

/* Every logo gets an explicit box, whatever the format. An SVG with only a
   viewBox has no intrinsic size, and a WebP whose dimensions WordPress
   never recorded has none either — both collapse to zero without this. */
.adi-cl__item img {
	width: 100%;
	height: clamp(34px, 4.5vw, 56px);
	min-height: 34px;
	object-fit: contain;
	object-position: center;
}

.adi-cl__cell--empty { font-size: 12px; text-align: center; }
.adi-cl__missing { color: var(--adi-cl-muted); }

.adi-cl__img {
	display: block;
	width: 100%;
	max-width: clamp(110px, 14vw, 190px);
	height: clamp(34px, 4.5vw, 56px);
	max-height: none;
	object-fit: contain;
	object-position: center;
	/* Mismatched brand colours side by side look like a jumble; grey calms
	   the wall and colour on hover rewards the look. */
	filter: grayscale(1);
	opacity: .72;
	transition: filter .25s ease, opacity .25s ease, transform .25s ease;
}
.adi-cl[data-colour] .adi-cl__img { filter: none; opacity: 1; }

a.adi-cl__item:hover .adi-cl__img,
a.adi-cl__item:focus-visible .adi-cl__img {
	filter: none;
	opacity: 1;
	transform: scale(1.03);
}

.adi-cl__sector {
	font-size: 11px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--adi-cl-muted);
	opacity: 0;
	transition: opacity .2s ease;
}
.adi-cl--sectors .adi-cl__sector,
.adi-cl__cell:hover .adi-cl__sector { opacity: 1; }

/* Per-mode logos: both are in the markup, CSS picks one. */
.adi-cl__img--dark { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
	.adi-cl__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.adi-cl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.adi-cl__sector { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.adi-cl__img,
	.adi-cl__sector,
	.adi-cl-page__groups a { transition: none; }
	a.adi-cl__item:hover .adi-cl__img { transform: none; }
}

/* =====================================================================
   Dark mode
   ================================================================== */

@media (prefers-color-scheme: dark) {
	:root:not([data-adi-theme="light"]) .adi-cl {
		--adi-cl-ink: #f3f1ee;
		--adi-cl-muted: #b4aea7;
		--adi-cl-rule: rgba(255, 255, 255, .22);
		--adi-cl-cell: #1b1a19;
	}
	:root:not([data-adi-theme="light"]) .adi-cl-page { background: #141312; }
	:root:not([data-adi-theme="light"]) .adi-cl-page__groups a[aria-current="page"] { background: #f3f1ee; color: #141312; }

	/* A dark-ink logo vanishes on a dark cell, so swap when one was
	   uploaded — and invert the rest as a reasonable fallback. */
	:root:not([data-adi-theme="light"]) .adi-cl__cell.has-dark .adi-cl__img--light { display: none; }
	:root:not([data-adi-theme="light"]) .adi-cl__cell.has-dark .adi-cl__img--dark { display: block; }
	:root:not([data-adi-theme="light"]) .adi-cl__cell:not(.has-dark) .adi-cl__img { filter: grayscale(1) invert(1); opacity: .8; }
	:root:not([data-adi-theme="light"]) .adi-cl[data-colour] .adi-cl__cell:not(.has-dark) .adi-cl__img { filter: invert(1); }
	:root:not([data-adi-theme="light"]) .adi-cl__cell:not(.has-dark) a.adi-cl__item:hover .adi-cl__img { filter: grayscale(0) invert(1); opacity: 1; }
}

[data-adi-theme="dark"] .adi-cl {
	--adi-cl-ink: #f3f1ee;
	--adi-cl-muted: #b4aea7;
	--adi-cl-rule: rgba(255, 255, 255, .22);
	--adi-cl-cell: #1b1a19;
}
[data-adi-theme="dark"] .adi-cl-page { background: #141312; }
[data-adi-theme="dark"] .adi-cl__cell.has-dark .adi-cl__img--light { display: none; }
[data-adi-theme="dark"] .adi-cl__cell.has-dark .adi-cl__img--dark { display: block; }
[data-adi-theme="dark"] .adi-cl__cell:not(.has-dark) .adi-cl__img { filter: grayscale(1) invert(1); opacity: .8; }

@media (prefers-contrast: more) {
	.adi-cl {
		--adi-cl-muted: var(--adi-cl-ink);
		--adi-cl-rule: currentColor;
	}
	.adi-cl__img { filter: none; opacity: 1; }
}

/* Headings inherit our colour, not the theme's. */
.adi-cl h1,
.adi-cl h2,
.adi-cl h3,
.adi-cl h4,
.adi-cl h5,
.adi-cl h6 { color: inherit; }

/* =====================================================================
   Work For — logos by industry, each opening a panel
   ================================================================== */

.adi-wf {
	max-width: 1280px;
	margin: 0 auto;
	padding: clamp(28px, 5vw, 72px) clamp(18px, 4vw, 56px) clamp(50px, 8vw, 110px);
	font-family: var(--adi-cl-sans, "Inter", system-ui, -apple-system, sans-serif);
}

.adi-wf__heading {
	margin: 0 0 clamp(22px, 3vw, 36px);
	font-size: clamp(28px, 4vw, 52px);
	line-height: 1.05;
	letter-spacing: -.03em;
	font-weight: 600;
	color: inherit;
}

/* ---------- filters ---------- */

.adi-wf__filters { margin-bottom: clamp(24px, 3.4vw, 40px); }
.adi-wf__filter-row { display: flex; flex-wrap: wrap; gap: 8px; }

.adi-wf__filter {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid var(--adi-cl-rule);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.adi-wf__filter:hover { border-color: var(--adi-cl-ink); }
.adi-wf__filter.is-on {
	background: var(--adi-cl-ink);
	border-color: var(--adi-cl-ink);
	color: var(--adi-cl-cell);
}
.adi-wf__count {
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	opacity: .65;
}

.adi-wf__filter:focus-visible {
	outline: 3px solid var(--adi-cl-accent, #e03127);
	outline-offset: 3px;
}

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

.adi-wf__grid {
	display: grid;
	grid-template-columns: repeat(var(--adi-cl-cols, 4), minmax(0, 1fr));
	gap: 1px;
	background: var(--adi-cl-rule);
	border: 1px solid var(--adi-cl-rule);
	border-radius: 4px;
	overflow: hidden;
	margin: 0;
	padding: 0;
	list-style: none;
}

.adi-wf__cell { background: var(--adi-cl-cell); }
.adi-wf__cell[hidden] { display: none; }

.adi-wf__open {
	display: grid;
	place-items: center;
	width: 100%;
	min-height: clamp(120px, 14vw, 170px);
	padding: clamp(18px, 3vw, 34px);
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
	transition: background-color .18s ease;
}
.adi-wf__open:hover { background: color-mix(in srgb, currentColor 5%, transparent); }
.adi-wf__open:focus-visible {
	outline: 3px solid var(--adi-cl-accent, #e03127);
	outline-offset: -3px;
}

.adi-wf__logo { display: block; width: 100%; }
.adi-wf__logo img {
	display: block;
	width: 100%;
	max-width: clamp(110px, 14vw, 190px);
	height: clamp(34px, 4.5vw, 56px);
	margin: 0 auto;
	object-fit: contain;
	filter: grayscale(1);
	opacity: .74;
	transition: filter .25s ease, opacity .25s ease;
}
.adi-wf__open:hover .adi-wf__logo img,
.adi-wf__open:focus-visible .adi-wf__logo img { filter: none; opacity: 1; }

.adi-wf__empty { margin: 30px 0; color: var(--adi-cl-muted); }

/* ---------- the panel ---------- */

.adi-wf__dialog {
	width: min(640px, calc(100vw - 32px));
	max-height: min(86vh, 760px);
	padding: 0;
	border: 1px solid var(--adi-cl-rule);
	border-radius: 6px;
	background: var(--adi-cl-cell);
	color: var(--adi-cl-ink);
	overflow: visible;
}
.adi-wf__dialog::backdrop { background: rgba(17, 16, 16, .55); }

.adi-wf__dialog-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	max-height: min(86vh, 760px);
	padding: clamp(26px, 4vw, 44px);
	overflow-y: auto;
}

.adi-wf__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid transparent;
	border-radius: 50%;
	background: none;
	color: inherit;
	cursor: pointer;
}
.adi-wf__close:hover { border-color: var(--adi-cl-rule); }
.adi-wf__close svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.adi-wf__dialog-logo { margin-bottom: clamp(20px, 3vw, 30px); }
.adi-wf__dialog-logo img {
	max-width: 180px;
	max-height: 56px;
	width: auto;
	object-fit: contain;
}

.adi-wf__eyebrow {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--adi-cl-muted);
}

.adi-wf__name {
	margin: 0 0 12px;
	font-size: clamp(24px, 3vw, 36px);
	line-height: 1.1;
	letter-spacing: -.025em;
	font-weight: 600;
	color: inherit;
}

.adi-wf__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin: 0 0 18px;
	font-size: 13px;
	color: var(--adi-cl-muted);
}

.adi-wf__about { margin: 0; font-size: 16px; line-height: 1.75; color: var(--adi-cl-muted); }

.adi-wf__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: clamp(22px, 3vw, 30px) 0 0; }

.adi-wf__btn {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 13px 24px;
	border: 1px solid var(--adi-cl-ink);
	border-radius: 3px;
	background: var(--adi-cl-ink);
	color: var(--adi-cl-cell);
	font-size: 15px;
	text-decoration: none;
	transition: background-color .18s ease, border-color .18s ease;
}
.adi-wf__btn:hover { background: var(--adi-cl-accent, #e03127); border-color: var(--adi-cl-accent, #e03127); color: #fff; }
.adi-wf__btn--ghost { background: transparent; color: inherit; }
.adi-wf__btn--ghost:hover { background: transparent; border-color: var(--adi-cl-accent, #e03127); color: var(--adi-cl-accent, #e03127); }

.adi-wf__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-top: clamp(24px, 3vw, 34px);
	padding-top: 18px;
	border-top: 1px solid var(--adi-cl-rule);
}

.adi-wf__step {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--adi-cl-rule);
	border-radius: 3px;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.adi-wf__step:hover:not([disabled]) { border-color: var(--adi-cl-ink); }
.adi-wf__step[disabled] { opacity: .4; cursor: default; }

.adi-wf__position { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--adi-cl-muted); }

/* With no dialog support the panel still opens, as a block in the page. */
.adi-wf__dialog:not([open]) { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
	.adi-wf__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.adi-wf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.adi-wf__dialog { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: 0; margin: auto 0 0; }
	.adi-wf__btn { width: 100%; justify-content: center; }
	.adi-wf__nav { flex-direction: column-reverse; align-items: stretch; }
	.adi-wf__step { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.adi-wf__filter,
	.adi-wf__open,
	.adi-wf__logo img,
	.adi-wf__btn { transition: none; }
}

@media (prefers-contrast: more) {
	.adi-wf__logo img { filter: none; opacity: 1; }
}

/* Dark mode: the grid and panel follow the clients palette already set
   further up this file. */
@media (prefers-color-scheme: dark) {
	:root:not([data-adi-theme="light"]) .adi-wf__dialog::backdrop { background: rgba(0, 0, 0, .7); }
	:root:not([data-adi-theme="light"]) .adi-wf__btn { background: var(--adi-cl-ink); border-color: var(--adi-cl-ink); color: #141312; }
	:root:not([data-adi-theme="light"]) .adi-wf__filter.is-on { background: var(--adi-cl-ink); border-color: var(--adi-cl-ink); color: #141312; }
	:root:not([data-adi-theme="light"]) .adi-wf__cell:not(.has-dark) .adi-wf__logo img { filter: grayscale(1) invert(1); }
}
[data-adi-theme="dark"] .adi-wf__btn { background: var(--adi-cl-ink); border-color: var(--adi-cl-ink); color: #141312; }
[data-adi-theme="dark"] .adi-wf__filter.is-on { background: var(--adi-cl-ink); border-color: var(--adi-cl-ink); color: #141312; }
[data-adi-theme="dark"] .adi-wf__cell:not(.has-dark) .adi-wf__logo img { filter: grayscale(1) invert(1); }
