/**
 * Rules the redesigned pages share: the section gutter, the eyebrow, the
 * section title and lead, the button variants, the "AI generated" pill and
 * the photo card.
 *
 * The prototype has these as components (Eyebrow, Button, AiGeneratedLabel)
 * and as Tailwind classes repeated on every page. The front page and the
 * Industry page each carried their own copy under page-scoped class names
 * (sba-eyebrow, sba-ind-eyebrow …); the Chapters pages were the third to need
 * them, and this is the extraction that docs/industry.md asked for. home.css
 * keeps its copy until the front page's editorial round is through:
 * switching it means changing the classes stored on its elements, see
 * docs/chapters.md. (industry.css kept one until the Industry page moved
 * to components on October 17, 2026.)
 *
 * Every rule here targets a class set on an Elementor element, so the file
 * reaches nothing on a page that does not use it. It is enqueued per page in
 * functions.php.
 *
 * Specificity, in short: Elementor sizes buttons with two classes, pads
 * columns with three and gives every widget the full width of its column with
 * `.elementor-widget-wrap > .elementor-element`. The selectors below carry
 * one more class than the rule they have to beat.
 */

/* --------------------------------------------------------------------------
 * Section gutter
 *
 * The prototype's sections all use `container mx-auto px-4`: 1400px wide,
 * 16px of padding at every width. Elementor's boxed sections have the width
 * from the Global Kit but no padding.
 * -------------------------------------------------------------------------- */

.sba-section > .elementor-container {
	padding-right: 16px;
	padding-left: 16px;
}

/* --------------------------------------------------------------------------
 * Eyebrow
 *
 * The prototype's Eyebrow component: 14px at weight 500, dark red on light
 * fields and white on photographs and charcoal. The hero variant carries a
 * 32px rule in front. The spacing below (20px hero, 16px section) is the
 * widget's own margin in Elementor.
 * -------------------------------------------------------------------------- */

.sba-eyebrow .elementor-heading-title {
	margin: 0;
	color: var(--sba-red-dark);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: normal;
	line-height: 20px;
}

.sba-eyebrow-dark .elementor-heading-title {
	color: #fff;
}

.sba-eyebrow-hero .elementor-heading-title {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sba-eyebrow-hero .elementor-heading-title::before {
	content: "";
	flex: 0 0 32px;
	height: 1px;
	background-color: currentColor;
}

/* --------------------------------------------------------------------------
 * Section title and lead
 *
 * text-3xl md:text-4xl font-bold tracking-tight text-balance, in a max-w-3xl
 * block; the lead is text-lg in the muted foreground.
 * -------------------------------------------------------------------------- */

.sba-section-title .elementor-heading-title {
	max-width: 48rem;
	margin: 0;
	text-wrap: balance;
	color: var(--sba-charcoal);
	font-size: 30px;
	font-weight: var(--sba-heading-weight);
	letter-spacing: var(--sba-heading-tracking);
	line-height: 36px;
}

.sba-section-title-light .elementor-heading-title {
	color: #fff;
}

@media (min-width: 768px) {
	.sba-section-title .elementor-heading-title {
		font-size: 36px;
		line-height: 40px;
	}
}

.sba-section-lead {
	color: var(--sba-slate);
	font-size: 18px;
	line-height: 28px;
}

/* The measure sits on the paragraph, not the widget. Buttons are auto-width
 * widgets, flex items in the same row; a capped widget leaves room beside it
 * on a wide screen, and the button rises next to the lead. The same holds
 * for the other leads (chapters.css). */
.sba-section-lead p {
	max-width: 48rem;
	margin: 0;
}

.sba-section-lead-light {
	color: hsl(0 0% 100% / 0.75);
}

/* --------------------------------------------------------------------------
 * Buttons
 *
 * The style guide's specification (docs/style-guide.md): 40px tall with 16px
 * of side padding, or 44px with 32px for the large size; 14px at weight 500,
 * --sba-radius-md corners, an 8px gap and a 16px icon. The arrow moves 4px on
 * hover; the label does not.
 *
 * Four variants. Primary is the dark red that clears AA behind white text.
 * Glass is for photographs and dark gradients: translucent white, a white
 * border at half opacity and a 4px blur, solid white on hover. Outline is the
 * secondary button on a light field. Link is text only, for cards whose
 * whole surface is the target.
 *
 * Elementor sizes its button with two classes; these carry three.
 * -------------------------------------------------------------------------- */

.sba-btn.elementor-widget-button .elementor-button {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--sba-radius-md);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	transition:
		background-color var(--sba-duration-hover) ease,
		border-color var(--sba-duration-hover) ease,
		color var(--sba-duration-hover) ease;
}

