/*
Theme Name: Huachenyang
Theme URI: https://flockedswab.net
Author: Huachenyang
Description: Lightweight custom theme for Huachenyang (sterile flocked swabs, sample collection and DNA kits). No page builder, no jQuery, mobile first.
Version: 1.2.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hcy
Tags: business, e-commerce, accessibility-ready
*/

/* ---------- tokens ----------
   Final direction: medical blue palette with minimal geometry —
   6px corners, hairline borders, no drop shadows.
   ------------------------------------------------------------ */
:root {
	--brand: #0b57a4;
	--brand-dark: #073b70;
	--brand-tint: #e8f1fb;
	--accent: #00a3a3;
	--ink: #111827;
	--muted: #5b6b7f;
	--line: #dde5ee;
	--surface: #f5f8fc;
	--white: #fff;
	--radius: 6px;
	--radius-sm: 4px;
	--btn-radius: 6px;
	--topbar-bg: #0a2b4d;
	--shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 16px 32px -22px rgba(16, 24, 40, .35);
	--wrap: 1180px;
	--gap: clamp(1rem, 3vw, 2rem);
	--section-y: clamp(2.75rem, 5.5vw, 5rem);
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--ink);
	background: var(--white);
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .6em; font-weight: 700; }
h1 { letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.35rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.15rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- layout helpers ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.section__head { max-width: 62ch; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.section__head p { color: var(--muted); margin: 0; }
.eyebrow {
	display: inline-flex; align-items: center; gap: .5rem;
	font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
	color: var(--brand); margin-bottom: .75rem;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 999;
	background: var(--brand); color: #fff; padding: .75rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; color: #fff; }

/* ---------- buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	padding: .8rem 1.4rem; border-radius: var(--btn-radius); border: 1px solid transparent;
	font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
	transition: transform .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn--light { background: #fff; color: var(--brand); }
.btn--light:hover { background: var(--brand-tint); color: var(--brand-dark); }

/* ---------- header ---------- */
.topbar {
	background: var(--topbar-bg); color: #cfe0f2; font-size: .82rem;
}
.topbar .wrap { display: flex; gap: 1.25rem; justify-content: flex-end; padding-block: .45rem; flex-wrap: wrap; }
.topbar a { color: #cfe0f2; text-decoration: none; }
.topbar a:hover { color: #fff; }

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .94);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; padding-block: .85rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand__mark {
	width: 38px; height: 38px; border-radius: 6px; flex: 0 0 auto;
	background: linear-gradient(135deg, var(--brand), var(--accent));
	display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: -.02em;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; }
.brand__tag { font-size: .72rem; color: var(--muted); letter-spacing: .04em; }

.nav { margin-left: auto; }
.nav ul { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav a {
	display: block; padding: .55rem .8rem; border-radius: var(--radius-sm);
	color: var(--ink); text-decoration: none; font-size: .94rem; font-weight: 500;
}
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a { background: var(--brand-tint); color: var(--brand); }
.nav .menu-item-has-children { position: relative; }
.nav .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 220px; display: none;
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
	box-shadow: var(--shadow); padding: .4rem; flex-direction: column; gap: 0; z-index: 60;
}
.nav .sub-menu li { width: 100%; }
.nav li:hover > .sub-menu, .nav li:focus-within > .sub-menu { display: flex; }

.nav-toggle {
	display: none; margin-left: auto; background: none; border: 1px solid var(--line);
	border-radius: var(--radius-sm); padding: .5rem .7rem; cursor: pointer; color: var(--ink);
}
.header-cta { flex: 0 0 auto; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #eaf2fb, #fff 65%); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding-block: clamp(3rem, 6vw, 5rem); }
.hero h1 { margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero__lead { font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: var(--muted); max-width: 46ch; margin-bottom: 1.75rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__media { position: relative; }
.hero__media img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

.hero__badges { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.hero__badges span { display: inline-flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--muted); font-weight: 600; }
.hero__badges span::before { content: "✓"; color: var(--accent); font-weight: 800; }

/* ---------- cards / products ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
	display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px -18px rgba(16, 24, 40, .4); border-color: var(--brand); color: inherit; }
.card__media { aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 1.1rem 1.2rem 1.35rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card__cat { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.card__title { font-size: 1.05rem; margin: 0; font-weight: 700; }
.card__excerpt { font-size: .9rem; color: var(--muted); margin: 0; }
.card__more { margin-top: auto; padding-top: .7rem; font-size: .87rem; font-weight: 600; color: var(--brand); }
.card__more::after { content: " →"; transition: margin-left .15s ease; display: inline-block; }
.card:hover .card__more::after { margin-left: 4px; }

/* ---------- feature blocks ---------- */
.feature { display: flex; flex-direction: column; gap: .55rem; padding: 1.6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.feature__icon { width: 44px; height: 44px; border-radius: 6px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); margin-bottom: .35rem; }
.feature h3 { margin: 0; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- stats ---------- */
.stats { background: var(--brand); color: #fff; border-radius: var(--radius); padding: clamp(1.75rem, 4vw, 2.75rem); display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stat__num { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat__label { font-size: .86rem; color: #bfd6ee; margin-top: .4rem; }

/* ---------- split section ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.split__media img { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.checklist { list-style: none; padding: 0; margin: 1.25rem 0 1.75rem; display: grid; gap: .6rem; }
.checklist li { position: relative; padding-left: 1.9rem; color: var(--ink); font-size: .96rem; }
.checklist li::before {
	content: ""; position: absolute; left: 0; top: .35em; width: 1.15rem; height: 1.15rem; border-radius: 50%;
	background: var(--brand-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b57a4' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/72% no-repeat;
}

/* ---------- cta ---------- */
.cta { background: linear-gradient(135deg, var(--brand-dark), var(--brand) 60%, #0d6dbb); color: #fff; border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.5rem); display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta h2 { margin: 0 0 .4rem; color: #fff; }
.cta p { margin: 0; color: #cfe0f2; max-width: 52ch; }

/* ---------- content / post ---------- */
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3 { margin-top: 1.8em; }
.prose img { border-radius: var(--radius); }
.prose blockquote { margin: 1.5em 0; padding: .5em 0 .5em 1.2em; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.prose th, .prose td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); }

.breadcrumb { font-size: .85rem; color: var(--muted); padding-block: 1rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

.page-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-block: clamp(1.75rem, 4vw, 3rem); }
.page-head h1 { margin: 0; }
.page-head p { margin: .5rem 0 0; color: var(--muted); max-width: 60ch; }

/* product detail */
.product { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.product__gallery img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); width: 100%; }
.product__specs { margin: 1.5rem 0 0; border-top: 1px solid var(--line); }
.product__specs div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.product__specs dt { color: var(--muted); margin: 0; }
.product__specs dd { margin: 0; font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { background: #0b1622; color: #a8b6c6; padding-block: clamp(2.5rem, 5vw, 4rem) 0; margin-top: clamp(3rem, 6vw, 5rem); }
.site-footer a { color: #c9d6e4; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2rem; padding-bottom: 2.5rem; }
.site-footer h2.footer__title { color: #fff; font-size: .95rem; margin: 0 0 1rem; letter-spacing: .01em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .92rem; }
.footer__about p { font-size: .92rem; max-width: 34ch; }
.footer__bottom { border-top: 1px solid #1c2b3c; padding-block: 1.25rem; font-size: .82rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer .brand__name { color: #fff; }
.site-footer .brand__tag { color: #7f93a8; }

/* ---------- forms ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], textarea, select {
	width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
	font: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: 3px solid rgba(11, 87, 164, .15); outline-offset: 0; }
label { font-size: .9rem; font-weight: 600; display: block; margin-bottom: .35rem; }
.form-row { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: clamp(2rem, 4vw, 3rem); }
.pagination .page-numbers {
	display: grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding-inline: .6rem;
	border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-size: .9rem;
}
.pagination .current, .pagination .page-numbers:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- utilities ---------- */
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; width: 1px;
	overflow: hidden; position: absolute !important; word-wrap: normal !important;
}
.single-post .entry-meta { color: var(--muted); font-size: .88rem; margin-bottom: 1.5rem; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
	.hero .wrap, .split, .product { grid-template-columns: 1fr; }
	.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stats { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
	.nav-toggle { display: inline-flex; }
	.header-cta { display: none; }
	.nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: .75rem; display: none; box-shadow: var(--shadow); }
	.nav.is-open { display: block; }
	.nav ul { flex-direction: column; align-items: stretch; gap: .15rem; }
	.nav .sub-menu { position: static; display: flex; box-shadow: none; border: 0; padding-left: .75rem; }
	.grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
	.form-grid { grid-template-columns: 1fr; }
	.topbar .wrap { justify-content: center; }
	.cta { flex-direction: column; align-items: flex-start; }
	.footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
