/**
 * Listing preview cards in the prototype's visual language.
 *
 * MyListing renders every listing in a feed, an explore page or a search result
 * through one of three preview card templates, configured per listing type:
 * "default" (cover image with the text on top, used by companies), "list-view"
 * (text only, used by news) and "alternate". This restyles them site-wide, as
 * agreed on 2026-09-21, so a card looks the same wherever it appears rather
 * than only on the pages already redesigned.
 *
 * Events are configured with "default" too but no longer use its markup: the
 * child's default.php hands them to our own event.php, the prototype's
 * EventCard, styled in the last section of this file.
 *
 * Structure, because it drives every selector here: the outer element is
 * .lf-item-container. Inside it sits .lf-item — the image with the title and
 * info fields laid over it — followed by the footer sections (.event-host,
 * .listing-details, .listing-details-3) as siblings, not children of .lf-item.
 * The parent theme joins all of that into one white box with dividing lines.
 * The footer sections lose those rules; the box itself is redrawn in the event
 * card's border, shadow and hover lift, so that a company, a news item and an
 * event read as one kind of card side by side in search results (2026-09-25).
 *
 * Specificity: the parent theme styles these cards from several stylesheets, in
 * an order we do not control, and some of its rules carry three classes. Every
 * selector here is therefore anchored on .lf-item-container — which is also
 * what it means: this is the card. Rules written shorter than that lost.
 *
 * What this does not do: change which fields a card shows. The prototype's news
 * card has neither the lead text nor the tag list that the news listing type is
 * configured to print. Dropping those is a listing type change on staging, not
 * a stylesheet change, and stays a decision for whoever owns the content.
 */

/* --------------------------------------------------------------------------
 * The card as a whole
 * -------------------------------------------------------------------------- */

/*
 * The verified-listing tick on company cards only (decision of October 5,
 * 2026): it tells a claimed company from an unclaimed one, and on an event,
 * a job or a news item it says nothing. The parent's card templates print it
 * after the title of every claimed listing, with no setting or filter
 * ("verified" is the claimed state), so the other types hide it here. The
 * listing page's hero applies the same rule in main-info.php. style.css hides
 * it in the map popup since 2021.
 */
.lf-item-container:not(.type-company) img.verified-listing {
	display: none;
}

/*
 * One image height for every card, so that mixed results line up: the midpoint
 * between the prototype's event image (16:9) and its company card (4:3),
 * measured as height over width — 0.65625, or 32:21 (2026-09-25).
 */
.lf-item-container {
	--sba-card-media-ratio: 32 / 21;
	background-color: transparent;
	border-radius: 0;
	overflow: visible;
	box-shadow: none;
}

/*
 * Every card but the event card, which draws its own box inside the container
 * (.sba-event-card, below): border, shadow and hover as there. No overflow
 * clipping, so the bookmark and badge tooltips can leave the card; the image
 * rounds its own top corners instead.
 */
.lf-item-container:not(.type-event) {
	border: 1px solid color-mix(in srgb, var(--sba-border) 50%, transparent);
	border-radius: var(--sba-radius);
	background-color: var(--sba-surface);
	box-shadow: 0 1px 2px 0 hsl(var(--sba-charcoal-hsl) / 0.05);
	transition:
		transform var(--sba-duration-hover) ease,
		box-shadow var(--sba-duration-hover) ease;
}

.lf-item-container:not(.type-event):hover {
	transform: translateY(-4px);
	box-shadow:
		0 10px 15px -3px hsl(var(--sba-charcoal-hsl) / 0.1),
		0 4px 6px -4px hsl(var(--sba-charcoal-hsl) / 0.1);
}

/*
 * The base title, for card templates this file does not size individually —
 * "alternate", and anything a listing type is configured with later. It used to
 * come from a global `font-size: 19px !important` in the Customizer stylesheet,
 * which no card design could override; that rule is gone and this replaces it.
 */
.lf-item-container .listing-preview-title {
	font-family: var(--sba-font-sans);
	font-size: 20px;
	font-weight: var(--sba-heading-weight);
	line-height: 1.375;
	letter-spacing: var(--sba-heading-tracking);
}

/* --------------------------------------------------------------------------
 * Cover image cards: companies
 * -------------------------------------------------------------------------- */

