/*
Theme Name: Hai Van Son
Text Domain: haivanson
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Description: Theme giới thiệu Hoàng Hữu – non bộ, tiểu cảnh, sân vườn Hải Vân Sơn.
*/

/* =========================================================
   Tokens
   ========================================================= */
:root {
	/* Bảng màu lấy từ logo Hải Vân Sơn: trời – biển – mây – núi vàng – mặt trời đỏ */
	--c-ink: #13324d;      /* chữ tiêu đề, xanh than */
	--c-deep: #1f5785;     /* nền khối tối: biển sâu */
	--c-deep-2: #2c6ea3;   /* biển sáng (gradient) */
	--c-sea: #2f6b9e;      /* nhấn chính trên nền sáng */
	--c-mist: #a9c8e4;     /* trời */
	--c-cloud: #c4e4f6;    /* mây */
	--c-stone: #9fb4c7;
	--c-sky: #edf5fc;      /* nền khối sáng */
	--c-sky-2: #d8e9f6;
	--c-white: #fbfdff;
	--c-accent: #2f6b9e;   /* chữ nhấn trên nền sáng */
	--c-gold: #f5cf2e;     /* núi vàng: nhấn trên nền tối, đường kẻ, chấm */
	--c-red: #e5323e;      /* mặt trời: điểm nhấn rất nhỏ */
	--c-text: #22405a;
	--c-muted: #5b7186;
	--c-line: rgba(20, 48, 74, 0.14);
	--c-line-light: rgba(255, 255, 255, 0.22);

	--f-display: "Cormorant Garamond", "Times New Roman", serif;
	--f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--container: 1240px;
	--gutter: clamp(16px, 4vw, 40px);
	--header-h: 84px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
	--radius: 2px;
}

/* =========================================================
   Base
   ========================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--header-h);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--f-body);
	font-size: 16px;
	font-weight: 300;
	line-height: 1.75;
	color: var(--c-text);
	background: var(--c-white);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.5em;
	font-family: var(--f-display);
	font-weight: 500;
	line-height: 1.1;
	color: var(--c-ink);
}

p {
	margin: 0 0 1.2em;
}

ul,
ol {
	margin: 0;
	padding: 0;
}

button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

::selection {
	background: var(--c-gold);
	color: var(--c-ink);
}

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

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

.screen-reader-text:focus {
	clip: auto;
	width: auto;
	height: auto;
	top: 8px;
	left: 8px;
	padding: 8px 14px;
	background: var(--c-white);
	z-index: 1000;
}

.icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

/* =========================================================
   Typography helpers
   ========================================================= */
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 20px;
	font-family: var(--f-body);
	line-height: 1.6;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--c-accent);
}

.eyebrow::before {
	content: "";
	width: 36px;
	height: 1px;
	background: currentColor;
}

.eyebrow--light {
	color: var(--c-gold);
}

.section-title {
	font-size: clamp(2.2rem, 4.6vw, 3.9rem);
	letter-spacing: -0.01em;
}

.section-title em {
	font-style: italic;
	font-weight: 400;
	color: var(--c-sea);
}

.section-title--light,
.section--dark .section-title {
	color: var(--c-white);
}

.section-title--light em,
.section--dark .section-title em {
	color: var(--c-gold);
}

.section-intro {
	max-width: 440px;
	color: var(--c-muted);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 16px 30px;
	border: 1px solid transparent;
	border-radius: 100px;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-decoration: none;
	overflow: hidden;
	isolation: isolate;
	transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
}

.btn::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	transform: translateY(101%);
	transition: transform 0.6s var(--ease);
}

.btn:hover::before,
.btn:focus-visible::before {
	transform: translateY(0);
}

.btn .icon--arrow-right {
	transition: transform 0.5s var(--ease);
}

.btn:hover .icon--arrow-right {
	transform: translateX(4px);
}

.btn--light {
	background: var(--c-white);
	color: var(--c-ink);
}

.btn--light::before {
	background: var(--c-gold);
}

.btn--outline-light {
	border-color: rgba(255, 255, 255, 0.5);
	color: var(--c-white);
}

.btn--outline-light::before {
	background: var(--c-white);
}

.btn--outline-light:hover {
	color: var(--c-ink);
	border-color: var(--c-white);
}

.btn--dark {
	background: var(--c-deep);
	color: var(--c-white);
}

