/* STS Exhibitor & Sponsor Directory
   Dark is the default so the grid sits inside the STS look used on the
   programme page. Add theme="light" to a shortcode for a white section. */

.sts-directory,
.sts-sponsors {
	--sts-accent: #E81E3D;
	--sts-bg: #000000;
	--sts-panel: #0d0d0d;
	--sts-line: rgba(255, 255, 255, .16);
	--sts-text: #ffffff;
	--sts-muted: #9a9a9e;
	--sts-cols: 4;

	background: var(--sts-bg);
	color: var(--sts-text);
	padding: 48px 24px 64px;
	margin: 0;
	box-sizing: border-box;
}

.sts-directory[data-theme="light"],
.sts-sponsors[data-theme="light"] {
	--sts-bg: #ffffff;
	--sts-panel: #ffffff;
	--sts-line: #d9dbe0;
	--sts-text: inherit;
	--sts-muted: #5b5f66;
}

.sts-directory *,
.sts-sponsors * {
	box-sizing: border-box;
}

.sts-inner {
	max-width: 1240px;
	margin: 0 auto;
}

/* Break out of the theme's narrow content column so the section runs
   edge to edge, the way the programme page does. */

.sts-directory.is-fullbleed,
.sts-sponsors.is-fullbleed {
	position: relative;
	left: 50%;
	right: 50%;
	width: 100vw;
	max-width: 100vw;
	margin-left: -50vw;
	margin-right: -50vw;
}

/* A faint seam so two full-bleed sections stacked on one page, for
   example a sponsor wall sitting above the exhibitor grid, read as two
   sections rather than one continuous block. */

.sts-directory.is-fullbleed,
.sts-sponsors.is-fullbleed {
	border-top: 1px solid var(--sts-line);
}

/* Section heading */

.sts-heading {
	margin: 0 0 8px;
	color: var(--sts-accent);
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.01em;
}

.sts-intro {
	max-width: 720px;
	margin: 0 0 28px;
	color: var(--sts-muted);
	font-size: 16px;
	line-height: 1.6;
}

.sts-heading + .sts-controls,
.sts-heading + .sts-az {
	margin-top: 28px;
}

/* Controls */

.sts-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 20px;
}

.sts-control {
	flex: 0 1 240px;
}

.sts-control-search {
	flex: 1 1 340px;
}

.sts-directory input[type="search"],
.sts-directory select {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--sts-line);
	border-radius: 4px;
	background: var(--sts-panel);
	color: var(--sts-text);
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	-webkit-appearance: none;
	appearance: none;
}

.sts-directory select {
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 19px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 40px;
}

.sts-directory input[type="search"]::placeholder {
	color: var(--sts-muted);
	opacity: 1;
}

.sts-directory input[type="search"]:focus,
.sts-directory select:focus {
	outline: none;
	border-color: var(--sts-accent);
	box-shadow: 0 0 0 1px var(--sts-accent);
}

/* A to Z */

.sts-az {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 20px;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--sts-line);
}

.sts-az-btn {
	min-width: 36px;
	padding: 8px 10px;
	border: 1px solid var(--sts-line);
	border-radius: 4px;
	background: transparent;
	color: var(--sts-text);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.sts-az-btn:hover:not([disabled]) {
	border-color: var(--sts-accent);
	color: var(--sts-accent);
}

.sts-az-btn.is-active {
	background: var(--sts-accent);
	border-color: var(--sts-accent);
	color: #fff;
}

.sts-az-btn[disabled] {
	opacity: .3;
	cursor: default;
}

.sts-az-btn:focus-visible {
	outline: 2px solid var(--sts-accent);
	outline-offset: 2px;
}

/* Count */

.sts-count {
	margin: 0 0 20px;
	color: var(--sts-muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* Grid */

.sts-grid {
	display: grid;
	grid-template-columns: repeat(var(--sts-cols), minmax(0, 1fr));
	gap: 20px;
}

.sts-directory[data-columns="2"] { --sts-cols: 2; }
.sts-directory[data-columns="3"] { --sts-cols: 3; }
.sts-directory[data-columns="4"] { --sts-cols: 4; }
.sts-directory[data-columns="5"] { --sts-cols: 5; }
.sts-directory[data-columns="6"] { --sts-cols: 6; }

.sts-card.is-hidden {
	display: none;
}

.sts-card-link {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 1px solid var(--sts-line);
	border-radius: 6px;
	overflow: hidden;
	background: var(--sts-panel);
	color: var(--sts-text);
	font: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: border-color .15s ease, transform .15s ease;
}

.sts-card-link:hover,
.sts-card-link:focus-visible {
	border-color: var(--sts-accent);
	transform: translateY(-2px);
	text-decoration: none;
	color: var(--sts-text);
}

.sts-card-link:focus-visible {
	outline: 2px solid var(--sts-accent);
	outline-offset: 2px;
}

.sts-card.is-featured .sts-card-link {
	border-color: var(--sts-accent);
}

/* Logos always sit on white so black and colour logos both read. */

.sts-card-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 140px;
	padding: 22px;
	background: #ffffff;
}

.sts-card-logo img,
.sts-sponsor-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.sts-logo-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #f1f2f4;
	color: #5b5f66;
	font-size: 24px;
	font-weight: 700;
}

.sts-card-body {
	display: block;
	padding: 18px 20px 20px;
}

.sts-card-name {
	display: block;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--sts-text);
}