/*
 * The theme gives the card a fixed height and the image inside it another one,
 * so the image overflows and is cropped. The card takes the shared image ratio
 * instead and the image fills it. It is the top of the card's box, so only the top corners
 * round, a pixel tighter than the box to sit inside its border.
 */
.lf-item-container .lf-item.lf-item-default {
	height: auto;
	aspect-ratio: var(--sba-card-media-ratio);
	border-radius: calc(var(--sba-radius) - 1px) calc(var(--sba-radius) - 1px) 0 0;
	overflow: hidden;
}

.lf-item-container .lf-item-default .lf-background,
.owl-carousel .lf-item-container .lf-item-default .lf-background {
	height: 100%;
}

/*
 * The flat overlay is a global MyListing setting — colour and opacity are both
 * inline, and the hover state raises the opacity with !important. It cannot
 * express a gradient, so it is hidden and the gradient painted on a
 * pseudo-element instead of fought with more !important.
 */
.lf-item-container .lf-item-default .overlay {
	display: none;
}

.lf-item-container .lf-item-default > a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background-image: linear-gradient(
		to top,
		hsl(var(--sba-charcoal-hsl) / 0.75) 0%,
		hsl(var(--sba-charcoal-hsl) / 0.2) 50%,
		hsl(var(--sba-charcoal-hsl) / 0) 100%
	);
}

.lf-item-container .lf-item-default .lf-background {
	transition: transform 0.5s ease;
}

.lf-item-container:hover .lf-item-default .lf-background {
	transform: scale(1.05);
}

/*
 * The parent's logo tile is hidden on every card but the company's, which
 * has its own below. Hiding it also releases the indent the parent reserves
 * for it.
 */
.lf-item-container .lf-item-default .lf-avatar {
	display: none;
}

.lf-item-container.has-logo .lf-item-default .lf-item-info {
	padding-left: 0;
}

/*
 * The company card's tile, left of the name: the company icon, the company
 * logo when the listing has no icon (includes/raskin/company-cards.php), and
 * the building icon when it has neither. It is the Directory hero's logo
 * tile (.sba-pf-directory-logo in platforms.css): 44px, white, the image
 * contained with 4px around it, so a wide logo is shown whole.
 *
 * The parent template prints .lf-avatar only when there is an image, and the
 * container's has-logo class knows the icon alone, so "no tile in the info
 * block" is the fallback condition, as in the host row below. The building
 * is the same Lucide SVG the icon stylesheets use, 24px in slate.
 */
.lf-item-container.type-company .lf-item-default .lf-item-info {
	min-height: 44px;
	padding-left: 56px;
}

