/*
 * Work card (components/work-card/): one case study.
 *
 * Picture side: always dark (the client logos are white) — the case's
 * picture under a navy veil, or the brand's scene with a faint open diamond.
 * Text side: the card's own surface, light by default, dark inside dark
 * sections (bottom of this file).
 *
 * Hover / keyboard: the picture eases in a little and the edge lights up.
 * No translate on the card itself — it belongs to the appear-on-scroll
 * reveal (appear.css), which owns that property.
 */

.gb-work-cards {
	display: grid;
	gap: var(--gb-space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

.gb-work-cards > li {
	display: grid;
}

/* /works/: large cards, two per row on wide screens. */
.gb-work-cards--large {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
	gap: var(--gb-space-l);
}

/* «قصص أخرى» / service pages: smaller cards, three per row. */
.gb-work-cards--compact {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

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

.gb-work-card {
	position: relative;
	display: grid;
	grid-template-rows: auto 1fr;
	overflow: hidden;
	border: 1px solid var(--gb-border);
	border-radius: var(--gb-radius-l);
	background-color: var(--gb-bg);
	color: var(--gb-text);
	box-shadow: 0 1.5rem 3rem -2.25rem rgb(12 35 66 / 0.45);
	transition:
		border-color var(--gb-duration-base) linear,
		box-shadow var(--gb-duration-base) var(--gb-ease-out);
}

.gb-work-card:hover {
	border-color: var(--gb-color-turquoise-a60);
	box-shadow: 0 2rem 3.5rem -2rem rgb(12 35 66 / 0.55);
}

/* The whole card is the link's target, so the whole card shows the focus ring. */
.gb-work-card:has(.gb-work-card__link:focus-visible) {
	outline: 3px solid var(--gb-focus);
	outline-offset: 3px;
}

.gb-work-card__link:focus-visible {
	outline: none;
}

/* ---------- Picture side ---------- */

.gb-work-card__visual {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background-color: var(--gb-color-navy);
	background-image:
		radial-gradient(70% 60% at 50% 55%, var(--gb-color-turquoise-a20), transparent 70%),
		linear-gradient(160deg, #10284a, var(--gb-color-navy) 60%);
}

.gb-work-card__image {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	transition: scale var(--gb-duration-slow) var(--gb-ease-out);
}

.gb-work-card:hover .gb-work-card__image {
	scale: 1.04;
}

/* A navy veil from the bottom: the logo and the label read on any picture. */
.gb-work-card--photo .gb-work-card__visual::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(12 35 66 / 0.88), rgb(12 35 66 / 0.2) 55%, rgb(12 35 66 / 0.1));
	pointer-events: none;
}

/* No picture: the identity's open diamond, faint, as the scene. */
.gb-work-card__art {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
}

.gb-work-card__art path {
	fill: none;
	stroke: var(--gb-color-turquoise-a20);
	stroke-width: 1.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.gb-work-card__art circle {
	fill: var(--gb-seed);
	opacity: 0.6;
}

.gb-work-card__logo {
	position: relative;
	z-index: 1;
}

/* With a picture, the logo moves to the bottom corner (reading start). */
.gb-work-card--photo .gb-work-card__logo {
	position: absolute;
	inset-block-end: var(--gb-space-s);
	inset-inline-start: var(--gb-space-s);
}

.gb-work-card__type {
	position: absolute;
	z-index: 1;
	inset-block-start: var(--gb-space-s);
	inset-inline-start: var(--gb-space-s);
	padding-block: 0.25em;
	padding-inline: 0.8em;
	border: 1px solid rgb(255 255 255 / 0.2);
	border-radius: var(--gb-radius-pill);
	background-color: rgb(12 35 66 / 0.55);
	color: var(--gb-scene-text);
	font-size: var(--gb-step--1);
	backdrop-filter: blur(6px);
}

/* ---------- Text side ---------- */

.gb-work-card__body {
	display: grid;
	align-content: start;
	gap: var(--gb-space-2xs);
	padding: var(--gb-space-m);
}

.gb-work-card__client {
	font-size: var(--gb-step--1);
	font-weight: var(--gb-weight-bold);
	color: var(--gb-text-muted);
}

.gb-work-card__title {
	font-family: var(--gb-font-display);
	font-size: var(--gb-step-2);
	line-height: 1.35;
}

.gb-work-card--large .gb-work-card__title {
	font-size: var(--gb-step-3);
}

.gb-work-card__link {
	color: inherit;
	text-decoration: none;
}

/* The stretched link: the whole card is one target. */
.gb-work-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.gb-work-card__subtitle {
	display: block;
	font-family: var(--gb-font-sans);
	font-size: 0.6em;
	font-weight: var(--gb-weight-bold);
	color: var(--gb-text-muted);
}

.gb-work-card__line {
	font-size: var(--gb-step-0);
	color: var(--gb-text-muted);
}

.gb-work-card__services {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gb-work-card__services li {
	padding-block: 0.2em;
	padding-inline: 0.75em;
	border-radius: var(--gb-radius-pill);
	background-color: var(--gb-color-turquoise-a10);
	color: var(--gb-color-navy);
	font-size: var(--gb-step--1);
}

.gb-work-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	margin-block-start: var(--gb-space-3xs);
	color: var(--gb-color-navy);
	font-size: var(--gb-step--1);
	font-weight: var(--gb-weight-bold);
}

.gb-work-card__more span {
	border-block-end: 2px solid var(--gb-primary);
	padding-block-end: 0.1em;
}

.gb-work-card__more svg {
	inline-size: 1em;
	block-size: 1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: translate var(--gb-duration-base) var(--gb-ease-out);
}

.gb-work-card:hover .gb-work-card__more svg {
	translate: calc(var(--gb-dir) * 0.25em) 0;
}

/* The chevron is drawn for RTL (pointing to the reading end); mirror it in LTR. */
[dir="ltr"] .gb-work-card__more svg {
	scale: -1 1;
}

/* ---------- Inside dark sections (service pages «من أعمالنا») ---------- */

.gb-svc-work .gb-work-card {
	border-color: var(--gb-color-turquoise-a20);
	background-color: rgb(255 255 255 / 0.04);
	color: var(--gb-scene-text);
	box-shadow: none;
}

.gb-svc-work .gb-work-card:hover {
	border-color: var(--gb-primary);
}

.gb-svc-work .gb-work-card__client,
.gb-svc-work .gb-work-card__subtitle,
.gb-svc-work .gb-work-card__line {
	color: var(--gb-scene-text-muted);
}

.gb-svc-work .gb-work-card__more {
	color: var(--gb-scene-text);
}

.gb-svc-work .gb-work-card__services li {
	color: var(--gb-scene-text);
}

/* The service page's stories come before its other proof. */
.gb-svc-stories + * {
	margin-block-start: var(--gb-space-xl);
}
