/**
 * BrickCo - news.css
 * Mục Tin tức: trang /tin-tuc/, trang chuyên mục, chi tiết bài viết.
 * Mobile (< 640px): header riêng, thẻ bài viết dạng ngang. Máy tính: lưới 2-3 cột.
 */

/* ===== Header mobile (template-parts/header/news.php) ===== */
.nw-mhead { position:sticky; top:0; z-index:40; border-bottom:1px solid var(--gray-200); background:var(--white); }
.nw-mhead-inner { display:flex; align-items:center; gap:0.25rem; height:3.5rem; padding:0 0.5rem; }
.nw-mhead-title { flex:1; min-width:0; margin-left:0.25rem; font-size:1.0625rem; font-weight:700; color:var(--gray-900); }
.nw-mhead-btn { position:relative; display:flex; padding:0.5rem; border-radius:9999px; color:var(--gray-800); transition:background .15s; }
.nw-mhead-btn:hover { background:var(--gray-100); }
.nw-mhead-cart .cart-badge { right:0.125rem; top:0.125rem; background:var(--orange-500); color:var(--white); }
.nw-search { position:relative; padding:0 0.75rem 0.75rem; }
.nw-search-input { width:100%; height:2.5rem; padding:0 2.75rem 0 0.875rem; border:1px solid var(--gray-200); border-radius:9999px; background:var(--gray-50); font-size:0.875rem; color:var(--gray-800); outline:none; -webkit-appearance:none; appearance:none; }
.nw-search-input:focus { border-color:var(--orange-400); background:var(--white); box-shadow:0 0 0 3px var(--orange-100); }
.nw-search-btn { position:absolute; right:0.875rem; top:0; display:flex; align-items:center; justify-content:center; width:2.5rem; height:2.5rem; color:var(--gray-500); }
body.is-news .header { display:none; }

@media (min-width:601px) { .admin-bar .nw-mhead { top:46px; } }

/* ===== Bố cục ===== */
.nw-main { min-height:60vh; }
.nw-container { max-width:var(--max-w); margin:0 auto; padding:0 0.75rem; }

