/**
 * Nhà gỗ Đức Cận – CSS chính (mobile-first).
 */

/* ===== 1. Biến ===== */
:root {
	--c-wood: #5B3A1E;
	--c-wood-dark: #3f2814;
	--c-red: #8B1E1E;
	--c-red-dark: #6e1616;
	--c-gold: #C9A227;
	--c-gold-light: #e3c766;
	--c-paper: #F7F1E3;
	--c-paper-dark: #ede3cc;
	--c-text: #2B2118;
	--c-muted: #6b5a49;
	--c-white: #fff;
	--c-zalo: #0068ff;

	--f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--f-heading: "Noto Serif", Georgia, "Times New Roman", serif;

	--radius: 10px;
	--shadow: 0 6px 20px rgba(43, 33, 24, .12);
	--container: 1200px;
	--gutter: 16px;
	--header-h: 64px;
	--mobile-bar-h: 64px;
	--hoi-van: url("../img/hoi-van.svg");
}

/* ===== 2. Nền tảng ===== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: 112.5%; /* 18px – chữ to dễ đọc cho người lớn tuổi */
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
	margin: 0;
	font-family: var(--f-body);
	font-size: 1rem;
	line-height: 1.7;
	color: var(--c-text);
	background: var(--c-paper);
	text-rendering: optimizeLegibility;
}

body.has-mobile-bar {
	padding-bottom: var(--mobile-bar-h);
}

img,
svg,
video,
iframe {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

a {
	color: var(--c-red);
	text-underline-offset: .15em;
}

a:hover {
	color: var(--c-red-dark);
}

:focus-visible {
	outline: 3px solid var(--c-gold);
	outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
	font-family: var(--f-heading);
	font-weight: 700;
	line-height: 1.3;
	color: var(--c-wood);
	margin: 0 0 .6em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
	margin: 0 0 1em;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 12px 18px;
	clip: auto;
	background: var(--c-white);
	color: var(--c-wood);
	border-radius: var(--radius);
}

.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.section {
	/* Chỉ padding dọc: không đè lề ngang khi dùng chung với .container. */
	padding-block: 40px;
}

.text-center {
	text-align: center;
}

/* ===== 3. Họa tiết & tiêu đề section ===== */
.ornament {
	display: block;
	width: 200px;
	height: auto;
	color: var(--c-gold);
}

.section-title {
	text-align: center;
	margin-bottom: 28px;
}

.section-title__heading {
	margin-bottom: 8px;
}

.section-title__ornament {
	margin: 0 auto 12px;
}

.section-title__sub {
	max-width: 680px;
	margin: 0 auto;
	color: var(--c-muted);
}

.divider-hoi-van {
	height: 12px;
	background: var(--hoi-van) repeat-x center;
	opacity: .8;
}

/* ===== 4. Nút ===== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 12px 24px;
	font: 600 1rem/1.2 var(--f-body);
	text-decoration: none;
	border: 2px solid transparent;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}

.btn--primary {
	background: var(--c-red);
	color: var(--c-white);
}

.btn--primary:hover {
	background: var(--c-red-dark);
	color: var(--c-white);
}

.btn--gold {
	background: var(--c-gold);
	color: var(--c-text);
}

.btn--gold:hover {
	background: var(--c-gold-light);
	color: var(--c-text);
}

.btn--outline {
	background: transparent;
	color: var(--c-wood);
	border-color: var(--c-wood);
}

.btn--outline:hover {
	background: var(--c-wood);
	color: var(--c-white);
}

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.icon {
	width: 1.25em;
	height: 1.25em;
	flex-shrink: 0;
}

/* ===== 5. Header ===== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--c-wood);
	color: var(--c-paper);
	border-bottom: 3px solid var(--c-gold);
}

.admin-bar .site-header {
	top: 46px;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: var(--header-h);
}

.site-logo,
.custom-logo-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--c-paper);
	text-decoration: none;
}

.custom-logo {
	max-height: 48px;
	width: auto;
}

.site-logo:hover {
	color: var(--c-gold-light);
}

.site-logo__mark .icon {
	width: 32px;
	height: 32px;
	color: var(--c-gold);
}

.site-logo__text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.site-logo__name {
	font: 700 clamp(1rem, 4.6vw, 1.25rem)/1.2 var(--f-heading);
	white-space: nowrap;
}

.site-logo__tagline {
	font-size: .75rem;
	color: var(--c-gold-light);
	letter-spacing: .02em;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.header-hotline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 48px;
	min-height: 48px;
	padding: 6px 10px;
	color: var(--c-text);
	background: var(--c-gold);
	border-radius: 999px;
	text-decoration: none;
}

.header-hotline:hover {
	color: var(--c-text);
	background: var(--c-gold-light);
}

.header-hotline__text {
	display: none;
	flex-direction: column;
	line-height: 1.15;
}

.header-hotline__label {
	font-size: .7rem;
}

.header-hotline__number {
	font-weight: 700;
	font-size: 1.05rem;
}

.nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-width: 48px;
	min-height: 48px;
	padding: 6px;
	color: var(--c-paper);
	background: transparent;
	border: 2px solid rgba(247, 241, 227, .4);
	border-radius: var(--radius);
	cursor: pointer;
}

.nav-toggle__label {
	font-size: .8rem;
}

@media (max-width: 359px) {
	.nav-toggle__label,
	.site-logo__mark {
		display: none;
	}
}

.nav-toggle__close,
.nav-toggle[aria-expanded="true"] .nav-toggle__open {
	display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__close {
	display: block;
}

/* Menu mobile: panel trượt xuống dưới header. */
.site-nav {
	position: fixed;
	inset: calc(var(--header-h) + 3px) 0 var(--mobile-bar-h) 0;
	z-index: 99;
	padding: 12px var(--gutter) 24px;
	overflow-y: auto;
	background: var(--c-wood-dark);
	transform: translateX(100%);
	visibility: hidden;
	transition: transform .25s ease, visibility .25s;
}

.site-nav.is-open {
	transform: none;
	visibility: visible;
}

.admin-bar .site-nav {
	top: calc(var(--header-h) + 3px + 46px);
}

.site-nav .menu,
.site-nav .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	display: block;
	padding: 14px 4px;
	font-size: 1.1rem;
	font-weight: 500;
	color: var(--c-paper);
	text-decoration: none;
	border-bottom: 1px solid rgba(201, 162, 39, .25);
}

