/* =========================================================================
   Boyle Built — Projects + carousel

   ONE card-project.php component, ONE track, reused unchanged at every
   breakpoint. Only the carousel controls are structurally different per
   breakpoint (header arrows / tablet text-glyph overlay arrows / mobile
   icon overlay arrows) — exactly one set is visible at a time via
   `display: none` (removes the other two from the accessibility tree and
   tab order, same mechanism as Header/Nav and Services).
   ========================================================================= */

.projects {
	background-color: var(--color-dark-green-1);
	display: flex;
	flex-direction: column;
}

.projects__heading {
	display: flex;
	flex-direction: column;
}

.projects__eyebrow {
	margin: 0;
	color: var(--color-gold);
	font-family: var(--font-body);
	font-weight: 800;
	text-transform: uppercase;
}

.projects__title {
	margin: 0;
	color: var(--color-text-light);
	font-family: var(--font-display);
	font-weight: 500;
}

.projects__header-actions {
	display: flex;
	align-items: center;
}

.projects__view-all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--color-primary-green);
	color: var(--color-text-light);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: var(--radius-button);
	white-space: nowrap;
}

.projects__view-all:focus-visible {
	outline: 2px solid var(--color-text-light);
	outline-offset: 2px;
}

.projects__nav {
	display: flex;
	align-items: center;
}

.projects__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	cursor: pointer;
}

.projects__arrow:focus-visible {
	outline: 2px solid var(--color-text-light);
	outline-offset: 2px;
}

.projects__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

/* -------------------------------------------------------------------------
   Carousel track + peek mechanics (shared shape; sizes set per breakpoint)
   ------------------------------------------------------------------------- */

.projects__carousel {
	position: relative;
	width: 100%;
}

/*
 * .projects__viewport is the ONLY element that clips (overflow: hidden)
 * and is ALSO the only one that gets inset via margin at tablet/mobile
 * (see breakpoint blocks below). It is deliberately separate from
 * .projects__carousel (which stays full-width so the absolutely-
 * positioned arrow overlays still align to the true section edges) and
 * from .projects__track (which is the element the JS transforms).
 *
 * Overflow-clipping and the translateX transform must never live on the
 * SAME element: if they did, moving that element also moves its own
 * clip rectangle as one rigid unit, so "next"/"prev" just relocates the
 * already-clipped image instead of panning through the slide content —
 * this was the root cause of the tablet "tiny sliver / empty space" bug.
 */
.projects__viewport {
	overflow: hidden;
}

.projects__track {
	display: flex;
	transition: transform 0.3s ease;
}

.projects__slide {
	flex-shrink: 0;
}

.project-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: var(--color-dark-green-2);
	border: 1px solid var(--color-border-dark);
	border-radius: var(--radius-card);
	overflow: hidden;
}

.project-card__image-wrapper {
	position: relative;
	width: 100%;
	flex-shrink: 0;
	background-color: var(--color-border-dark);
}

.project-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.project-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background-color: var(--color-primary-green);
	color: var(--color-text-light);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 10px;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: var(--radius-button);
}

.project-card__info {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px;
	gap: 16px;
}

.project-card__title-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.project-card__title {
	margin: 0;
	color: var(--color-text-light);
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 22px;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
}

.project-card__meta {
	margin: 0;
	color: var(--color-gold);
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
}

.project-card__divider {
	height: 1px;
	background-color: var(--color-border-dark);
}

.project-card__action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--color-text-light);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	text-decoration: none;
}

.project-card__action:focus-visible {
	outline: 2px solid var(--color-text-light);
	outline-offset: 2px;
}

.project-card__arrow {
	display: block;
	width: 12px;
	height: 12px;
}

/* -------------------------------------------------------------------------
   Dots (shared shape; only shown at tablet/mobile — see below)
   ------------------------------------------------------------------------- */

.projects__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.carousel__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--color-border-dark);
	padding: 0;
}

.carousel__dot--active {
	background-color: var(--color-gold);
}

