/* ==========================================================================
   Custom Projects Showcase — Stylesheet
   Design language: quiet editorial "gallery placard" aesthetic.
   Ink background, brass accent, serif display + sans body + mono captions.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
	--cps-ink:        #14161b;
	--cps-ink-2:      #1c1f26;
	--cps-paper:      #edeae2;
	--cps-paper-dim:  #a9a79f;
	--cps-brass:      #2d5988;
	--cps-brass-soft: #4a7ba8;
	--cps-sage:       #5c6f63;
	--cps-line:       rgba(237, 234, 226, 0.12);

	--cps-font-display: 'Fraunces', Georgia, serif;
	--cps-font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--cps-font-caption: 'IBM Plex Mono', Menlo, monospace;
}

.cps-projects-wrapper {
	--cps-ink:        #14161b;
	--cps-ink-2:      #1c1f26;
	--cps-paper:      #edeae2;
	--cps-paper-dim:  #a9a79f;
	--cps-brass:      #2d5988;
	--cps-brass-soft: #4a7ba8;
	--cps-sage:       #5c6f63;
	--cps-line:       rgba(237, 234, 226, 0.12);

	--cps-font-display: 'Fraunces', Georgia, serif;
	--cps-font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--cps-font-caption: 'IBM Plex Mono', Menlo, monospace;

	color: var(--cps-paper);
	font-family: var(--cps-font-body);
	line-height: 1.6;
	max-width: 1280px;
	margin: 0 auto;
	padding: 48px 32px 96px;
	box-sizing: border-box;
}

/* The archive header now sits outside .cps-projects-wrapper (a plain
   <header> element), so give it its own background/spacing plus an
   inner max-width container that lines up with the grid below. */
.cps-archive-header {
	background: var(--cps-ink);
	padding: 64px 32px 40px;
}

.cps-archive-header .main_wrappermadhan {
	max-width: 640px;
	margin: 0 auto;
	padding: 0;
}

.cps-projects-wrapper *,
.cps-projects-wrapper *::before,
.cps-projects-wrapper *::after {
	box-sizing: border-box;
}

.cps-projects-wrapper a {
	color: inherit;
	text-decoration: none;
}

/* --------------------------------------------------------------------
   Archive header content (eyebrow / title / subtitle)
   -------------------------------------------------------------------- */
.cps-eyebrow {
	display: inline-block;
	font-family: var(--cps-font-caption);
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--cps-brass);
	margin-bottom: 14px;
}

.cps-archive-title {
	font-family: var(--cps-font-display);
	font-weight: 600;
	font-size: clamp(2.4rem, 5vw, 3.6rem);
	line-height: 1.05;
	margin: 0 0 16px;
	color: var(--cps-paper);
}

.cps-archive-subtitle {
	color: var(--cps-paper-dim);
	font-size: 1.05rem;
	margin: 0;
}

/* --------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------- */
.cps-filter-bar-outer {
	margin: 8px 0 48px;
	border-top: 1px solid var(--cps-line);
	border-bottom: 1px solid var(--cps-line);
	padding: 0 4px 14px;
}

.cps-filter-bar {
	position: relative;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	padding: 18px 4px 8px;
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;

	/* Hide the native scrollbar everywhere — mobile browsers render it
	   as a faint, transient overlay that's easy to miss, so we draw our
	   own always-visible progress bar below instead (same on every
	   device, not dependent on native scrollbar rendering quirks). */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.cps-filter-bar::-webkit-scrollbar {
	display: none;
	height: 0;
}

/* Our own scroll progress bar — fully custom, so it's guaranteed to
   look and behave the same on phone, tablet, and desktop. */
.cps-filter-scroll-track {
	position: relative;
	height: 4px;
	margin: 4px 4px 0;
	border-radius: 999px;
	background: var(--cps-line);
	overflow: hidden;
	display: none;
}

.cps-filter-bar-outer.has-scroll .cps-filter-scroll-track {
	display: block;
}

.cps-filter-scroll-thumb {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	min-width: 32px;
	border-radius: 999px;
	background: var(--cps-brass);
	transition: transform 0.15s ease, width 0.15s ease;
}

.cps-filter-indicator {
	position: absolute;
	top: 18px;
	left: 4px;
	height: 38px;
	border-radius: 999px;
	background: var(--cps-brass);
	box-shadow: 0 6px 16px -6px rgba(45, 89, 136, 0.55);
	transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1), width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
	pointer-events: none;
	z-index: 0;
}