.lf-item-container.type-company .lf-item-default .lf-avatar,
.lf-item-container.type-company .lf-item-default .lf-item-info:not(:has(.lf-avatar))::before {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 44px;
	height: 44px;
	border: 4px solid var(--sba-surface);
	border-radius: var(--sba-radius-md);
	background-color: var(--sba-surface);
	background-origin: content-box;
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

.lf-item-container.type-company .lf-item-default .lf-item-info:not(:has(.lf-avatar))::before {
	content: "";
}

.lf-item-container.type-company .lf-item-default .lf-item-info:not(:has(.lf-avatar))::after {
	content: "";
	position: absolute;
	top: 10px;
	left: 10px;
	width: 24px;
	height: 24px;
	background-color: var(--sba-slate);
	-webkit-mask: url("../icons/lucide/building-2.svg") center / contain no-repeat;
	mask: url("../icons/lucide/building-2.svg") center / contain no-repeat;
}

/*
 * 24px from the card's edge, the footer sections' padding, so the label, the
 * tile and the rows below the image share one left edge.
 */
.lf-item-container .lf-item-default .lf-item-info {
	left: 24px;
	right: 24px;
	bottom: 16px;
}

.lf-item-container .lf-item-default .lf-item-info > h4 {
	font-size: 20px;
	line-height: 1.375;
	margin-bottom: 4px;
}

.lf-item-container .lf-item-default .lf-item-info > ul li {
	font-size: 14px;
	padding-bottom: 0;
}

/* Date badge, top left, reading as a label on the image rather than a control. */
.lf-item-container .lf-item-default .lf-head {
	top: 16px;
	left: 24px;
}

/*
 * The featured badge is hidden site-wide, but its tooltip wrapper stays in
 * the row of a featured card and takes the row's 5px gap, which indented the
 * label behind it.
 */
.lf-item-container .lf-item-default .lf-head > .tooltip-element:has(> .ad-badge) {
	display: none;
}

.lf-item-container .lf-item-default .lf-head-btn {
	height: auto;
	padding: 6px 12px;
	border: 0;
	border-radius: var(--sba-radius-sm);
	background-color: hsl(0 0% 100% / 0.9);
	backdrop-filter: blur(4px);
	color: var(--sba-charcoal);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
}

.lf-item-container .lf-item-default .lf-head-btn.formatted .event-date {
	color: var(--sba-charcoal);
}

/* --------------------------------------------------------------------------
 * Text-only cards: news
 * -------------------------------------------------------------------------- */

.lf-item-container .lf-item.lf-item-list-view {
	border: 0;
	border-radius: calc(var(--sba-radius) - 1px) calc(var(--sba-radius) - 1px) 0 0;
	overflow: hidden;
}

/*
 * The border reset is for the Customizer stylesheet's
 * ".type-news .lf-item.lf-item-list-view .lf-item-info", which gives the card a
 * dividing line and a 10px padding. It ties with this selector, and this file
 * is enqueued after legacy-customizer.css, so order settles it — see
 * docs/customizer-css.md.
 */
.lf-item-container .lf-item.lf-item-list-view .lf-item-info,
.lf-item-container.no-logo .lf-item.lf-item-list-view .lf-item-info,
.lf-item-container.no-info-fields .lf-item.lf-item-list-view .lf-item-info {
	min-height: 0;
	padding: 24px;
	border: 0;
	background-color: var(--sba-surface);
}

.lf-item-container .lf-item.lf-item-list-view .lf-avatar {
	display: none;
}

/*
 * A news item's cover image, set by the child's previews/list-view.php only
 * when the item has one of its own. On a narrow card (a results grid, a
 * phone) it lies across the top in the cards' ratio, as on event and company
 * cards; on a wide one (the archive's single column) at the left, beside
 * the text. The card measures itself, so the same rule serves both.
 */
.lf-item-container .lf-item.lf-item-list-view.has-cover {
	container-type: inline-size;
}

.lf-item-list-view.has-cover .sba-news-card-media {
	aspect-ratio: var(--sba-card-media-ratio);
	overflow: hidden;
	background-color: var(--sba-muted);
}

.lf-item-list-view.has-cover .sba-news-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.lf-item-container:hover .lf-item-list-view.has-cover .sba-news-card-media img {
	transform: scale(1.02);
}

@container (min-width: 640px) {
	.lf-item-list-view.has-cover > a {
		display: grid;
		grid-template-columns: 280px minmax(0, 1fr);
		align-items: start;
	}

	/* The picture keeps the text's 24px from the card's edge and takes the
	   card's inner corners. */
	.lf-item-list-view.has-cover .sba-news-card-media {
		margin: 24px 0 0 24px;
		border-radius: var(--sba-radius-md);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lf-item-container:hover .lf-item-list-view.has-cover .sba-news-card-media img {
		transform: none;
	}
}

/*
 * All news, /news/: one column at every width. The Customizer stylesheet
 * says so (".explore-type-2 .col-md-4 { width: 100% }"), but between 992px
 * and 1200px the parent's explore-widget.css sets the same columns to 50%
 * with !important, and the list turned into two columns there, on
 * production too. Hence the !important here. The explore widget's class on
 * that page carries the rule, so the search results' grid keeps its columns.
 */
.explore-news .explore-type-2 .results-view > .grid-item {
	width: 100% !important;
}

/* "Featured" above the title of a news item with a priority, the event
   card's "Featured event"; set by the child's previews/list-view.php. */
.lf-item-container .lf-item.lf-item-list-view .lf-item-info > .sba-card-eyebrow {
	margin: 0 0 12px;
	color: var(--sba-red-dark);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
}

.lf-item-container .lf-item.lf-item-list-view .lf-item-info > h4 {
	font-size: 20px;
	line-height: 1.375;
	margin-bottom: 12px;
}

.lf-item-container .lf-item.lf-item-list-view .lf-item-info > ul li {
	color: var(--sba-slate);
	font-size: 14px;
	white-space: normal;
}

/* --------------------------------------------------------------------------
 * Footer sections, inside the card's box without dividing lines
 * -------------------------------------------------------------------------- */

.lf-item-container .c27-footer-section,
.listing-preview .c27-footer-section {
	background: transparent;
	border-top: 0;
	border-radius: 0;
}

.lf-item-container .event-host,
.lf-item-container .listing-details,
.lf-item-container .listing-details-3 {
	height: auto;
	min-height: 0;
	padding: 12px 24px 0;
	background: transparent;
}

/*
 * The parent zeroes .listing-details-3's padding with !important, so these rows
 * take theirs on the list inside.
 */
.lf-item-container .listing-details-3 > .details-list {
	padding: 12px 24px 0;
}

/* The event card's body padding, at the bottom of the box. */
.lf-item-container > .c27-footer-section:last-child,
.lf-item-container > .listing-details-3:last-child > .details-list {
	padding-bottom: 24px;
}

.lf-item-container .event-host .host-name,
.lf-item-container .listing-details-3 .details-list li {
	color: var(--sba-slate);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
}

/*
 * The host row leads with the host's logo — the company listing's icon, as the
 * old production site showed it — and falls back to the prototype's building
 * icon when the company has none. The parent template only prints .avatar when
 * a logo exists, so "no avatar in the row" is the whole fallback condition.
 * The icon is drawn from the same Lucide SVG the icon stylesheets use, in the
 * row's own text colour.
 */
.lf-item-container .event-host > a {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

/* The parent floats the logo with its own margin; the flex row handles both. */
.lf-item-container.listing-preview .event-host .avatar {
	flex: 0 0 24px;
	float: none;
	width: 24px;
	height: 24px;
	margin: 0;
	border-radius: var(--sba-radius-sm);
	overflow: hidden;
}

.lf-item-container .event-host .avatar img {
	object-fit: contain;
}

.lf-item-container .event-host > a:not(:has(.avatar))::before {
	content: "";
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	background-color: var(--sba-slate);
	-webkit-mask: url("../icons/lucide/building-2.svg") center / contain no-repeat;
	mask: url("../icons/lucide/building-2.svg") center / contain no-repeat;
}

.lf-item-container .event-host .host-name {
	max-width: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lf-item-container .listing-details-3 .details-list li {
	padding: 0;
}

.lf-item-container .listing-details-3 .details-list li i {
	width: auto;
	margin-right: 8px;
	margin-bottom: 0;
	color: var(--sba-slate);
}

.lf-item-container .listing-details-3 .details-list li span {
	width: auto;
	text-align: left;
}

/*
 * The term row (categories, tags, regions). The parent positions both halves
 * absolutely — the term list at left: 15px, the bookmark and quick view at
 * right: 15px — and relies on its fixed 55px footer height to hold them. With
 * the height released above, the footer shrank to its 12px padding, the
 * absolute list centred itself on that and hung into the card below. Both go
 * back into the footer's flex row, so the row is as tall as its content
 * wherever the card sits.
 *
 * The list keeps the Customizer stylesheet's `width: 100% !important`; as a
 * flex item it shrinks from there to leave room for .ld-info.
 */
.lf-item-container .listing-details > ul {
	position: static;
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 8px;
	min-width: 0;
	float: none;
}

/* The first term gives way when the row is short; the "+3" keeps its width. */
.lf-item-container .listing-details > ul > li {
	flex: 0 0 auto;
	float: none;
	max-width: none;
	margin: 0;
	overflow: visible;
}

.lf-item-container .listing-details > ul > li:first-child {
	flex: 0 1 auto;
	min-width: 0;
	max-width: none;
	margin: 0;
}

/* Room between the last chip and the bookmark on a narrow card. */
.lf-item-container .listing-details {
	column-gap: 12px;
}

/* A second term row (a job's type under its categories) reads as a wrapped
 * line of the first: the chips' own gap rather than the footer's. */
.lf-item-container .listing-details + .listing-details:not(.actions) {
	padding-top: 8px;
}

.lf-item-container .listing-details .ld-info {
	position: static;
	flex: 0 0 auto;
	margin-left: auto;
	float: none;
}

/* --------------------------------------------------------------------------
 * The chip: a term wherever a listing names one
 * -------------------------------------------------------------------------- */

/*
 * One chip for a category, a tag or a region, on a card's footer and in the
 * term blocks of the single listing page (whose list layout is in
 * listing.css): the muted surface with the small radius, 14px at weight 500,
 * light red on hover when it links to the term's listings. See the style
 * guide's layout page, "Chip".
 *
 * The parent drew a term on a card as a 30px disc in the term's color with
 * the term's icon, and the name beside it in red. Neither taxonomy has
 * per-term icons, so every disc showed the same glyph, or none where the icon
 * stylesheet is not loaded; the disc goes, as it did on the listing page, and
 * the count of further terms ("+3", their names in its tooltip) is a chip of
 * the same kind rather than a second disc.
 */
#c27-single-listing .element .pf-body .details-list li a,
#c27-single-listing .element .pf-body .details-list li .terms-no-link,
#c27-single-listing .element .pf-body .listing-details li a,
#c27-single-listing .element .pf-body .listing-details li .terms-no-link,
.lf-item-container .listing-details > ul > li a {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 6px 12px;
	border-radius: var(--sba-radius-sm);
	background: var(--sba-muted);
	color: var(--sba-charcoal-light);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	transition:
		background-color var(--sba-duration-hover) ease,
		color var(--sba-duration-hover) ease;
}

#c27-single-listing .element .pf-body .details-list li a:hover,
#c27-single-listing .element .pf-body .listing-details li a:hover,
.lf-item-container .listing-details > ul > li a:hover {
	background: var(--sba-red-light);
	color: var(--sba-red-dark);
}

.lf-item-container .listing-details > ul .cat-icon:not(.cat-more) {
	display: none;
}

/* With a:hover in the selector as well: style.css underlines the name there. */
.lf-item-container .listing-details > ul .category-name,
.lf-item-container .listing-details > ul a:hover .category-name {
	display: block;
	padding: 0;
	border: 0;
	overflow: hidden;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lf-item-container .listing-details > ul .cat-more {
	display: block;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

/* --------------------------------------------------------------------------
 * A term as a destination: the Categories tab of an explore page
 * -------------------------------------------------------------------------- */

/*
 * The tab lists a listing type's terms as tiles, each one a filter. The
 * parent draws a 130px slab with the term's image under a dark overlay, the
 * term icon and white text; no term here has an image, so it was a grey slab
 * (the Customizer rules that set its height and overlay are pruned from
 * legacy-customizer.css). It becomes the guide's quiet card as a row: the
 * term's name and its listing count, the border in red on hover, the light
 * red of a chip's hover once selected.
 */
.finder-search .listing-cat {
	height: auto;
	margin-bottom: 8px;
	border: 1px solid hsl(220 13% 90% / 0.6);
	border-radius: var(--sba-radius);
	background: var(--sba-surface);
	transition:
		border-color var(--sba-duration-hover) ease,
		background-color var(--sba-duration-hover) ease;
}

.finder-search .listing-cat:hover {
	border-color: hsl(var(--sba-red-hsl) / 0.4);
}

.finder-search .listing-cat.active {
	border-color: transparent;
	background: var(--sba-red-light);
}

.finder-search .listing-cat .overlay,
.finder-search .listing-cat .lc-background,
.finder-search .listing-cat .lc-icon {
	display: none;
}

.finder-search .listing-cat .lc-info {
	position: static;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	width: auto;
	padding: 12px 16px;
	text-align: left;
}

.finder-search .listing-cat .lc-info h4 {
	margin: 0;
	color: var(--sba-charcoal);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
}

.finder-search .listing-cat.active .lc-info h4 {
	color: var(--sba-red-dark);
}

.finder-search .listing-cat .lc-info h6 {
	flex: 0 0 auto;
	margin: 0;
	opacity: 1;
	color: var(--sba-slate);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
}

/* The selected term above its sub-terms: the name alone, without the disc. */
.finder-search .active-taxonomy-container .cat-icon {
	display: none;
}

.finder-search .active-taxonomy-container .category-name {
	color: var(--sba-charcoal);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

/* Bookmark and quick view: plain icons, as in the prototype, not grey discs. */
.lf-item-container .ld-info ul li a {
	width: 24px;
	height: 24px;
	background: transparent;
}

.lf-item-container .ld-info ul li i {
	color: var(--sba-slate);
	transition: color var(--sba-duration-hover) ease;
}

.lf-item-container .ld-info ul li a:hover i {
	color: var(--sba-red-dark);
}

/* --------------------------------------------------------------------------
 * Rows: one height per row
 * -------------------------------------------------------------------------- */

/*
 * Every card in a row as tall as the tallest: now that every card is a box, a
 * row of boxes of different heights reads as broken. In a grid the cell
 * already stretches; in a feed widget's carousel Owl lays the slides out as
 * floated blocks, so the stage becomes a flex row and each slide passes its
 * height down to the card.
 */
.lf-item-container {
	height: 100%;
}

.owl-carousel .owl-stage:has(.lf-item-container) {
	display: flex;
}

.owl-carousel .owl-item:has(.lf-item-container) {
	float: none;
	display: flex;
	flex-direction: column;
}

.owl-carousel .owl-item:has(.lf-item-container) > div {
	flex: 1 1 auto;
}

/*
 * Explore pages and search results lay their results out with Isotope's
 * masonry: every card absolutely positioned under the previous one in its
 * column, from inline styles, so cards of different heights stagger. The grid
 * becomes a wrapping flex row instead. The items keep the column widths the
 * parent's explore-widget.css gives them per breakpoint, and each row
 * stretches to its tallest card. !important only against Isotope's inline
 * position, offsets and container height, which it rewrites on every layout.
 */
.results-view.grid:has(> .grid-item .lf-item-container) {
	display: flex;
	flex-wrap: wrap;
	height: auto !important;
}

.results-view.grid:has(> .grid-item .lf-item-container) > .grid-item {
	position: static !important;
	display: flex;
	flex-direction: column;
	float: none;
}

.results-view.grid > .grid-item > .lf-item-container {
	flex: 1 1 auto;
	height: auto;
}

/* --------------------------------------------------------------------------
 * Event cards
 *
 * The prototype's EventCard (sba3, src/components/EventCard.tsx): a white card
 * with the image on top, then eyebrow, title, teaser, the date, location and
 * host rows and "Event details". Markup in
 * templates/single-listing/previews/event.php; nothing of the parent's card
 * markup is left in it, so none of the rules above reach it.
 * -------------------------------------------------------------------------- */

.sba-event-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--sba-border) 50%, transparent);
	border-radius: var(--sba-radius);
	background-color: var(--sba-surface);
	box-shadow: 0 1px 2px 0 hsl(var(--sba-charcoal-hsl) / 0.05);
	font-family: var(--sba-font-sans);
	transition:
		transform var(--sba-duration-hover) ease,
		box-shadow var(--sba-duration-hover) ease;
}

.sba-event-card:hover {
	transform: translateY(-4px);
	box-shadow:
		0 10px 15px -3px hsl(var(--sba-charcoal-hsl) / 0.1),
		0 4px 6px -4px hsl(var(--sba-charcoal-hsl) / 0.1);
}

/* The title's link is the card's link, so its focus ring is the card's. */
.sba-event-card:has(.sba-event-card__title a:focus-visible) {
	outline: 2px solid var(--sba-ring);
	outline-offset: 2px;
}

.sba-event-card__media {
	aspect-ratio: var(--sba-card-media-ratio);
	overflow: hidden;
	background-color: var(--sba-muted);
}

.sba-event-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.sba-event-card:hover .sba-event-card__media img {
	transform: scale(1.02);
}

.sba-event-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 24px;
}

.sba-event-card__eyebrow {
	margin: 0 0 12px;
	color: var(--sba-red-dark);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
}

.sba-event-card__title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--sba-charcoal);
	font-family: var(--sba-font-sans);
	font-size: 20px;
	font-weight: var(--sba-heading-weight);
	letter-spacing: normal;
	line-height: 1.375;
}

.sba-event-card__title a,
.sba-event-card__title a:hover {
	color: inherit;
	text-decoration: none;
}

.sba-event-card__title a:focus-visible {
	outline: none;
}

/* Stretched over the card: image, text and "Event details" all lead here. */
.sba-event-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.sba-event-card__teaser {
	display: -webkit-box;
	margin: 12px 0 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--sba-slate);
	font-size: 14px;
	line-height: 1.625;
}

