@charset "UTF-8";

/* ==========================================================================
   §7. CERTIFICATION 섹션 전용 스타일
   ========================================================================== */

#certification {
	padding: 120px 0;
	background: var(--light);
}

/* 줄(row) — 특허/저작권, 협력(MOU) 두 줄로 구성 */
.cert-row + .cert-row {
	margin-top: 56px;
}

.cert-row-label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	font-size: 15px;
	font-weight: 400;
	letter-spacing: 0.3px;
	color: #1a1a1a;
	margin-bottom: 20px;
}

.cert-row-label::before,
.cert-row-label::after {
	content: '';
	width: 18px;
	height: 1px;
	background: currentColor;
	flex-shrink: 0;
}

/* 슬라이더 래퍼 — [버튼 | marquee | 버튼] flex 배치
   padding-right: 사이드 네비(80px) + 여유(24px)
   구분선 없이 라벨의 -- 액센트와 여백만으로 줄 구분 */
.cert-slider-wrap {
	margin-top: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 104px 0 24px;
}

.cert-row:first-of-type .cert-slider-wrap {
	margin-top: 0;
}

/* 버튼 */
.cert-nav {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border: 1px solid var(--border-light);
	border-radius: 50%;
	background: white;
	color: #1a1a1a;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	z-index: 4;
}

.cert-nav--prev { margin-right: 56px; }
.cert-nav--next { margin-left:  56px; }

.cert-nav:hover:not(:disabled) {
	border-color: var(--primary);
	color: var(--primary);
	box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
	transform: scale(1.06);
}

.cert-nav:disabled {
	background: white;
	border-color: var(--border-light);
	color: var(--line);
	cursor: default;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* 스크롤 컨테이너 — width: 카드5장×215 + gap4개×75 = 1375px
   가장자리 마스크 페이드: 스크롤 가능함을 시각적으로 암시 */
.cert-marquee {
	width: 1375px;
	flex-shrink: 1;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
	        mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}

.cert-marquee::-webkit-scrollbar { display: none; }

/* 트랙 — 카드 수가 5장 미만이면 marquee 너비 안에서 가운데 정렬,
   5장 이상(스크롤 필요)이면 콘텐츠가 꽉 차서 자연히 좌측부터 채워짐 */
.cert-track {
	display: flex;
	justify-content: center;
	gap: 75px;
	min-width: min-content;
	padding: 40px 0;
}

/* 카드 — 클릭 시 원본 모달 오픈 */
.cert-item {
	flex-shrink: 0;
	width: 215px;
	text-align: center;
	cursor: pointer;
}

/* 이미지 박스 (A4 비율 1:√2 — 스캔 문서 실제 비율에 맞춰 여백 없이 꽉 차게)
   직사각형, 평소엔 무채색 그림자 / 호버 시 블루 톤 */
.cert-image {
	width: 215px;
	aspect-ratio: 1 / 1.41421356;
	background: white;
	margin-bottom: 18px;
	border: 1px solid var(--border-light);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	position: relative;
	overflow: hidden;
	transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.cert-item:hover .cert-image {
	transform: translateY(-6px);
	border-color: var(--primary);
	box-shadow: 0 16px 32px rgba(0, 102, 204, 0.16);
}

/* 클릭하면 원본이 크게 보인다는 힌트 — 호버 시 돋보기 아이콘 페이드인 */
.cert-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background-color: rgba(255, 255, 255, 0.55);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230066cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 34px 34px;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.cert-item:hover .cert-image::after {
	opacity: 1;
}

.cert-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: white;
	display: block;
}

.cert-name {
	font-size: 14px;
	color: #1a1a1a;
	font-weight: 600;
	line-height: 1.4;
	padding: 0 8px;
	transition: color 0.25s ease;
}

.cert-item:hover .cert-name {
	color: var(--primary);
}

.cert-year {
	font-size: 12px;
	color: var(--gray-light);
	margin-top: 4px;
}

/* 태블릿 (768px ~ 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
	#certification { padding: 80px 0; }

	.cert-slider-wrap {
		margin-top: 40px;
		padding: 0 92px 0 12px;
	}

	.cert-nav { width: 40px; height: 40px; }
	.cert-nav--prev { margin-right: 28px; }
	.cert-nav--next { margin-left:  28px; }

	/* width: 카드5장×215 + gap4개×40 = 1235px */
	.cert-marquee {
		width: 1235px;
		-webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
		        mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	}

	.cert-track { gap: 40px; padding: 36px 0 30px; }
}

