/* 사이트 공통 디자인 톤(kr-market-forecast 참고): border-radius 6px, Astra 테마 기본값에
   맞춘 회색조(#3a3a3a 계열) 텍스트 계층 + 기본 시스템 폰트 스택. 다른 설치된 플러그인들과
   시각적으로 통일감을 유지한다. */

.aif-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	max-width: 960px;
}

@media (max-width: 782px) {
	.aif-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.aif-grid {
		grid-template-columns: 1fr;
	}
}

.aif-item {
	font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Malgun Gothic", sans-serif;
	transition: grid-column 0.2s ease;
}

.aif-item.aif-expanded {
	grid-column: 1 / -1;
	max-width: 480px;
	margin: 0 auto;
}

.aif-thumb-button {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 6px;
}

.aif-expanded .aif-thumb-button,
.aif-expanded .aif-media-wrapper {
	aspect-ratio: auto;
}

.aif-thumb,
.aif-media-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.2s ease;
}

.aif-expanded .aif-thumb,
.aif-media-wrapper img,
.aif-media-wrapper video {
	object-fit: contain;
	height: auto;
}

.aif-thumb-button:hover .aif-thumb {
	transform: scale(1.03);
}

.aif-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 40px;
	margin-top: -20px;
	margin-left: -28px;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 10px;
}

.aif-play-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 55%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 16px;
	border-color: transparent transparent transparent #fff;
}

.aif-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
}

.aif-badge-reel {
	background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4);
}

.aif-media-wrapper {
	position: relative;
	width: 100%;
	border-radius: 6px;
	overflow: hidden;
}

.aif-media-wrapper video {
	width: 100%;
	display: block;
}

.aif-close-button {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	line-height: 28px;
	text-align: center;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	z-index: 2;
}

.aif-caption {
	margin: 8px 0 2px;
	font-size: 14px;
	line-height: 1.4;
	color: #3a3a3a;
}

.aif-permalink {
	margin: 2px 0 0;
	font-size: 12px;
}

.aif-permalink a {
	color: #8134af;
	text-decoration: none;
}

.aif-permalink a:hover {
	text-decoration: underline;
}

.aif-error,
.aif-empty {
	color: #767676;
	font-size: 14px;
}
