/*
 * LUCRARI — archive-lucrare.php (§4.2). Reuses the shared `.site-header`
 * (components.css §7) for logo+nav; only the menu→content gap and the
 * masonry grid itself are page-specific. Mobile-first: base = mobile
 * values (1-column masonry), `@media (min-width: 768px)` = desktop
 * (2-column masonry).
 */

/* Menu→content gap (§4.2): mobile 40px, desktop 70px. Targeting the
   element immediately after `.site-header` covers both the populated
   grid and the empty-state message without duplicating the rule. */
.site-header + .works-grid,
.site-header + .works-empty {
	margin-top: var(--sp-lg);
}

@media (min-width: 768px) {
	.site-header + .works-grid,
	.site-header + .works-empty {
		margin-top: var(--sp-3xl);
	}
}

/* CSS multi-column masonry — no JS masonry lib needed. Mobile: 1 column.
   Mobile side gutters (client feedback-01, ~20px) on `.works-grid`/
   `.works-empty` so content never touches the screen edges; the desktop
   container below takes over past 768px. */
.works-grid,
.works-empty {
	padding-left: var(--sp-sm);
	padding-right: var(--sp-sm);
}

.works-grid {
	column-count: 1;
	column-gap: var(--sp-sm);
}

@media (min-width: 768px) {
	.works-grid {
		column-count: 2;
	}

	/* Desktop container (client feedback-01): the works content was
	   spreading edge-to-edge; wrap it to a centered 1140px column instead
	   of constraining the fixed full-screen `.site-background` layer. */
	.works-grid,
	.works-empty {
		max-width: var(--container-max); /* shared token — single-sourced with detaliu.css */
		margin-left: auto;
		margin-right: auto;
		padding-left: 0;
		padding-right: 0;
	}
}

.work-card {
	break-inside: avoid;
	margin-bottom: var(--sp-sm);
	border: var(--bd-strong) solid var(--c-white);
}

/* The whole card is clickable — the link wraps badge/image/info and
   establishes the positioning context for both. */
.work-card__link {
	position: relative;
	display: block;
}

.work-card__image {
	width: 100%;
	height: auto;
	display: block;
}

.work-card__badge {
	position: absolute;
	top: 0; /* client feedback-01: badge sits at the very top edge of the card */
	left: var(--sp-sm);
}

.work-card__info {
	position: absolute;
	left: var(--sp-sm);
	right: var(--sp-sm);
	bottom: var(--sp-sm);
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--sp-sm);
}
