/*
 * Typical Solutions / «Типовые объекты и ориентиры бюджета» —
 * DESIGN.md §14 (project cards), docs/homepage-structure.md §11.
 *
 * Deliberately NOT the Services technical panel: individual bordered
 * cards with real gaps, photographic media zone, editorial/commercial
 * character — contrast is compositional, same design system (tokens,
 * radius, border language) as the rest of the page.
 */

.typical-solutions {
	position: relative;
	background: var(--ark-bg-850);
	padding-block: var(--ark-space-section-compact);
}

.typical-solutions__header {
	margin-bottom: 48px;
}

.typical-solutions__overline {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	color: var(--ark-text-secondary);
	margin: 0 0 16px;
}

.typical-solutions__header-row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.typical-solutions__title {
	font-size: var(--ark-fs-h2);
	font-weight: 600;
	line-height: 1.15;
	color: var(--ark-text-primary);
	margin: 0;
}

.typical-solutions__all-link {
	display: inline-flex;
	align-items: center;
	font-size: 0.92rem;
	color: var(--ark-text-secondary);
	white-space: nowrap;
	padding-bottom: 6px;
	border-bottom: 1px solid transparent;
	transition:
		color 150ms var(--ark-ease),
		border-color 150ms var(--ark-ease);
}

.typical-solutions__all-link:hover,
.typical-solutions__all-link:focus-visible {
	color: var(--ark-text-primary);
	border-color: var(--ark-border-titanium);
}

.typical-solutions__lead {
	max-width: 680px;
	font-size: 1.05rem;
	color: var(--ark-text-secondary);
	margin: 0;
}

.typical-solutions__grid {
	display: grid;
	/* 6 cards: 3x2 at desktop (≥1180px, breakpoint below), 2x3 tablet, 1-col mobile. */
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

.typical-solutions__disclaimer {
	margin: 32px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--ark-border-soft);
	max-width: 860px;
	font-size: 0.82rem;
	line-height: 1.6;
	color: var(--ark-text-muted);
}

/* ---- Card ---- */

.solution-card {
	display: flex;
	flex-direction: column;
	background: var(--ark-surface-700);
	border: 1px solid var(--ark-border-soft);
	border-radius: var(--ark-radius-lg);
	overflow: hidden;
	transition: transform 200ms var(--ark-ease), border-color 200ms var(--ark-ease);
}

.solution-card:hover {
	transform: translateY(-3px);
	border-color: var(--ark-border-medium);
}

.solution-card__media {
	position: relative;
	/* Shorter than the original 16/10 — media reads as ~55% of the card,
	   content ~45% (was closer to 62/38), per the density pass. */
	aspect-ratio: 2 / 1;
	overflow: hidden;
	background-color: var(--ark-bg-850);
}

.solution-card__media-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Per-card override via inline style (solution-card.php's image_position
	   arg) — set individually once each real photo is in, art-direction
	   needs differ per object. */
	object-position: var(--solution-image-position, 50% 50%);
	transition: transform 400ms var(--ark-ease);
}

.solution-card:hover .solution-card__media-image {
	transform: scale(1.02);
}

/*
 * DEV PLACEHOLDER — abstract CAD/blueprint tone, not a finished visual.
 * Deliberately reads as "media goes here", not as final art (item 6).
 * Swapping in solution-card.php's $image_src later needs no CSS change —
 * this rule simply stops matching once data-has-image flips to "true".
 */
.solution-card__media[data-has-image="false"] {
	background-image:
		linear-gradient(155deg, var(--ark-bg-850) 0%, var(--ark-bg-950) 60%, #0F1D27 100%),
		repeating-linear-gradient(0deg, rgba(166, 176, 186, 0.06) 0 1px, transparent 1px 32px),
		repeating-linear-gradient(90deg, rgba(166, 176, 186, 0.06) 0 1px, transparent 1px 32px);
}

.solution-card__media-dev-label {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ark-text-muted);
	background: rgba(5, 12, 18, 0.55);
	border: 1px solid var(--ark-border-soft);
	border-radius: 4px;
	padding: 3px 8px;
}

/*
 * Legibility gradient for the caption (bottom) + a very light uniform
 * graphite wash across the whole photo (item 9) — the 6 source photos
 * span different shoots/exposures (dusk exteriors, a bright daylight
 * lawn shot, dark interiors); this nudges them toward one consistent
 * contrast/tone without meaningfully darkening any of them individually
 * (kept intentionally subtle — over-darkening was a previous mistake).
 */
