/**
 * Grid + hover overlay for [structure_projects] shortcode.
 */

.structure-projects-wrap {
	margin: 0;
	padding: 0;
}

/* Show at most 3 tiles on small screens (viewport, not User-Agent). */
@media (max-width: 767px) {
	.structure-projects-wrap--mobile-max-3 .structure-projects-grid__item:nth-child(n + 4) {
		display: none !important;
	}
}

.structure-projects-grid {
	display: grid;
	gap: 5px;
	margin: 10px !important;
	padding: 0;
	list-style: none;
}

.structure-projects-grid__item {
	margin: 0 !important;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.structure-projects-grid--cols-2 {
		grid-template-columns: repeat(2, 1fr);
	}
	.structure-projects-grid--cols-3 {
		grid-template-columns: repeat(3, 1fr);
	}
	.structure-projects-grid--cols-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

.structure-project-card {
	position: relative;
	display: block;
	overflow: hidden;
	background: #1a1a1a;
	color: #fff;
	text-decoration: none;
	outline: none;
}

.structure-project-card:focus-visible {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px #eb4723;
}

.structure-project-card__media {
	position: relative;
	margin: 0;
	line-height: 0;
	aspect-ratio: 4 / 3;
}

.structure-project-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

.structure-project-card:hover .structure-project-card__media img,
.structure-project-card:focus-within .structure-project-card__media img {
	transform: scale(1.05);
}

.structure-project-card__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 24px;
	text-align: center;
	background: rgba(0, 0, 0, 0.72);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.structure-project-card:hover .structure-project-card__overlay,
.structure-project-card:focus-within .structure-project-card__overlay {
	opacity: 1;
	visibility: visible;
}

.structure-project-card__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
}

.structure-project-card__more {
	display: inline-block;
	padding: 10px 22px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
	border: 2px solid #fff;
	transition: background 0.25s ease, color 0.25s ease;
}

.structure-project-card__more:hover,
.structure-project-card:focus-within .structure-project-card__more {
	background: #fff;
	color: #1a1a1a;
}

.structure-project-card__placeholder {
	width: 100%;
	height: 100%;
	min-height: 200px;
	background: linear-gradient(135deg, #2a2a2a 0%, #444 100%);
}

.structure-projects-grid__empty {
	margin: 0;
	padding: 1em 0;
	color: #666;
}

.structure-projects-grid__footer {
	margin: 0;
	padding: 1.25rem 0 0;
	text-align: center;
}

.structure-projects-grid__all {
	display: inline-block;
	padding: 12px 28px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: #1a1a1a;
	background: #fff;
	border: 2px solid #1a1a1a;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.structure-projects-grid__all:hover,
.structure-projects-grid__all:focus-visible {
	color: #fff;
	background: #1a1a1a;
	border-color: #1a1a1a;
	outline: none;
}

.structure-projects-grid__all:focus-visible {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px #eb4723;
}

/* Touch / no-hover: keep title + CTA visible (gradient at bottom). */
@media (hover: none), (pointer: coarse) {
	.structure-project-card__media img {
		transition: none;
	}

	.structure-project-card:hover .structure-project-card__media img,
	.structure-project-card:focus-within .structure-project-card__media img {
		transform: none;
	}

	.structure-project-card__overlay {
		opacity: 1;
		visibility: visible;
		justify-content: flex-end;
		background: linear-gradient(
			to top,
			rgba(0, 0, 0, 0.88) 0%,
			rgba(0, 0, 0, 0.35) 45%,
			transparent 100%
		);
		padding-bottom: 20px;
	}
}

/* --------------------------------------------------------------------------
   Filter tabs: [structure_projects_filtered]
   -------------------------------------------------------------------------- */

.structure-projects-filtered .structure-projects-filter {
	margin: 0 0 1.75rem;
	padding: 0;
}

.structure-projects-filtered .structure-projects-filter__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.structure-projects-filtered .structure-projects-filter__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.structure-projects-filtered .structure-projects-filter__btn {
	margin: 0;
	padding: 0.35rem 0;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #b5b5b5;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.structure-projects-filtered .structure-projects-filter__btn:hover,
.structure-projects-filtered .structure-projects-filter__btn:focus-visible {
	color: #8a8a8a;
	outline: none;
}

.structure-projects-filtered .structure-projects-filter__btn.is-active {
	color: #e6a817;
	border-bottom-color: #e6a817;
}

.structure-projects-filtered .structure-projects-filter__btn:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e6a817;
	border-radius: 2px;
}
