/* ==========================================================================
   RAW Studio: tokens, type, buttons, header, footer, shared layout
   Reviewed from the Canva mockup (spec R1–R8): one font (Inter), one type scale,
   two browns instead of five, one button and one secondary link.
   ========================================================================== */
:root {
	--paper: #f5f5f7;
	--card: #ffffff;
	--night: #111010;
	--night-2: #1c1a18;
	--ink: #1d1d1f;
	--ink-2: #6e6e73;
	--line: #d2d2d7;
	--on-night: #f5f5f7;
	--on-night-2: #a1a1a6;
	--brown: #8b5a3c;      /* on light backgrounds */
	--brown-hi: #c68b5e;   /* on dark backgrounds */
	--brown-press: #74482f;

	--f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

	/* --hs: heading scale from Customizer → "Cỡ chữ tiêu đề" (1 = as designed). */
	--hs: 1;
	--t-display: calc(clamp(2.5rem, 6.2vw, 5.75rem) * var(--hs));
	--t-headline: calc(clamp(2rem, 4.6vw, 4rem) * var(--hs));
	--t-title: calc(clamp(1.375rem, 2vw, 1.75rem) * (1 + (var(--hs) - 1) / 2));
	--t-lead: clamp(1.125rem, 1.5vw, 1.4rem);
	--t-body: 1.0625rem;
	--t-small: 0.875rem;

	--max: 1200px;
	--gutter: clamp(1rem, 4vw, 2rem);
	--section: clamp(4.5rem, 10vw, 8.5rem);
	--radius: 18px;
	--radius-lg: 28px;
	--header: 52px;
	--ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 1rem); }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--f-sans);
	font-size: var(--t-body);
	line-height: 1.5;
	letter-spacing: -0.011em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brown); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; border-radius: 6px; }
.is-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--brown-hi); }
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 10px;
}
.skip-link:focus { top: 0.75rem; }

/* Type scale ---------------------------------------------------------------- */
.display { font-size: var(--t-display); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em; }
.headline { font-size: var(--t-headline); font-weight: 700; line-height: 1.06; letter-spacing: -0.03em; }
.lead { font-size: var(--t-lead); line-height: 1.4; color: var(--ink-2); font-weight: 500; letter-spacing: -0.015em; text-wrap: pretty; }
.eyebrow { font-size: clamp(1rem, 1.3vw, 1.25rem); font-weight: 600; color: var(--brown); margin-bottom: 0.4em; letter-spacing: -0.01em; }
.is-dark .lead { color: var(--on-night-2); }
.is-dark .eyebrow { color: var(--brown-hi); }

/* Buttons --------------------------------------------------------------------
   One primary (brown pill) and one secondary link with a single chevron (R8). */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; }
