/* Hallmark · v2.0.0 · polish · genre editorial · theme: project (IMM brand: --imm-primary, Noto Serif + Roboto) · shape: listing (hero, programs strip, filter + card grid) · signature: the justice-statue hero · copy: verbatim (layout approved from the client mockup) */
/* Hallmark · pre-emit critique: P3 H4 E4 S4 R3 V3 · weakest: R, the hero keeps the three-icon row from the approved mockup; spacing moved onto one 4px scale and the closing band was cut */
/* Hallmark · waive 59 · the programs strip is a sand band about 160px tall between hero and filter · a 120px gap around this listing strip would push the article grid below the fold */
/* Hallmark · dismissed 3 · the stroke sits on the filter bar's ::after, not on a card; it is the approved mockup's curved red underline */
/* Hallmark · dismissed 41 · .gn26-card__media only holds the article photo, it never carries text */

/**
 * Danh mục Góc nhìn IMM (template-parts/goc-nhin/listing.php). Mọi selector nằm trong .gn26; token ở :root có tiền tố --gn-.
 * Tiêu đề: Noto Serif (tự host, inc/self-hosted-fonts.php). Nội dung: Roboto.
 * Khoảng cách: thang 4px (--gn-space-*), section 64–96px, tiêu đề → dòng mô tả 16–24px, khối tiêu đề → nội dung 40px.
 */

:root {
	/* Màu */
	--gn-red: var(--imm-primary, #cb0e12);
	--gn-red-dark: #a30b0e;
	--gn-navy: #0c2846;
	--gn-navy-2: #123a63;
	--gn-navy-photo: #012243; /* nền navy của ảnh hero */
	--gn-navy-veil-strong: rgba(1, 34, 67, .92);
	--gn-navy-veil: rgba(1, 34, 67, .75);
	--gn-navy-veil-soft: rgba(1, 34, 67, .45);
	--gn-navy-veil-desk: rgba(1, 34, 67, .85);
	--gn-navy-veil-desk-mid: rgba(1, 34, 67, .55);
	--gn-navy-veil-clear: rgba(1, 34, 67, 0);
	--gn-ink: #141414;
	--gn-text: #3c3c3c;
	--gn-muted: #5e5e5e;
	--gn-line: #dedede;
	--gn-line-strong: #d4d4d4;
	--gn-divider: #c9c9c9;
	--gn-field-edge: #8a8a8a; /* ≥ 3:1 trên nền trắng */
	--gn-sand: #f4f2ee;
	--gn-paper: #fffefc;
	--gn-on-dark: #fbfaf7;
	--gn-on-dark-soft: rgba(251, 250, 247, .92);
	--gn-on-dark-line: rgba(251, 250, 247, .3);
	--gn-shadow-soft: rgba(12, 40, 70, .12);
	--gn-shadow-a: rgba(0, 0, 0, .1);
	--gn-shadow-b: rgba(0, 0, 0, .06);
	--gn-shadow-hover-a: rgba(0, 0, 0, .12);
	--gn-shadow-hover-b: rgba(0, 0, 0, .1);

	/* Chữ */
	--gn-serif: "Noto Serif", Georgia, serif;
	--gn-sans: "Roboto", Arial, sans-serif;

	/* Khoảng cách: thang 4px */
	--gn-space-2xs: 4px;
	--gn-space-xs: 8px;
	--gn-space-sm: 12px;
	--gn-space-md: 16px;
	--gn-space-lg: 24px;
	--gn-space-xl: 40px;
	--gn-space-2xl: 64px;
	--gn-space-3xl: 96px;
	--gn-section: clamp(48px, 7vw, 96px); /* khoảng đệm khối lớn */
	--gn-section-s: clamp(40px, 5vw, 64px); /* dải nền đổi màu */
	--gn-head-gap: clamp(24px, 3vw, 40px); /* khối tiêu đề → nội dung */
	--gn-filter-gap: clamp(32px, 4vw, 48px); /* dải chương trình → thanh lọc → tiêu đề bài viết (bằng nhau) */

	--gn-gutter: calc(clamp(16px, 3vw, 32px) + 8px);
}

/* Từ 992px header thêm 24px trước logo (menu desktop). */
@media (min-width: 992px) {
	:root {
		--gn-gutter: calc(clamp(16px, 3vw, 32px) + 32px);
	}
}

.gn26 {
	font-family: var(--gn-sans);
	color: var(--gn-ink);
}

.gn26 *,
.gn26 *::before,
.gn26 *::after {
	box-sizing: border-box;
}

/* Reset độ ưu tiên 0 (:where) để class thành phần đặt lề được. */
:where(.gn26) :where(h1, h2, h3, p, ul) {
	margin: 0;
	padding: 0;
}

.gn26 a {
	text-decoration: none;
}

.gn26 svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Viền focus: home-base.css của theme đặt `:focus{outline:none!important}` → cần !important để hiện cho người dùng bàn phím. */
.gn26 :focus-visible {
	outline: 2px solid var(--gn-red) !important;
	outline-offset: 3px;
}

.gn26-hero :focus-visible {
	outline-color: var(--gn-on-dark) !important;
}

/* Cùng khung với .header__top (max 1440) → chữ thẳng hàng logo. */
.gn26-wrap {
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 var(--gn-gutter);
}

.gn26-nw {
	white-space: nowrap;
}

.gn26-ico-arrow {
	width: 1em;
	height: 1em;
	flex-shrink: 0;
	stroke-width: 1.8;
}

/* Nhãn "/ IMM GROUP /" */
.gn26-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--gn-space-xs);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--gn-on-dark);
}