.sba-event-card__meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 16px 0 0;
	padding: 0;
}

.sba-event-card__meta li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	min-width: 0;
	margin: 0;
	color: var(--sba-slate);
	font-size: 14px;
	line-height: 20px;
}

/*
 * Row icons, as in the style guide: calendar-days for the date, map-pin for
 * the location, building-2 for the host when the host has no logo. Drawn as
 * masks in the row's text colour, like the parent-icon mapping in icons.css.
 */
.sba-event-card__meta li::before {
	content: "";
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	background-color: currentColor;
	-webkit-mask: var(--sba-event-card-icon) center / contain no-repeat;
	mask: var(--sba-event-card-icon) center / contain no-repeat;
}

.sba-event-card__date {
	--sba-event-card-icon: url("../icons/lucide/calendar-days.svg");
}

.sba-event-card__location {
	--sba-event-card-icon: url("../icons/lucide/map-pin.svg");
}

.sba-event-card__host {
	--sba-event-card-icon: url("../icons/lucide/building-2.svg");
}

.sba-event-card__meta li.has-logo::before {
	content: none;
}

/*
 * The host's logo — the company listing's icon — in place of the building.
 * 20px, a size up from the icons, so a logo stays legible; it sits on the
 * row's line box, where the icons sit 2px down inside it. Three classes,
 * because in a carousel Owl's ".owl-carousel .owl-item img" sets every image
 * to the full width.
 */