.sba-btn.elementor-widget-button .elementor-button-content-wrapper {
	gap: 8px;
}

.sba-btn.elementor-widget-button .elementor-button-icon {
	margin: 0;
	font-size: 16px;
	line-height: 1;
	transition: transform var(--sba-duration-hover) ease;
}

.sba-btn.elementor-widget-button .elementor-button:hover .elementor-button-icon {
	transform: translateX(4px);
}

.sba-btn-lg.elementor-widget-button .elementor-button {
	min-height: 44px;
	padding: 0 32px;
}

.sba-btn-primary.elementor-widget-button .elementor-button {
	background-color: var(--sba-red-dark);
	color: #fff;
}

.sba-btn-primary.elementor-widget-button .elementor-button:hover {
	background-color: var(--sba-red-darker);
	color: #fff;
}

.sba-btn-glass.elementor-widget-button .elementor-button {
	border: 1px solid hsl(0 0% 100% / 0.5);
	background-color: hsl(0 0% 100% / 0.1);
	backdrop-filter: blur(4px);
	color: #fff;
}

.sba-btn-glass.elementor-widget-button .elementor-button:hover {
	border-color: #fff;
	background-color: #fff;
	color: var(--sba-charcoal);
}

.sba-btn-outline.elementor-widget-button .elementor-button {
	border: 1px solid var(--sba-input);
	background-color: var(--sba-surface);
	color: var(--sba-charcoal);
}

.sba-btn-outline.elementor-widget-button .elementor-button:hover {
	border-color: var(--sba-input);
	background-color: var(--sba-accent);
	color: var(--sba-charcoal);
}

.sba-btn-link.elementor-widget-button .elementor-button {
	min-height: 0;
	padding: 0;
	border-radius: 0;
	background-color: transparent;
	color: var(--sba-red-dark);
}

.sba-btn-link.elementor-widget-button .elementor-button:hover {
	background-color: transparent;
	color: var(--sba-red-darker);
}

/* A text link that wraps in a narrow card reads as text: the label aligns
 * left, not centred as Elementor's button, and the arrow follows its last
 * word. Elementor puts the icon before the label and reverses the flex row,
 * which leaves the arrow at the right edge of the wrapped block, so for the
 * arrows (the icons that follow a label, see the buttons guide) the icon
 * element is hidden and the label draws the same shape inline after itself.
 * Static icons (sba-btn-static-icon) precede the label and keep Elementor's
 * layout. The mask is the one icons-lucide.css gives the icon Elementor
 * holds, so changing the icon in the editor still changes the arrow.
 * --sba-link-arrow-size resizes it where a page sets a smaller icon.
 * The mask has to cover the whole box: WebKit paints what a no-repeat mask
 * leaves uncovered of an inline box in the background color. With the 8px
 * gap inside the padding Safari showed a red block before the arrow, so the
 * gap is a margin; with a 16px mask in a box as tall as the font, a phone's
 * Safari showed a red line above and below the arrow, so the mask is sized
 * to the box and the SVG's viewBox keeps the arrow square and centered. */
.sba-btn-link.elementor-widget-button .elementor-button {
	text-align: left;
}

