/* ============================================
   부산불꽃축제 행사연혁 (history.css)
   라이트 테마 - 흰색 배경 사이트용
   + 스크롤 애니메이션 / 인터랙션 효과
   ============================================ */

.bff-history { position: relative; }

/* 헤더 */
.bff-history__header {
	text-align: center;
	margin-bottom: 80px;
}

.bff-history__eyebrow-wrap {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}

.bff-history__line {
	width: 28px;
	height: 1px;
	background: #FF007F;
}

.bff-history__eyebrow {
	font-size: 12px;
	color: #FF007F;
	letter-spacing: 4px;
	margin: 0;
	font-weight: 600;
}

.bff-history__title {
	font-size: 42px;
	color: #1a1a1a;
	margin: 0 0 12px;
	font-weight: 600;
	letter-spacing: -1px;
}

.bff-history__subtitle {
	font-size: 14px;
	color: #888;
	margin: 0;
	letter-spacing: 0.5px;
}

/* ============================================
   타임라인 + 스크롤 진행 라인
   ============================================ */
.bff-timeline { position: relative; }

/* 기본 회색 라인 (배경) */
.bff-timeline__line {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 1px;
	background: linear-gradient(
		to bottom,
		transparent 0%,
		#e5e5e0 5%,
		#e5e5e0 95%,
		transparent 100%
	);
	transform: translateX(-50%);
	z-index: 1;
}

/* 스크롤 진행에 따라 채워지는 빨간 라인 */
.bff-timeline__progress {
	position: absolute;
	left: 50%;
	top: 0;
	width: 2px;
	height: 0;
	background: linear-gradient(
		to bottom,
		#FF007F 0%,
		#FF007F 90%,
		transparent 100%
	);
	transform: translateX(-50%);
	z-index: 2;
	transition: height 0.1s linear;
	box-shadow: 0 0 8px rgba(255, 0, 127, 0.3);
}

/* 진행 라인 끝에 빛나는 점 */
.bff-timeline__progress::after {
	content: '';
	position: absolute;
	bottom: -4px;
	left: 50%;
	transform: translateX(-50%);
	width: 10px;
	height: 10px;
	background: #FF007F;
	border-radius: 50%;
	box-shadow: 0 0 12px #FF007F, 0 0 20px rgba(255, 0, 127, 0.4);
	animation: progress-glow 1.5s ease-in-out infinite;
}