.gn26-eyebrow::before,
.gn26-eyebrow::after {
	content: "";
	width: 4px;
	height: 14px;
	background: var(--gn-red);
	transform: skewX(-20deg);
}

/* Tiêu đề mục có vạch đỏ nghiêng */
.gn26-h2 {
	display: flex;
	align-items: center;
	gap: var(--gn-space-md);
	min-width: 0;
	margin-bottom: var(--gn-head-gap);
	font-family: var(--gn-serif);
	font-size: clamp(26px, 3vw, 34px);
	font-weight: 600;
	line-height: 1.2;
	color: var(--gn-ink);
	overflow-wrap: break-word;
	text-wrap: balance;
}

.gn26-h2::before {
	content: "";
	flex-shrink: 0;
	width: 5px;
	height: .9em;
	background: var(--gn-red);
	transform: skewX(-20deg);
}

/* Nút đỏ */
.gn26-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--gn-space-xs);
	min-height: 48px;
	padding: var(--gn-space-sm) var(--gn-space-lg);
	border-radius: 4px;
	background: var(--gn-red);
	color: var(--gn-on-dark);
	font-size: 16px;
	font-weight: 500;
	white-space: nowrap;
	transition: background-color .2s, transform .1s;
}

.gn26-btn:hover,
.gn26-btn:focus-visible {
	background: var(--gn-red-dark);
	color: var(--gn-on-dark);
}

.gn26-btn:active {
	transform: translateY(1px);
}

/* ---------- Hero ---------- */
.gn26-hero {
	position: relative;
	overflow: hidden;
	background: var(--gn-navy-photo); /* hiện khi ảnh chưa tải */
	color: var(--gn-on-dark);
	isolation: isolate;
}

/* Ảnh phủ toàn bộ hero: nửa trái là nền navy của chính ảnh, chủ thể nằm bên phải. */
.gn26-hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.gn26-hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: right center;
}

/* Lớp navy mờ dần từ trái: giữ chữ dễ đọc khi khung hẹp làm chủ thể ảnh lấn sang vùng chữ. */
.gn26-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, var(--gn-navy-veil-desk) 0%, var(--gn-navy-veil-desk-mid) 45%, var(--gn-navy-veil-clear) 70%);
}

.gn26-hero__inner {
	padding-top: var(--gn-section-s);
	padding-bottom: var(--gn-section-s);
}

.gn26-hero__title {
	min-width: 0;
	max-width: 600px;
	margin: var(--gn-space-xs) 0 var(--gn-space-lg);
	font-family: var(--gn-serif);
	font-size: clamp(38px, 5vw, 60px);
	font-weight: 600;
	line-height: 1.1;
	color: var(--gn-on-dark);
	overflow-wrap: break-word;
	text-wrap: balance;
}