.sba-btn-link:not(.sba-btn-static-icon).elementor-widget-button .elementor-button:has(.sba-i-arrow-right, .sba-i-arrow-up-right, .sba-i-arrow-down) .elementor-button-content-wrapper {
	display: block;
}

.sba-btn-link:not(.sba-btn-static-icon).elementor-widget-button .elementor-button:has(.sba-i-arrow-right, .sba-i-arrow-up-right, .sba-i-arrow-down) .elementor-button-icon {
	display: none;
}

.sba-btn-link:not(.sba-btn-static-icon).elementor-widget-button .elementor-button:has(.sba-i-arrow-right, .sba-i-arrow-up-right, .sba-i-arrow-down) .elementor-button-text::after {
	/* A word joiner, so the arrow never wraps onto a line of its own. The
	 * pseudo-element stays inline, which is what lets the joiner hold; the
	 * arrow is painted in its padding, and it moves with `left` because
	 * inline boxes ignore transforms. */
	content: "\2060";
	position: relative;
	margin-left: 8px;
	padding-left: var(--sba-link-arrow-size, 16px);
	background-color: currentColor;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	transition: left var(--sba-duration-hover) ease;
}

.sba-btn-link.elementor-widget-button .elementor-button:has(.sba-i-arrow-right) .elementor-button-text::after {
	-webkit-mask-image: url("../icons/lucide/arrow-right.svg");
	mask-image: url("../icons/lucide/arrow-right.svg");
}

.sba-btn-link.elementor-widget-button .elementor-button:has(.sba-i-arrow-up-right) .elementor-button-text::after {
	-webkit-mask-image: url("../icons/lucide/arrow-up-right.svg");
	mask-image: url("../icons/lucide/arrow-up-right.svg");
}

.sba-btn-link.elementor-widget-button .elementor-button:has(.sba-i-arrow-down) .elementor-button-text::after {
	-webkit-mask-image: url("../icons/lucide/arrow-down.svg");
	mask-image: url("../icons/lucide/arrow-down.svg");
}

/* The resting offset carries little specificity, so the hover rules below
 * and in chapters.css win over it. */
.sba-btn-link .elementor-button-text::after {
	left: 0;
}

.sba-btn-link.elementor-widget-button .elementor-button:hover .elementor-button-text::after {
	left: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.sba-btn.elementor-widget-button .elementor-button:hover .elementor-button-icon,
	.sba-btn-link.elementor-widget-button .elementor-button:hover .elementor-button-text::after {
		left: 0;
	}
}

/* --------------------------------------------------------------------------
 * The "AI generated" pill
 *
 * The prototype's AiGeneratedLabel, bottom right of the nearest positioned
 * box: 12px in on a figure, 16px on a hero and 32px/24px from 768px up. The
 * widget keeps Elementor's full column width unless told otherwise, which is
 * why `width: auto` sits next to `right`.
 * -------------------------------------------------------------------------- */

.elementor-widget-wrap > .elementor-element.sba-ai-label {
	position: absolute;
	right: 12px;
	bottom: 12px;
	left: auto;
	z-index: 2;
	width: auto;
	margin: 0;
}

.elementor-widget-wrap > .elementor-element.sba-ai-label-hero {
	right: 16px;
	bottom: 16px;
}

.sba-ai-label .elementor-icon-list-items {
	margin: 0;
	padding: 0;
}

.sba-ai-label .elementor-icon-list-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border: 1px solid hsl(0 0% 100% / 0.2);
	border-radius: var(--sba-radius-sm);
	background-color: hsl(0 0% 0% / 0.5);
	backdrop-filter: blur(4px);
	color: hsl(0 0% 100% / 0.9);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.025em;
	line-height: 1;
}

.sba-ai-label .elementor-icon-list-icon {
	display: flex;
	padding: 0;
}

