/*
MASTER_TEMPLATE v2

Theme Name:   Astra Child - Master Template
Theme URI:    https://wpastra.com/
Description:  Astra Child Theme. 홈 상단 Featured News(대표기사+보조기사) 및 카테고리별 카드형 글 목록 중심의 MASTER_TEMPLATE v2.
Author:       Site Owner
Template:     astra
Version:      2.0.0
Text Domain:  astra-child
*/

/* ==========================================================================
   MASTER_TEMPLATE v2 - 최소 커스텀 CSS
   ========================================================================== */

/* ----- 전체 폰트 통일 ----- */
body,
button,
input,
select,
textarea,
.mt-site-header,
.mt-category-nav,
.mt-featured-news,
.mt-post-card {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ----- Astra 기본 헤더(사이트 제목/메뉴 빌더 영역) 숨김 -----
   functions.php 의 mt_render_site_header() 가 같은 자리(astra_header_before)에
   출력하는 커스텀 헤더로 대체하므로, Astra 빌더 헤더 행은 화면에서 숨긴다. */
.site-header,
.ast-above-header-wrap,
.ast-below-header-wrap,
.ast-mobile-header-wrap {
	display: none !important;
}

/* ----- Astra 기본 푸터 숨김 -----
   functions.php 의 mt_render_site_footer() 가 같은 자리(astra_footer_before)에
   출력하는 커스텀 푸터로 대체한다. */
.site-footer {
	display: none !important;
}

/* ----- 사이트 전체 배경/링크 색상 강제 -----
   Astra 부모 테마의 기본 링크색(파란색)/배경색을 헤더·푸터·카테고리 메뉴에서
   덮어써 흰 배경 + 검정 텍스트로 통일한다. */
body {
	background: #ffffff !important;
}

.mt-site-header,
.mt-site-footer {
	background: #ffffff !important;
}

.mt-site-header a,
.mt-category-nav a,
.mt-site-footer a {
	color: #111111 !important;
}

/* ----- 커스텀 헤더: 사이트명 + 카테고리 메뉴 ----- */
.mt-site-header {
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	padding: 1.5em 0 1em;
}

.mt-site-title {
	text-align: center;
}

.mt-site-title a {
	font-size: 1.6em;
	font-weight: 800;
	color: inherit;
	text-decoration: none;
}

.mt-category-nav {
	margin-top: 0.75em;
	border-top: 1px solid #333;
	border-bottom: 1px solid #333;
}

.mt-header-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 36px;
	list-style: none;
	margin: 0;
	padding: 22px 0;
}

.mt-header-menu li {
	margin: 0;
}

.mt-header-menu a {
	text-decoration: none;
	font-weight: 600;
}

/* 날짜 표시: Featured News / post-card.php / single.php 공통 */
.mt-post-meta {
	font-size: 14px;
	color: #6b7280;
}

.mt-section {
	margin-bottom: 3em;
}

.mt-section-title {
	font-size: 1.4em;
	font-weight: 700;
	margin-bottom: 1em;
	padding-bottom: 0.3em;
	border-bottom: 2px solid currentColor;
}

/* ----- 카테고리별 섹션 헤더 -----
   "최근 소식"(Featured News)에는 적용하지 않고, 카테고리별 섹션에만 적용한다. */
.mt-section-header {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
}

.mt-section-header .mt-section-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0;
	padding-left: 14px;
	padding-bottom: 0;
	border-bottom: none;
	border-left: 3px solid #d63b2a;
	white-space: nowrap;
}

.mt-section-line {
	flex: 1;
	height: 1px;
	background: #222;
	opacity: 0.6;
}

.mt-view-all {
	color: #d63b2a;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.mt-view-all:hover {
	text-decoration: underline;
}

/* ----- Featured News (대표기사 1 + 보조기사 2) -----
   모바일/태블릿: 1열 (대표기사 → 기사2 → 기사3 순서로 세로 출력)
   데스크탑(1024px+): 좌측 65% 대표기사 / 우측 35% 보조기사 2개 세로 스택 */
.mt-featured-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: stretch;
}

@media (min-width: 1024px) {
	.mt-featured-layout {
		grid-template-columns: 65% 35%;
	}
}