@keyframes progress-glow {
	0%, 100% { box-shadow: 0 0 12px #FF007F, 0 0 20px rgba(255, 0, 127, 0.4); }
	50% { box-shadow: 0 0 18px #FF007F, 0 0 30px rgba(255, 0, 127, 0.6); }
}

/* ============================================
   아이템 - 기본 레이아웃
   ============================================ */
.bff-item {
	display: grid;
	grid-template-columns: 1fr 150px 1fr;
	gap: 0;
	margin-bottom: 70px;
	position: relative;
	z-index: 2;
	align-items: center;
}

.bff-item:last-child {
	margin-bottom: 0;
}

.bff-item[data-side="left"] .bff-item__content {
	grid-column: 1;
	text-align: right;
	padding-right: 30px;
}

.bff-item[data-side="left"] .bff-item__poster {
	grid-column: 3;
	padding-left: 30px;
}

.bff-item[data-side="right"] .bff-item__poster {
	grid-column: 1;
	padding-right: 30px;
	display: flex;
	justify-content: flex-end;
}

.bff-item[data-side="right"] .bff-item__content {
	grid-column: 3;
	padding-left: 30px;
}

/* ============================================
   스크롤 진입 애니메이션
   - JS가 .is-visible 클래스를 추가하면 등장
   ============================================ */

/* 좌측 컨텐츠: 왼쪽에서 슬라이드인 */
.bff-item[data-side="left"] .bff-item__content,
.bff-item[data-side="right"] .bff-item__poster {
	opacity: 0;
	transform: translateX(-60px);
	transition:
		opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 우측 컨텐츠: 오른쪽에서 슬라이드인 */
.bff-item[data-side="right"] .bff-item__content,
.bff-item[data-side="left"] .bff-item__poster {
	opacity: 0;
	transform: translateX(60px);
	transition:
		opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 노드: 스케일 + 페이드 */
.bff-item__node {
	opacity: 0;
	transform: scale(0);
	transition:
		opacity 0.5s ease,
		transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 활성화 상태 (JS로 추가) */
.bff-item.is-visible[data-side="left"] .bff-item__content,
.bff-item.is-visible[data-side="right"] .bff-item__poster,
.bff-item.is-visible[data-side="right"] .bff-item__content,
.bff-item.is-visible[data-side="left"] .bff-item__poster {
	opacity: 1;
	transform: translateX(0);
}

.bff-item.is-visible .bff-item__node {
	opacity: 1;
	transform: scale(1);
	transition-delay: 0.2s;
}

/* 컨텐츠는 노드보다 살짝 늦게 등장 */
.bff-item.is-visible .bff-item__content {
	transition-delay: 0.3s;
}

.bff-item.is-visible .bff-item__poster {
	transition-delay: 0.1s;
}

/* ============================================
   노드(중앙 점)
   ============================================ */
.bff-item__node {
	grid-column: 2;
	width: 14px;
	height: 14px;
	background: #fff;
	border: 2px solid #FF007F;
	border-radius: 50%;
	margin: 0 auto;
	position: relative;
	box-sizing: border-box;
	z-index: 3;
}

.bff-item__node::before {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	background: rgba(255, 0, 127, 0.1);
	opacity: 0;
	transform: scale(0.5);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.bff-item:hover .bff-item__node {
	background: #FF007F;
	transform: scale(1.2);
	transition: all 0.3s ease;
}

.bff-item:hover .bff-item__node::before {
	opacity: 1;
	transform: scale(1);
}

.bff-item__node--upcoming {
	width: 18px;
	height: 18px;
	background: #FF007F;
	border: 3px solid #fff;
	box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.2);
}

.bff-item__node--first {
	width: 16px;
	height: 16px;
	background: #FF007F;
	border: 2px solid #fff;
	box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.2);
}

.bff-item__node--canceled {
	background: #fafaf7;
	border: 1.5px dashed #aaa;
}

/* Ripple */
.bff-item__ripple {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	border: 1.5px solid rgba(255, 0, 127, 0.4);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	animation: ripple 2s ease-out infinite;
	pointer-events: none;
}

.bff-item__ripple::after {
	content: '';
	position: absolute;
	inset: 0;
	border: 1.5px solid rgba(255, 0, 127, 0.3);
	border-radius: 50%;
	animation: ripple 2s ease-out infinite 0.7s;
}

@keyframes ripple {
	0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
	100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* ============================================
   컨텐츠
   ============================================ */
.bff-item__content { }

.bff-item[data-side="left"] .bff-item__content {
	margin-left: auto;
}

.bff-item__year {
	margin: 0 0 15px;
	font-family: 'Presentation';
	color: #FF007F;
	font-weight: 700;
	font-size: 1em;
	letter-spacing: 1px;
}

.bff-item--upcoming .bff-item__year { color: #FF007F; }

.bff-item__title {
	font-family: 'Presentation';
	font-size: 45px;
	margin: 0 0 20px;
	font-weight: 800;
	letter-spacing: -0.5px;
	line-height: 1;
	transition: color 0.3s ease;
}

.bff-item:hover .bff-item__title {
	color: #222;
}

.bff-item--upcoming .bff-item__title { }

.bff-item__title--canceled {
	color: #888;
	font-size: 20px;
	text-decoration: line-through;
	text-decoration-color: #FF007F;
	text-decoration-thickness: 2px;
}

.bff-item:hover .bff-item__title--canceled {
	color: #888;
}

.bff-item__date {
	font-size: 0.9em;
	color: #555;
	margin: 0 0 6px;
}

.bff-item__desc {
	font-size: 0.85em;
	color: #777;
	margin: 0;
	line-height: 1.7;
}

.bff-item--canceled .bff-item__desc {
	color: #999;
	font-style: italic;
}

.bff-item--canceled .bff-item__content {
	opacity: 0.6;
}

/* ============================================
   배지
   ============================================ */
.bff-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 14px;
	background: linear-gradient(135deg, #FF007F, #BC13FE);
	border-radius: 100px;
	margin-bottom: 12px;
	font-family: 'Presentation';
	font-size: 11px;
	color: #fff;
	font-weight: 600;
	letter-spacing: 1px;
	box-shadow: 0 4px 12px rgba(188, 19, 254, 0.25);
	animation: badge-float 3s ease-in-out infinite;
}

@keyframes badge-float {
	0%, 100% { transform: translateY(0); box-shadow: 0 4px 12px rgba(188, 19, 254, 0.25); }
	50% { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(188, 19, 254, 0.35); }
}

.bff-badge--first {
	/* background: linear-gradient(135deg, #D946EF, #BC13FE); */
	box-shadow: 0 4px 12px rgba(188, 19, 254, 0.25);
	animation-name: badge-float-amber;
}

@keyframes badge-float-amber {
	0%, 100% { transform: translateY(0); box-shadow: 0 4px 12px rgba(188, 19, 254, 0.25); }
	50% { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(188, 19, 254, 0.35); }
}

.bff-badge__dot {
	width: 6px;
	height: 6px;
	background: currentColor;
	border-radius: 50%;
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.5; transform: scale(1.2); }
}

/* ============================================
   태그
   ============================================ */
.bff-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 12px;
}

.bff-item[data-side="left"] .bff-tags {
	justify-content: flex-end;
}

.bff-tag {
	font-size: 13px;
	padding: 4px 10px;
	background: #f5f5f0;
	border: 1px solid #e5e5e0;
	border-radius: 4px;
	color: #555;
	letter-spacing: 0.5px;
	font-weight: 500;
	transition: all 0.3s ease;
}

.bff-item:hover .bff-tag {
	transform: translateY(-2px);
}

.bff-tag--accent {
	background: #fff0f7;
	border-color: #fbcfe8;
	color: #9d174d;
}

/* ============================================
   포스터 - 호버 줌 + 패럴랙스
   ============================================ */
.bff-poster {
	width: 100%;
	max-width: 360px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	transition:
		transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		box-shadow 0.5s ease;
	cursor: pointer;
	border-radius: 0px;
	will-change: transform;
}

/* 포스터 위에 그라디언트 오버레이 (호버 시 등장) */
.bff-poster::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.15) 0%,
		transparent 50%
	);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
	z-index: 2;
}

.bff-poster:hover {
	transform: translateY(-8px);
	/* box-shadow: 0 20px 40px rgba(255, 0, 127, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05); */
}

.bff-poster:hover::after {
	opacity: 1;
}

.bff-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bff-poster:hover img {
	/* transform: scale(1.08); */
}

.bff-poster--upcoming {
	aspect-ratio: 4 / 4;
	background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
	border: 1.5px dashed #FF007F;
	flex-direction: column;
	gap: 10px;
}

.bff-poster--first { }

.bff-poster--canceled {
	background: #f5f5f0;
	border: 1px dashed #d4d4d4;
	opacity: 0.6;
}

.bff-poster--canceled:hover {
	transform: none;
	box-shadow: none;
}

/* 포스터 안 아이콘 (Coming Soon) */
.bff-poster__icon {
	font-size: 32px;
	color: #FF007F;
	line-height: 1;
	font-weight: 300;
	animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.bff-poster__label {
	font-size: 12px;
	color: #FF007F;
	letter-spacing: 3px;
	font-weight: 600;
	z-index: 3;
}

.bff-poster--canceled .bff-poster__label {
	color: #999;
}

.bff-poster__label-bottom {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	color: #aaa;
	background: rgba(255, 255, 255, 0.95);
	padding: 4px 10px;
	border-radius: 4px;
	letter-spacing: 2px;
	font-size: 11px;
	font-weight: 500;
	border: 1px solid #eee;
	z-index: 3;
	transition: all 0.3s ease;
}

.bff-poster:hover .bff-poster__label-bottom {
	background: #FF007F;
	color: #fff;
	border-color: #FF007F;
}

.bff-poster img + .bff-poster__label-bottom {
	display: none;
}

/* 불꽃 효과 (Upcoming) */
.bff-poster__spark {
	position: absolute;
	width: 4px;
	height: 4px;
	background: #FF007F;
	border-radius: 50%;
	animation: sparkle 2.5s ease-in-out infinite;
	box-shadow: 0 0 8px rgba(255, 0, 127, 0.5);
}

.bff-poster__spark--orange {
	background: #BC13FE;
	animation-delay: 0.8s;
	box-shadow: 0 0 8px rgba(188, 19, 254, 0.5);
}

@keyframes sparkle {
	0%, 100% { opacity: 0.3; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.5); }
}

/* ============================================
   푸터
   ============================================ */
.bff-history__footer {
	text-align: center;
	margin-top: 80px;
	padding-top: 40px;
	border-top: 1px solid #e5e5e0;
}

.bff-history__footer-text {
	font-size: 14px;
	color: #FF007F;
	letter-spacing: 2px;
	margin: 0;
	font-weight: 500;
}

/* ============================================
   스크롤 페이드 - 양 끝 페이드
   ============================================ */
.bff-timeline::before,
.bff-timeline::after {
	content: '';
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 60px;
	background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, transparent 70%);
	z-index: 4;
	pointer-events: none;
}