.cps-filter-indicator.cps-no-transition {
	transition: none;
}

.cps-filter-btn {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	font-family: var(--cps-font-caption);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	background: transparent;
	border: 1px solid var(--cps-line);
	color: var(--cps-paper-dim);
	padding: 9px 20px;
	border-radius: 999px;
	cursor: pointer;
	transition: border-color 0.25s ease, color 0.3s ease, transform 0.15s ease;
}

.cps-filter-btn:hover {
	color: var(--cps-paper);
	border-color: var(--cps-brass-soft);
}

.cps-filter-btn:active {
	transform: scale(0.97);
}

.cps-filter-btn.is-active {
	border-color: transparent;
	color: var(--cps-paper);
	font-weight: 600;
}

.cps-filter-btn:focus-visible {
	outline: 2px solid var(--cps-brass);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------
   Projects grid + card
   -------------------------------------------------------------------- */
.cps-projects-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px 32px;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.cps-projects-grid.cps-is-filtering {
	opacity: 0;
	transform: translateY(8px);
}

.cps-projects-grid.cps-columns-2 { grid-template-columns: repeat(2, 1fr); }
.cps-projects-grid.cps-columns-3 { grid-template-columns: repeat(3, 1fr); }
.cps-projects-grid.cps-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
	.cps-projects-grid,
	.cps-projects-grid.cps-columns-2,
	.cps-projects-grid.cps-columns-3,
	.cps-projects-grid.cps-columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.cps-projects-grid,
	.cps-projects-grid.cps-columns-2,
	.cps-projects-grid.cps-columns-3,
	.cps-projects-grid.cps-columns-4 {
		grid-template-columns: 1fr;
	}
}

.cps-card {
	position: relative;
	display: flex;
	flex-direction: column;
	opacity: 0;
	transform: translateY(14px);
	animation: cps-card-in 0.6s ease forwards;
}

@keyframes cps-card-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cps-card-media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 10px;
	background: var(--cps-ink-2);
	isolation: isolate;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -20px rgba(0, 0, 0, 0.55);
	transition: box-shadow 0.35s ease;
}

.cps-card:hover .cps-card-media {
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 26px 54px -20px rgba(0, 0, 0, 0.65);
}

.cps-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cps-card-img--placeholder {
	background: linear-gradient(135deg, var(--cps-ink-2), #262a33);
}

.cps-card:hover .cps-card-img {
	transform: scale(1.06);
}

.cps-card-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	font-family: var(--cps-font-caption);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--cps-paper);
	background: var(--cps-brass);
	padding: 6px 12px;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.cps-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 22px;
	background: linear-gradient(180deg, transparent 40%, rgba(20, 22, 27, 0.85) 100%);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.cps-card:hover .cps-card-overlay {
	opacity: 1;
}

.cps-view-btn {
	font-family: var(--cps-font-caption);
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--cps-paper);
	padding-bottom: 2px;
	border-bottom: 1px solid var(--cps-brass);
	transform: translateY(8px);
	transition: transform 0.35s ease;
}

.cps-card:hover .cps-view-btn {
	transform: translateY(0);
}

.cps-card-body {
	padding-top: 20px;
}

.cps-card-title {
	font-family: var(--cps-font-display);
	font-weight: 500;
	font-size: 1.3rem;
	margin: 0 0 8px;
	line-height: 1.3;
}

.cps-card-category {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--cps-font-caption);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--cps-paper-dim);
}

.cps-card-category::before {
	content: '';
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--cps-brass);
	flex-shrink: 0;
}

.cps-card-title a:hover {
	color: var(--cps-brass-soft);
}

.cps-no-projects {
	color: var(--cps-paper-dim);
	font-style: italic;
}

.cps-projects-grid .cps-card:nth-child(1)  { animation-delay: 0.02s; }
.cps-projects-grid .cps-card:nth-child(2)  { animation-delay: 0.08s; }
.cps-projects-grid .cps-card:nth-child(3)  { animation-delay: 0.14s; }
.cps-projects-grid .cps-card:nth-child(4)  { animation-delay: 0.2s; }
.cps-projects-grid .cps-card:nth-child(5)  { animation-delay: 0.26s; }
.cps-projects-grid .cps-card:nth-child(6)  { animation-delay: 0.32s; }
.cps-projects-grid .cps-card:nth-child(n+7) { animation-delay: 0.36s; }