/* 모바일 (~767px)
   - 버튼 숨김, 터치 스와이프
   - cert-marquee를 뷰포트 전체 너비로 확장
   - padding-right으로 다음 카드 살짝 노출 (peek 효과) */
@media (max-width: 767px) {
	#certification { padding: 60px 0; }

	.cert-slider-wrap {
		margin-top: 40px;
		padding: 0;
		justify-content: flex-start;
	}

	.cert-nav { width: 40px; height: 40px; display: none; }
	.cert-nav--prev { margin-right: 12px; }
	.cert-nav--next { margin-left:  12px; }

	.cert-marquee {
		width: 100vw;       /* 뷰포트 전체 너비 */
		flex-shrink: 0;
		overflow-x: auto;
		overflow-y: visible;
		/* peek 효과(다음 카드 살짝 노출)를 가리지 않도록 마스크 페이드 비활성화 */
		-webkit-mask-image: none;
		        mask-image: none;
	}

	.cert-track {
		gap: 16px;
		padding: 32px 20px 24px 20px; /* 좌우 여백으로 첫/끝 카드 위치 조정 */
		/* 마지막 카드 오른쪽에 여백을 줘서 다음 카드 peek 효과 */
		padding-right: 60px;
	}

	.cert-item  { width: 150px; }
	.cert-image { width: 150px; }

	.cert-name  { font-size: 12px; }
	.cert-year  { font-size: 11px; }

	.cert-row-label { font-size: 13px; margin-bottom: 14px; }
	.cert-row + .cert-row { margin-top: 36px; }
}

/* ==========================================================================
   원본 이미지 모달 — 카드 클릭 시 확대, MOU는 1/2페이지 화살표 전환
   ========================================================================== */
body.cert-modal-open {
	overflow: hidden;
}

.cert-modal {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cert-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.cert-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 39, 0.88);
}

.cert-modal-content {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 20px;
	max-width: min(92vw, 960px);
	max-height: 92vh;
}

.cert-modal-close {
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.08);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.cert-modal-close:hover {
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.6);
}

.cert-modal-nav {
	grid-row: 1;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.08);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.cert-modal-nav:hover {
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.6);
}

.cert-modal-nav--prev { grid-column: 1; }
.cert-modal-nav--next { grid-column: 3; }

.cert-modal-nav[hidden] { display: none; }

.cert-modal-image-wrap {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
}

.cert-modal-image {
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	background: white;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
	display: block;
	transform: scale(0.96);
	transition: transform 0.3s ease;
}

.cert-modal.is-open .cert-modal-image {
	transform: scale(1);
}

.cert-modal-caption {
	grid-column: 1 / -1;
	grid-row: 2;
	margin-top: 16px;
	text-align: center;
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
}

.cert-modal-page {
	margin-left: 8px;
	color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 767px) {
	.cert-modal { padding: 24px 16px; }

	.cert-modal-content { grid-template-columns: 1fr; }

	.cert-modal-image-wrap { grid-column: 1; grid-row: 1; }
	.cert-modal-caption    { grid-column: 1; grid-row: 2; }

	.cert-modal-nav {
		position: absolute;
		top: 50%;
		grid-row: unset;
		transform: translateY(-50%);
		z-index: 2;
		width: 40px;
		height: 40px;
		/* 흰색 문서 이미지 위에 겹치므로 살짝 투명한 어두운 배경으로 대비 확보 */
		background: rgba(10, 14, 39, 0.45);
		border-color: rgba(255, 255, 255, 0.5);
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	}

	.cert-modal-nav:hover {
		background: rgba(10, 14, 39, 0.65);
	}

	.cert-modal-nav--prev { left: 4px; }
	.cert-modal-nav--next { right: 4px; }

	.cert-modal-close { top: 12px; right: 12px; width: 38px; height: 38px; }
}