.gn26-hero__lead {
	max-width: 460px;
	font-size: 18px;
	line-height: 1.5;
	color: var(--gn-on-dark-soft);
}

.gn26-features {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gn-space-sm) 0;
	margin: var(--gn-space-xl) 0;
	list-style: none;
}

.gn26-features li {
	display: flex;
	align-items: center;
	gap: var(--gn-space-sm);
	max-width: 200px;
	padding: 0 var(--gn-space-lg);
	border-left: 1px solid var(--gn-on-dark-line);
	font-size: 14px;
	line-height: 1.3;
	color: var(--gn-on-dark-soft);
}

.gn26-features span {
	text-wrap: balance;
}

.gn26-features li:first-child {
	padding-left: 0;
	border-left: 0;
}

.gn26-features svg {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	stroke-width: 1.4;
}

/* ---------- Chương trình nổi bật ---------- */
.gn26-programs {
	padding: var(--gn-section-s) 0;
	background: var(--gn-sand);
}

.gn26-programs__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--gn-space-md);
	list-style: none;
}

.gn26-program {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gn-space-sm);
	min-height: 64px;
	padding: var(--gn-space-md) var(--gn-space-lg);
	border: 1px solid var(--gn-line-strong);
	background: var(--gn-paper);
	color: var(--gn-ink);
	font-size: 17px;
	font-weight: 700;
	transition: border-color .2s, color .2s, transform .1s;
}

.gn26-program .gn26-ico-arrow {
	width: 20px;
	height: 20px;
	color: var(--gn-red);
}

.gn26-program:hover,
.gn26-program:focus-visible {
	border-color: var(--gn-red);
	color: var(--gn-red);
}

.gn26-program:active {
	transform: translateY(1px);
}

/* ---------- Bộ lọc ---------- */
.gn26-posts {
	padding: var(--gn-filter-gap) 0 var(--gn-section);
	scroll-margin-top: var(--imm-header-h, 70px);
}

.gn26-filter {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--gn-space-md) var(--gn-space-lg);
	margin-bottom: var(--gn-filter-gap);
	padding-right: var(--gn-space-lg);
	border-radius: 12px;
	background: var(--gn-paper);
	box-shadow: 0 2px 12px var(--gn-shadow-soft);
}

/* Vạch đỏ cong ở mép dưới phải (theo mẫu). */
.gn26-filter::after {
	content: "";
	position: absolute;
	left: 30%;
	right: 0;
	bottom: -4px;
	height: 16px;
	border-right: 3px solid var(--gn-red);
	border-bottom: 3px solid var(--gn-red);
	border-bottom-right-radius: 16px;
	pointer-events: none;
}

.gn26-filter__badge {
	display: flex;
	align-items: center;
	align-self: stretch;
	flex-shrink: 0;
	width: 128px;
	min-height: 80px;
	padding-left: var(--gn-space-xl);
	border-radius: 12px 0 0 12px;
	background: var(--gn-navy);
	color: var(--gn-on-dark);
	clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
}

.gn26-filter__badge svg {
	width: 36px;
	height: 36px;
	stroke-width: 1.5;
}

.gn26-filter__field {
	display: flex;
	align-items: center;
	gap: var(--gn-space-md);
	flex: 1 1 0;
	min-width: 0;
}

.gn26-filter__field + .gn26-filter__field {
	padding-left: var(--gn-space-lg);
	border-left: 1px solid var(--gn-divider);
}

.gn26-filter__label {
	flex-shrink: 0;
	margin: 0;
	font-size: 17px;
	font-weight: 500;
	color: var(--gn-ink);
}