.sba-event-card .sba-event-card__meta .sba-event-card__host-logo {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	border-radius: var(--sba-radius-sm);
	object-fit: contain;
}

.sba-event-card__host a,
.sba-event-card__host span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Above the stretched title link, so the host keeps its own target. */
.sba-event-card__host a {
	position: relative;
	z-index: 2;
	color: inherit;
	text-decoration: none;
	transition: color var(--sba-duration-hover) ease;
}

.sba-event-card__host a:hover {
	color: var(--sba-charcoal);
}

.sba-event-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: auto;
	padding-top: 20px;
}

.sba-event-card__more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--sba-red-dark);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	transition: color var(--sba-duration-hover) ease;
}

.sba-event-card__more::after {
	content: "";
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: url("../icons/lucide/arrow-right.svg") center / contain no-repeat;
	mask: url("../icons/lucide/arrow-right.svg") center / contain no-repeat;
	transition: transform var(--sba-duration-hover) ease;
}

.sba-event-card:hover .sba-event-card__more {
	color: var(--sba-red-darker);
}

.sba-event-card:hover .sba-event-card__more::after {
	transform: translateX(2px);
}

/* The bookmark button: a plain icon, as on the other cards. */
.sba-event-card__actions {
	position: relative;
	z-index: 2;
	display: flex;
	margin: 0;
	padding: 0;
}

