/*
Theme Name: 탕정365한의원
Theme URI: https://tangjeong365.co.kr/
Description: 탕정365한의원 5대 특화진료(추나요법·초음파약침·교통사고·다이어트·성장치료)와 의료정보 컬럼을 위한 Twenty Twenty-Four 자식 테마.
Author: 탕정365한의원
Template: twentytwentyfour
Version: 1.0.1
Requires at least: 6.5
Tested up to: 6.5
Text Domain: twentytwentyfour-tangjeong365
*/

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css");

:root {
	--tj-primary: #1967d2;
	--tj-primary-dark: #1352aa;
	--tj-navy: #0c213f;
	--tj-navy-dark: #071526;
	--tj-gold: #c5a059;
	--tj-gold-dark: #a98540;
	--tj-bg-subtle: #f1f7fc;
	--tj-line: #d8e5ef;
	--tj-ink: #16283e;
	--tj-muted: #617083;
	--tj-paper: #ffffff;
	--tj-shadow: 0 18px 45px rgba(12, 33, 63, 0.09);
	--tj-glow: 0 14px 34px rgba(25, 103, 210, 0.22);
}

body {
	background: var(--tj-bg-subtle);
	color: var(--tj-ink);
	font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	letter-spacing: -0.035em;
}

body * {
	box-sizing: border-box;
	word-break: keep-all;
	overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, .wp-block-post-title {
	letter-spacing: -0.05em;
	line-height: 1.25;
	text-wrap: balance;
	word-break: keep-all;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.tj-site-header {
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--tj-line);
	position: sticky;
	top: 0;
	z-index: 100;
}

.tj-header-logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--tj-navy);
}

.tj-header-logo img {
	height: 38px;
	width: auto;
}

.tj-header-logo__name {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--tj-navy);
	letter-spacing: -0.04em;
}

/* 블로그 메인 배경: 모눈/그리드 패턴 */
.tj-blog-main {
	background:
		linear-gradient(rgba(43, 135, 211, 0.055) 1px, transparent 1px),
		linear-gradient(90deg, rgba(43, 135, 211, 0.055) 1px, transparent 1px),
		#f1f7fc;
	background-size: 42px 42px;
	min-height: 70vh;
	padding-bottom: 5rem;
}

.tj-blog-hero {
	padding: 50px 0 20px;
	text-align: center;
}

.tj-eyebrow {
	font-size: 0.82rem;
	font-weight: 800;
	color: var(--tj-primary);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.tj-blog-hero h1,
.tj-blog-hero .wp-block-query-title,
.tj-blog-hero .wp-block-heading {
	font-size: clamp(2.05rem, 4.4vw, 3.2rem);
	font-weight: 800;
	margin: 0;
	color: #0c213f;
}

.tj-blog-hero p {
	color: #617083;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.8;
}

.tj-category-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	justify-content: center;
	margin-top: 2rem;
}

