/**
 * News Archive Scoped Styles.
 *
 * Implements Hallmark visual fidelity, WCAG AA/AAA contrast,
 * CSS grid responsive layout, and zero horizontal overflow.
 *
 * @package Hoa_Duc_Child
 */

:root {
	--hde-news-primary: #046531;
	--hde-news-primary-hover: #034b24;
	--hde-news-secondary: #28a745;
	--hde-news-text: #333333;
	--hde-news-text-muted: #666666;
	--hde-news-bg-light: #f8f9fa;
	--hde-news-border: #e5e5e5;
	--hde-news-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	--hde-news-card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.12);
	--hde-news-radius: 8px;
}

body.hoaduc-news-native,
body.hoaduc-news-native .site-main.hde-news-site-main {
	overflow-x: visible !important;
}

.hde-news-site-main {
	background-color: #ffffff;
	color: var(--hde-news-text);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.6;
		padding-bottom: 50px;
		overflow-x: visible;
	}

.hde-news-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 16px;
	box-sizing: border-box;
}

/* Breadcrumbs Bar */
.hde-news-breadcrumbs-wrap {
	background-color: #fcfcfc;
	border-bottom: 1px solid var(--hde-news-border);
	padding: 12px 0;
	margin-bottom: 24px;
}

.hde-news-breadcrumbs-wrap nav,
.hde-news-breadcrumbs-wrap .woocommerce-breadcrumb {
	font-size: 14px;
	color: var(--hde-news-text-muted);
	margin: 0;
	padding: 0;
}

.hde-news-breadcrumbs-wrap a {
	color: var(--hde-news-text-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.hde-news-breadcrumbs-wrap a:hover,
.hde-news-breadcrumbs-wrap a:focus-visible {
	color: var(--hde-news-primary);
}

/* Two-column Layout */
.hde-news-layout {
	display: flex;
	align-items: flex-start;
	gap: 30px;
}

	.hde-news-main-col {
		flex: 1 1 0%;
		min-width: 0;
		max-width: 100%;
		overflow-x: clip;
	}
	
	.hde-news-sidebar-col {
		width: 330px;
		flex-shrink: 0;
		box-sizing: border-box;
		position: -webkit-sticky;
		position: sticky;
		top: 16px;
		max-height: calc(100vh - 24px);
		overflow-x: hidden;
		overflow-y: auto;
	}

/* Header & H1 */
.hde-news-header {
	margin-bottom: 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--hde-news-primary);
}

.hde-news-heading {
	font-size: 26px;
	font-weight: 700;
	color: var(--hde-news-primary);
	text-transform: uppercase;
	margin: 0;
	letter-spacing: 0.5px;
}

/* Featured / Sticky Item */
.hde-news-featured {
	display: flex;
	background: #ffffff;
	border: 1px solid var(--hde-news-border);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: var(--hde-news-card-shadow);
	margin-bottom: 30px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hde-news-featured:hover {
	transform: translateY(-3px);
	box-shadow: var(--hde-news-card-shadow-hover);
}

.hde-news-featured__media {
	flex: 0 0 45%;
	overflow: hidden;
}

.hde-news-featured__media-link {
	display: block;
	height: 100%;
}

.hde-news-featured__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hde-news-featured__content {
	flex: 1 1 55%;
	padding: 24px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.hde-news-featured__badge {
	display: inline-block;
	align-self: flex-start;
	background-color: var(--hde-news-secondary);
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 4px;
	margin-bottom: 10px;
	text-transform: uppercase;
}

.hde-news-featured__title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 12px 0;
}

.hde-news-featured__title a {
	color: var(--hde-news-text);
	text-decoration: none;
	transition: color 0.2s ease;
}

.hde-news-featured__title a:hover {
	color: var(--hde-news-primary);
}

.hde-news-featured__excerpt {
	font-size: 14px;
	color: var(--hde-news-text-muted);
	margin-bottom: 16px;
	line-height: 1.5;
}

.hde-news-featured__cta {
	display: inline-flex;
	align-items: center;
	color: var(--hde-news-primary);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: transform 0.2s ease;
}

.hde-news-featured__cta:hover {
	transform: translateX(4px);
}

/* Regular News Grid */
.hde-news-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 36px;
}

/* Card Item */
.hde-news-card {
	display: flex;
	flex-direction: column;
	background-color: #ffffff;
	border: 1px solid var(--hde-news-border);
	border-radius: var(--hde-news-radius);
	overflow: hidden;
	box-shadow: var(--hde-news-card-shadow);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	box-sizing: border-box;
}

.hde-news-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--hde-news-card-shadow-hover);
}

.hde-news-card__media {
	position: relative;
	width: 100%;
	padding-top: 60%;
	background-color: #f0f0f0;
	overflow: hidden;
}

.hde-news-card__media-link {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
}

.hde-news-card__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.hde-news-card:hover .hde-news-card__thumb {
	transform: scale(1.04);
}

.hde-news-card__placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f4f6f8;
	color: var(--hde-news-text-muted);
	font-size: 13px;
	font-weight: 500;
}

.hde-news-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 16px;
}