.btn--dark::before {
	background: var(--c-sea);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
	position: fixed;
	inset: 0 0 auto;
	z-index: 100;
	height: var(--header-h);
	color: var(--c-ink);
	transition: background-color 0.5s var(--ease), height 0.5s var(--ease), box-shadow 0.5s var(--ease), transform 0.5s var(--ease), color 0.5s var(--ease);
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 100%;
}

.has-hero .site-header {
	color: var(--c-white);
}

.site-header.is-scrolled,
body:not(.has-hero) .site-header {
	--header-h: 70px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--c-ink);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 1px 0 var(--c-line);
}

.site-header.is-hidden {
	transform: translateY(-100%);
}

.site-branding {
	display: flex;
	align-items: center;
	position: relative;
	z-index: 2;
}

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

.site-title {
	display: flex;
	align-items: center;
	gap: 12px;
	line-height: 1;
	text-decoration: none;
}

.site-title__logo {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	box-shadow: 0 4px 14px -6px rgba(12, 38, 62, 0.5);
	transition: width 0.5s var(--ease), height 0.5s var(--ease), transform 0.8s var(--ease);
}

.site-title:hover .site-title__logo {
	transform: rotate(-8deg) scale(1.05);
}

.site-header.is-scrolled .site-title__logo,
body:not(.has-hero) .site-title__logo {
	width: 46px;
	height: 46px;
}

.site-title__text {
	display: flex;
	flex-direction: column;
}

@media (max-width: 480px) {
	.site-title__logo {
		width: 46px;
		height: 46px;
	}
}

.site-title__name {
	font-family: var(--f-display);
	font-size: 1.65rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.site-title__tagline {
	margin-top: 4px;
	font-size: 10px;
	font-weight: 400;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	opacity: 0.75;
}

.main-navigation ul {
	display: flex;
	align-items: center;
	gap: clamp(18px, 2.4vw, 36px);
	list-style: none;
}

.main-navigation a {
	position: relative;
	display: inline-block;
	padding: 6px 0;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-decoration: none;
}

.main-navigation a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.5s var(--ease);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
	transform: scaleX(1);
	transform-origin: left;
}

.menu-toggle {
	display: none;
	position: relative;
	z-index: 2;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
}

.menu-toggle span {
	position: absolute;
	left: 10px;
	right: 10px;
	height: 1.5px;
	background: currentColor;
	transition: transform 0.5s var(--ease), opacity 0.3s;
}

.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 22px; }
.menu-toggle span:nth-child(3) { top: 28px; }

.menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
	.menu-toggle {
		display: block;
	}

	.main-navigation {
		position: fixed;
		inset: 0;
		display: flex;
		align-items: center;
		padding: calc(var(--header-h) + 20px) var(--gutter) 40px;
		background: var(--c-deep);
		color: var(--c-white);
		clip-path: circle(0 at calc(100% - 40px) 40px);
		transition: clip-path 0.8s var(--ease-in-out);
		visibility: hidden;
	}

	.menu-open .main-navigation {
		clip-path: circle(150% at calc(100% - 40px) 40px);
		visibility: visible;
	}

	.menu-open .site-header {
		color: var(--c-white);
		background: transparent;
		box-shadow: none;
		backdrop-filter: none;
	}

	.main-navigation ul {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.main-navigation a {
		font-family: var(--f-display);
		font-size: clamp(2rem, 9vw, 2.8rem);
		font-weight: 500;
		opacity: 0;
		transform: translateY(20px);
		transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
	}

	.menu-open .main-navigation a {
		opacity: 1;
		transform: none;
	}

	.menu-open .main-navigation li:nth-child(1) a { transition-delay: 0.25s; }
	.menu-open .main-navigation li:nth-child(2) a { transition-delay: 0.3s; }
	.menu-open .main-navigation li:nth-child(3) a { transition-delay: 0.35s; }
	.menu-open .main-navigation li:nth-child(4) a { transition-delay: 0.4s; }
	.menu-open .main-navigation li:nth-child(5) a { transition-delay: 0.45s; }
	.menu-open .main-navigation li:nth-child(6) a { transition-delay: 0.5s; }

	.menu-open {
		overflow: hidden;
	}
}

/* =========================================================
   Layout
   ========================================================= */
.site-main {
	min-height: 60vh;
}

