/* =========================================================
   components.css
   ---------------------------------------------------------
   카드 공통 컴포넌트
   - 상단 hero 오버레이 카드
   - 최신뉴스 / 섹션 리스트 카드
   ========================================================= */

/* =========================================================
   오버레이 카드
   ========================================================= */
.card-overlay {
	position: relative;
	overflow: hidden;
	background: #ffffff;
}

.card-overlay__link {
	position: absolute;
	inset: 0;
	z-index: 5;
}

.card-overlay__thumb {
	position: relative;
	overflow: hidden;
	background: #dcdcdc;
}

.card-overlay__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/**
 * 공통 제목 오버레이
 * - 이미지 하단에 검정 반투명 배경
 * - 시안보다 너무 높지 않게 조정
 */
.card-overlay__body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 16px 18px 18px;
	background: rgba(0, 0, 0, 0.42);
	color: #fff;
}

.card-overlay__category {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 0 12px;
	margin-bottom: 10px;
	border-radius: 999px;
	background: var(--sc-accent);
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	color: #111;
}

.card-overlay__title {
	margin: 0;
	font-weight: 900;
	line-height: 1.34;
	word-break: keep-all;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

/**
 * 왼쪽 메인 hero 카드 제목
 * - 시안처럼 더 크고 강하게
 */
.card-overlay--hero-main .card-overlay__body {
	padding: 20px 22px 22px;
}

.card-overlay--hero-main .card-overlay__title {
	font-size: 21px;
	-webkit-line-clamp: 2;
}

/**
 * 오른쪽 hero 카드 제목
 * - 시안처럼 조금 더 작고 타이트하게
 */
.card-overlay--hero-side .card-overlay__body {
	padding: 10px 12px 12px;
	background: rgba(0, 0, 0, 0.48);
}

.card-overlay--hero-side .card-overlay__title {
	font-size: 14px;
	line-height: 1.32;
	-webkit-line-clamp: 2;
}

.card-overlay--hero-side .card-overlay__category {
	min-height: 22px;
	padding: 0 9px;
	margin-bottom: 8px;
	font-size: 11px;
}

/**
 * 이미지 없는 카드(앰바고 카드)
 * - 상단 연회색 영역
 * - 하단 진회색 바
 * - 제목은 아래 띠 안에 배치
 */
.card-overlay--text-only {
	background: #d6d6d6;
	min-height: 100%;
}

.card-overlay--text-only .card-overlay__thumb {
	display: none;
}

.card-overlay--text-only .card-overlay__body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px 14px;
	background: rgba(122, 122, 122, 0.72);
}

.card-overlay--text-only .card-overlay__title {
	font-size: 14px;
	line-height: 1.3;
	-webkit-line-clamp: 2;
}

.card-overlay--text-only .card-overlay__category {
	display: none;
}

/* =========================================================
   공통 사이드바
   ---------------------------------------------------------
   대상:
   - 기사 상세
   - 리스트 / 카테고리 / 태그 / 검색 / 404
   ========================================================= */

.sc-common-sidebar {
	display: grid;
	grid-template-columns: 1fr;
	row-gap: 36px;
	background: #ffffff;
}

.sc-common-sidebar__section {
	min-width: 0;
}

.sc-common-sidebar__title {
	margin: 0 0 10px;
	color: #111111;
	font-size: 1.3em;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -0.04em;
}

.sc-common-sidebar__list {
	display: grid;
	grid-template-columns: 1fr;
	row-gap: 12px;
}

.sc-common-sidebar__item {
	position: relative;
	display: grid;
	align-items: center;
	min-width: 0;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e5e5;
	background: #ffffff;
}

.sc-common-sidebar__item--recommended {
	grid-template-columns: minmax(0, 1fr) 120px;
	column-gap: 10px;
}

.sc-common-sidebar__item--popular {
	grid-template-columns: 120px minmax(0, 1fr);
	column-gap: 15px;
	position: relative;
}

.sc-common-sidebar__item--recommended.sc-common-sidebar__item--text-only {
	grid-template-columns: 1fr;
}

.sc-common-sidebar__item--popular.sc-common-sidebar__item--text-only {
	grid-template-columns: 32px 1fr;
}

.sc-common-sidebar__item-link {
	position: absolute;
	inset: 0;
	z-index: 3;
}

.sc-common-sidebar__body {
	min-width: 0;
}

.sc-common-sidebar__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 24px;
	padding: 0 10px;
	margin: 0 0 7px;
	border-radius: 24px 0 24px 24px;
	background: #379585;
	color: #ffffff;
	font-size: 0.8em;
	line-height: 1;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.sc-common-sidebar__item-title {
	margin: 0;
	color: #111111;
	font-size: 1em;
	line-height: 1.3;
	font-weight: 500;
	letter-spacing: -0.05em;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sc-common-sidebar__thumb {
	position: relative;
	overflow: hidden;
	background: #e9e9e9;
	aspect-ratio: 4 / 3;
}

.sc-common-sidebar__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sc-common-sidebar__rank {
	display: block;
	align-items: flex-start;
	justify-content: center;
	padding-top: 1px;
	color: #111111;
	font-size:3rem;
	line-height: 0.88;
	font-weight: 900;
	letter-spacing: -0.05em;
	position: absolute;
	left:-15px;
	z-index: 10;
}

@media (max-width: 1024px) {
	.sc-common-sidebar__title {
		font-size: 24px;
	}
}

@media (max-width: 767px) {
	.sc-common-sidebar {
		row-gap: 30px;
	}

	.sc-common-sidebar__title {
		margin-bottom: 14px;
		font-size: 22px;
	}

	.sc-common-sidebar__item--recommended {
		grid-template-columns: minmax(0, 1fr) 96px;
		column-gap: 10px;
		padding-bottom: 10px;
	}

	.sc-common-sidebar__item--popular {
		grid-template-columns: 100px minmax(0, 1fr);
		column-gap: 10px;
		padding-bottom: 10px;
	}

	.sc-common-sidebar__item--popular.sc-common-sidebar__item--text-only {
		grid-template-columns: 24px 1fr;
	}

	.sc-common-sidebar__badge {
		height: 22px;
		padding: 0 10px;
		margin-bottom: 6px;
		font-size: 0.8em;
	}

	.sc-common-sidebar__item-title {
		font-size: 1em;
		line-height: 1.4;
	}

	.sc-common-sidebar__rank {
		font-size: 2.4em;
		left: 0;
		top: 0;
	}
}

.sc-common-sidebar__item-title-link {
	color: inherit;
	text-decoration: none;
}

.sc-common-sidebar__item-title-link:hover,
.sc-common-sidebar__item-title-link:focus,
.sc-common-sidebar__item-title-link:focus-visible {
	color: inherit;
	text-decoration: none;
}