﻿@charset "utf-8";

/* ============================================================
	mcat02 — 카드 그리드 리스트
	카테고리 필터 + 호버 효과
	============================================================ */

/* ============================================================
	히어로
	============================================================ */
.cg-hero {
	position: relative;
	height: 55vh;
	min-height: 360px;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
}

.cg-hero-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 0;
	transform: scale(1.04);
}

.cg-hero-dim {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.28) 55%, rgba(0, 0, 0, 0.08) 100%);
	z-index: 1;
}

.cg-hero-inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1599px;
	margin: 0 auto;
	padding: 0 60px 56px;
	color: #fff;
}

.cg-hero-label {
	font-size: 14px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	opacity: 0.55;
	margin-bottom: 16px;
	animation: cg-fadeUp 0.6s ease 0.1s both;
}

.cg-hero-tit {
	font-size: clamp(34px, 5vw, 58px);
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 16px;
	animation: cg-fadeUp 0.6s ease 0.25s both;
}

/* 히어로 설명 — 콘텐츠 본문 기준 적용 */
.cg-hero-desc {
	font-size: clamp(16px, 1.5vw, 18px);
	opacity: 0.65;
	line-height: 1.8;
	animation: cg-fadeUp 0.6s ease 0.4s both;
}

@keyframes cg-fadeUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ============================================================
	섹션 & 랩
	============================================================ */
.cg-section {
	padding-bottom: 100px;
}

.cg-wrap {
	max-width: 1599px;
	margin: 0 auto;
	padding: 0 40px;
}

/* ============================================================
	필터
	============================================================ */
.cg-filter-wrap {
	background: var(--color-bg-main);
	padding: 18px 0;
	border-bottom: 1px solid var(--color-border);
	transition: box-shadow 0.25s ease;
	z-index: 4;
}

.cg-filter-wrap.is-fixed {
	position: fixed;
	left: 0;
	right: 0;
	top: 0; /* JS가 헤더 하단 위치에 맞춰 동적으로 설정 */
}

.cg-filter-wrap.has-shadow {
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.cg-filter-spacer {
	display: none;
}

.cg-filter-spacer.is-active {
	display: block;
}

.cg-filter {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* UI 기준 최소 16px */
.cg-filter-btn {
	padding: 8px 20px;
	border-radius: 50px;
	font-size: 16px;
	font-weight: 500;
	color: var(--color-text-sub);
	border: 1.5px solid var(--color-border-strong);
	background: transparent;
	cursor: pointer;
	transition:
		color 0.2s ease,
		border-color 0.2s ease,
		background 0.2s ease;
}

.cg-filter-btn:hover {
	color: var(--color-text-main);
	border-color: var(--color-text-main);
}

.cg-filter-btn.is-active {
	background: var(--color-text-main);
	color: var(--color-bg-main);
	border-color: var(--color-text-main);
}

.cg-filter-count {
	margin-left: auto;
	font-size: 14px;
	color: var(--color-text-muted);
}

/* ============================================================
	카드 그리드
	============================================================ */
.cg-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px 24px;
	padding-top: 40px;
}

/* ============================================================
	카드 공통
	============================================================ */
.cg-card {
	background: var(--color-bg-card);
	border-radius: 12px;
	overflow: hidden;
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

.cg-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.cg-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
}

/* 썸네일 */
.cg-card-thumb {
	overflow: hidden;
	aspect-ratio: 16 / 10;
	flex-shrink: 0;
}

.cg-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.cg-card:hover .cg-card-thumb img {
	transform: scale(1.07);
}

/* 카드 바디 */
.cg-card-body {
	display: flex;
	flex-direction: column;
	padding: 24px;
	flex: 1;
}

/* 카테고리 배지 */
.cg-card-cat {
	display: inline-block;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-primary);
	margin-bottom: 10px;
}

/* 카드 제목 */
.cg-card-tit {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.45;
	color: var(--color-text-main);
	margin-bottom: 10px;
	transition: color 0.2s ease;
}

.cg-card:hover .cg-card-tit {
	color: var(--color-primary);
}