body:not(.has-hero) .site-main {
	padding: calc(var(--header-h) + 48px) 0 80px;
}

.section {
	position: relative;
	padding: clamp(80px, 12vw, 160px) 0;
}

.section--paper {
	background: var(--c-sky);
}

.section--dark {
	background: linear-gradient(160deg, var(--c-deep-2) 0%, var(--c-deep) 100%);
	color: rgba(255, 255, 255, 0.78);
}

.entry {
	margin-bottom: 48px;
}

.entry-title {
	font-size: clamp(2rem, 4vw, 3rem);
}

.entry-title a {
	text-decoration: none;
}

.entry-meta {
	font-size: 0.875rem;
	color: var(--c-muted);
}

.container--with-sidebar {
	display: grid;
	gap: 48px;
}

@media (min-width: 960px) {
	.container--with-sidebar {
		grid-template-columns: minmax(0, 1fr) 300px;
	}
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
	padding: 72px 0 32px;
	background: var(--c-deep);
	color: rgba(255, 255, 255, 0.6);
	font-size: 14px;
}

.site-footer a {
	text-decoration: none;
	transition: color 0.3s;
}

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

.footer__top {
	display: grid;
	gap: 40px;
	padding-bottom: 48px;
	border-bottom: 1px solid var(--c-line-light);
}

@media (min-width: 800px) {
	.footer__top {
		grid-template-columns: 1.4fr 1fr 1fr;
	}
}

.footer__brand {
	display: flex;
	align-items: center;
	gap: 16px;
	font-family: var(--f-display);
	font-size: 2rem;
	font-weight: 500;
	color: var(--c-white);
	line-height: 1.1;
}

.footer__logo {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.footer__about {
	max-width: 360px;
	margin-top: 16px;
}

.footer__heading {
	margin-bottom: 16px;
	font-family: var(--f-body);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--c-gold);
}

.footer__list {
	display: grid;
	gap: 10px;
	list-style: none;
}

.footer__list li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.footer__list .icon {
	margin-top: 3px;
	color: var(--c-gold);
}

.footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	padding-top: 28px;
	font-size: 13px;
}

/* =========================================================
   Image placeholder (until real photos are added)
   ========================================================= */
.ph {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 200px;
	background: linear-gradient(180deg, #e4f0fa 0%, #cfe3f3 55%, #b7d3ea 100%);
	overflow: hidden;
}

.ph svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ph__sun { fill: rgba(229, 50, 62, 0.55); }
.ph__far { fill: rgba(47, 107, 158, 0.22); }
.ph__mid { fill: rgba(47, 107, 158, 0.4); }
.ph__near { fill: rgba(29, 79, 122, 0.6); }

/* =========================================================
   Scroll reveal (only when JS is running)
   ========================================================= */
.js [data-reveal] {
	transition: opacity 1s var(--ease), transform 1.2s var(--ease);
	transition-delay: var(--d, 0s);
}

.js [data-reveal="fade-up"] { opacity: 0; transform: translate3d(0, 48px, 0); }
.js [data-reveal="fade"] { opacity: 0; }
.js [data-reveal="fade-left"] { opacity: 0; transform: translate3d(-48px, 0, 0); }
.js [data-reveal="fade-right"] { opacity: 0; transform: translate3d(48px, 0, 0); }
.js [data-reveal="scale"] { opacity: 0; transform: scale(0.8); }
.js [data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* Curtain reveal: a cover slides away (clip-path on the element itself would stop IntersectionObserver from firing). */
.js [data-reveal="clip"]::after {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: 3;
	background: var(--curtain, var(--c-white));
	transform-origin: top;
	transition: transform 1.4s var(--ease-in-out) var(--d, 0s);
	pointer-events: none;
}

.js [data-reveal="clip"].is-visible::after {
	transform: scaleY(0);
}

/* Split characters */
[data-split] .word {
	display: inline-block;
	white-space: nowrap;
}

[data-split] .char {
	display: inline-block;
}

.js [data-split] .char {
	opacity: 0;
	transform: translate3d(0, 0.6em, 0) rotate(6deg);
	filter: blur(8px);
	transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease);
	transition-delay: calc(var(--i) * 0.06s + var(--d, 0.5s));
}

.js [data-split].is-visible .char {
	opacity: 1;
	transform: none;
	filter: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
	}
}
