/**
 * Project Gallery — Residential Roofing section 10 (1920x1478).
 *
 * Two rows of 450px tiles inside the 1440 container:
 *   row 1  337 | 704 (double) | 337
 *   row 2  337 | 337 | 337 | 337
 * with a 30px gutter. A 12-column grid expresses both: every tile spans 3,
 * the second spans 6. Extra images simply continue the 3-column rhythm.
 */

.project-gallery__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-40);
}

.project-gallery__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.project-gallery__head .section-eyebrow-center {
	margin-bottom: 22px;
}

.project-gallery__heading {
	margin-bottom: var(--space-16);
}

.project-gallery__text {
	margin: 0;
}

.project-gallery__grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--space-30);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* A tabbed gallery prints one grid per tab and hides all but the active one.
 * The class rule above would otherwise beat the UA's [hidden] display:none. */
.project-gallery__grid[hidden] {
	display: none;
}

.project-gallery__tile {
	grid-column: span 3;
	aspect-ratio: 337 / 450;
	overflow: hidden;
}

.project-gallery__tile--wide {
	grid-column: span 6;
	aspect-ratio: 704 / 450;
}

.project-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: var(--transition);
}

.project-gallery__tile:hover .project-gallery__image {
	transform: scale(1.04);
}

.project-gallery__actions {
	justify-content: center;
}

@media (max-width: 991px) {

	.project-gallery__grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	/* 4/3 at the developer's instruction. The 337/450 portrait is the desktop
	 * tile's own frame; two of them per row on a tablet made a very tall band,
	 * and the wide tile had to give its 704/450 up anyway to sit in the same
	 * grid. The 567 band below already used 4/3 — this just brings the step
	 * forward so the two agree. */
	.project-gallery__tile,
	.project-gallery__tile--wide {
		grid-column: span 3;
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 567px) {

	.project-gallery__grid {
		grid-template-columns: 1fr;
		gap: var(--space-20);
	}

	.project-gallery__tile,
	.project-gallery__tile--wide {
		grid-column: auto;
		aspect-ratio: 4 / 3;
	}
}

/* The whole tile is the lightbox trigger. */
.project-gallery__link {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

/* --- filter tabs (Our Work only) ---------------------------------------
 * Figma: a 1440x78 bar 30px above the grid, three equal 480 segments on white
 * with the active one #01963A. Each tab owns its own grid — see the template.
 * ---------------------------------------------------------------------- */
.project-gallery__tabs {
	display: grid;
	grid-auto-columns: 1fr;
	grid-auto-flow: column;
	/* The inner already opens 40 between its children and the design wants 30
	 * here, so this pulls the grid back the difference rather than adding to it. */
	margin-bottom: -10px;
	background-color: var(--white);
}

.project-gallery__tab {
	min-height: 78px;
	padding: var(--space-20) var(--space-15);
	border: 0;
	background: transparent;
	color: var(--primary-black);
	font-family: var(--font-body);
	font-size: var(--fs-20);
	font-weight: 700;
	line-height: var(--lh-body);
	text-align: center;
	transition: var(--transition);
	cursor: pointer;
}

.project-gallery__tab.is-active {
	background-color: var(--primary-green);
	color: var(--white);
}

.project-gallery__tab:hover:not(.is-active),
.project-gallery__tab:focus-visible:not(.is-active) {
	color: var(--primary-green);
}

@media (max-width: 767px) {

	.project-gallery__tabs {
		grid-auto-flow: row;
	}

	.project-gallery__tab {
		min-height: 56px;
	}
}