.site-nav .sub-menu a {
	padding-left: 24px;
	font-size: 1rem;
	font-weight: 400;
}

.site-nav .current-menu-item > a,
.site-nav a:hover {
	color: var(--c-gold-light);
}

body.nav-open {
	overflow: hidden;
}

/* ===== 6. Nội dung chung ===== */
.page-content,
.entry-content {
	max-width: 820px;
	margin-left: auto;
	margin-right: auto;
}

.entry-content img {
	border-radius: var(--radius);
}

.post-list {
	display: grid;
	gap: 24px;
}

.post-item {
	overflow: hidden;
	background: var(--c-white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.post-item__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.post-item__body {
	padding: 16px 18px 20px;
}

.post-item__title {
	font-size: 1.2rem;
}

.post-item__title a {
	color: inherit;
	text-decoration: none;
}

.post-item__meta {
	font-size: .85rem;
	color: var(--c-muted);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	min-height: 48px;
	padding: 0 12px;
	color: var(--c-wood);
	background: var(--c-white);
	border: 1px solid var(--c-paper-dark);
	border-radius: var(--radius);
	text-decoration: none;
}

.pagination .page-numbers.current {
	color: var(--c-white);
	background: var(--c-wood);
}

/* ===== 7. Footer ===== */
.site-footer {
	color: var(--c-paper);
	background: var(--c-wood-dark);
}

.site-footer__band {
	height: 14px;
	background: var(--hoi-van) repeat-x center, var(--c-wood);
}

.site-footer__grid {
	display: grid;
	gap: 32px;
	padding-top: 40px;
	padding-bottom: 32px;
}

.footer-brand {
	font: 700 1.4rem/1.3 var(--f-heading);
	color: var(--c-gold);
}

.footer-title {
	font-size: 1.15rem;
	color: var(--c-gold);
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(201, 162, 39, .35);
}

.site-footer a {
	color: var(--c-paper);
}

.site-footer a:hover {
	color: var(--c-gold-light);
}

.footer-contact {
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-contact li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-bottom: 12px;
}

.footer-contact .icon {
	margin-top: .25em;
	color: var(--c-gold);
}

.footer-map {
	overflow: hidden;
	aspect-ratio: 4 / 3;
	margin: 0;
	border: 2px solid var(--c-gold);
	border-radius: var(--radius);
}

.footer-map iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.footer-map--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-size: .9rem;
	text-align: center;
	color: var(--c-gold-light);
	border-style: dashed;
}

.site-footer__bottom {
	font-size: .85rem;
	background: rgba(0, 0, 0, .25);
}

.site-footer__bottom-inner {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 16px;
	padding-bottom: 16px;
}

.site-footer__bottom p {
	margin: 0;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ===== 8. Thanh liên hệ mobile ===== */
.mobile-bar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 110;
	display: grid;
	grid-auto-columns: 1fr;
	grid-auto-flow: column;
	height: var(--mobile-bar-h);
	padding-bottom: env(safe-area-inset-bottom);
	box-shadow: 0 -4px 16px rgba(0, 0, 0, .18);
}

.mobile-bar__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	font-size: .9rem;
	font-weight: 700;
	color: var(--c-white);
	text-decoration: none;
}