.hde-news-card__meta {
	font-size: 13px;
	color: var(--hde-news-text-muted);
	margin-bottom: 8px;
}

.hde-news-card__title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 14px 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1 1 auto;
}

.hde-news-card__title a {
	color: var(--hde-news-text);
	text-decoration: none;
	transition: color 0.2s ease;
}

.hde-news-card__title a:hover {
	color: var(--hde-news-primary);
}

.hde-news-card__footer {
	margin-top: auto;
}

.hde-news-card__cta {
	display: inline-block;
	font-size: 13px;
	font-weight: 500;
	color: var(--hde-news-primary);
	text-decoration: none;
	transition: color 0.2s ease, transform 0.2s ease;
}

.hde-news-card__cta:hover {
	color: var(--hde-news-primary-hover);
	transform: translateX(3px);
}

/* Pagination */
.hde-news-pagination {
	margin-top: 30px;
	text-align: center;
}

.hde-news-pagination__inner {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}

.hde-news-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 4px;
	border: 1px solid var(--hde-news-border);
	background: #ffffff;
	color: var(--hde-news-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.hde-news-pagination .page-numbers:hover {
	border-color: var(--hde-news-primary);
	color: var(--hde-news-primary);
}

.hde-news-pagination .page-numbers.current {
	background-color: var(--hde-news-primary);
	border-color: var(--hde-news-primary);
	color: #ffffff;
	cursor: default;
}

/* Sidebar Widgets */
.hde-news-widget {
	background: #ffffff;
	border: 1px solid var(--hde-news-border);
	border-radius: var(--hde-news-radius);
	padding: 20px;
	margin-bottom: 24px;
	box-shadow: var(--hde-news-card-shadow);
}

.hde-widget-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--hde-news-text);
	text-align: center;
	margin: 0 0 10px 0;
	text-transform: capitalize;
}

.hde-widget-divider {
	width: 40px;
	height: 3px;
	background-color: var(--hde-news-primary);
	margin: 0 auto 16px auto;
	border-radius: 2px;
}

/* Search Form */
.hde-search-form__group {
	display: flex;
	position: relative;
	border: 1px solid #ced4da;
	border-radius: 4px;
	overflow: hidden;
}

.hde-search-input {
	flex: 1 1 auto;
	border: none;
	padding: 10px 14px;
	font-size: 14px;
	color: var(--hde-news-text);
	outline: none;
	background: #fbfbfb;
}

.hde-search-input:focus {
	background: #ffffff;
}

.hde-search-submit {
	background-color: var(--hde-news-primary);
	color: #ffffff;
	border: none;
	padding: 0 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease;
}

.hde-search-submit:hover {
	background-color: var(--hde-news-primary-hover);
}

/* Categories List */
.hde-cat-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.hde-cat-item {
	border-bottom: 1px dashed #e9ecef;
	padding: 10px 0;
}

.hde-cat-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.hde-cat-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: var(--hde-news-text);
	text-decoration: none;
	font-size: 14px;
	transition: color 0.2s ease, transform 0.2s ease;
}

.hde-cat-link:hover {
	color: var(--hde-news-primary);
	transform: translateX(3px);
}

.hde-cat-count {
	font-size: 12px;
	color: var(--hde-news-text-muted);
}

/* Recent Posts List */
.hde-recent-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.hde-recent-item {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f1f3f5;
	align-items: center;
}

.hde-recent-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.hde-recent-thumb {
	width: 64px;
	height: 64px;
	flex-shrink: 0;
	border-radius: 4px;
	overflow: hidden;
}

.hde-recent-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hde-recent-content {
	flex: 1 1 auto;
	min-width: 0;
}

.hde-recent-date {
	font-size: 12px;
	color: var(--hde-news-text-muted);
	display: block;
	margin-bottom: 4px;
}

.hde-recent-title {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hde-recent-title a {
	color: var(--hde-news-text);
	text-decoration: none;
	transition: color 0.2s ease;
}

.hde-recent-title a:hover {
	color: var(--hde-news-primary);
}

/* Keyboard accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--hde-news-primary);
	outline-offset: 2px;
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
	.hde-news-card,
	.hde-news-card__thumb,
	.hde-news-featured,
	.hde-cat-link,
	.hde-news-card__cta {
		transition: none !important;
		transform: none !important;
	}
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
	.hde-news-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.hde-news-layout {
		gap: 20px;
	}
	.hde-news-sidebar-col {
		width: 280px;
	}
}

@media (max-width: 768px) {
	.hde-news-layout {
		flex-direction: column;
	}
	.hde-news-main-col {
		width: 100%;
	}
		.hde-news-sidebar-col {
			width: 100%;
			margin-top: 30px;
			position: static;
			max-height: none;
			overflow: visible;
		}
	.hde-news-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}
	.hde-news-featured {
		flex-direction: column;
	}
	.hde-news-featured__media {
		height: 220px;
	}
	.hde-news-heading {
		font-size: 22px;
	}
}

@media (max-width: 480px) {
	.hde-news-grid {
		grid-template-columns: 1fr;
	}
	.hde-news-container {
		padding: 0 12px;
	}
}