.sba-event-card__actions li {
	margin: 0;
}

.sba-event-card__actions a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.sba-event-card__actions i {
	color: var(--sba-slate);
	font-size: 18px;
	transition: color var(--sba-duration-hover) ease;
}

.sba-event-card__actions a:hover i,
.sba-event-card__actions a.bookmarked i {
	color: var(--sba-red-dark);
}

/* --------------------------------------------------------------------------
 * The explore sidebar: title, "Add" pill, links
 *
 * Every explore page (companies, jobs, events, news, the search results)
 * opens its sidebar with the page title, left-aligned, and the "Add" pill
 * to its right; the guides, the newsletter and the Directory's page are
 * links at the foot. The markup comes from includes/raskin/explore.php,
 * which also shows each element for its type. See docs/explore.md.
 *
 * The pill is the listing page's utility pill on a light ground: fully
 * round, 6px by 16px of padding, 14px at weight 500, the outline button's
 * border and hover, the plus after the label. The foot's links are the
 * guide's link buttons, the arrow after the label, moving 4px on hover.
 *
 * Where the sidebar is the panel behind "Filters" (below 1200px, and on the
 * news page at every width) assets/js/company-finder.js copies them into
 * the search bar, right of "Filters" and in its style (.sba-explore-head-add).
 * It also puts the company link under an empty search result, see
 * docs/company-finder.md.
 * -------------------------------------------------------------------------- */

