/* CeylonCraft Projects Gallery — scoped front-end styles */
.ccg-gallery,
.ccg-gallery * {
	box-sizing: border-box;
}

.ccg-gallery {
	--ccg-background: #FAF7EF;
	--ccg-text: #193F2B;
	--ccg-heading: #52745D;
	--ccg-muted: #778276;
	--ccg-accent: #A17C32;
	--ccg-columns: 2;
	--ccg-columns-tablet: 2;
	--ccg-columns-mobile: 1;
	--ccg-ratio: 16 / 9;
	--ccg-gap: 28px;
	--ccg-radius: 0px;
	width: 100%;
	max-width: 100%;
	padding: clamp(18px, 3.25vw, 48px) clamp(14px, 3.2vw, 48px) clamp(28px, 4.5vw, 68px);
	background: var(--ccg-background);
	color: var(--ccg-text);
	font-family: "DM Sans", Arial, sans-serif;
	overflow: hidden;
}

.ccg-filter-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(8px, 1.35vw, 20px);
	max-width: 1160px;
	margin: 0 auto clamp(28px, 4.2vw, 52px);
	padding: 0;
}

.ccg-filter-nav--image {
	justify-content: flex-start;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(39, 72, 58, .28) transparent;
}

.ccg-filter-nav--image::-webkit-scrollbar {
	height: 4px;
}

.ccg-filter-nav--image::-webkit-scrollbar-thumb {
	background: rgba(39, 72, 58, .28);
	border-radius: 20px;
}

.ccg-filter {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 42px;
	padding: 6px 5px 11px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--ccg-muted);
	font: inherit;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .035em;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: color .25s ease, transform .25s ease;
}

.ccg-filter::after {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 2px;
	border-radius: 4px;
	background: var(--ccg-accent);
	content: "";
	transform: translateX(-50%);
	transition: width .28s ease;
}

.ccg-filter:hover,
.ccg-filter:focus-visible,
.ccg-filter.is-active {
	color: var(--ccg-accent);
}

.ccg-filter:focus-visible {
	outline: 2px solid var(--ccg-accent);
	outline-offset: 4px;
}

.ccg-filter.is-active::after {
	width: 28px;
}

.ccg-filter:hover {
	transform: translateY(-1px);
}

.ccg-filter-image {
	display: block;
	width: 56px;
	height: 36px;
	overflow: hidden;
	border: 1px solid rgba(39, 72, 58, .12);
	border-radius: 2px;
	background: #e6dfd1;
	box-shadow: 0 2px 8px rgba(39, 72, 58, .06);
	flex: 0 0 auto;
	transition: border-color .25s ease, box-shadow .25s ease;
}

.ccg-filter-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ccg-filter.is-active .ccg-filter-image {
	border-color: var(--ccg-accent);
	box-shadow: 0 4px 12px rgba(39, 72, 58, .16);
}

.ccg-filter-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 10px;
	background: rgba(39, 72, 58, .08);
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
	opacity: .72;
}

.ccg-filter-nav--text .ccg-filter {
	padding-right: 8px;
	padding-left: 8px;
}

.ccg-grid {
	display: grid;
	grid-template-columns: repeat(var(--ccg-columns), minmax(0, 1fr));
	gap: var(--ccg-gap);
	max-width: 1160px;
	margin: 0 auto;
}

.ccg-card {
	min-width: 0;
	animation: none;
	transition: opacity .28s ease, transform .28s ease;
}

.ccg-gallery.ccg-ready[data-animation="fade-up"] .ccg-card {
	animation: ccg-fade-up .62s cubic-bezier(.22, .61, .36, 1) both;
}

.ccg-gallery.ccg-ready[data-animation="fade"] .ccg-card {
	animation: ccg-fade .55s ease both;
}

.ccg-card.is-hidden {
	display: none;
}

.ccg-card-media {
	position: relative;
	display: block;
	aspect-ratio: var(--ccg-ratio);
	overflow: hidden;
	border-radius: var(--ccg-radius);
	background: #ded7c9;
	color: inherit;
	isolation: isolate;
}

