/*
 * Thân bài Tin tức & Sự kiện — style cho toàn bộ block Gutenberg.
 *
 * HỢP ĐỒNG QUAN TRỌNG: mọi selector trong file này PHẢI bắt đầu bằng
 * `.ne-single__content`. inc/news-editor.php đọc chính file này, thay chuỗi đó
 * bằng `body` rồi nạp vào trình soạn thảo, nên Admin xem trước giống hệt trang
 * thật mà không phải duy trì hai bản CSS. Đặt selector khác tiền tố sẽ không
 * áp dụng được trong Admin.
 *
 * Chỉ dùng biến màu/font đã khai báo ở news-events.css. Không thêm màu mới.
 */

/* ---------- Chữ cơ bản ---------- */
.ne-single__content > * { margin-top: 0; margin-bottom: 1.15em; }
.ne-single__content > *:last-child { margin-bottom: 0; }
.ne-single__content p { margin-bottom: 1.15em; }
.ne-single__content strong { font-weight: 700; color: var(--ne-green); }
.ne-single__content em { font-style: italic; }
.ne-single__content a { text-decoration: underline; text-underline-offset: 3px; }

.ne-single__content h2,
.ne-single__content h3,
.ne-single__content h4 { font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.ne-single__content h2 { margin-top: 1.7em; font-size: clamp(28px, 3vw, 38px); }
.ne-single__content h3 { margin-top: 1.5em; font-size: clamp(23px, 2.3vw, 29px); }
.ne-single__content h4 { margin-top: 1.4em; font-size: clamp(19px, 1.9vw, 23px); }
.ne-single__content h2:first-child,
.ne-single__content h3:first-child,
.ne-single__content h4:first-child { margin-top: 0; }

/* ---------- Danh sách ---------- */
.ne-single__content ul,
.ne-single__content ol { margin-bottom: 1.2em; padding-left: 1.5em; }
.ne-single__content ul { list-style: disc; }
.ne-single__content ol { list-style: decimal; }
.ne-single__content li { margin-bottom: .45em; }
.ne-single__content li::marker { color: var(--ne-gold); }
.ne-single__content ol li::marker { color: var(--ne-mid); font-weight: 700; }
.ne-single__content li > ul,
.ne-single__content li > ol { margin-top: .45em; margin-bottom: 0; }

/* ---------- Ảnh và chú thích ---------- */
.ne-single__content figure { margin: 2em 0; }
.ne-single__content img { width: 100%; height: auto; }
.ne-single__content figcaption,
.ne-single__content .wp-element-caption {
	margin-top: 12px;
	padding-left: 14px;
	border-left: 3px solid var(--ne-gold);
	color: var(--ne-muted);
	font-size: 14px;
	font-style: normal;
	line-height: 1.5;
	text-align: left;
}
.ne-single__content .wp-block-image { margin: 2em 0; }
.ne-single__content .wp-block-image img { display: block; }
.ne-single__content .aligncenter { margin-inline: auto; text-align: center; }
.ne-single__content .aligncenter figcaption { text-align: left; }
.ne-single__content .alignleft { float: left; width: min(46%, 420px); margin: .4em 2em 1.4em 0; }
.ne-single__content .alignright { float: right; width: min(46%, 420px); margin: .4em 0 1.4em 2em; }
.ne-single__content .alignwide,
.ne-single__content .alignfull {
	width: min(1180px, calc(100vw - 40px));
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}
.ne-single__content .alignfull { width: 100vw; }

/* ---------- Thư viện ảnh ---------- */
.ne-single__content .wp-block-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin: 2em 0; }
.ne-single__content .wp-block-gallery .wp-block-image { flex: 1 1 240px; margin: 0; }
.ne-single__content .wp-block-gallery img { aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Trích dẫn ---------- */
.ne-single__content blockquote,
.ne-single__content .wp-block-quote {
	margin: 2em 0;
	padding: 26px 30px;
	border: 0;
	border-left: 4px solid var(--ne-gold);
	background: var(--ne-soft);
	color: var(--ne-green);
	font-family: var(--sl-font-heading);
	font-size: clamp(19px, 1.8vw, 23px);
	font-weight: 600;
	line-height: 1.45;
}
.ne-single__content blockquote p:last-child { margin-bottom: 0; }
.ne-single__content blockquote cite,
.ne-single__content .wp-block-quote cite {
	display: block;
	margin-top: 14px;
	color: var(--ne-mid);
	font-family: var(--sl-font-body);
	font-size: 13px;
	font-style: normal;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.ne-single__content .wp-block-pullquote {
	margin: 2.4em 0;
	padding: 34px 0;
	border-top: 2px solid var(--ne-gold);
	border-bottom: 2px solid var(--ne-gold);
	text-align: center;
}
.ne-single__content .wp-block-pullquote p {
	color: var(--ne-green);
	font-family: var(--sl-font-heading);
	font-size: clamp(23px, 2.4vw, 32px);
	font-weight: 700;
	line-height: 1.2;
}

/* ---------- Bảng ---------- */
.ne-single__content table,
.ne-single__content .wp-block-table table {
	width: 100%;
	margin: 2em 0;
	border-collapse: collapse;
	font-size: 16px;
}
.ne-single__content .wp-block-table { overflow-x: auto; }
.ne-single__content th,
.ne-single__content td { padding: 13px 16px; border: 1px solid var(--ne-border); text-align: left; vertical-align: top; }
.ne-single__content th { background: var(--ne-green); color: #fff; /* surface-dark table heading */ font-weight: 700; letter-spacing: .04em; }
.ne-single__content tbody tr:nth-child(even) td { background: var(--ne-soft); }
.ne-single__content .wp-block-table figcaption { margin-top: 8px; }

/* ---------- Đường kẻ ---------- */
.ne-single__content hr,
.ne-single__content .wp-block-separator {
	width: 100%;
	max-width: none;
	height: 0;
	margin: 2.6em 0;
	border: 0;
	border-top: 1px solid var(--ne-border);
}
.ne-single__content .wp-block-separator.is-style-wide { border-top-color: var(--ne-gold); }

/* ---------- Nút ---------- */
.ne-single__content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 2em 0; }
.ne-single__content .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid var(--ne-gold);
	border-radius: 0;
	background: var(--ne-gold);
	color: var(--ne-black);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-decoration: none;
	text-transform: uppercase;
	transition: .2s;
}
.ne-single__content .wp-block-button__link:hover { background: var(--ne-gold-light); border-color: var(--ne-gold-light); }
.ne-single__content .is-style-outline .wp-block-button__link {
	background: transparent;
	border-color: var(--ne-green);
	color: var(--ne-green);
}

/* ---------- Cột và nhóm ---------- */
.ne-single__content .wp-block-columns { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 40px); margin: 2em 0; }
.ne-single__content .wp-block-column { flex: 1 1 260px; min-width: 0; }
.ne-single__content .wp-block-column > *:first-child { margin-top: 0; }
.ne-single__content .wp-block-group { margin: 2em 0; }
.ne-single__content .wp-block-group.has-background { padding: clamp(24px, 3vw, 38px); }

