/* Artist Farm Flip Card Grid — frontend styles */

.affcg-section {
	--affcg-accent: #1d7842;
	--affcg-front-bg: #0d1127;
	--affcg-back-bg: #071810;
	--affcg-radius: 20px;
	position: relative;
	padding: 40px 0;
}

.affcg-header {
	text-align: center;
	margin-bottom: 56px;
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

.affcg-eyebrow {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(13, 17, 39, 0.45);
	margin-bottom: 18px;
}

.affcg-title {
	font-size: clamp(1.8rem, 3.6vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.1;
	color: #0d1127;
	margin: 0 0 14px;
}

.affcg-accent {
	color: var(--affcg-accent);
}

.affcg-sub {
	font-size: 0.95rem;
	color: rgba(13, 17, 39, 0.5);
	margin: 0;
}

/* ── GRID ── */
.affcg-grid {
	--affcg-cols: 3;
	--affcg-gap: 28px;
	display: grid;
	grid-template-columns: repeat(var(--affcg-cols), 1fr);
	gap: var(--affcg-gap);
	max-width: 1280px;
	margin: 0 auto;
}

.affcg-item.affcg-wide {
	grid-column: 1 / -1;
}

/* ── CARD / FLIP MECHANICS ── */
.affcg-card {
	position: relative;
	width: 100%;
	perspective: 1400px;
	transform-style: preserve-3d;
	cursor: pointer;
	border-radius: var(--affcg-radius);
	outline: none;
}

.affcg-h-short .affcg-item:not(.affcg-wide) .affcg-card { aspect-ratio: 4 / 4; }
.affcg-h-medium .affcg-item:not(.affcg-wide) .affcg-card { aspect-ratio: 4 / 5; }
.affcg-h-tall .affcg-item:not(.affcg-wide) .affcg-card { aspect-ratio: 4 / 6.2; }

.affcg-item.affcg-wide .affcg-card {
	--affcg-wide-h: 280px;
	aspect-ratio: auto;
	min-height: var(--affcg-wide-h);
}

.affcg-card-inner,
.affcg-front,
.affcg-back {
	border-radius: var(--affcg-radius);
}

.affcg-front,
.affcg-back {
	position: absolute;
	inset: 0;
	overflow: hidden;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	transition: transform 0.78s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.5s ease;
	transform-style: preserve-3d;
}

.affcg-front {
	background: var(--affcg-front-bg);
	transform: rotateY(0deg);
	z-index: 2;
}

.affcg-back {
	background: var(--affcg-back-bg);
	transform: rotateY(180deg);
	z-index: 1;
}

.affcg-card.is-flipped .affcg-front {
	transform: rotateY(180deg);
}

.affcg-card.is-flipped .affcg-back {
	transform: rotateY(360deg);
}

.affcg-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.6s ease;
}

.affcg-front-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
	pointer-events: none;
}

.affcg-card.is-flipped .affcg-img {
	transform: scale(1.06);
}

.affcg-glass-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 20px 22px 18px;
	background: rgba(255, 255, 255, 0.10);
	backdrop-filter: blur(20px) saturate(1.6);
	-webkit-backdrop-filter: blur(20px) saturate(1.6);
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.affcg-tag {
	display: inline-block;
	font-size: 0.60rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.60);
	margin-bottom: 6px;
}

.affcg-front-title {
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.22;
	color: #fff;
	letter-spacing: -0.018em;
	margin: 0;
}

.affcg-front-hint {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.42);
	white-space: nowrap;
	transition: opacity 0.3s;
}

.affcg-front-hint svg {
	width: 14px;
	height: 14px;
	opacity: 0.5;
}

.affcg-card.is-flipped .affcg-front-hint {
	opacity: 0;
}

.affcg-back-orb {
	position: absolute;
	inset: -60%;
	border-radius: 50%;
	filter: blur(28px);
	pointer-events: none;
}

.affcg-back-orb-1 {
	z-index: 0;
	background: conic-gradient(from 0deg at 38% 52%, transparent 0deg, rgba(29, 120, 66, 0.7) 50deg, rgba(52, 168, 95, 0.5) 105deg, transparent 165deg, rgba(22, 90, 50, 0.45) 255deg, transparent 360deg);
	animation: affcgOrb1 12s linear infinite;
}