.sba-ai-label .elementor-icon-list-item .elementor-icon-list-icon i {
	font-size: 12px;
	line-height: 1;
}

.sba-ai-label .elementor-icon-list-text {
	padding: 0;
	color: inherit;
}

@media (min-width: 768px) {
	.elementor-widget-wrap > .elementor-element.sba-ai-label-hero {
		right: 32px;
		bottom: 24px;
	}
}

/* --------------------------------------------------------------------------
 * Photo cards
 *
 * The card of the Swiss Biotech Day's participation options in the prototype
 * (src/pages/sbd/SbdParticipationOptions.tsx): a photograph of the offer
 * across the top at 3:2, then an eyebrow, a title, a text and a link, in a
 * bordered card. For offers a picture explains better than an icon; first
 * used for the paid offers on the Promotion page, where the eyebrow names the
 * kind of promotion. Eyebrow, title, text and link take the feature tiles'
 * classes (chapters.css), so they read like the tiles; the card's box, the
 * image and the hover are here. The link is stretched over the card by the
 * tiles' rule, with this card as the reference.
 *
 * `sba-photo-cards-2` is two across from 768px, `-3` three across from 1025px.
 * -------------------------------------------------------------------------- */

.sba-photo-cards > .elementor-container {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
}

@media (min-width: 768px) {
	.sba-photo-cards-2 > .elementor-container {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Three across below 1025px leaves 240px a card, too narrow for the text;
 * until then the three stack. */
@media (min-width: 1025px) {
	.sba-photo-cards-3 > .elementor-container {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.elementor-element.sba-photo-cards + .elementor-element.sba-photo-cards {
	margin-top: 24px;
}

.sba-photo-cards > .elementor-container > .elementor-column.sba-photo-card {
	width: auto;
}

.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 0 0 32px;
	border: 1px solid var(--sba-border);
	border-radius: var(--sba-radius);
	background-color: var(--sba-surface);
	box-shadow: 0 1px 2px 0 hsl(var(--sba-charcoal-hsl) / 0.05);
	overflow: hidden;
	transition:
		transform var(--sba-duration-hover) ease,
		box-shadow var(--sba-duration-hover) ease;
}

.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated: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);
}

/* Everything under the photograph keeps the card's inner gutter. */
.sba-photo-card > .elementor-element-populated > .elementor-element:not(.sba-photo-card-media) {
	padding-inline: 32px;
}

.sba-photo-card-media,
.sba-photo-card-media .elementor-widget-container {
	overflow: hidden;
}

.sba-photo-card .sba-photo-card-media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.5s ease;
}

.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated:hover .sba-photo-card-media img {
	transform: scale(1.05);
}

/* Stacked at a tablet width, the three-across cards are as wide as the page;
 * their photographs take 2:1 there, so that each card still fits a screen. */
@media (min-width: 768px) and (max-width: 1024px) {
	.sba-photo-cards-3 .sba-photo-card .sba-photo-card-media img {
		aspect-ratio: 2 / 1;
	}
}

/* The link's arrow moves as on the tiles. */
.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated:hover .sba-ch-tile-link .elementor-button-icon {
	transform: translateX(4px);
}

.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated:hover .sba-ch-tile-link .elementor-button-text::after {
	left: 4px;
}

.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated:has(.sba-ch-tile-link .elementor-button:focus-visible) {
	outline: 2px solid var(--sba-red);
	outline-offset: 2px;
}

@media (min-width: 1025px) {
	.sba-photo-cards-2 .elementor-column.sba-photo-card > .elementor-element-populated {
		padding-bottom: 40px;
	}

	.sba-photo-cards-2 .sba-photo-card > .elementor-element-populated > .elementor-element:not(.sba-photo-card-media) {
		padding-inline: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated:hover {
		transform: none;
	}

	.sba-photo-cards .elementor-column.sba-photo-card > .elementor-element-populated:hover .sba-photo-card-media img {
		transform: none;
	}
}