.tj-category-filter a {
	align-items: center;
	background: #ffffff;
	border: 1px solid #d8e5ef;
	border-radius: 999px;
	color: #16283e;
	display: inline-flex;
	font-size: 0.92rem;
	font-weight: 800;
	line-height: 1.2;
	min-height: 2.55rem;
	padding: 0.7rem 1.05rem;
	text-decoration: none;
	transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.tj-category-filter a:hover,
.tj-category-filter a.is-active {
	background: #1469bd;
	border-color: #1469bd;
	box-shadow: 0 12px 26px rgba(25, 103, 210, 0.25);
	color: #ffffff;
	transform: translateY(-2px);
}

/* 포스트 그리드 (4열 구성) */
.tj-post-grid {
	margin-top: 2.5rem;
}

.tj-post-grid .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

@media (max-width: 1100px) {
	.tj-post-grid .wp-block-post-template {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.tj-post-grid .wp-block-post-template {
		grid-template-columns: 1fr;
	}
}

.tj-post-grid .wp-block-post {
	background: #ffffff;
	border: 1px solid rgba(160, 153, 135, 0.45);
	border-radius: 8px;
	box-shadow: 0 18px 45px rgba(36, 45, 42, 0.08);
	display: flex;
	flex-direction: column;
	min-height: 100%;
	overflow: hidden;
	position: relative;
	transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.tj-post-grid .wp-block-post:hover {
	border-color: #1469bd;
	box-shadow: 0 18px 38px rgba(25, 103, 210, 0.20);
	transform: translateY(-4px);
}

/* 썸네일 플레이스홀더 (특성 이미지가 없을 때 부드러운 그라데이션) */
.tj-post-grid .wp-block-post::before {
	background:
		radial-gradient(circle at 20% 24%, rgba(106, 145, 120, 0.22), transparent 28%),
		radial-gradient(circle at 82% 75%, rgba(140, 194, 160, 0.28), transparent 30%),
		linear-gradient(135deg, #f7fbf8 0%, #ffffff 56%, #e9f4ed 100%);
	content: "";
	display: block;
	height: 10rem;
	width: 100%;
}

/* 특성 이미지가 있는 경우 플레이스홀더 숨김 */
.tj-post-grid .wp-block-post:has(.wp-block-post-featured-image)::before {
	display: none;
}

/* 특성 이미지 스타일 */
.tj-post-grid .wp-block-post-featured-image {
	background:
		radial-gradient(circle at 20% 24%, rgba(106, 145, 120, 0.22), transparent 28%),
		radial-gradient(circle at 82% 75%, rgba(140, 194, 160, 0.28), transparent 30%),
		linear-gradient(135deg, #f7fbf8 0%, #ffffff 56%, #e9f4ed 100%);
	border-radius: 0 !important;
	height: 10rem;
	margin: 0;
	overflow: hidden;
	position: relative;
}

.tj-post-grid .wp-block-post-featured-image::after {
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.36) 100%);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 1;
}

.tj-post-grid .wp-block-post-featured-image a,
.tj-post-grid .wp-block-post-featured-image img {
	border-radius: 0 !important;
	display: block;
	height: 100%;
	width: 100%;
}

.tj-post-grid .wp-block-post-featured-image img {
	object-fit: cover;
	transition: transform 0.28s ease;
}

.tj-post-grid .wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

/* 카드 본문 컨테이너 */
.tj-post-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.25rem;
	position: static !important;
	text-align: left !important;
}

.tj-post-card-body > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	margin-left: 0 !important;
	margin-right: auto !important;
	max-width: 100% !important;
	width: 100%;
}

/* 카테고리 뱃지: 썸네일 영역 하단에 위치 */
.tj-post-grid .wp-block-post-terms.taxonomy-category {
	color: #1469bd;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	font-size: 0.78rem;
	font-weight: 800;
	left: 1.25rem !important;
	margin: 0;
	position: absolute !important;
	right: 1.25rem !important;
	top: 7rem !important;
	z-index: 3 !important;
	text-align: left !important;
	justify-content: flex-start !important;
}

.tj-post-grid .wp-block-post-terms.taxonomy-category a {
	align-items: center;
	background: #ffffff;
	border: 0;
	border-radius: 999px;
	color: #1469bd;
	display: inline-flex;
	line-height: 1;
	padding: 0.58rem 1rem;
	text-decoration: none;
	font-weight: 800;
}

.tj-post-grid .wp-block-post-terms.taxonomy-category a:hover {
	background: #1469bd;
	color: #ffffff;
}

/* 게시물 제목 */
.tj-post-card-body .wp-block-post-title {
	font-size: 1.14rem;
	font-weight: 800;
	line-height: 1.5;
	margin: 0;
	text-align: left !important;
}

.tj-post-card-body .wp-block-post-title a {
	color: #16283e;
	display: block;
	text-decoration: none;
}

.tj-post-card-body .wp-block-post-title a:hover {
	color: #1469bd;
}

/* 게시물 요약 */
.tj-post-card-body .wp-block-post-excerpt {
	color: #617083;
	font-size: 0.94rem;
	line-height: 1.75;
	margin: 0;
	text-align: left !important;
}

.tj-post-card-body .wp-block-post-excerpt__excerpt {
	margin: 0;
	text-align: left !important;
}

/* 카드 본문 내 날짜 숨김 */
.tj-post-card-body .wp-block-post-date {
	display: none !important;
}

/* 자세히 보기 버튼 */
.tj-read-more {
	margin-top: auto;
	text-align: left !important;
}

.tj-read-more .wp-block-read-more,
.wp-block-query-pagination a,
.wp-block-post-navigation-link a,
.tj-blog-list-link {
	background: #2b87d3;
	border-radius: 999px;
	color: #ffffff !important;
	display: inline-flex;
	font-size: 0.9rem;
	font-weight: 800;
	padding: 0.7rem 1.05rem;
	text-decoration: none;
	transition: background-color 0.22s ease, transform 0.22s ease;
}

.tj-read-more .wp-block-read-more:hover,
.wp-block-query-pagination a:hover,
.wp-block-post-navigation-link a:hover,
.tj-blog-list-link:hover {
	background: #1469bd;
	color: #ffffff !important;
	transform: translateY(-2px);
}

.wp-block-query-pagination {
	margin-top: 2.5rem;
}

.screen-reader-text,
.tj-post-grid .screen-reader-text,
.tj-post-card-body .screen-reader-text,
.tj-read-more .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.tj-site-footer {
	background: #071526;
	color: #94a3b8;
	padding: 50px 0 40px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}