.sts-card-stand {
	display: block;
	margin-top: 8px;
	color: var(--sts-accent);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.sts-empty,
.sts-none {
	margin: 32px 0;
	color: var(--sts-muted);
}

/* Red pill labels, as used on the programme page */

.sts-tag {
	display: inline-block;
	margin: 0 6px 6px 0;
	padding: 4px 10px;
	border: 1px solid var(--sts-accent);
	border-radius: 3px;
	color: var(--sts-accent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* Button */

.sts-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 26px;
	background: var(--sts-accent);
	border: 1px solid var(--sts-accent);
	border-radius: 3px;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none;
}

.sts-button:hover,
.sts-button:focus {
	background: transparent;
	color: var(--sts-accent);
	text-decoration: none;
}

/* Modal */

.sts-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.sts-modal[hidden] {
	display: none;
}

.sts-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .8);
}

.sts-modal-panel {
	position: relative;
	width: 100%;
	max-width: 700px;
	max-height: 86vh;
	overflow-y: auto;
	padding: 0 0 36px;
	background: #111114;
	border: 1px solid var(--sts-line);
	border-radius: 6px;
	color: #fff;
}

.sts-directory[data-theme="light"] .sts-modal-panel {
	background: #fff;
	color: inherit;
}

.sts-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	z-index: 2;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .5);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.sts-modal-close:hover {
	background: var(--sts-accent);
}

.sts-modal-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 160px;
	padding: 28px;
	background: #fff;
}

.sts-modal-logo:empty {
	display: none;
}

.sts-modal-logo img {
	max-width: 260px;
	max-height: 120px;
	width: auto;
	height: auto;
}

.sts-modal-content {
	padding: 30px 36px 0;
}

.sts-detail-name {
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
}

.sts-detail-stand {
	margin-top: 10px;
	color: var(--sts-accent);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.sts-detail-country {
	margin-top: 6px;
	color: var(--sts-muted);
	font-size: 14px;
}

.sts-detail-sectors {
	margin-top: 18px;
}

.sts-detail-bio {
	margin-top: 20px;
	line-height: 1.65;
	color: var(--sts-muted);
}

.sts-directory[data-theme="light"] .sts-detail-bio {
	color: inherit;
}

.sts-detail-bio p {
	margin: 0 0 1em;
}

.sts-detail-cta {
	margin-top: 26px;
}

.sts-detail-more {
	margin-top: 14px;
	font-size: 14px;
}

.sts-detail-more a {
	color: var(--sts-muted);
}

body.sts-modal-open {
	overflow: hidden;
}

/* Sponsor wall */

.sts-sponsors[data-columns="2"] { --sts-cols: 2; }
.sts-sponsors[data-columns="3"] { --sts-cols: 3; }
.sts-sponsors[data-columns="4"] { --sts-cols: 4; }
.sts-sponsors[data-columns="5"] { --sts-cols: 5; }
.sts-sponsors[data-columns="6"] { --sts-cols: 6; }

.sts-tier-heading {
	margin: 40px 0 18px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--sts-line);
	color: var(--sts-text);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.sts-tier-heading:first-child {
	margin-top: 0;
}

.sts-sponsor-grid {
	display: grid;
	grid-template-columns: repeat(var(--sts-cols), minmax(0, 1fr));
	gap: 20px;
}

.sts-sponsor {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	border: 1px solid var(--sts-line);
	border-radius: 6px;
	overflow: hidden;
	background: var(--sts-panel);
	color: var(--sts-text);
	text-align: center;
	text-decoration: none;
}

a.sts-sponsor:hover,
a.sts-sponsor:focus-visible {
	border-color: var(--sts-accent);
	text-decoration: none;
	color: var(--sts-text);
}

.sts-sponsor-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 120px;
	padding: 20px;
	background: #fff;
}

.sts-sponsor-name {
	padding: 16px 16px 0;
	font-size: 15px;
	font-weight: 700;
}

.sts-sponsor-stand {
	display: block;
	margin-top: 6px;
	padding: 0 16px;
	color: var(--sts-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.sts-sponsor-tier {
	display: inline-block;
	margin: 8px 16px 0;
	padding: 3px 9px;
	border: 1px solid var(--sts-accent);
	border-radius: 3px;
	color: var(--sts-accent);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.sts-sponsor-of {
	display: block;
	padding: 6px 16px 18px;
	color: var(--sts-muted);
	font-size: 12px;
}

.sts-sponsor-name:last-child,
.sts-sponsor-stand:last-child,
.sts-sponsor-tier:last-child {
	padding-bottom: 18px;
	margin-bottom: 0;
}

/* Single listing page, if individual pages are switched on */

.sts-single-logo img {
	max-width: 240px;
	height: auto;
}

.sts-single-facts {
	margin: 16px 0;
}

.sts-single-facts p {
	margin: 0 0 4px;
}

.sts-single-footer {
	margin-top: 24px;
}

/* Screen reader helper, in case the theme does not define one */

.sts-directory .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Responsive */

@media (max-width: 1024px) {
	.sts-grid,
	.sts-sponsor-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.sts-directory,
	.sts-sponsors {
		padding: 36px 18px 48px;
	}

	.sts-grid,
	.sts-sponsor-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.sts-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.sts-control,
	.sts-control-search {
		flex: 1 1 100%;
	}

	.sts-modal {
		padding: 0;
	}

	.sts-modal-panel {
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
		border: 0;
	}

	.sts-modal-content {
		padding: 24px 20px 0;
	}

	.sts-detail-name {
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sts-card-link {
		transition: none;
	}

	.sts-card-link:hover {
		transform: none;
	}
}
