/**
 * SCG Showcase — frontend styles for the project grid cards and details bar.
 * Single showcases are Beaver Builder layouts; the theme styles those.
 *
 * Colors resolve through CSS variables. --scg-accent / --scg-heading are set
 * from Settings (usually to a Page Builder Framework global color variable).
 */

.scg-showcase {
	--scg-accent-final: var(--scg-accent, var(--accent-color, #2d2d2d));
	--scg-radius-final: var(--scg-radius, 6px);
	--scg-gap: 28px;
	--scg-border-color: rgba(0, 0, 0, 0.12);
	box-sizing: border-box;
}

.scg-showcase *,
.scg-showcase *::before,
.scg-showcase *::after {
	box-sizing: inherit;
}

.scg-showcase img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ---------- Details bar ---------- */

.scg-details-bar {
	list-style: none;
	margin: 0;
	padding: 1em 1.25em;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em 2.5em;
	background: rgba(0, 0, 0, 0.035);
	border-radius: var(--scg-radius-final);
}

.scg-details-bar li {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15em;
}

.scg-detail-label {
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.65;
}

.scg-detail-value {
	font-weight: 600;
}

.scg-detail-value a {
	color: var(--scg-accent-final);
}

/* ---------- Cards ---------- */

.scg-showcase-grid {
	display: grid;
	gap: var(--scg-gap);
	grid-template-columns: repeat(var(--scg-columns, 3), 1fr);
}

.scg-showcase-grid.scg-cols-1 { --scg-columns: 1; }
.scg-showcase-grid.scg-cols-2 { --scg-columns: 2; }
.scg-showcase-grid.scg-cols-3 { --scg-columns: 3; }
.scg-showcase-grid.scg-cols-4 { --scg-columns: 4; }

.scg-showcase-list {
	display: flex;
	flex-direction: column;
	gap: var(--scg-gap);
}

.scg-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: var(--scg-radius-final);
	overflow: hidden;
}

.scg-card-shadow {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.scg-card-shadow:hover {
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
	transform: translateY(-2px);
}

.scg-card-border {
	border: 1px solid var(--scg-border-color);
}

.scg-showcase-list .scg-card {
	flex-direction: row;
	align-items: stretch;
}

.scg-showcase-list .scg-card-media {
	flex: 0 0 38%;
}

.scg-showcase-list .scg-card-media img {
	height: 100%;
	object-fit: cover;
}

.scg-card-media a {
	display: block;
}

.scg-card-media img {
	width: 100%;
}

.scg-card-media.scg-ratio-4-3 img { aspect-ratio: 4 / 3; object-fit: cover; }
.scg-card-media.scg-ratio-3-2 img { aspect-ratio: 3 / 2; object-fit: cover; }
.scg-card-media.scg-ratio-16-9 img { aspect-ratio: 16 / 9; object-fit: cover; }
.scg-card-media.scg-ratio-1-1 img { aspect-ratio: 1 / 1; object-fit: cover; }

.scg-card-body {
	padding: 1.25em 1.35em 1.5em;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	flex: 1;
}

.scg-card-service {
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--scg-accent-final);
}

.scg-card-title {
	margin: 0;
	font-size: 1.15em;
	line-height: 1.3;
	color: var(--scg-heading, inherit);
}

.scg-card-title a {
	color: inherit;
	text-decoration: none;
}

.scg-card-title a:hover {
	text-decoration: underline;
}

.scg-card-location {
	font-size: 0.85em;
	opacity: 0.7;
}

.scg-card-excerpt {
	margin: 0;
	font-size: 0.92em;
	line-height: 1.55;
	flex: 1;
}

.scg-card-button {
	align-self: flex-start;
	margin-top: 0.5em;
	padding: 0.55em 1.3em;
	font-size: 0.88em;
	font-weight: 600;
	text-decoration: none;
	color: #fff;
	background: var(--scg-accent-final);
	border-radius: calc(var(--scg-radius-final) * 0.75);
	transition: filter 0.15s ease;
}

.scg-card-button:hover,
.scg-card-button:focus {
	color: #fff;
	filter: brightness(0.88);
	text-decoration: none;
}

/* ---------- Recent list (sidebar) ---------- */

.scg-recent {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.scg-recent-item {
	margin: 0;
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.scg-recent-stacked .scg-recent-item {
	flex-direction: column;
	gap: 8px;
}

.scg-recent-thumb {
	flex: 0 0 64px;
	display: block;
	overflow: hidden;
	border-radius: calc(var(--scg-radius-final) * 0.75);
}

.scg-recent-inline .scg-recent-thumb img {
	width: 64px;
	height: 64px;
	object-fit: cover;
}

.scg-recent-stacked .scg-recent-thumb {
	flex: none;
	width: 100%;
}

.scg-recent-stacked .scg-recent-thumb img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.scg-recent-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.scg-recent-title {
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	color: var(--scg-heading, inherit);
}

.scg-recent-title:hover {
	color: var(--scg-accent-final);
}

.scg-recent-meta {
	font-size: 0.82em;
	opacity: 0.7;
}

/* ---------- Pagination ---------- */

.scg-pagination ul {
	list-style: none;
	display: flex;
	gap: 6px;
	padding: 0;
	margin: 1.5em 0 0;
	flex-wrap: wrap;
}

.scg-pagination .page-numbers {
	display: inline-block;
	padding: 0.4em 0.9em;
	border: 1px solid var(--scg-border-color);
	border-radius: calc(var(--scg-radius-final) * 0.75);
	text-decoration: none;
	color: inherit;
}

.scg-pagination .page-numbers.current {
	background: var(--scg-accent-final);
	border-color: var(--scg-accent-final);
	color: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
	.scg-showcase-grid.scg-cols-4,
	.scg-showcase-grid.scg-cols-3 { --scg-columns: 2; }
}

@media (max-width: 640px) {
	.scg-showcase-grid { --scg-columns: 1 !important; }

	.scg-showcase-list .scg-card {
		flex-direction: column;
	}

	.scg-showcase-list .scg-card-media {
		flex: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.scg-card-shadow,
	.scg-card-button {
		transition: none;
	}
}
