/* ========================================
   MochaNews - 공통 스타일 (Instagram Style)
   ======================================== */

/* CSS Reset & Base */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	font-size: 16px;
	scroll-behavior: smooth;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "맑은 고딕", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: #262626;
	background-color: #FAFAFA;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* 링크 스타일 */
a {
	color: inherit;
	text-decoration: none;
	transition: all 0.2s ease;
}

a:hover {
	opacity: 0.7;
}

/* 이미지 최적화 */
img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* 컨테이너 */
.container {
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
}

/* 메인 컨테이너 (사이드바 + 콘텐츠) */
.main-container {
	max-width: 1400px;
	margin: 2rem auto;
	padding: 0 20px;
	display: grid;
	grid-template-columns: 250px 1fr;
	gap: 2rem;
}

/* 섹션 타이틀 */
.section-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: #262626;
	margin-bottom: 1.5rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #DBDBDB;
	position: relative;
}

/* 헤더 */
.header {
	background: #FFFFFF;
	border-bottom: 1px solid #DBDBDB;
	position: sticky;
	top: 0;
	z-index: 1000;
	padding: 1.5rem 0;
}

.header-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.logo a {
	display: block;
}

.logo h1,
.logo-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: #262626;
	margin: 0;
	letter-spacing: -0.5px;
	display: block;
}

.logo-sub {
	font-size: 0.75rem;
	color: #8E8E8E;
	margin-top: 0.25rem;
	font-weight: 500;
	letter-spacing: 0.5px;
}

/* 사이드바 */
.sidebar {
	position: sticky;
	top: 100px;
	height: fit-content;
}

.category-menu {
	background-color: #FFFFFF;
	border: 1px solid #DBDBDB;
	border-radius: 8px;
	padding: 1.5rem;
}

.category-menu-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: #262626;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #EFEFEF;
}

.category-list {
	list-style: none;
}

.category-item {
	margin-bottom: 0.5rem;
}

.category-item.active .category-link {
	background: #262626;
	color: #FFFFFF;
	font-weight: 600;
}

.category-item.active .category-icon,
.category-item.active .category-count {
	color: #FFFFFF;
}

.category-link {
	display: flex;
	align-items: center;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	transition: all 0.2s ease;
	color: #262626;
	font-size: 0.95rem;
}

.category-link:hover {
	background-color: #FAFAFA;
	color: #0095F6;
	transform: translateX(5px);
	opacity: 1;
}

.category-item.active .category-link:hover {
	background: #000000;
	color: #FFFFFF;
	transform: translateX(0);
}

.category-icon {
	font-size: 1.2rem;
	margin-right: 0.75rem;
	color: #8E8E8E;
	transition: color 0.2s ease;
}

.category-link:hover .category-icon {
	color: #0095F6;
}

.category-name {
	flex: 1;
	font-weight: 500;
}

.category-count {
	font-size: 0.85rem;
	color: #8E8E8E;
	font-weight: 600;
	margin-left: auto;
}

/* 메인 콘텐츠 */
.main-content {
	min-width: 0;
}

.main-content section {
	margin-bottom: 3rem;
}