.ccg-card-media:focus-visible {
	outline: 2px solid var(--ccg-accent);
	outline-offset: 4px;
}

.ccg-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.001);
	transition: transform .75s cubic-bezier(.22, .61, .36, 1), filter .75s ease;
}

.ccg-card-media-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(39, 72, 58, 0) 46%, rgba(39, 72, 58, .16) 100%);
	opacity: 0;
	transition: opacity .45s ease;
}

.ccg-card:hover .ccg-card-media img,
.ccg-card-media:focus-visible img {
	transform: scale(1.045);
	filter: saturate(1.04);
}

.ccg-card:hover .ccg-card-media-shade,
.ccg-card-media:focus-visible .ccg-card-media-shade {
	opacity: 1;
}

.ccg-card-body {
	padding: 13px 0 2px;
}

.ccg-card-category {
	margin-bottom: 5px;
	color: var(--ccg-muted);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1.35;
	text-transform: uppercase;
}

.ccg-card-title {
	margin: 0;
	color: var(--ccg-heading);
	font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	font-size: clamp(20px, 2vw, 28px);
	font-weight: 400;
	letter-spacing: -.018em;
	line-height: 1.15;
}

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

.ccg-card-title a:hover {
	color: var(--ccg-accent);
}

.ccg-card-excerpt {
	max-width: 52ch;
	margin: 8px 0 0;
	color: var(--ccg-muted);
	font-size: 13px;
	line-height: 1.65;
}

.ccg-card-cta {
	display: inline-block;
	margin-top: 8px;
	border-bottom: 1px solid rgba(39, 72, 58, .38);
	color: var(--ccg-accent);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	transition: border-color .25s ease, color .25s ease;
}

.ccg-card-cta:hover {
	border-color: var(--ccg-accent);
	color: var(--ccg-accent);
}

.ccg-empty-state,
.ccg-filter-empty {
	grid-column: 1 / -1;
	display: flex;
	align-items: flex-start;
	flex-direction: column;
	gap: 6px;
	padding: 42px 0;
	color: var(--ccg-muted);
	font-size: 14px;
	line-height: 1.6;
}

.ccg-empty-state strong {
	color: var(--ccg-heading);
	font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	font-size: 22px;
	font-weight: 400;
}

.ccg-filter-empty[hidden] {
	display: none;
}

@keyframes ccg-fade-up {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes ccg-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (max-width: 1024px) {
	.ccg-gallery {
		padding-right: clamp(18px, 4vw, 32px);
		padding-left: clamp(18px, 4vw, 32px);
	}

	.ccg-filter-nav {
		justify-content: flex-start;
		margin-bottom: 32px;
	}

	.ccg-filter-nav--image {
		flex-wrap: nowrap;
		padding-bottom: 8px;
	}

	.ccg-filter-nav--image .ccg-filter {
		flex: 0 0 auto;
	}

	.ccg-grid {
		grid-template-columns: repeat(var(--ccg-columns-tablet), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ccg-gallery {
		padding: 18px 16px 42px;
	}

	.ccg-filter-nav {
		gap: 7px;
		margin-right: -16px;
		margin-bottom: 28px;
		padding-right: 16px;
	}

	.ccg-filter-nav--image .ccg-filter {
		min-height: 48px;
		gap: 7px;
		padding: 4px 4px 10px;
		font-size: 10px;
	}

	.ccg-filter-image {
		width: 50px;
		height: 32px;
	}

	.ccg-filter-count {
		display: none;
	}

	.ccg-grid {
		grid-template-columns: repeat(var(--ccg-columns-mobile), minmax(0, 1fr));
		gap: 30px;
	}

	.ccg-card-body {
		padding-top: 11px;
	}

	.ccg-card-title {
		font-size: 22px;
	}

	.ccg-card-excerpt {
		font-size: 12.5px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ccg-gallery.ccg-ready .ccg-card,
	.ccg-filter,
	.ccg-card-media img,
	.ccg-card-media-shade,
	.ccg-card-cta {
		animation: none !important;
		transition: none !important;
	}
}