.sba-explore-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
	padding: 0 10px;
}

.sba-explore-head .finder-title,
.finder-search .sba-explore-head .finder-title {
	flex: 1 1 auto;
	min-width: 0;
	margin-bottom: 0;
	text-align: left;
}

.sba-explore-actions {
	flex: 0 0 auto;
	/* Centers the pill on the first line of the 30px title. */
	margin-top: 4px;
}

.sba-explore-add {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 16px;
	border: 1px solid hsl(var(--sba-charcoal-hsl) / 0.2);
	border-radius: 9999px;
	background-color: var(--sba-surface);
	color: var(--sba-charcoal);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
	transition:
		border-color var(--sba-duration-hover) ease,
		color var(--sba-duration-hover) ease;
}

.sba-explore-add:hover,
.sba-explore-add:focus {
	border-color: var(--sba-red);
	color: var(--sba-red-dark);
}

.sba-explore-add .sba-i {
	font-size: 16px;
	line-height: 1;
}

/* Before Vue has compiled the sidebar, every type's elements are in the
   document with their v-show attribute; hidden until it decides. */
.sba-explore-add[v-show],
.sba-explore-link[v-show] {
	display: none;
}

/* Where the sidebar is the panel behind "Filters", the bar with the search
   field carries "Add" as well: right of "Filters" and in its style, text and
   icon in dark red at 14px, weight 600. The parent splits that bar 75/25
   between the field and "Filters"; with a third item the field takes what
   the two leave. */