/* ---------- Nhúng video ---------- */
.ne-single__content .wp-block-embed { margin: 2.2em 0; }
.ne-single__content .wp-block-embed__wrapper { position: relative; }
.ne-single__content .wp-block-embed.is-type-video .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.ne-single__content .wp-block-embed.is-type-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------- Mã và file ---------- */
.ne-single__content code { padding: 2px 6px; background: var(--ne-soft); font-family: monospace; font-size: .92em; }
.ne-single__content pre { padding: 20px; overflow-x: auto; background: var(--ne-soft); font-size: 15px; }
.ne-single__content .wp-block-file { margin: 1.6em 0; }
.ne-single__content .wp-block-file a:not(.wp-block-file__button) { font-weight: 700; }

/* ---------- Bảng màu thương hiệu (khớp slug trong inc/news-editor.php) ---------- */
.ne-single__content .has-ne-green-color { color: var(--ne-green); }
.ne-single__content .has-ne-mid-color { color: var(--ne-mid); }
.ne-single__content .has-ne-mint-color { color: var(--ne-soft); }
.ne-single__content .has-ne-gold-color { color: var(--ne-gold); }
.ne-single__content .has-ne-ink-color { color: var(--ne-black); }
.ne-single__content .has-ne-white-color { color: #fff; /* surface-dark editor color */ }
.ne-single__content .has-ne-green-background-color { background-color: var(--ne-green); }
.ne-single__content .has-ne-mid-background-color { background-color: var(--ne-mid); }
.ne-single__content .has-ne-mint-background-color { background-color: var(--ne-soft); }
.ne-single__content .has-ne-gold-background-color { background-color: var(--ne-gold); }
.ne-single__content .has-ne-ink-background-color { background-color: var(--ne-black); }
.ne-single__content .has-ne-white-background-color { background-color: #fff; }
.ne-single__content .has-background { padding: clamp(22px, 3vw, 36px); }
.ne-single__content .has-ne-green-background-color,
.ne-single__content .has-ne-green-background-color p,
.ne-single__content .has-ne-green-background-color h2,
.ne-single__content .has-ne-green-background-color h3,
.ne-single__content .has-ne-green-background-color strong,
.ne-single__content .has-ne-mid-background-color,
.ne-single__content .has-ne-mid-background-color p,
.ne-single__content .has-ne-mid-background-color h2,
.ne-single__content .has-ne-mid-background-color h3,
.ne-single__content .has-ne-mid-background-color strong { color: #fff; /* surface-dark group */ }
.ne-single__content .has-ne-green-background-color.has-text-color,
.ne-single__content .has-ne-mid-background-color.has-text-color { color: inherit; }

/* ---------- Cỡ chữ (khớp slug trong inc/news-editor.php) ---------- */
.ne-single__content .has-small-font-size { font-size: 15px; }
.ne-single__content .has-normal-font-size { font-size: 18px; }
.ne-single__content .has-large-font-size { font-size: 22px; line-height: 1.55; }
.ne-single__content .has-xlarge-font-size { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.35; }

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
	.ne-single__content .alignleft,
	.ne-single__content .alignright { float: none; width: 100%; margin-inline: 0; }
	.ne-single__content .alignwide,
	.ne-single__content .alignfull { width: 100%; margin-left: 0; transform: none; }
	.ne-single__content .wp-block-columns { gap: 24px; }
	.ne-single__content blockquote,
	.ne-single__content .wp-block-quote { padding: 20px 22px; }
	.ne-single__content th,
	.ne-single__content td { padding: 10px 12px; }
}