.mt-featured-main {
	display: flex;
	flex-direction: column;
}

.mt-featured-main .mt-featured-thumb {
	display: block;
	flex: 1;
	min-height: 320px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.04);
}

.mt-featured-main .mt-featured-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mt-featured-main .mt-featured-title {
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 700;
	line-height: 1.2;
	color: #061a33;
	margin: 0.5em 0 0.3em;
}

/* 우측 보조기사 2개: 작은 이미지 옆에 텍스트가 붙는 가로형 media card */
.mt-featured-side {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.mt-featured-side-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 24px;
}

.mt-featured-side-thumb {
	display: block;
	flex: 0 0 45%;
	max-width: 45%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.04);
}

.mt-featured-side-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mt-featured-side-content {
	flex: 0 0 55%;
	max-width: 55%;
	min-width: 0;
}

.mt-featured-side-content .mt-featured-title {
	font-size: clamp(18px, 2.5vw, 24px);
	font-weight: 700;
	line-height: 1.2;
	color: #061a33;
	margin: 0.5em 0 0.25em;
}

@media (max-width: 767px) {
	.mt-featured-side-item {
		flex-direction: column;
		align-items: stretch;
	}

	.mt-featured-side-thumb,
	.mt-featured-side-content {
		flex: 0 0 auto;
		max-width: 100%;
	}
}

.mt-featured-title a {
	color: inherit;
	text-decoration: none;
}

/* ----- 카테고리 라벨(박스형 배지) -----
   Featured News 대표/보조기사, 일반 post-card.php 카드에서 공통 사용. */
.mt-category-label {
	display: inline-block;
	background: #d63b2a;
	color: #fff;
	padding: 4px 7px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	border-radius: 0;
	margin-top: 0.75em;
}

/* ----- 카드형 글 그리드 -----
   auto-fit + minmax(240px, 1fr) 로 카드 폭을 보장한다.
   글이 1개뿐이어도 카드 폭이 240~320px 이상 유지되고,
   여러 개일 때는 컨테이너 폭에 맞춰 자동으로 3~4열, 좁은 화면에서는 1열로 줄어든다. */
.mt-post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 28px;
	width: 100%;
}

/* 카테고리별 섹션의 3개/2개 교차 출력 전용 고정 열 수 (데스크탑).
   minmax(0, 1fr) 이라 컬럼 사이에 빈 공간 없이 카드가 폭 전체를 채운다. */
.mt-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mt-grid-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 768px) {
	.mt-grid-3,
	.mt-grid-2 {
		grid-template-columns: 1fr;
	}
}

.mt-empty-category {
	color: #6b7280;
	font-size: 0.95em;
}

/* 카드 박스: 흰 배경 + 옅은 테두리로 카드 영역 자체가 보이게 한다. */
.mt-post-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 0;
	padding: 16px;
	transition: box-shadow 0.2s ease;
}

.mt-post-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.mt-post-card .mt-post-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.04);
}

.mt-post-card .mt-post-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* 카테고리별 섹션 카드의 카테고리 라벨: Featured News(.mt-category-label)와 달리 박스 없는 빨간 텍스트 */
.mt-post-category {
	display: inline-block;
	color: #d63b2a;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	text-decoration: none;
	margin-top: 1em;
}

.mt-post-card .mt-post-title {
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.2;
	color: #061a33;
	margin: 0.5em 0 0.35em;
	word-break: keep-all;
	overflow-wrap: break-word;
}

.mt-post-card .mt-post-title a {
	color: inherit;
	text-decoration: none;
}

.mt-post-card .mt-post-meta {
	font-size: 14px;
	color: #6b7280;
	margin-bottom: 0.5em;
}

.mt-post-card .mt-post-excerpt {
	margin-bottom: 1em;
	font-size: 0.95em;
	line-height: 1.5;
	word-break: keep-all;
	overflow-wrap: break-word;
}

/* excerpt 2~3줄 제한 */
.mt-clamp-3 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
}

.mt-post-list {
	display: flex;
	flex-direction: column;
	gap: 2em;
}