/* --------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------- */
.cps-pagination {
	margin-top: 64px;
	display: flex;
	justify-content: center;
	gap: 6px;
	font-family: var(--cps-font-caption);
	font-size: 13px;
}

.cps-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 4px;
	color: var(--cps-paper-dim);
	border: 1px solid var(--cps-line);
}

.cps-pagination .page-numbers.current {
	background: var(--cps-brass);
	border-color: var(--cps-brass);
	color: var(--cps-paper);
	font-weight: 600;
}

.cps-pagination .page-numbers:hover {
	border-color: var(--cps-brass);
	color: var(--cps-paper);
}

/* --------------------------------------------------------------------
   Single project — hero
   -------------------------------------------------------------------- */
.cps-single-project {
	background: var(--cps-ink);
	color: var(--cps-paper);
	font-family: var(--cps-font-body);
	margin: 0 calc(50% - 50vw);
	width: 100vw;
}

.cps-single-hero {
	position: relative;
	min-height: 62vh;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
}

.cps-single-cover {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.cps-single-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cps-single-cover-scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(20, 22, 27, 0.15) 0%, rgba(20, 22, 27, 0.55) 55%, rgba(20, 22, 27, 0.96) 100%);
}

.cps-single-hero-content {
	position: relative;
	z-index: 1;
	max-width: 1280px;
	margin: 0 auto;
	width: 100%;
	padding: 0 32px 56px;
}

.cps-single-title {
	font-family: var(--cps-font-body);
	font-weight: 800;
	font-size: clamp(2.2rem, 5.5vw, 3.6rem);
	line-height: 1.05;
	letter-spacing: -0.01em;
	margin: 0 0 18px;
	max-width: 900px;
	color: var(--cps-paper);
}

.cps-single-breadcrumb-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px 24px;
}

.cps-single-breadcrumb {
	margin: 0;
	font-family: var(--cps-font-body);
	font-weight: 600;
	font-size: 0.95rem;
	color: rgba(237, 234, 226, 0.82);
}

.cps-single-breadcrumb a {
	color: rgba(237, 234, 226, 0.82);
	transition: color 0.2s ease;
}

.cps-single-breadcrumb a:hover {
	color: var(--cps-brass-soft);
}

.cps-single-breadcrumb span {
	margin: 0 6px;
	color: var(--cps-paper-dim);
}

.cps-single-breadcrumb-nav {
	margin: 0;
	display: flex;
	gap: 16px;
	font-family: var(--cps-font-caption);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cps-paper-dim);
}

.cps-single-breadcrumb-nav a {
	color: var(--cps-paper-dim);
	transition: color 0.2s ease;
}

.cps-single-breadcrumb-nav a:hover {
	color: var(--cps-brass-soft);
}

/* --------------------------------------------------------------------
   Single project — light detail section (image, name, category,
   optional info, description) — matches client reference layout.
   -------------------------------------------------------------------- */
.cps-single-body {
	background: var(--cps-paper);
	max-width: none;
	margin: 0;
	padding: 72px 32px 100px;
}

.cps-single-info-grid {
	max-width: 1280px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 460px) 1fr;
	gap: 56px;
	align-items: start;
}

@media (max-width: 900px) {
	.cps-single-info-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}

.cps-single-info-image {
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 20px 44px -20px rgba(20, 22, 27, 0.35);
}

.cps-single-info-image img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

.cps-single-info-content {
	padding-top: 4px;
}

.cps-single-name {
	font-family: var(--cps-font-body);
	font-weight: 800;
	font-size: clamp(1.7rem, 3vw, 2.3rem);
	line-height: 1.2;
	color: var(--cps-ink);
	margin: 0 0 20px;
}

.cps-single-meta-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px 24px;
	padding-bottom: 20px;
	margin-bottom: 24px;
	border-bottom: 1px solid rgba(20, 22, 27, 0.12);
	font-family: var(--cps-font-body);
	font-size: 0.95rem;
	color: #4a4a46;
}

.cps-single-meta-category a {
	color: var(--cps-ink);
	font-weight: 600;
	border-bottom: 1px solid var(--cps-brass);
}

.cps-single-meta-category a:hover {
	color: var(--cps-brass);
}

.cps-single-meta-info {
	color: #8a8880;
	font-style: italic;
}

.cps-single-description {
	font-size: 1.02rem;
	line-height: 1.75;
	color: #38372f;
}