/* ===== Banner ===== */
.nw-hero { padding:0.75rem 0.75rem 0; }
.nw-hero-inner { position:relative; display:flex; align-items:center; min-height:7.5rem; max-width:var(--max-w); margin:0 auto; overflow:hidden; border-radius:0.75rem; background:linear-gradient(100deg,#f3f4f6 0%,#f9fafb 55%,#fff 100%); }
.nw-hero-text { position:relative; z-index:2; flex:1 1 60%; min-width:0; padding:1rem 0 1rem 1rem; }
.nw-hero-title { display:flex; align-items:center; gap:0.625rem; font-size:1.375rem; font-weight:800; line-height:1.2; color:var(--gray-900); }
.nw-hero-icon { display:flex; flex-shrink:0; align-items:center; justify-content:center; width:2.5rem; height:2.5rem; border-radius:0.625rem; background:var(--orange-500); color:var(--white); box-shadow:0 4px 10px rgba(249,115,22,.3); }
.nw-hero-icon svg { width:1.375rem; height:1.375rem; }
.nw-hero-desc { margin-top:0.5rem; max-width:24rem; font-size:0.75rem; line-height:1.4; color:var(--gray-600); }
/* Mảng cam chéo phía sau ảnh */
.nw-hero-art { position:relative; align-self:stretch; flex:0 0 40%; }
.nw-hero-art::before,
.nw-hero-art::after { content:""; position:absolute; top:0; bottom:0; transform:skewX(-24deg); }
.nw-hero-art::before { right:-10%; width:55%; background:linear-gradient(135deg,var(--orange-400),var(--orange-600)); }
.nw-hero-art::after { right:42%; width:14%; background:var(--orange-200); opacity:.7; }
.nw-hero-img { position:absolute; z-index:1; right:0.25rem; bottom:0.25rem; width:auto; max-width:115%; height:92%; object-fit:contain; filter:drop-shadow(0 6px 10px rgba(0,0,0,.18)); }

/* ===== Tab chuyên mục ===== */
.nw-tabs { display:flex; gap:0.5rem; margin:0.875rem -0.75rem 0; padding:0 0.75rem 0.25rem; overflow-x:auto; scrollbar-width:none; }
.nw-tabs::-webkit-scrollbar { display:none; }
.nw-tab { display:flex; flex:1 0 auto; align-items:center; justify-content:center; gap:0.5rem; min-width:7.25rem; height:2.875rem; padding:0 0.75rem; border:1px solid var(--gray-200); border-radius:0.625rem; background:var(--white); color:var(--gray-800); font-size:0.8125rem; font-weight:600; white-space:nowrap; box-shadow:var(--shadow-sm); transition:border-color .15s, background .15s, color .15s; }
.nw-tab:hover { border-color:var(--orange-300); }
.nw-tab-icon { display:flex; color:var(--orange-500); }
.nw-tab-icon svg { width:1.25rem; height:1.25rem; }
.nw-tab-arrow { display:none; margin-left:auto; color:var(--gray-400); }
.nw-tab.is-active { border-color:var(--orange-500); background:linear-gradient(to right,var(--orange-500),var(--orange-600)); color:var(--white); box-shadow:0 4px 10px rgba(249,115,22,.25); }
.nw-tab.is-active .nw-tab-icon,
.nw-tab.is-active .nw-tab-arrow { color:var(--white); }

/* ===== Khối bài viết ===== */
.nw-section { margin-top:1.25rem; }
.nw-section-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:0.75rem; }
.nw-section-title { display:flex; align-items:center; gap:0.625rem; font-size:1.125rem; font-weight:700; color:var(--gray-900); }
.nw-section-title::before { content:""; width:0.25rem; height:1.25rem; border-radius:2px; background:var(--orange-500); }
.nw-more { display:flex; flex-shrink:0; align-items:center; gap:0.125rem; font-size:0.8125rem; color:var(--gray-600); transition:color .15s; }
.nw-more:hover { color:var(--orange-600); }
.nw-empty { padding:2.5rem 1rem; border-radius:0.75rem; background:var(--white); color:var(--gray-500); font-size:0.875rem; text-align:center; }

/* ===== Thẻ bài viết: mobile dạng ngang ===== */
.nw-grid { display:grid; gap:0.625rem; }
.nw-card { min-width:0; }
.nw-card-link { position:relative; display:flex; align-items:center; gap:0.75rem; height:100%; padding:0.625rem; border:1px solid var(--gray-200); border-radius:0.75rem; background:var(--white); box-shadow:var(--shadow-sm); transition:border-color .15s, box-shadow .15s, transform .15s; }
.nw-card-link:hover { border-color:var(--orange-200); box-shadow:var(--shadow-md); }
.nw-card-thumb { position:relative; flex:0 0 8.25rem; aspect-ratio:4/3; overflow:hidden; border-radius:0.5rem; background:var(--gray-100); }
.nw-card-img { width:100%; height:100%; object-fit:cover; transition:transform .3s; }
.nw-card-link:hover .nw-card-img { transform:scale(1.04); }
.nw-card-noimg { display:flex; align-items:center; justify-content:center; width:100%; height:100%; color:var(--gray-300); }
.nw-card-body { display:flex; flex:1; flex-direction:column; align-items:flex-start; gap:0.3125rem; min-width:0; }
.nw-card-title { display:-webkit-box; overflow:hidden; font-size:0.8125rem; font-weight:600; line-height:1.35; color:var(--gray-900); -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.nw-card-link:hover .nw-card-title { color:var(--orange-600); }
.nw-card-excerpt { display:none; }
.nw-card-arrow { display:flex; flex-shrink:0; color:var(--gray-400); }

.nw-badge { display:inline-flex; align-items:center; padding:0.125rem 0.5rem; border-radius:0.375rem; background:var(--orange-500); color:var(--white); font-size:0.6875rem; font-weight:600; line-height:1.1rem; white-space:nowrap; }
.nw-badge.is-overlay { display:none; position:absolute; right:0.5rem; bottom:0.5rem; border-radius:9999px; box-shadow:0 2px 6px rgba(0,0,0,.15); }
.nw-new { display:none; position:absolute; top:0.5rem; right:0.5rem; padding:0.125rem 0.5rem; border-radius:0.375rem; background:var(--orange-500); color:var(--white); font-size:0.75rem; font-weight:800; letter-spacing:.03em; transform:rotate(-8deg); box-shadow:0 2px 6px rgba(0,0,0,.2); }
.nw-date { display:inline-flex; align-items:center; gap:0.3125rem; font-size:0.75rem; color:var(--gray-500); }
.nw-date svg { color:var(--gray-500); }

/* ===== Phân trang ===== */
.nw-pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:0.25rem; margin-top:1.5rem; }
.nw-pagination .page-numbers { display:flex; align-items:center; justify-content:center; min-width:2.25rem; height:2.25rem; padding:0 0.5rem; border:1px solid var(--gray-200); border-radius:0.5rem; background:var(--white); color:var(--gray-700); font-size:0.875rem; font-weight:600; transition:border-color .15s, color .15s; }
.nw-pagination a.page-numbers:hover { border-color:var(--orange-500); color:var(--orange-600); }
.nw-pagination .page-numbers.current { border-color:var(--orange-500); background:var(--orange-500); color:var(--white); }
.nw-pagination .page-numbers.dots { border-color:transparent; background:none; }

/* ===== Chi tiết bài viết ===== */
.nw-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:0.25rem; padding-top:0.875rem; font-size:0.8125rem; color:var(--gray-500); }
.nw-crumbs a:hover { color:var(--orange-600); }
.nw-article { margin-top:0.75rem; padding:1rem; border:1px solid var(--gray-200); border-radius:0.75rem; background:var(--white); }
.nw-article-meta { display:flex; flex-wrap:wrap; align-items:center; gap:0.75rem; }
.nw-article-title { margin-top:0.625rem; font-size:1.375rem; font-weight:800; line-height:1.3; color:var(--gray-900); }
.nw-article-thumb { margin-top:1rem; overflow:hidden; border-radius:0.625rem; background:var(--gray-100); }
.nw-article-thumb img { width:100%; }
.nw-article-content { margin-top:1rem; font-size:0.9375rem; line-height:1.75; color:var(--gray-700); overflow-wrap:break-word; }
.nw-article-content > * + * { margin-top:1em; }
.nw-article-content h2,
.nw-article-content h3 { margin-top:1.5em; font-weight:700; line-height:1.35; color:var(--gray-900); }
.nw-article-content h2 { font-size:1.25rem; }
.nw-article-content h3 { font-size:1.0625rem; }
.nw-article-content a { color:var(--orange-600); text-decoration:underline; }
.nw-article-content ul,
.nw-article-content ol { padding-left:1.375rem; }
.nw-article-content img { height:auto; border-radius:0.5rem; }
.nw-article-content blockquote { padding:0.75rem 1rem; border-left:4px solid var(--orange-400); border-radius:0 0.5rem 0.5rem 0; background:var(--orange-50); color:var(--gray-700); }

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