.solution-card__media-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(180deg, rgba(5, 12, 18, 0) 35%, rgba(5, 12, 18, 0.88) 100%),
		rgba(7, 17, 26, 0.14);
}

.solution-card__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 20px 22px;
}

.solution-card__number {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--ark-text-secondary);
	margin-bottom: 6px;
}

/*
 * Taxonomy cue for 05/06 (Загородный дом, Квартира) — classification, not
 * a promotional badge: plain inline text, no background/border/pill, very
 * small, muted. Keeps commercial (01–04) as the unlabeled default focus.
 */
.solution-card__type-label {
	display: block;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ark-text-muted);
	margin-bottom: 6px;
}

.solution-card__title {
	/* Primary identifier of the card (item 2) — bumped from 1.35rem/600. */
	font-size: 1.55rem;
	font-weight: 700;
	color: var(--ark-text-primary);
	margin: 0 0 6px;
}

/*
 * Optional secondary navigation affordance (details_url) — visually
 * identical to the plain title (color/size/weight inherited via base.css's
 * `a { color: inherit; text-decoration: none; }`), a hover-only underline
 * is the only discoverability cue. No transform/scale/lift; focus-visible
 * relies on base.css's existing global `:focus-visible` rule, no override
 * needed here.
 */
.solution-card__title-link {
	text-decoration: none;
}

.solution-card__title-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.solution-card__area {
	/* Stays secondary — scale, not the headline. */
	font-size: 0.9rem;
	color: var(--ark-text-secondary);
	margin: 0;
}

.solution-card__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 20px 22px 22px;
}

.solution-card__systems-label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ark-text-muted);
	margin: 0 0 8px;
}

.solution-card__systems {
	/* Easier to scan than the original dense 0.92rem line (item 3). */
	font-size: 0.98rem;
	line-height: 1.6;
	color: var(--ark-text-secondary);
	margin: 0 0 18px;
}

.solution-card__metrics {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	padding-block: 14px;
	border-block: 1px solid var(--ark-border-soft);
	margin-bottom: 16px;
}

.solution-card__metric {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.solution-card__metric-label {
	font-size: 0.72rem;
	color: var(--ark-text-muted);
}

.solution-card__metric-value {
	font-weight: 700;
	color: var(--ark-text-primary);
}

/* Budget leads (item 4); duration is deliberately second in visual weight. */
.solution-card__metric:first-child .solution-card__metric-value {
	font-size: 1.3rem;
}

.solution-card__metric:last-child .solution-card__metric-value {
	font-size: 1rem;
	font-weight: 600;
	color: var(--ark-text-secondary);
}

.solution-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: auto;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ark-text-primary);
}

.solution-card__cta-arrow {
	color: var(--ark-border-titanium);
	transition: transform 200ms var(--ark-ease);
}

.solution-card:hover .solution-card__cta-arrow {
	transform: translateX(4px);
}

/*
 * Below 1180px, 3 columns get too narrow for comfortable card content
 * (item 6) — drop to 2x3. Cards are then wider than the 3-col desktop
 * range, so no further type/padding shrink is needed here.
 */
@media (max-width: 1179px) {
	.typical-solutions__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

/* Mobile: 1 column, restore roomier padding/gap since width is no longer scarce. */
@media (max-width: 600px) {
	.typical-solutions__grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.solution-card__caption,
	.solution-card__body {
		padding-inline: 24px;
	}

	/* fix(home): remove mobile horizontal overflow — .typical-solutions__all-link's
	   desktop white-space: nowrap keeps this long CTA text on one line, which
	   is wider than narrow mobile viewports and was the confirmed cause of a
	   16px+ document-level horizontal overflow (verified via Playwright: hiding
	   this link alone brought scrollWidth back down to clientWidth at
	   390/375/360px). Wrapping is safe here — .typical-solutions__header-row
	   already gives it its own row via flex-wrap once it doesn't fit next to
	   the heading, so wrapped text just grows that row's height, and
	   max-width: 100% keeps it from ever exceeding the row/container width.
	   Desktop (>600px) keeps the original single-line treatment untouched. */
	.typical-solutions__all-link {
		white-space: normal;
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.solution-card,
	.solution-card__media-image,
	.solution-card__cta-arrow {
		transition: none;
	}
}