.cps-single-description p {
	margin: 0 0 1.2em;
}

.cps-single-description p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------
   Gallery section + lightbox thumbnails
   -------------------------------------------------------------------- */
.cps-gallery-section {
	max-width: 1280px;
	margin: 64px auto 0;
	padding-top: 48px;
	border-top: 1px solid rgba(20, 22, 27, 0.12);
}

.cps-gallery-heading {
	font-family: var(--cps-font-caption);
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8a8880;
	margin: 0 0 28px;
	font-weight: 500;
}

.cps-lightbox-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

@media (max-width: 900px) {
	.cps-lightbox-gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.cps-lightbox-gallery {
		grid-template-columns: 1fr;
	}
}

.cps-gallery-thumb {
	position: relative;
	display: block;
	padding: 0;
	border: none;
	background: #ece8de;
	border-radius: 10px;
	overflow: hidden;
	cursor: zoom-in;
	aspect-ratio: 4 / 3;
	box-shadow: 0 12px 28px -16px rgba(20, 22, 27, 0.3);
}

.cps-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.cps-gallery-thumb:hover img {
	transform: scale(1.05);
}

.cps-gallery-thumb::after {
	content: '';
	position: absolute;
	inset: 0;
	border: 1px solid transparent;
	border-radius: 10px;
	transition: border-color 0.25s ease;
}

.cps-gallery-thumb:hover::after {
	border-color: var(--cps-brass);
}

.cps-gallery-thumb:focus-visible {
	outline: 2px solid var(--cps-brass);
	outline-offset: 3px;
}

/* --------------------------------------------------------------------
   Lightbox overlay
   -------------------------------------------------------------------- */
.cps-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(10, 11, 14, 0.96);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 40px;
}

.cps-lightbox.is-open {
	display: flex;
}

.cps-lightbox-img {
	max-width: min(1100px, 90vw);
	max-height: 82vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(0.98);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.cps-lightbox.is-open .cps-lightbox-img.is-loaded {
	opacity: 1;
	transform: scale(1);
}

.cps-lightbox-close,
.cps-lightbox-prev,
.cps-lightbox-next {
	position: absolute;
	background: transparent;
	border: 1px solid rgba(237, 234, 226, 0.25);
	color: #edeae2;
	cursor: pointer;
	border-radius: 50%;
	width: 46px;
	height: 46px;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
	font-family: var(--cps-font-body);
}

.cps-lightbox-close:hover,
.cps-lightbox-prev:hover,
.cps-lightbox-next:hover {
	border-color: #b98b3e;
	color: #b98b3e;
}

.cps-lightbox-close {
	top: 24px;
	right: 24px;
	font-size: 22px;
}

.cps-lightbox-prev {
	left: 24px;
	top: 50%;
	transform: translateY(-50%);
}

.cps-lightbox-next {
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
}

.cps-lightbox-counter {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	font-family: var(--cps-font-caption);
	font-size: 12px;
	letter-spacing: 0.1em;
	color: var(--cps-paper-dim);
}

@media (max-width: 640px) {
	.cps-lightbox-prev,
	.cps-lightbox-next {
		width: 38px;
		height: 38px;
	}
	.cps-lightbox {
		padding: 16px;
	}
}

/* --------------------------------------------------------------------
   Responsive fine-tuning
   -------------------------------------------------------------------- */
@media (max-width: 782px) {
	.cps-projects-wrapper {
		padding: 40px 20px 64px;
	}

	.cps-archive-header {
		padding: 40px 20px 28px;
	}

	.cps-projects-grid {
		gap: 32px 20px;
	}

	.cps-card-media {
		aspect-ratio: 4 / 3.2;
	}

	.cps-single-hero-content {
		padding: 0 20px 40px;
	}

	.cps-single-body {
		padding: 44px 20px 72px;
	}
}

@media (max-width: 480px) {
	.cps-card-media {
		aspect-ratio: 3 / 2.4;
	}

	.cps-card-badge {
		top: 12px;
		left: 12px;
		font-size: 9.5px;
		padding: 5px 10px;
	}

	.cps-single-meta-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.cps-single-body {
		padding: 36px 16px 56px;
	}

	.cps-gallery-section {
		margin-top: 44px;
		padding-top: 36px;
	}
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
	.cps-card-img,
	.cps-view-btn,
	.cps-gallery-thumb img,
	.cps-lightbox-img {
		transition: none !important;
	}
}