.mobile-bar__item:hover {
	color: var(--c-white);
}

.mobile-bar__item .icon {
	width: 26px;
	height: 26px;
}

.mobile-bar__item--call {
	background: var(--c-red);
}

.mobile-bar__item--zalo {
	background: var(--c-zalo);
}

.mobile-bar__item--zalo .icon path:first-child {
	fill: var(--c-white);
}

.mobile-bar__item--zalo .icon path + path {
	stroke: var(--c-zalo);
}

.mobile-bar__item--quote {
	color: var(--c-text);
	background: var(--c-gold);
}

.mobile-bar__item--quote:hover {
	color: var(--c-text);
}

/* ===== 9. Màn hình lớn hơn ===== */
@media (min-width: 600px) {
	.post-list {
		grid-template-columns: repeat(2, 1fr);
	}

	.header-hotline {
		padding: 6px 16px 6px 12px;
	}

	.header-hotline__text {
		display: flex;
	}
}

@media (min-width: 783px) {
	.admin-bar .site-header {
		top: 32px;
	}

	.admin-bar .site-nav {
		top: calc(var(--header-h) + 3px + 32px);
	}
}

@media (min-width: 768px) {
	h1 { font-size: 2.2rem; }
	h2 { font-size: 1.85rem; }

	.section {
		padding-block: 64px;
	}

	.site-footer__grid {
		grid-template-columns: 1.2fr 1fr 1fr;
	}

	.site-footer__bottom-inner {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.ornament {
		width: 240px;
	}
}

@media (min-width: 1024px) {
	:root {
		--header-h: 84px;
		--gutter: 24px;
	}

	body.has-mobile-bar {
		padding-bottom: 0;
	}

	.mobile-bar,
	.nav-toggle {
		display: none;
	}

	.post-list {
		grid-template-columns: repeat(3, 1fr);
	}

	.site-nav,
	.admin-bar .site-nav {
		position: static;
		padding: 0;
		overflow: visible;
		background: none;
		transform: none;
		visibility: visible;
	}

	.site-nav .menu {
		display: flex;
		gap: 4px;
	}

	.site-nav .menu > li {
		position: relative;
	}

	.site-nav a {
		padding: 10px 10px;
		font-size: 1rem;
		white-space: nowrap;
		border-bottom: 0;
	}

	.site-nav .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 240px;
		padding: 8px 0;
		background: var(--c-wood-dark);
		border-top: 2px solid var(--c-gold);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: var(--shadow);
		opacity: 0;
		visibility: hidden;
		transition: opacity .15s;
	}

	.site-nav li:hover > .sub-menu,
	.site-nav li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
	}

	.site-nav .sub-menu a {
		padding: 10px 18px;
	}
}

/* ===== 10. Giảm chuyển động ===== */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}
