/*
 * Health Library — article teaser grid, homepage [log_health_library]
 * @package log-core
 */

/* Reference's plain, unclassed blog section reads white via its white
   body. This site's body uses --paper sitewide by design, so #health-library
   needs its own explicit white background to match (see #categories in
   log-cat-grid.css for the same fix). */
#health-library {
	background: var(--white);
}

.article-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	max-width: 960px;
	margin: 40px auto 0;
}

.article-card {
	display: block;
	position: relative;
	background: #fff;
	border-radius: var(--r-md);
	border: 1px solid var(--line);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	text-decoration: none;
	color: inherit;
	transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .2s var(--ease);
}

.article-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-lg);
	border-color: var(--gold-500);
}

.article-card-shine {
	position: absolute;
	inset: 0;
	border-radius: var(--r-md);
	pointer-events: none;
	background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .18) 0%, transparent 65%);
	opacity: 0;
	transition: opacity .2s;
	z-index: 5;
}

.article-card:hover .article-card-shine {
	opacity: 1;
}

.article-visual {
	height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 44px;
	position: relative;
	overflow: hidden;
	transition: transform .4s var(--ease);
}

.article-card:hover .article-visual {
	transform: scale(1.04);
}

.article-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.article-tag {
	position: absolute;
	bottom: 14px;
	left: 14px;
	font-size: 10px;
	font-weight: 800;
	padding: 3px 10px;
	border-radius: 6px;
	text-transform: uppercase;
	letter-spacing: .04em;
	z-index: 2;
}

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

.article-body h4 {
	font-family: var(--display);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	margin: 0 0 10px;
	color: var(--ink-900);
}

.article-meta {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--gold-600);
	margin-bottom: 8px;
}

.article-desc {
	font-size: 13.5px;
	line-height: 1.65;
	color: var(--gray-mid);
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.article-link {
	font-size: 12px;
	font-weight: 700;
	color: var(--gold-600);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.article-link .icon {
	width: 13px;
	height: 13px;
	transition: transform .25s var(--ease);
}

.article-card:hover .article-link .icon {
	transform: translateX(3px);
}

/* Matches website_reference/homepage_5.html .blog-grid behavior: 2-col
   tablet, tighter 2-col mobile, then a compact thumbnail-left row card
   on small phones instead of collapsing straight to one stacked column. */
@media (max-width: 1024px) {
	.article-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.article-grid {
		gap: 14px;
	}

	.article-visual {
		height: 130px;
		font-size: 32px;
	}

	.article-body {
		padding: 14px 16px;
	}

	.article-body h4 {
		font-size: 15px;
		margin-bottom: 6px;
	}

	.article-meta {
		font-size: 11px;
		margin-bottom: 10px;
	}
}

@media (max-width: 480px) {
	.article-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.article-card {
		display: flex;
		flex-direction: row;
		align-items: flex-start;
		gap: 12px;
		padding: 6px;
	}

	.article-visual {
		width: 96px;
		min-width: 96px;
		max-width: 96px;
		height: 96px;
		flex-shrink: 0;
		border-radius: var(--r-sm);
		overflow: hidden;
	}

	.article-body {
		flex: 1;
		min-width: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
	}

	.article-tag {
		top: 6px;
		left: 6px;
		bottom: auto;
		font-size: 8.5px;
		padding: 3px 7px;
		display: none;
	}

	/* Title-first, meta below, description dropped — matches the compact
	   thumbnail-left row pattern at this width; order is CSS-only so the
	   markup (and desktop/tablet reading order) stays untouched. */
	.article-body h4 {
		order: 1;
		font-size: 13.5px;
		margin: 0 0 5px;
		line-height: 1.3;
	}

	.article-meta {
		order: 2;
		font-size: 10.5px;
		margin-bottom: 6px;
	}

	.article-desc {
		display: none;
	}

	.article-link {
		order: 3;
		font-size: 12px;
	}
}