/* 네비게이션 */
.nav {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.nav-link {
	padding: 0.5rem 1rem;
	color: #262626;
	font-weight: 500;
	font-size: 0.9rem;
	border-radius: 8px;
	transition: all 0.2s ease;
	white-space: nowrap;
	border: 1px solid transparent;
}

.nav-link:hover {
	background-color: #FAFAFA;
	border-color: #DBDBDB;
	color: #000000;
	transform: translateY(-1px);
}

/* 푸터 */
.footer {
	background-color: #FFFFFF;
	border-top: 1px solid #DBDBDB;
	color: #8E8E8E;
	padding: 4rem 0 2rem;
	margin-top: 5rem;
}

.footer-content {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 2rem;
	margin-bottom: 2rem;
}

.footer-info h3 {
	color: #262626;
	font-size: 1.25rem;
	margin-bottom: 0.5rem;
}

.footer-info p {
	font-size: 0.9rem;
	color: #8E8E8E;
}

.footer-links {
	display: flex;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.footer-links a {
	color: #8E8E8E;
	font-size: 0.9rem;
	transition: color 0.2s ease;
}

.footer-links a:hover {
	color: #262626;
}

.footer-bottom {
	border-top: 1px solid #EFEFEF;
	padding-top: 1.5rem;
	text-align: center;
}

.footer-bottom p {
	font-size: 0.85rem;
	color: #8E8E8E;
}

/* 태그 스타일 */
.tag {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	background-color: #EFEFEF;
	color: #262626;
	font-size: 0.8rem;
	border-radius: 6px;
	margin-right: 0.5rem;
	margin-bottom: 0.5rem;
	transition: all 0.2s ease;
	border: 1px solid #DBDBDB;
}

.tag:hover {
	background-color: #262626;
	color: #FFFFFF;
	border-color: #262626;
	transform: translateY(-1px);
}

/* Risk Level 태그 */
.tag.risk-LOW {
	background-color: #E8F5E9;
	color: #2E7D32;
	border-color: #A5D6A7;
}

.tag.risk-MEDIUM {
	background-color: #FFF3E0;
	color: #E65100;
	border-color: #FFCC80;
}

.tag.risk-HIGH {
	background-color: #FFEBEE;
	color: #C62828;
	border-color: #EF9A9A;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
	.main-container {
		grid-template-columns: 220px 1fr;
		gap: 1.5rem;
	}

	.category-menu {
		padding: 1.25rem;
	}
}

@media (max-width: 768px) {
	html {
		font-size: 14px;
	}

	.container {
		padding: 0 15px;
	}

	.main-container {
		grid-template-columns: 1fr;
		gap: 1rem;
		margin: 1rem auto;
		padding: 0 15px;
	}

	.sidebar {
		position: static;
		order: 2;
	}

	.main-content {
		order: 1;
	}

	.header {
		padding: 0.75rem 0;
	}

	.header-content {
		flex-direction: column;
		align-items: flex-start;
	}

	.nav {
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 0.5rem;
	}

	.nav::-webkit-scrollbar {
		display: none;
	}

	.section-title {
		font-size: 1.5rem;
	}

	.footer-content {
		flex-direction: column;
		gap: 1.5rem;
	}

	.category-menu {
		border-radius: 0;
		border-left: none;
		border-right: none;
	}
}

@media (max-width: 480px) {
	.logo h1,
	.logo-title {
		font-size: 1.5rem;
	}

	.logo-sub {
		font-size: 0.7rem;
	}

	.nav-link {
		padding: 0.4rem 0.8rem;
		font-size: 0.85rem;
	}

	.category-menu {
		padding: 1rem;
	}

	.category-link {
		padding: 0.6rem 0.75rem;
		font-size: 0.9rem;
	}

	.main-container {
		margin: 0.5rem auto;
		padding: 0 10px;
	}
}

/* 로딩 애니메이션 */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.fade-in {
	animation: fadeIn 0.4s ease-out;
}

/* 스크롤바 스타일 (Chrome, Edge, Safari) */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: #FAFAFA;
}

::-webkit-scrollbar-thumb {
	background: #DBDBDB;
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: #8E8E8E;
}

/* 햄버거 메뉴 버튼 (모바일 전용) */
.hamburger-menu {
	display: none;
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1100;
	width: 44px;
	height: 44px;
	background: #262626;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hamburger-menu:hover {
	background: #000000;
	transform: scale(1.05);
}

.hamburger-menu span {
	display: block;
	width: 22px;
	height: 2px;
	background: #FFFFFF;
	border-radius: 2px;
	transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
	transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
	opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
	transform: rotate(-45deg) translate(5px, -5px);
}

/* 모바일 사이드바 오버레이 */
.sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1050;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
	opacity: 1;
}

/* 모바일 사이드바 슬라이드 */
@media (max-width: 768px) {
	.hamburger-menu {
		display: flex;
	}

	.sidebar {
		position: fixed;
		top: 0;
		left: -100%;
		height: 100vh;
		width: 280px;
		background: #FAFAFA;
		z-index: 1060;
		overflow-y: auto;
		transition: left 0.3s ease;
		padding: 80px 20px 20px;
		box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
	}

	.sidebar.active {
		left: 0;
	}

	.category-menu {
		border: 1px solid #DBDBDB;
		border-radius: 8px;
	}
}