.carousel__dot:focus-visible {
	outline: 2px solid var(--color-text-light);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Arrow-control visibility: exactly one set per breakpoint
   ------------------------------------------------------------------------- */

.projects__nav--header {
	display: none;
}

.projects__nav--overlay-tablet {
	display: none;
}

.projects__nav--overlay-mobile {
	display: flex;
	position: absolute;
	left: 0;
	right: 0;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	top: 55px;
}

.projects__arrow--overlay-mobile {
	width: 36px;
	height: 36px;
	background-color: var(--color-dark-green-2);
	border: 1px solid var(--color-gold);
}

.projects__arrow--overlay-mobile img {
	width: 16px;
	height: 16px;
}

/* -------------------------------------------------------------------------
   Mobile (0–600px)
   ------------------------------------------------------------------------- */

.projects {
	gap: 28px;
	padding: 56px 0;
}

.projects__header {
	display: flex;
	flex-direction: column;
	padding: 0 16px;
}

.projects__header-actions {
	display: none;
}

.projects__eyebrow {
	font-size: 10px;
}

.projects__title {
	font-size: 28px;
}

.projects__viewport {
	margin-left: 16px;
	width: calc(100% - 16px);
}

.projects__track {
	gap: 16px;
}

.projects__slide {
	width: 280px;
}

.projects__slide--peeking {
	opacity: 0.65;
}

.project-card__image-wrapper {
	height: 150px;
}

.project-card__title {
	font-size: 17px;
}

/* -------------------------------------------------------------------------
   Tablet (601–1024px)
   ------------------------------------------------------------------------- */

@media (min-width: 601px) {
	.projects {
		gap: 40px;
		padding: 80px 0;
	}

	.projects__header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 0 32px;
	}

	.projects__header-actions {
		display: flex;
		gap: 16px;
	}

	.projects__view-all {
		padding: 10px 20px;
	}

	.projects__eyebrow {
		font-size: 11px;
	}

	.projects__title {
		font-size: 32px;
	}

	.projects__viewport {
		margin-left: 32px;
		width: calc(100% - 32px);
	}

	.projects__track {
		gap: 20px;
	}

	.projects__slide {
		width: 340px;
	}

	.projects__slide--peeking {
		opacity: 0.6;
	}

	.project-card__image-wrapper {
		height: 190px;
	}

	.project-card__title {
		font-size: 18px;
	}

	.projects__nav--overlay-mobile {
		display: none;
	}

	.projects__nav--overlay-tablet {
		display: flex;
		position: absolute;
		left: 0;
		right: 0;
		align-items: center;
		justify-content: space-between;
		padding: 0 16px;
		top: 80px;
	}

	.projects__arrow--overlay-tablet {
		width: 40px;
		height: 40px;
		background-color: rgba(28, 36, 23, 0.8);
		border: 1px solid var(--color-gold);
		color: var(--color-text-light);
		font-family: var(--font-body);
		font-weight: 700;
		font-size: 18px;
		line-height: 1;
	}

	.projects__dots {
		padding: 0 32px;
	}

	.carousel__dot {
		width: 8px;
		height: 8px;
	}
}

/* -------------------------------------------------------------------------
   Desktop (1025px+)
   ------------------------------------------------------------------------- */

@media (min-width: 1025px) {
	.projects {
		gap: 40px;
		padding: 80px 40px;
	}

	.projects__header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 0;
	}

	.projects__header-actions {
		gap: 16px;
	}

	.projects__view-all {
		padding: 10px 20px;
	}

	.projects__nav--header {
		display: flex;
		gap: 8px;
	}

	.projects__arrow--header {
		width: 36px;
		height: 36px;
		background-color: transparent;
		border: 1px solid var(--color-border-dark);
	}

	.projects__arrow--header img {
		width: 14px;
		height: 14px;
	}

	.projects__eyebrow {
		font-size: 12px;
	}

	.projects__title {
		font-size: 36px;
	}

	/* Explicit reset: min-width media queries are additive, not mutually
	   exclusive — 1025px+ still satisfies the 601px query above, so the
	   tablet block's margin-left/width must be reset here or it would
	   silently persist at desktop and misalign the 5-column row. */
	.projects__viewport {
		margin-left: 0;
		width: 100%;
	}

	.projects__track {
		gap: 16px;
	}

	.projects__slide {
		width: auto;
		flex: 0 0 calc((100% - (4 * 16px)) / 5);
	}

	.projects__slide--peeking {
		opacity: 1; /* no peek treatment at desktop — all visible cards are fully opaque */
	}

	.project-card__image-wrapper {
		height: 180px;
	}

	.project-card__title {
		font-size: 22px;
	}

	.projects__nav--overlay-tablet,
	.projects__nav--overlay-mobile {
		display: none;
	}

	.projects__dots {
		display: none;
	}
}