/* .gn26 phía trước: thắng rule select chung của theme (ép chiều cao ở khổ < 992px). */
.gn26 .gn26-filter__select {
	flex: 1;
	min-width: 0;
	height: 48px;
	padding: 0 var(--gn-space-xl) 0 var(--gn-space-md);
	border: 1px solid var(--gn-field-edge);
	border-radius: 4px;
	background: var(--gn-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23141414' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right var(--gn-space-md) center / 16px;
	color: var(--gn-ink);
	font: inherit;
	font-size: 16px;
	appearance: none;
	cursor: pointer;
	transition: border-color .2s;
}

.gn26 .gn26-filter__select:hover {
	border-color: var(--gn-ink);
}

.gn26-filter__go {
	flex-shrink: 0;
	height: 48px;
	padding: 0 var(--gn-space-lg);
	border: 0;
	border-radius: 4px;
	background: var(--gn-red);
	color: var(--gn-on-dark);
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

.gn26-filter__go:hover {
	background: var(--gn-red-dark);
}

.gn26-filter__go:active {
	transform: translateY(1px);
}

/* Có JS: đổi lựa chọn là lọc ngay. */
.gn26-filter.is-js .gn26-filter__go {
	display: none;
}

/* ---------- Vùng kết quả (lọc AJAX: js/goc-nhin-2026.js) ---------- */
.gn26-results {
	transition: opacity .2s;
}

.gn26-results.is-loading {
	opacity: .45;
	pointer-events: none;
}

/* Chỉ trình đọc màn hình đọc (số bài sau khi lọc). */
.gn26-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Lưới thẻ: nhịp 3 + 2 ---------- */
.gn26-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--gn-space-xl) var(--gn-space-lg);
}

.gn26-card {
	position: relative;
	display: flex;
	flex-direction: column;
	grid-column: span 2;
	overflow: hidden;
	border-radius: 6px;
	background: var(--gn-paper);
	box-shadow: 0 1px 3px var(--gn-shadow-a), 0 4px 14px var(--gn-shadow-b);
	transition: box-shadow .2s, transform .2s;
}

.gn26-card:nth-child(5n + 4),
.gn26-card:nth-child(5n + 5) {
	grid-column: span 3;
}

/* Phản hồi nằm ở khung thẻ, ảnh đứng yên. */
.gn26-card:hover {
	box-shadow: 0 2px 6px var(--gn-shadow-hover-a), 0 12px 28px var(--gn-shadow-hover-b);
	transform: translateY(-2px);
}

.gn26-card:active {
	transform: translateY(0);
}

.gn26-card__media {
	position: relative;
	/* Khung theo đúng tỉ lệ ảnh đại diện bài (1140×633) → hiện trọn ảnh; 5:2 / 5:1 trước đây cắt mất chữ và mặt người. */
	aspect-ratio: 1140 / 633;
	overflow: hidden;
	background: var(--gn-navy);
}


.gn26-card__img,
.gn26-card__ph {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gn26-card__ph {
	background: linear-gradient(120deg, var(--gn-navy) 0%, var(--gn-navy-2) 100%);
}

.gn26-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: var(--gn-space-lg) var(--gn-space-xl) var(--gn-space-lg);
}

.gn26-card__eyebrow {
	margin-bottom: var(--gn-space-sm);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--gn-red);
}

.gn26-card__title {
	min-width: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--gn-ink);
	overflow-wrap: break-word;
}

.gn26-card__title a {
	color: inherit;
}

/* Cả thẻ bấm được. */
.gn26-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.gn26-card:hover .gn26-card__title a,
.gn26-card__title a:focus-visible {
	color: var(--gn-red);
}

/* Viền focus vẽ quanh cả thẻ, không quanh link tiêu đề. */
.gn26 .gn26-card__title a:focus-visible {
	outline: none !important;
}

.gn26 .gn26-card:has(a:focus-visible) {
	outline: 2px solid var(--gn-red) !important;
	outline-offset: 3px;
}

.gn26-card__excerpt {
	display: -webkit-box;
	margin: var(--gn-space-sm) 0 var(--gn-space-lg);
	overflow: hidden;
	font-size: 16px;
	line-height: 1.5;
	color: var(--gn-text);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.gn26-card__more {
	display: inline-flex;
	align-items: center;
	gap: var(--gn-space-xs);
	margin-top: auto;
	font-size: 16px;
	font-weight: 700;
	color: var(--gn-red);
}

.gn26-empty {
	padding: var(--gn-space-lg) 0;
	color: var(--gn-muted);
}

.gn26-empty a {
	color: var(--gn-red);
	font-weight: 700;
}

/* Phân trang */
.gn26-pager {
	margin-top: var(--gn-space-2xl);
}

.gn26-pager ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--gn-space-xs);
	list-style: none;
}