/* 카드 설명 — 콘텐츠 본문 기준 적용 */
.cg-card-desc {
	font-size: 18px;
	color: var(--color-text-sub);
	line-height: 1.75;
	flex: 1;
	margin-bottom: 18px;
}

/* 메타 — 날짜/읽기시간 */
.cg-card-meta {
	display: flex;
	align-items: center;
	gap: 0;
	font-size: 15px;
	color: var(--color-text-muted);
	margin-top: auto;
}

.cg-card-read::before {
	content: "·";
	margin: 0 8px;
}

/* ============================================================
	피처드 카드
	============================================================ */
.cg-card--featured {
	grid-column: 1 / -1;
}

.cg-card--featured .cg-card-link {
	flex-direction: row;
}

.cg-card--featured .cg-card-thumb {
	width: 54%;
	aspect-ratio: auto;
	min-height: 300px;
}

.cg-card--featured .cg-card-body {
	padding: 44px 48px;
	justify-content: center;
}

.cg-card--featured .cg-card-cat {
	font-size: 14px;
	margin-bottom: 14px;
}

.cg-card--featured .cg-card-tit {
	font-size: clamp(22px, 2.4vw, 30px);
	margin-bottom: 14px;
}

/* 피처드 설명 — 콘텐츠 본문 기준 적용 */
.cg-card--featured .cg-card-desc {
	font-size: 18px;
	margin-bottom: 24px;
}

.cg-card--featured .cg-card-meta {
	font-size: 15px;
}

/* ============================================================
	반응형 — 필수 구간 999 / 768 / 499
	============================================================ */

/* 태블릿 — 2열 그리드 */
@media all and (max-width: 999px) {
	.cg-wrap {
		padding: 0 24px;
	}

	.cg-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 24px 20px;
	}

	.cg-card--featured {
		grid-column: 1 / -1;
	}

	.cg-card--featured .cg-card-link {
		flex-direction: row;
	}

	.cg-card--featured .cg-card-thumb {
		width: 48%;
	}

	.cg-card--featured .cg-card-body {
		padding: 28px 32px;
	}

	/* 콘텐츠 본문 769px+ 기준: 16px */
	.cg-card-desc {
		font-size: 16px;
	}

	.cg-card--featured .cg-card-desc {
		font-size: 16px;
	}

	.cg-filter-btn {
		font-size: 15px;
	}
}

/* 모바일 — 1열, 피처드 세로 전환 */
@media all and (max-width: 768px) {
	.cg-hero-inner {
		padding: 0 20px 36px;
	}

	.cg-hero-desc {
		font-size: 16px;
	}

	.cg-wrap {
		padding: 0 16px;
	}

	.cg-filter-wrap {
		padding: 14px 0;
	}

	/* UI 최소 14px */
	.cg-filter-btn {
		padding: 7px 16px;
		font-size: 14px;
	}

	.cg-filter-count {
		width: 100%;
		margin-left: 0;
		padding-top: 4px;
	}

	.cg-grid {
		grid-template-columns: 1fr;
		gap: 20px;
		padding-top: 24px;
	}

	.cg-card--featured .cg-card-link {
		flex-direction: column;
	}

	.cg-card--featured .cg-card-thumb {
		width: 100%;
		min-height: auto;
		aspect-ratio: 16 / 10;
	}

	.cg-card--featured .cg-card-body {
		padding: 24px;
	}

	/* 콘텐츠 본문 500px+ 기준: 15px */
	.cg-card-desc,
	.cg-card--featured .cg-card-desc {
		font-size: 15px;
	}
}

/* 소형 폰 */
@media all and (max-width: 499px) {
	.cg-filter {
		gap: 6px;
	}

	.cg-filter-btn {
		padding: 6px 14px;
		font-size: 14px;
	}

	/* 콘텐츠 본문 499px 이하 기준: 14px */
	.cg-card-desc,
	.cg-card--featured .cg-card-desc {
		font-size: 14px;
	}

	.cg-card-tit {
		font-size: 17px;
	}
}