.affcg-back-orb-2 {
	z-index: 1;
	filter: blur(36px);
	background: conic-gradient(from 190deg at 62% 46%, transparent 0deg, rgba(52, 168, 95, 0.32) 72deg, transparent 138deg, rgba(29, 120, 66, 0.2) 228deg, transparent 360deg);
	animation: affcgOrb2 20s linear infinite;
}

@keyframes affcgOrb1 { to { transform: rotate(360deg); } }
@keyframes affcgOrb2 { to { transform: rotate(-360deg); } }

.affcg-back-inner {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: clamp(16px, 2vw, 26px);
}

.affcg-back-tag {
	display: inline-block;
	font-size: clamp(0.5rem, 0.75vw, 0.6rem);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(110, 219, 143, 0.9);
	border: 1px solid rgba(52, 168, 95, 0.3);
	border-radius: 4px;
	padding: 3px 9px;
	margin-bottom: clamp(8px, 1.2vw, 14px);
	width: fit-content;
	flex-shrink: 0;
}

.affcg-back-title {
	font-size: clamp(0.95rem, 1.3vw, 1.2rem);
	font-weight: 700;
	line-height: 1.24;
	color: #fff;
	letter-spacing: -0.018em;
	margin: 0 0 clamp(8px, 1vw, 14px);
	flex-shrink: 0;
}

.affcg-back-desc {
	font-size: clamp(0.74rem, 0.95vw, 0.88rem);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.65);
	margin: 0 0 clamp(8px, 1vw, 14px);
	flex: 1;
	min-height: 0;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
}

.affcg-item.affcg-wide .affcg-back-desc {
	-webkit-line-clamp: 3;
	max-width: 760px;
}

.affcg-back-cta {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 8px 14px;
	border-radius: 8px;
	border: 1px solid rgba(52, 168, 95, 0.35);
	background: rgba(29, 120, 66, 0.18);
	color: rgba(110, 219, 143, 0.95);
	text-decoration: none;
	width: fit-content;
	margin-top: auto;
	flex-shrink: 0;
	transition: background 0.2s;
}

.affcg-back-cta:hover {
	background: rgba(29, 120, 66, 0.32);
	color: rgba(110, 219, 143, 0.95);
}

.affcg-back-cta svg {
	width: 13px;
	height: 13px;
}

/* ── RESPONSIVE GRID FALLBACK ── */
@media (max-width: 1024px) {
	.affcg-grid {
		--affcg-cols: 2;
	}
}

@media (max-width: 767px) {
	.affcg-grid.affcg-mobile-stack {
		--affcg-cols: 1;
	}

	/* ── MOBILE SLIDING CAROUSEL ── */
	.affcg-grid.affcg-mobile-carousel {
		display: flex;
		align-items: flex-start;
		grid-template-columns: none;
		overflow-x: auto;
		overflow-y: visible;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding: 4px 6px 18px;
		margin: -4px -6px 0;
		scrollbar-width: none;
	}

	.affcg-grid.affcg-mobile-carousel::-webkit-scrollbar {
		display: none;
	}

	.affcg-grid.affcg-mobile-carousel .affcg-item,
	.affcg-grid.affcg-mobile-carousel .affcg-item.affcg-wide {
		flex: 0 0 82%;
		scroll-snap-align: center;
	}

	/* Keep the "wide" card the same height as normal cards while swiping on mobile */
	.affcg-grid.affcg-mobile-carousel.affcg-h-short .affcg-item.affcg-wide .affcg-card {
		aspect-ratio: 4 / 4;
		min-height: 0;
	}
	.affcg-grid.affcg-mobile-carousel.affcg-h-medium .affcg-item.affcg-wide .affcg-card {
		aspect-ratio: 4 / 5;
		min-height: 0;
	}
	.affcg-grid.affcg-mobile-carousel.affcg-h-tall .affcg-item.affcg-wide .affcg-card {
		aspect-ratio: 4 / 6.2;
		min-height: 0;
	}

	.affcg-item.affcg-wide .affcg-back-desc {
		-webkit-line-clamp: 6;
	}
}

.affcg-dots {
	display: none;
}

@media (max-width: 767px) {
	.affcg-dots {
		display: flex;
		justify-content: center;
		align-items: center;
		gap: 8px;
		margin-top: 6px;
	}

	.affcg-dots .affcg-dot {
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: rgba(13, 17, 39, 0.18);
		transition: background 0.3s, transform 0.3s;
	}

	.affcg-dots .affcg-dot.is-active {
		background: var(--affcg-accent);
		transform: scale(1.5);
	}
}