.gn26-pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 var(--gn-space-sm);
	border: 1px solid var(--gn-line);
	border-radius: 4px;
	color: var(--gn-ink);
	font-size: 16px;
	font-weight: 500;
}

.gn26-pager a.page-numbers:hover {
	border-color: var(--gn-red);
	color: var(--gn-red);
}

.gn26-pager a.page-numbers:active {
	transform: translateY(1px);
}

.gn26-pager .page-numbers.current {
	border-color: var(--gn-red);
	background: var(--gn-red);
	color: var(--gn-on-dark);
}

.gn26-pager .page-numbers.dots {
	border-color: transparent;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
	/* Khổ hẹp: chủ thể ảnh nằm dưới chữ → phủ lớp navy để chữ dễ đọc. */
	.gn26-hero__media::after {
		background: linear-gradient(90deg, var(--gn-navy-veil-strong) 0%, var(--gn-navy-veil) 60%, var(--gn-navy-veil-soft) 100%);
	}

	.gn26-program {
		padding: var(--gn-space-md);
		font-size: 15px;
	}

	.gn26-filter__field {
		flex-direction: column;
		align-items: stretch;
		gap: var(--gn-space-xs);
		padding: var(--gn-space-md) 0;
	}

	/* Xếp dọc: flex:1 sẽ co chiều cao ô chọn. */
	.gn26 .gn26-filter__select {
		flex: none;
	}

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

	.gn26-card,
	.gn26-card:nth-child(5n + 4),
	.gn26-card:nth-child(5n + 5) {
		grid-column: span 1;
	}


	.gn26-card__body {
		padding: var(--gn-space-lg);
	}

	.gn26-filter__badge {
		width: 96px;
		padding-left: var(--gn-space-lg);
	}

	.gn26-filter__label {
		font-size: 15px;
	}
}

/* Tablet 2 cột: thẻ lẻ cuối chiếm cả hàng, xếp ngang (ảnh 4:3 bên trái, chữ bên phải) để không cao quá. */
@media (min-width: 768px) and (max-width: 991px) {
	.gn26-card:last-child:nth-child(odd) {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: stretch;
	}

	.gn26-grid .gn26-card:last-child:nth-child(odd) .gn26-card__media {
		align-self: center;
	}
}

@media (max-width: 767px) {
	.gn26-hero__lead {
		font-size: 16px;
	}

	.gn26-features {
		gap: var(--gn-space-md);
		margin: var(--gn-space-lg) 0 var(--gn-space-xl);
	}

	.gn26-features li,
	.gn26-features li:first-child {
		max-width: none;
		width: 100%;
		padding: 0;
		border: 0;
	}

	.gn26-features svg {
		width: 28px;
		height: 28px;
	}

	.gn26-programs__list,
	.gn26-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.gn26-program {
		font-size: 16px;
	}

	.gn26-filter {
		flex-direction: column;
		align-items: stretch;
		gap: var(--gn-space-md);
		padding: 0 var(--gn-space-md) var(--gn-space-lg);
	}

	.gn26-filter::after {
		left: 20%;
	}

	.gn26-filter__badge {
		width: auto;
		min-height: 56px;
		margin: 0 calc(var(--gn-space-md) * -1);
		padding-left: var(--gn-space-md);
		border-radius: 12px 12px 0 0;
		clip-path: none;
	}

	.gn26-filter__badge svg {
		width: 28px;
		height: 28px;
	}

	.gn26-filter__field {
		flex-direction: row;
		align-items: center;
		gap: var(--gn-space-sm);
		padding: 0;
	}

	.gn26 .gn26-filter__select {
		flex: 1;
	}

	.gn26-filter__field + .gn26-filter__field {
		padding-left: 0;
		border-left: 0;
	}

	.gn26-filter__label {
		width: 84px;
	}

	.gn26-card__title {
		font-size: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gn26-results,
	.gn26-card,
	.gn26-btn,
	.gn26-program,
	.gn26 .gn26-filter__select {
		transition: none;
	}

	.gn26-card:hover,
	.gn26-card:active,
	.gn26-btn:active,
	.gn26-program:active {
		transform: none;
	}
}