/* ===== sm (640px+): header mặc định, lưới thẻ dọc ===== */
@media (min-width:640px) {
	.nw-mhead { display:none; }
	body.is-news .header { display:block; }

	.nw-container { padding:0 1rem; }
	.nw-hero { padding:0; }
	.nw-hero-inner { min-height:9.5rem; border-radius:0; max-width:none; }
	.nw-hero-text { padding:1.5rem 0 1.5rem max(1.5rem, calc((100vw - var(--max-w)) / 2 + 1.5rem)); }
	.nw-hero-title { gap:1rem; font-size:2.25rem; }
	.nw-hero-icon { width:3.25rem; height:3.25rem; border-radius:0.75rem; }
	.nw-hero-icon svg { width:1.75rem; height:1.75rem; }
	.nw-hero-desc { margin-top:0.625rem; padding-left:4.25rem; font-size:0.9375rem; line-height:1.6; }
	.nw-hero-img { right:max(1rem, calc((100vw - var(--max-w)) / 2)); }

	.nw-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0.75rem; margin:1.25rem 0 0; padding:0; overflow:visible; }
	.nw-tab { justify-content:flex-start; gap:0.75rem; height:3.25rem; padding:0 1rem 0 1.25rem; font-size:1rem; }
	.nw-tab-icon svg { width:1.625rem; height:1.625rem; }
	.nw-tab-arrow { display:flex; }

	.nw-section { margin-top:1.75rem; }
	.nw-section-title { font-size:1.375rem; }
	.nw-section-title::before { height:1.5rem; }

	.nw-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
	.nw-card-link { flex-direction:column; align-items:stretch; gap:0; padding:0; border-radius:0.625rem; overflow:hidden; }
	.nw-card-link:hover { transform:translateY(-2px); }
	.nw-card-thumb { flex:none; aspect-ratio:2/1; border-radius:0; }
	.nw-card-body { gap:0.375rem; padding:0.875rem 1rem 1.125rem; }
	.nw-card-title { font-size:1rem; line-height:1.45; }
	.nw-card-excerpt { display:-webkit-box; overflow:hidden; margin-top:0.25rem; font-size:0.8125rem; line-height:1.6; color:var(--gray-500); -webkit-line-clamp:3; -webkit-box-orient:vertical; }
	.nw-card-arrow,
	.nw-badge.is-inline { display:none; }
	.nw-badge.is-overlay,
	.nw-new { display:inline-flex; }

	.nw-article { padding:1.5rem 2rem 2rem; }
	.nw-article-title { font-size:1.875rem; }
	.nw-article-content { font-size:1rem; }
}

@media (min-width:1024px) {
	.nw-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:1.25rem; }
	.nw-hero-inner { min-height:10.5rem; }
	.nw-article { max-width:52rem; margin-left:auto; margin-right:auto; }
	.nw-crumbs { max-width:52rem; margin:0 auto; }
}
