/*
 * 경희대범한의원 article-list layer.
 * Loaded only for the homepage preview and /blog/.
 */

.khbum-latest-links {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px 22px;
}

.khbum-latest-links .khbum-latest-external {
	margin: 0;
}

.khbum-latest-media {
	aspect-ratio: 1 / 1 !important;
	background: var(--kh-soft);
}

.khbum-latest-media img {
	object-fit: contain !important;
}

.khbum-article-query,
.khbum-article-query .khbum-article-grid {
	margin: 0;
	padding: 0;
}

.khbum-article-query .khbum-article-grid.wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(28px, 3vw, 42px) clamp(20px, 2.6vw, 34px);
	border: 0;
	list-style: none;
}

.khbum-article-query .khbum-article-grid > li {
	display: block;
	min-width: 0;
	padding: 0;
	border: 0;
}

.khbum-article-card {
	display: flex;
	height: 100%;
	min-width: 0;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--kh-line);
	border-top: 3px solid var(--kh-burgundy);
	background: var(--kh-white);
	transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.khbum-article-card:hover {
	border-color: color-mix(in srgb, var(--kh-burgundy) 46%, var(--kh-line));
	box-shadow: 0 18px 40px rgb(95 32 31 / 10%);
	transform: translateY(-3px);
}

.khbum-article-media,
.khbum-article-media.wp-block-post-featured-image {
	overflow: hidden;
	margin: 0;
	aspect-ratio: 1 / 1 !important;
	background: var(--kh-soft);
}

.khbum-article-media a,
.khbum-article-media img {
	display: block;
	width: 100%;
	height: 100%;
}

.khbum-article-media img {
	object-fit: contain !important;
	transition: transform 280ms ease;
}

.khbum-article-card:hover .khbum-article-media img {
	transform: scale(1.01);
}

.khbum-article-media a:focus-visible,
.khbum-latest-media a:focus-visible,
.khbum-article-title a:focus-visible,
.khbum-latest-title a:focus-visible,
.khbum-article-pagination a:focus-visible {
	outline: 3px solid var(--kh-burgundy);
	outline-offset: 3px;
}

.khbum-article-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 22px 22px 24px;
}

.khbum-article-date {
	margin: 0 0 10px;
	color: var(--kh-muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.khbum-article-title {
	margin: 0;
	font-size: clamp(1.12rem, 1.5vw, 1.35rem);
	line-height: 1.42;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.khbum-article-title a {
	color: var(--kh-ink);
	text-decoration: none;
}

.khbum-article-excerpt {
	display: flex;
	flex: 1;
	flex-direction: column;
	margin: 14px 0 0;
	color: var(--kh-muted);
	font-size: 0.91rem;
	line-height: 1.72;
}

.khbum-article-excerpt > p:first-child {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.khbum-article-excerpt .wp-block-post-excerpt__more-text {
	margin-top: auto;
	padding-top: 18px;
}

.khbum-article-excerpt .wp-block-post-excerpt__more-link {
	color: var(--kh-burgundy);
	font-size: 0.82rem;
	font-weight: 600;
}

.khbum-article-pagination.wp-block-query-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: clamp(46px, 7vw, 72px);
	gap: 8px;
}

.khbum-article-pagination :is(a, .page-numbers) {
	display: inline-flex;
	width: 44px;
	height: 44px;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	margin: 0;
	border: 1px solid var(--kh-line);
	background: var(--kh-white);
	color: var(--kh-ink);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}

.khbum-article-pagination .page-numbers.current {
	border-color: var(--kh-burgundy-dark);
	background: var(--kh-burgundy-dark);
	color: var(--kh-white);
}

.khbum-article-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

.khbum-article-pagination :is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
	width: auto;
	min-width: 44px;
	padding: 0 8px;
	border-color: transparent;
	background: transparent;
	color: var(--kh-burgundy);
}

.khbum-article-empty {
	padding: clamp(42px, 7vw, 76px);
	border: 1px solid var(--kh-line);
	border-top: 3px solid var(--kh-burgundy);
	background: var(--kh-soft);
	text-align: center;
}

.khbum-article-empty h2 {
	margin: 10px 0;
	font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.khbum-article-empty p:last-child {
	margin-bottom: 0;
	color: var(--kh-muted);
}

.khbum-article-fallback {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 10px;
	background:
		linear-gradient(135deg, transparent 49.6%, rgb(128 48 46 / 12%) 50%, transparent 50.4%),
		var(--kh-rose);
	color: var(--kh-burgundy-dark);
	text-align: center;
}

.khbum-article-fallback span {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.16em;
}

.khbum-article-fallback strong {
	font-size: clamp(1.3rem, 3vw, 2rem);
	letter-spacing: -0.04em;
}

@media (max-width: 1099px) {
	.khbum-article-query .khbum-article-grid.wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.khbum-latest-links {
		justify-content: flex-start;
	}
}

@media (max-width: 679px) {
	.khbum-article-query .khbum-article-grid.wp-block-post-template {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.khbum-article-body {
		padding: 20px 20px 22px;
	}

	.khbum-article-title {
		font-size: 1.12rem;
	}

	.khbum-article-excerpt > p:first-child {
		-webkit-line-clamp: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.khbum-article-card,
	.khbum-article-media img {
		transition: none;
	}

	.khbum-article-card:hover,
	.khbum-article-card:hover .khbum-article-media img {
		transform: none;
	}
}