/* With "Filters" in the flow the bar centers its three items. On the news
   page the bar is a block on a wide screen, the field 400px wide. */
.mobile-explore-head-top:has(.sba-explore-head-add) {
	align-items: center;
}

.no-map-tmpl > .mobile-explore-head-top:has(.sba-explore-head-add) {
	display: flex;
}

.mobile-explore-head-top:has(.sba-explore-head-add) .explore-head-search {
	flex: 1 1 auto;
	min-width: 0;
}

/* The parent pins "Filters" to the bar's right edge with position: absolute;
   back in the flow it is pushed right by its margin, where the field has a
   fixed width (the news page on a wide screen), and "Add" follows it. */
.mobile-explore-head-top:has(.sba-explore-head-add) .explore-head-top-filters {
	position: static;
	flex: 0 0 auto;
	margin-left: auto;
}

.sba-explore-head-add {
	display: flex;
	flex: 0 0 auto;
}

.sba-explore-head-add:not(:has(a:not([style*="none"]))) {
	display: none;
}

.sba-explore-head-link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding-left: 16px;
	color: var(--sba-red-dark);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.sba-explore-head-link:hover,
.sba-explore-head-link:focus {
	color: var(--sba-red-darker);
}

.sba-explore-head-link .sba-i {
	font-size: 20px;
	line-height: 1;
}

/* In the filter panel the bar already offers it. */
.no-map-tmpl .sba-explore-actions {
	display: none;
}

@media (max-width: 1199px) {
	.sba-explore-actions {
		display: none;
	}

	/* The explore pages keep the gutter of every other page, 16px
	   (--sba-container-padding), where MyListing's mobile layout has 10px:
	   the bar with the search field and "Filters", the "Showing" line and
	   the cards. */
	.cts-explore .mobile-explore-head-top,
	.cts-explore .fl-head .explore-desktop-head,
	.cts-explore .finder-listings .grid-item {
		padding-right: var(--sba-container-padding);
		padding-left: var(--sba-container-padding);
	}
}

.sba-explore-links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin-top: 32px;
	padding-bottom: 24px;
}

.sba-explore-btn,
.sba-explore-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-align: left;
	text-decoration: none;
	transition:
		border-color var(--sba-duration-hover) ease,
		color var(--sba-duration-hover) ease;
}

.sba-explore-link {
	color: var(--sba-red-dark);
}

.sba-explore-link:hover,
.sba-explore-link:focus {
	color: var(--sba-red-darker);
}

.sba-explore-btn .sba-i,
.sba-explore-link .sba-i {
	flex: 0 0 auto;
	font-size: 16px;
	line-height: 1;
	transition: transform var(--sba-duration-hover) ease;
}

.sba-explore-btn:hover .sba-i,
.sba-explore-link:hover .sba-i {
	transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
	.sba-explore-btn:hover .sba-i,
	.sba-explore-link:hover .sba-i {
		transform: none;
	}
}

/* Under an empty company search: the sentence and the guide's outline
   button, which names the page in full. */
.no-results-wrapper .sba-explore-empty {
	display: block;
	margin-top: 24px;
	color: var(--sba-slate);
	font-size: 14px;
	line-height: 20px;
	text-align: center;
}

.sba-explore-btn {
	min-height: 40px;
	margin-top: 12px;
	padding: 0 16px;
	border: 1px solid hsl(var(--sba-charcoal-hsl) / 0.2);
	border-radius: var(--sba-radius-md);
	background-color: transparent;
	color: var(--sba-charcoal);
}

.sba-explore-btn:hover,
.sba-explore-btn:focus {
	border-color: var(--sba-red);
	color: var(--sba-red-dark);
}
