/*
 * GPIPL content components (Phase 3, global): cards, icon blocks, CTA band and inline CTA.
 * Hairline borders, 4px radius, no shadows or gradients. Hover changes the border and
 * underlines the title: it tells you the card is a link without animating it.
 */
@layer components {
	/* ============================================================ Card
	   One link per card: the title link is stretched over the whole card, so
	   screen readers announce one clear link and the card stays clickable. */
	.card {
		position: relative;
		display: flex;
		flex-direction: column;
		gap: var(--space-xs);
		padding: var(--space-l);
		border: var(--border);
		border-radius: var(--radius-m);
		background: var(--color-bg);
		transition: border-color var(--dur-base) var(--ease-out);
	}
	.card--surface { background: var(--color-surface); border-color: transparent; }
	.card--flush { padding: 0; border: 0; background: transparent; }

	.card__media {
		margin: calc(-1 * var(--space-l)) calc(-1 * var(--space-l)) var(--space-xs);
		aspect-ratio: 4 / 3;
		overflow: hidden;
		border-radius: var(--radius-m) var(--radius-m) 0 0;
		background: var(--color-surface);
	}
	.card--flush .card__media { margin: 0 0 var(--space-xs); border-radius: var(--radius-m); }
	.card__media img { width: 100%; height: 100%; object-fit: cover; }

	.card__meta { font-size: var(--step--1); color: var(--color-text-muted); }
	.card__title {
		font-size: var(--step-1); /* GPIPL category/solution names are long; larger sizes wrap to 4–5 lines in card columns */
		font-stretch: var(--wdth-heading);
		line-height: var(--lh-heading);
	}
	.card__title a { color: var(--color-heading); text-decoration: none; }
	.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
	.card__text { color: var(--color-text-muted); }
	.card__footer { margin-top: auto; padding-top: var(--space-xs); }
	/* Secondary links inside a stretched card must sit above the stretched link. */
	.card__footer a, .card__footer button { position: relative; z-index: 1; }

	.card:has(.card__title a):hover { border-color: var(--color-line-strong); }
	.card:has(.card__title a):hover .card__title a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
	/* Keyboard focus rings the whole card, not just the title text. */
	.card:has(.card__title a:focus-visible) { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
	.card__title a:focus-visible { outline: none; }

	/* ============================================================ Icon block
	   Icon + short title + one or two sentences: capabilities, services. */
	.icon-block { display: grid; gap: var(--space-xs); align-content: start; }
	.icon-block__title { font-size: var(--step-1); }
	.icon-block__text { color: var(--color-text-muted); max-width: 40ch; }
	@media (min-width: 30em) {
		.icon-block--inline { grid-template-columns: auto 1fr; column-gap: var(--space-s); }
		.icon-block--inline > .icon-plate { grid-row: span 2; }
	}

	/* ============================================================ CTA band
	   Full-width closing call to action; dark by default via .is-dark on the section. */
	.cta-band {
		display: grid;
		gap: var(--space-l);
		align-items: end;
	}
	.cta-band__title { font-size: var(--step-4); max-width: 20ch; }
	.cta-band__text { margin-top: var(--space-s); max-width: var(--measure-narrow); color: var(--color-text-muted); font-size: var(--step-1); line-height: var(--lh-snug); }
	.cta-band__contact {
		display: flex;
		flex-wrap: wrap;
		gap: var(--space-2xs) var(--space-l);
		margin-top: var(--space-m);
		font-size: var(--step--1);
		color: var(--color-text-muted);
	}
	.cta-band__contact a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5em; min-height: var(--tap); }
	.cta-band__contact a:hover { color: var(--color-link); text-decoration: underline; }
	@media (min-width: 64em) {
		.cta-band { grid-template-columns: minmax(0, 1.4fr) auto; }
		.cta-band__actions { justify-self: end; }
	}

	/* ============================================================ Inline CTA
	   A compact prompt inside page content, e.g. after a product specification. */
	.cta-inline {
		display: grid;
		gap: var(--space-s);
		padding: var(--space-l);
		border-radius: var(--radius-m);
		background: var(--color-surface);
		border-left: 3px solid var(--color-accent);
	}
	.cta-inline__title { font-size: var(--step-2); }
	.cta-inline__text { color: var(--color-text-muted); max-width: var(--measure-narrow); }
	/* Wide: heading and text in the first column, actions in the second spanning both rows.
	   Placed explicitly; auto-placement put the text into the actions column. */
	@media (min-width: 48em) {
		.cta-inline { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-xl); }
		.cta-inline__title,
		.cta-inline__text { grid-column: 1; }
		.cta-inline__actions { grid-column: 2; grid-row: 1 / span 2; }
	}

	/* ============================================================ Password gate */
	.password-gate .breadcrumbs { margin-bottom: var(--space-l); }
	.password-gate__title { font-size: var(--step-4); max-width: 24ch; }
	.password-gate__form { margin-top: var(--space-l); }
	.password-gate__form input[type="password"] { min-height: 3rem; padding: 0.6rem 0.8rem; border: 1px solid var(--color-control-border); border-radius: var(--radius-s); }
	.password-gate__form input[type="submit"] { min-height: var(--tap); padding: 0.5rem 1.2rem; border: 0; border-radius: var(--radius-s); background: var(--button-primary-bg); color: var(--button-primary-text); font-weight: var(--wght-semibold); cursor: pointer; }
}