.mt-related-posts {
	margin-top: 3em;
	padding-top: 2em;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   강제 오버라이드: 카테고리 섹션 카드 큰 이미지 보장
   Astra 부모 스타일(astra-theme-css)이 동일/높은 우선순위로 이미지 폭을 줄이는
   경우를 대비해, 실제 마크업 클래스(.mt-post-thumb)를 기준으로 파일 맨 아래에서
   !important 로 최종 강제 적용한다.
   ========================================================================== */
.mt-category-section .mt-post-grid {
	display: grid !important;
	gap: 28px !important;
	width: 100% !important;
}

.mt-category-section .mt-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.mt-category-section .mt-grid-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.mt-category-section .mt-post-card {
	width: 100% !important;
	max-width: none !important;
	border: 1px solid #e5e7eb !important;
	background: #ffffff !important;
	padding: 16px !important;
}

.mt-category-section .mt-post-thumb {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	margin-bottom: 20px !important;
}

.mt-category-section .mt-post-thumb img {
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	aspect-ratio: 16 / 9 !important;
	object-fit: cover !important;
	display: block !important;
}

.mt-category-section .mt-post-title {
	font-size: 22px !important;
	line-height: 1.2 !important;
	font-weight: 700 !important;
	margin: 10px 0 !important;
}

.mt-category-section .mt-post-excerpt {
	font-size: 16px !important;
	line-height: 1.7 !important;
	color: #333 !important;
}

@media (max-width: 768px) {
	.mt-category-section .mt-grid-3,
	.mt-category-section .mt-grid-2 {
		grid-template-columns: 1fr !important;
	}
}

/* ==========================================================================
   카테고리 아카이브 페이지(category.php) — 홈 카테고리 섹션과 동일한 카드 디자인.
   주의: .mt-featured-* (최근 소식/Featured News) 영역은 이 블록과 무관하며 수정하지 않음.
   ========================================================================== */
.mt-category-archive {
	max-width: 1200px;
	margin: 0 auto;
	padding: 60px 24px;
}

.mt-archive-title {
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 24px;
}

.mt-category-archive .mt-post-grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 28px !important;
	width: 100% !important;
}

@media (max-width: 1024px) {
	.mt-category-archive .mt-post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 768px) {
	.mt-category-archive .mt-post-grid {
		grid-template-columns: 1fr !important;
	}
}

.mt-category-archive .mt-post-card {
	width: 100% !important;
	max-width: none !important;
	background: #ffffff !important;
	border: 1px solid #e5e7eb !important;
	padding: 16px !important;
}

.mt-category-archive .mt-post-thumb {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	margin-bottom: 20px !important;
}

.mt-category-archive .mt-post-thumb img {
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	aspect-ratio: 16 / 9 !important;
	object-fit: cover !important;
	display: block !important;
}

.mt-category-archive .mt-post-title {
	font-size: 22px !important;
	line-height: 1.2 !important;
	font-weight: 700 !important;
	margin: 10px 0 !important;
	word-break: keep-all !important;
	overflow-wrap: break-word !important;
}

.mt-category-archive .mt-post-excerpt {
	font-size: 16px !important;
	line-height: 1.7 !important;
	color: #333 !important;
}

/* ----- 커스텀 푸터: 사이트명 + 카테고리 메뉴(한 줄) + Copyright ----- */
.mt-site-footer {
	background: #ffffff;
	color: #111111;
	padding: 30px 20px;
	text-align: center;
	border-top: 1px solid #dddddd;
}

/* 사이트명 + 메뉴를 같은 <ul> 안에서 한 줄로 출력, 항목 사이는 세로선(|) 구분 */
.mt-footer-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	row-gap: 8px;
}

.mt-footer-menu li {
	margin: 0;
}

.mt-footer-menu li:not(:first-child) {
	margin-left: 16px;
	padding-left: 16px;
	border-left: 1px solid #111111;
}

.mt-footer-site-name {
	font-size: 24px;
	font-weight: 700;
}

.mt-footer-menu a {
	font-size: 16px;
	color: #111111;
	text-decoration: none;
}

.mt-footer-copyright {
	margin-top: 16px;
	font-size: 14px;
	color: #111111;
}
