/*
Theme Name: SynMed
Theme URI: https://synmed.vn
Description: Theme riêng cho web chính SynMed (synmed.vn): giới thiệu, tính năng, bảng giá, việc làm và sự kiện lấy từ app.synmed.vn qua API công khai. Không page builder, không jQuery.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.3
Author: HolyMarketing
Author URI: https://holymarketing.net
Text Domain: synmed
*/

:root {
	--bg: #f6f8fa;
	--surface: #fff;
	--fg: #14202b;
	--muted: #5b6b7a;
	--border: #dde3e9;
	--brand: #0f766e;
	--brand-strong: #115e59;
	--brand-soft: #e6f4f2;
	--warn-bg: #fef3c7;
	--warn-fg: #92400e;
	--radius: 14px;
	--max: 1120px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0d1419;
		--surface: #141d24;
		--fg: #e6edf3;
		--muted: #93a4b4;
		--border: #26333d;
		--brand: #2dd4bf;
		--brand-strong: #5eead4;
		--brand-soft: #12302d;
		--warn-bg: #3a2a0a;
		--warn-fg: #fcd34d;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.screen-reader-text, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 8px; top: 8px; z-index: 100; width: auto; height: auto; clip: auto; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- Nút, nhãn ---------- */
.btn, .btn-primary, .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: .95rem; line-height: 1.3;
	border: 1px solid var(--border); background: var(--surface); color: var(--fg); text-decoration: none !important;
}
.btn:hover { background: var(--brand-soft); }
.btn-primary, .wp-block-button__link { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .wp-block-button__link:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .btn-primary, .wp-block-button__link { color: #062a26; } }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }
.badge { display: inline-block; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 600; padding: 2px 10px; }
.badge-muted { display: inline-block; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: .78rem; padding: 1px 9px; }
.badge-warn { display: inline-block; border-radius: 999px; background: var(--warn-bg); color: var(--warn-fg); font-size: .78rem; font-weight: 600; padding: 2px 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1em 0; }
.center .actions, .actions.center { justify-content: center; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.3rem; color: var(--brand); }
.brand:hover { text-decoration: none; }
.brand .mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 1rem; }
.brand img { max-height: 36px; width: auto; }
.nav-main ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; font-weight: 600; font-size: .95rem; }
.nav-main a { color: var(--fg); }
.nav-main a:hover, .nav-main .current-menu-item > a, .nav-main .current-page-ancestor > a { color: var(--brand); text-decoration: none; }
.header-cta { display: flex; gap: 8px; }
.nav-mobile { display: none; border-top: 1px solid var(--border); overflow-x: auto; }
.nav-mobile ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 8px 16px; white-space: nowrap; font-size: .92rem; }
.nav-mobile a { color: var(--fg); }
@media (max-width: 860px) {
	.nav-main { display: none; }
	.nav-mobile { display: block; }
	.header-cta .btn-primary { display: none; }
}

/* ---------- Bố cục trang ---------- */
.site-main { padding: 28px 0 56px; }
.breadcrumbs, .rank-math-breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a, .rank-math-breadcrumb a { color: var(--muted); }
.page-head { margin-bottom: 24px; }
.page-head .lead { font-size: 1.15rem; max-width: 760px; }
.entry { max-width: 820px; }
.entry > * + * { margin-top: 0; }
.entry p, .entry li { text-align: justify; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: .35em; }
.updated { font-size: .78rem; color: var(--muted); margin-top: 32px; }
.section { margin-top: 56px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 22px; }
.section-head p { color: var(--muted); }

/* ---------- Thẻ, lưới ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
a.card { display: block; color: var(--fg); transition: border-color .15s; }
a.card:hover { border-color: var(--brand); text-decoration: none; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.card h3 { margin-bottom: .3em; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .more { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--brand); font-size: .92rem; }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }

/* Khối soạn trong trình soạn thảo: nhóm có lớp synmed-cards = lưới thẻ (mỗi h3 + p là một thẻ) */
.synmed-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); margin: 1em 0 1.5em; }
.synmed-cards > .wp-block-group__inner-container { display: contents; }
.synmed-cards .wp-block-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.synmed-cards .wp-block-group > .wp-block-group__inner-container > :last-child, .synmed-cards .wp-block-group > :last-child { margin-bottom: 0; }
.synmed-cards p { color: var(--muted); font-size: .95rem; text-align: left; }
.synmed-note { background: var(--brand-soft); border-radius: 10px; padding: 12px 16px; font-size: .95rem; }

/* Hỏi đáp: nhóm có lớp synmed-faq, mỗi câu hỏi là h3, trả lời là đoạn ngay sau */
.synmed-faq h3 { background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 14px 16px 4px; margin: 14px 0 0; font-size: 1.02rem; }
.synmed-faq h3 + p { background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 0 16px 14px; color: var(--muted); }

/* ---------- Trang chủ ---------- */
.hero { border-radius: 24px; background: linear-gradient(135deg, var(--brand-soft), var(--surface)); padding: 56px 20px; text-align: center; }
.hero h1 { max-width: 820px; margin: 10px auto 14px; font-size: clamp(1.9rem, 5vw, 3rem); }
.hero .lead { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }
.hero .actions { justify-content: center; margin-top: 22px; }
.ai-notice { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: .92rem; margin: 24px 0; }
.ai-notice strong { color: var(--brand); }
.cta-band { margin-top: 56px; border-radius: 22px; background: var(--brand); color: #fff; text-align: center; padding: 40px 20px; }
.cta-band h2 { margin-top: 0; }
.cta-band p { opacity: .92; max-width: 640px; margin: 0 auto 18px; }
.cta-band .btn { background: #fff; color: var(--brand); border-color: #fff; }
.cta-band .btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); }
@media (prefers-color-scheme: dark) { .cta-band { color: #062a26; } .cta-band .btn-ghost { color: #062a26; border-color: rgba(6,42,38,.5); } }

/* ---------- Bảng giá ---------- */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 18px 0; }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan.featured { border: 2px solid var(--brand); }
.plan .price { font-size: 1.45rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.plan ul { list-style: none; padding: 0; margin: 0; flex: 1; font-size: .95rem; }
.plan li { padding-left: 1.4em; position: relative; margin-bottom: .4em; text-align: left; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table.compare { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .95rem; }
table.compare th, table.compare td { border-bottom: 1px solid var(--border); padding: 9px 10px; text-align: center; }
table.compare th:first-child, table.compare td:first-child { text-align: left; }

/* ---------- Việc làm, sự kiện ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter label { flex: 1 1 200px; font-size: .9rem; font-weight: 600; }
.filter select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); font: inherit; }
.list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.meta { color: var(--muted); font-size: .92rem; }
.detail { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
dl.facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin: 0; }
dl.facts dt { color: var(--muted); font-size: .85rem; }
dl.facts dd { margin: 0; font-weight: 600; }
.prewrap { white-space: pre-line; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: .92rem; }
.site-footer .cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); padding: 40px 16px; }
.site-footer h2 { font-size: 1rem; margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }
.site-footer .legal { border-top: 1px solid var(--border); padding: 16px; text-align: center; color: var(--muted); font-size: .8rem; }
.site-footer .credit-row { text-align: center; padding: 0 16px 22px; }