.bff-timeline::before { top: -30px; }
.bff-timeline::after { bottom: -30px; }

/* ============================================
   prefers-reduced-motion 대응
   - 사용자가 모션 감소 설정한 경우 애니메이션 최소화
   ============================================ */
@media (prefers-reduced-motion: reduce) {
	.bff-item[data-side="left"] .bff-item__content,
	.bff-item[data-side="right"] .bff-item__poster,
	.bff-item[data-side="right"] .bff-item__content,
	.bff-item[data-side="left"] .bff-item__poster {
		opacity: 1;
		transform: none;
	}

	.bff-item__node {
		opacity: 1;
		transform: scale(1);
	}

	.bff-poster__icon,
	.bff-badge,
	.bff-badge--first {
		animation: none;
	}
}

/* ============================================
   반응형 (Tablet)
   ============================================ */
@media (max-width: 1024px) {
	.bff-history {
		padding: 60px 30px 50px;
	}

	.bff-history__title {
		font-size: 32px;
	}

	.bff-item__title {
		font-size: 24px;
	}

	.bff-item--upcoming .bff-item__title {
		font-size: 28px;
	}

	.bff-poster {
		max-width: 260px;
	}
}

/* ============================================
   반응형 (Mobile) - 좌측 정렬 1단
   ============================================ */
