/*
 * AI-агенти. Built from the same tokens as the rest of the site — the page is
 * about something novel, which is exactly why it should not also look novel.
 */

.sx-ai__h2 {
	margin: var( --wp--preset--spacing--60 ) 0 0.75rem;
	font-size: var( --sx-title-section );
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.sx-ai__intro .sx-ai__h2 {
	margin-top: var( --wp--preset--spacing--50 );
}

.sx-ai__lead {
	margin: 0 0 1.5rem;
	max-width: 62ch;
	color: var( --sx-text-muted );
}

/* ---- Бот проти агента ----
   Two panels side by side, and the right one carries the weight: this is the
   distinction the whole page rests on, so it is drawn rather than described. */

.sx-ai__compare {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 16px;
	margin-bottom: var( --wp--preset--spacing--50 );
}

.sx-ai__side {
	min-width: 0;
	padding: 22px 24px;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	background: var( --sx-surface );
}

.sx-ai__side--strong {
	background: var( --sx-white );
	border-color: var( --sx-brand );
	box-shadow: 0 6px 18px color-mix( in srgb, var( --sx-brand ) 10%, transparent );
}

.sx-ai__side-label {
	display: inline-block;
	margin-bottom: 8px;
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --sx-text-muted );
}

.sx-ai__side--strong .sx-ai__side-label {
	color: var( --sx-brand-text );
}

.sx-ai__side p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}

/* ---- Що вже працює ---- */

.sx-ai__grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 20px;
}

/* Three across once there is room: six cards of about forty words each read
   badly at half the width of a wide column. */
@media ( min-width: 1080px ) {
	.sx-ai__grid {
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	}
}

.sx-ai__card {
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 24px 26px;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	transition:
		border-color var( --sx-transition-base ) var( --sx-ease ),
		box-shadow var( --sx-transition-base ) var( --sx-ease );
}

@media ( hover: hover ) {
	.sx-ai__card:hover {
		border-color: var( --sx-border-strong );
		box-shadow: 0 8px 22px color-mix( in srgb, var( --sx-text ) 7%, transparent );
	}
}

.sx-ai__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-bottom: 14px;
	border-radius: var( --sx-radius-md );
	background: var( --sx-brand-50 );
	color: var( --sx-brand-text );
}

.sx-ai__icon svg {
	width: 22px;
	height: 22px;
}

.sx-ai__card h3 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	line-height: 1.3;
	overflow-wrap: break-word;
}

.sx-ai__card p {
	margin: 0;
	color: var( --sx-text-muted );
	font-size: 0.95rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}

/* Pushed to the bottom so the links line up across a row whatever the cards
   above them do. */
.sx-ai__more {
	margin-top: auto;
	padding-top: 14px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var( --sx-brand-text );
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
}

.sx-ai__more:hover {
	text-decoration: underline;
}

/* ---- Що бачить ---- */

.sx-ai__facts {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 20px 32px;
}

.sx-ai__fact {
	min-width: 0;
	/* A rule instead of a card: these are notes on the thing above, and six
	   more boxes would make the page read as nothing but boxes. */
	padding-left: 16px;
	border-left: 2px solid var( --sx-brand-200 );
}

.sx-ai__fact h3 {
	margin: 0 0 6px;
	font-size: 1rem;
	line-height: 1.3;
}

.sx-ai__fact p {
	margin: 0;
	color: var( --sx-text-muted );
	font-size: 0.95rem;
	line-height: 1.6;
}


/* ---- Розібрано в статтях ----
   The page's evidence. A card says what an agent does; the article shows it
   being done, which is what a reader deciding whether any of this is real
   actually wants — so these are given the width and the picture. */

.sx-ai__reads {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 20px;
}

.sx-ai__read {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	color: inherit;
	text-decoration: none;
	transition:
		border-color var( --sx-transition-base ) var( --sx-ease ),
		box-shadow var( --sx-transition-base ) var( --sx-ease ),
		transform var( --sx-transition-base ) var( --sx-ease );
}

@media ( hover: hover ) {
	.sx-ai__read:hover {
		transform: translateY( -3px );
		border-color: var( --sx-border-strong );
		box-shadow: 0 12px 28px color-mix( in srgb, var( --sx-text ) 9%, transparent );
	}
}