.btn,
.button,
button.button,
input[type="submit"],
.wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	min-height: 44px;
	padding: 0.7rem 1.6rem;
	border: 0;
	border-radius: 980px;
	background: var(--brown);
	color: #fff;
	font: 600 1rem/1.2 var(--f-sans);
	letter-spacing: -0.01em;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 200ms var(--ease), transform 200ms var(--ease);
}
.btn:hover, .button:hover, input[type="submit"]:hover { background: var(--brown-press); color: #fff; text-decoration: none; }
.btn:active, .button:active { transform: scale(0.98); }
.is-dark .btn { background: var(--brown-hi); color: var(--night); }
.is-dark .btn:hover { background: #d9a175; color: var(--night); }

.link-more { font-weight: 600; font-size: 1.0625rem; color: var(--brown); display: inline-flex; align-items: baseline; gap: 0.3em; }
.link-more__chevron { font-size: 1.2em; line-height: 0; transition: transform 200ms var(--ease); }
.link-more:hover .link-more__chevron { transform: translateX(3px); }
.is-dark .link-more { color: var(--brown-hi); }

/* Forms --------------------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="search"], input[type="url"], select, textarea {
	width: 100%;
	min-height: 44px;
	padding: 0.65rem 0.9rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--card);
	color: var(--ink);
	font: 400 1rem/1.4 var(--f-sans);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(139, 90, 60, 0.18); }

/* Header: thin, sticky, frosted ------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(245, 245, 247, 0.8);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	transition: box-shadow 200ms var(--ease);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header.is-scrolled { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08); }
.site-header__inner {
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 var(--gutter);
	height: var(--header);
	display: flex;
	align-items: center;
	gap: 1.5rem;
}
.brand { display: flex; align-items: center; color: var(--ink); flex: none; }
.brand__mark { width: 66px; }
.raw-mark { overflow: visible; }
.raw-mark__bean { fill: var(--brown); }
.raw-mark__groove { stroke: var(--paper); }

.primary-nav { flex: 1; display: flex; justify-content: center; }
.primary-nav__list { display: flex; gap: clamp(1.25rem, 3vw, 2.75rem); list-style: none; margin: 0; padding: 0; }
.primary-nav__list a { color: var(--ink); font-size: var(--t-small); font-weight: 500; opacity: 0.85; }
.primary-nav__list a:hover, .primary-nav__list .current-menu-item > a { opacity: 1; text-decoration: none; color: var(--brown); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--ink); }
.cart-link__icon { width: 22px; height: 22px; }
.cart-link__count {
	position: absolute; right: 4px; top: 6px;
	min-width: 18px; height: 18px; padding: 0 5px;
	border-radius: 9px;
	background: var(--brown); color: #fff;
	font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center;
}
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink); }
.menu-toggle__bars, .menu-toggle__bars::before { display: block; width: 18px; height: 1.5px; margin: 0 auto; background: currentColor; position: relative; transition: transform 250ms var(--ease); }
.menu-toggle__bars { transform: translateY(-3.5px); }
.menu-toggle__bars::before { content: ""; position: absolute; left: 0; top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(-7px) rotate(-90deg); }

@media (max-width: 860px) {
	.site-header__inner { justify-content: space-between; }
	.menu-toggle { display: block; }
	.primary-nav {
		position: fixed;
		inset: var(--header) 0 auto 0;
		display: none;
		background: var(--paper);
		padding: 1rem var(--gutter) 2rem;
		box-shadow: 0 20px 30px -20px rgba(0, 0, 0, 0.25);
	}
	.admin-bar .primary-nav { top: calc(var(--header) + 46px); }
	.primary-nav.is-open { display: block; }
	.primary-nav__list { flex-direction: column; gap: 0; }
	.primary-nav__list a { display: block; padding: 0.85rem 0; font-size: 1.5rem; font-weight: 600; opacity: 1; border-bottom: 1px solid var(--line); }
}

/* Sections: light and dark in turn ---------------------------------------- */
.home-section { padding: var(--section) var(--gutter); }
.home-section > * { max-width: var(--max); margin-inline: auto; }
.is-light { background: var(--paper); color: var(--ink); }
.is-dark { background: var(--night); color: var(--on-night); }
.is-dark .raw-mark__groove { stroke: var(--night); }
.section-head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .lead { max-width: 40ch; margin-inline: auto; }

/* Reveal on scroll: only once JS confirmed motion is fine (main.js) */
.has-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); }
.has-reveal .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Generic pages ------------------------------------------------------------- */
.page-wrap { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) var(--section); }
.page-wrap--text { max-width: 760px; }
.page-head { margin-bottom: clamp(1.5rem, 4vw, 3rem); }
.page-head .headline { margin: 0; }
.entry-content { font-size: var(--t-body); line-height: 1.65; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: var(--t-title); margin-top: 2em; }
.entry-content img { border-radius: var(--radius); }
.post-meta { color: var(--ink-2); font-size: var(--t-small); font-weight: 500; margin-bottom: 0.6rem; }
.post-hero { margin: 0 0 2.5rem; }
.post-hero img { border-radius: var(--radius-lg); width: 100%; }
.page-404 { text-align: center; }
.page-404 .actions { justify-content: center; margin-top: 2rem; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 3rem 2rem; }
.post-card__media { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--card); margin-bottom: 1rem; color: var(--line); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.post-card__media:hover img { transform: scale(1.03); }
.post-card__placeholder { width: 40%; }
.post-card__title { font-size: var(--t-title); margin-bottom: 0.4rem; }
.post-card__title a { color: var(--ink); }
.post-card__excerpt { color: var(--ink-2); }
.navigation.pagination { margin-top: 3rem; }
.nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.page-numbers { display: inline-flex; min-width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 22px; color: var(--ink); font-weight: 600; }
.page-numbers.current { background: var(--ink); color: var(--paper); }

/* Footer: dark, three columns --------------------------------------------- */
.site-footer { background: var(--night); color: var(--on-night-2); padding: clamp(3.5rem, 7vw, 5.5rem) var(--gutter) 2rem; font-size: var(--t-small); }
.site-footer__inner {
	max-width: var(--max);
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: 2.5rem 2rem;
	padding: 2.5rem 0;
	border-block: 1px solid rgba(198, 139, 94, 0.45);
}
.site-footer__mark { width: 150px; color: var(--on-night); margin-bottom: 1rem; }
.site-footer .raw-mark__groove { stroke: var(--night); }
.site-footer h2 { font-size: var(--t-small); font-weight: 600; color: var(--brown-hi); letter-spacing: 0.02em; margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.site-footer a { color: var(--on-night); opacity: 0.85; }
.site-footer a:hover { opacity: 1; color: var(--brown-hi); }
.site-footer__legal { max-width: var(--max); margin: 1.75rem auto 0; text-align: center; font-size: 0.8125rem; }
@media (max-width: 760px) {
	.site-footer__inner { grid-template-columns: 1fr 1fr; }
	.site-footer__brand { grid-column: 1 / -1; }
}