@media (max-width: 768px) {
	.bff-history {
		padding: 50px 20px 40px;
		border-radius: 12px;
	}

	.bff-history__header {
		margin-bottom: 50px;
	}

	.bff-history__title {
		font-size: 26px;
	}

	.bff-history__eyebrow {
		font-size: 11px;
		letter-spacing: 3px;
	}

	.bff-timeline__line,
	.bff-timeline__progress {
		left: 20px;
		transform: none;
	}

	.bff-item {
		grid-template-columns: 40px 1fr;
		gap: 16px;
		margin-bottom: 50px;
	}

	/* 모바일에서는 모두 좌측에서 슬라이드인 */
	.bff-item[data-side="left"] .bff-item__content,
	.bff-item[data-side="right"] .bff-item__content,
	.bff-item[data-side="left"] .bff-item__poster,
	.bff-item[data-side="right"] .bff-item__poster {
		grid-column: 2;
		text-align: left;
		padding: 0;
		margin: 0;
		max-width: 100%;
		transform: translateX(-30px);
	}

	.bff-item.is-visible[data-side="left"] .bff-item__content,
	.bff-item.is-visible[data-side="right"] .bff-item__content,
	.bff-item.is-visible[data-side="left"] .bff-item__poster,
	.bff-item.is-visible[data-side="right"] .bff-item__poster {
		transform: translateX(0);
	}

	.bff-item[data-side="left"] .bff-item__content,
	.bff-item[data-side="right"] .bff-item__content {
		grid-row: 1;
	}

	.bff-item[data-side="left"] .bff-item__poster,
	.bff-item[data-side="right"] .bff-item__poster {
		grid-row: 2;
		padding: 16px 0 0;
		display: block;
	}

	.bff-item__node {
		grid-column: 1;
		grid-row: 1;
		margin: 8px auto 0;
	}

	.bff-item[data-side="left"] .bff-tags {
		justify-content: flex-start;
	}

	.bff-poster {
		max-width: 100%;
	}

	.bff-item__title {
		font-size: 22px;
	}

	.bff-item--upcoming .bff-item__title {
		font-size: 24px;
	}

	.bff-history__footer {
		margin-top: 50px;
	}
}