/*
 * A fixed window the banner sits inside, centred.
 *
 * grid + place-items rather than a plain block: with the image told to fill the
 * height, aspect-ratio became a suggestion the browser dropped as soon as the
 * picture's own height disagreed with it — one card's window came out 355px
 * tall against the other's 324, and the two cards stopped lining up.
 *
 * The ratio sits between the two banners' own — 2.34:1 and 1.84:1 — so neither
 * is left with a wide band of nothing.
 */
.sx-ai__read-media {
	display: grid;
	place-items: center;
	aspect-ratio: 2 / 1;
	overflow: hidden;
	background: var( --sx-surface );
	border-bottom: 1px solid var( --sx-border );
}

/*
 * contain, not cover.
 *
 * These are article banners, and a banner is a picture with words on it — the
 * words start at its left edge. The two here are 2.34:1 and 1.84:1 against a
 * 16:9 window, so cover cropped the wider one from both sides and took the
 * first third of "AI-Агент: Менеджер складу" with it.
 *
 * contain shows the whole banner and letterboxes what is left over. On the
 * surface grey that reads as a frame; a headline cut in half reads as a fault.
 */
.sx-ai__read-media img {
	display: block;
	width: 100%;
	height: 100%;
	/* Without it the image's own height becomes the grid row's minimum and the
	   picture grows back out of the window it was given. */
	min-height: 0;
	object-fit: contain;
}

.sx-ai__read-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px 24px 22px;
}

.sx-ai__read-kicker {
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --sx-brand-text );
}

.sx-ai__read-title {
	display: block;
	margin: 8px 0 8px;
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: break-word;
}

.sx-ai__read-text {
	display: block;
	color: var( --sx-text-muted );
	font-size: 0.95rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}

/* Bottom-aligned so the two cards' links agree whatever their excerpts do. */
.sx-ai__read-more {
	margin-top: auto;
	padding-top: 16px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var( --sx-brand-text );
	font-size: 0.9rem;
	font-weight: 600;
}

.sx-ai__read:hover .sx-ai__read-more {
	text-decoration: underline;
}

@media ( max-width: 700px ) {
	.sx-ai__compare,
	.sx-ai__grid,
	.sx-ai__facts,
	.sx-ai__reads {
		grid-template-columns: minmax( 0, 1fr );
	}
}

/* ---- Як виглядають звіти ----
   Cropped to the top of each sheet: the title, the split by warehouse and the
   top-ten bar are what show the report is a designed thing. The forty rows of
   stock underneath are a client's business, and nobody needs to read them from
   a service page — the full image is one click away for those who do. */

.sx-ai__shots {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 20px;
}

.sx-ai__shot {
	margin: 0;
	min-width: 0;
	overflow: hidden;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	transition:
		border-color var( --sx-transition-base ) var( --sx-ease ),
		box-shadow var( --sx-transition-base ) var( --sx-ease );
}

@media ( hover: hover ) {
	.sx-ai__shot:hover {
		border-color: var( --sx-border-strong );
		box-shadow: 0 12px 28px color-mix( in srgb, var( --sx-text ) 9%, transparent );
	}
}

.sx-ai__shot a {
	display: block;
	/* A fixed window on a variable sheet, so four reports of four different
	   lengths still line up as a grid. */
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var( --sx-surface );
	border-bottom: 1px solid var( --sx-border );
}

.sx-ai__shot img {
	display: block;
	width: 100%;
	height: 100%;
	/*
	 * cover, so a report that is wider than it is tall still fills the window
	 * — at height: auto the shortest of the four fell 18px short and left a
	 * strip of background under it.
	 *
	 * Anchored to the top, not the centre: the title, the split by warehouse
	 * and the top-ten bar are what show this is a designed report. Centred, the
	 * crop would land on the middle of the table instead.
	 */
	object-fit: cover;
	object-position: top center;
}

.sx-ai__shot figcaption {
	display: block;
	padding: 16px 20px 18px;
	color: var( --sx-text-muted );
	font-size: 0.9rem;
	line-height: 1.55;
}

.sx-ai__shot figcaption strong {
	display: block;
	margin-bottom: 4px;
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 1rem;
	font-weight: 700;
	color: var( --sx-text );
}

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

}

/* The pointer says the picture opens; the report cards are the only things on
   this page that do. */
.sx-ai__shot a {
	cursor: zoom-in;
}
