/* NorthWood Round 47: the guide pages (/guides/, /en/guides/, /zh/guides/).
   Loaded after nw-theme.css, so every colour is a Round 46 token and dark mode follows by itself.
   Rules for this file: no colour is typed here except the WhatsApp green; no external font; every tap target is at least 44px; nothing moves unless the visitor allows motion.
   Class names start with g- so they can never collide with the home page. */

:root { --wood: #c9712f; --wood-d: #9c5318; --wood-l: #e2a268;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body.g { margin: 0; font-family: var(--sans); color: var(--ink); line-height: 1.75; -webkit-font-smoothing: antialiased; padding-bottom: 0; }
body.g img { display: block; max-width: 100%; height: auto; }
body.g a { color: var(--accent-text); text-underline-offset: 3px; }
body.g :focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
.g-wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.g-skip { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--inv-bg); color: var(--inv-fg) !important; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.g-skip:focus { top: 12px; }

/* ---------- header ---------- */
.g-head { position: sticky; top: 0; z-index: 100; background: var(--nav-bg-solid); box-shadow: var(--nav-shadow); backdrop-filter: blur(12px); }
.g-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 68px; }
.g-brand { display: flex; align-items: center; gap: 10px; color: var(--ink) !important; text-decoration: none; font: 600 21px/1.1 var(--serif); }
.g-brand img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
.g-brand em { font-style: normal; color: var(--wood); }
.g-brand small { display: block; margin-top: 3px; font: 500 9.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gray); }
@media (min-width: 600px) { .g-brand small { font-size: 10.5px; letter-spacing: .1em; } }   /* the same size as the home page header (nw-theme.css): it was left at 9.5px here */
nav.g-links { display: flex; gap: 26px; font-size: 14px; font-weight: 600; background: transparent; box-shadow: none; position: static; }
.g-links a { color: var(--ink); text-decoration: none; padding: 10px 0; min-width: 32px; text-align: center; opacity: .78; border-bottom: 2px solid transparent; }   /* min-width: a short word such as "FAQ" was only 27 px wide to tap */
.g-links a:hover { opacity: 1; border-bottom-color: var(--wood); }
.g-links a[aria-current="page"] { opacity: 1; border-bottom-color: var(--wood); }
.g-tools { display: flex; align-items: center; gap: 10px; }
.g-lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.g-lang a { color: var(--gray); text-decoration: none; padding: 0 12px; min-height: 40px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.g-lang a[aria-current="true"] { background: var(--inv-bg); color: var(--inv-fg); }
.g-lang a:not([aria-current="true"]):hover { color: var(--ink); }
.g-cta-btn, .g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 24px; border-radius: 999px; font: 700 15px/1 var(--sans); text-decoration: none; border: 1px solid transparent; transition: transform .3s cubic-bezier(.2, .7, .2, 1), background .3s; cursor: pointer; }
.g-cta-btn { background: #14803f; color: #fff !important; min-height: 42px; padding: 0 20px; font-size: 14px; }
.g-btn.wa { background: #14803f; color: #fff !important; }
.g-btn.wa:hover, .g-cta-btn:hover { background: #0f6a33; transform: translateY(-2px); }
.g-btn.ghost { background: transparent; color: var(--walnut-fg) !important; border-color: rgba(255, 255, 255, .38); }
.g-btn.ghost:hover { background: rgba(255, 255, 255, .1); }
@media (max-width: 899px) { nav.g-links { display: none; } }
.g-brand span, .g-lang a { white-space: nowrap; }
@media (max-width: 599px) { .g-cta-btn { display: none; } .g-brand small { display: none; } .g-brand { font-size: 18px; gap: 8px; } .g-brand img { width: 40px; height: 40px; } .g-lang a { padding: 0 10px; } .g-bar { gap: 8px; } }
/* R48 (found by the 23-screen sweep): on a narrow phone (iPhone SE / mini, many Android phones at 360 px) the name + language switch + light/dark button needed about 366 px and pushed the whole page sideways.
   Now they tighten a little, the name may shorten as a last resort (so nothing can ever overflow), and on the narrowest screens only the logo stays next to the buttons. Nothing changes at 421 px and wider. */
.g-brand { min-width: 0; }
.g-brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.g-tools { flex: none; }
@media (max-width: 420px) { .g-brand { font-size: 16px; gap: 6px; } .g-brand img { width: 36px; height: 36px; } .g-tools { gap: 6px; } .g-lang a { padding: 0 7px; } }
@media (max-width: 359px) { .g-brand span { display: none; } }

/* ---------- breadcrumb ---------- */
nav.g-crumbs { background: transparent; box-shadow: none; position: static; padding: 22px 0 6px; font-size: 13.5px; }
.g-crumbs ol { display: flex; flex-wrap: nowrap; gap: 6px; list-style: none; margin: 0; padding: 0; color: var(--gray); }
.g-crumbs li { flex: none; }
.g-crumbs li[aria-current] { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-crumbs li + li::before { content: "›"; margin-right: 6px; opacity: .7; }
.g-crumbs a { color: var(--gray); }
.g-crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- article ---------- */
.g-article { max-width: 760px; margin: 0 auto; padding: 8px 0 24px; }
.g-eyebrow { margin: 18px 0 10px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; }
.g-article h1 { font: 600 clamp(30px, 4.6vw, 46px)/1.18 var(--serif); letter-spacing: -.01em; margin: 0 0 14px; }
.g-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 26px; font-size: 14px; color: var(--gray); }
.g-answer { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--wood); border-radius: 16px; padding: 20px 22px; margin: 0 0 28px; box-shadow: 0 10px 28px var(--card-shadow); }
.g-answer b { display: block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }
.g-answer p { margin: 0; font-size: 18px; line-height: 1.7; }
.g-intro p { font-size: 17.5px; color: var(--ink); margin: 0 0 16px; }
nav.g-toc { background: var(--cream-2); box-shadow: none; position: static; border-radius: 16px; padding: 18px 22px; margin: 28px 0 8px; }
.g-toc b { display: block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gray); margin-bottom: 8px; }
.g-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 2px; }
.g-toc a { display: inline-block; padding: 5px 0; font-weight: 600; text-decoration: none; }
.g-toc a:hover { text-decoration: underline; }
.g-sec { margin-top: 44px; }
.g-article h2 { font: 600 clamp(24px, 3.2vw, 31px)/1.25 var(--serif); margin: 0 0 14px; letter-spacing: -.005em; }
.g-article h3 { font: 700 19px/1.4 var(--sans); margin: 26px 0 6px; }
.g-article p { margin: 0 0 16px; font-size: 17px; }
.g-sec ul { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 10px; }
.g-sec li { position: relative; padding-left: 28px; font-size: 17px; }
.g-sec li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 9px; height: 9px; border-radius: 50%; background: var(--wood); }
.g-qa h3 { margin: 22px 0 6px; font: 600 20px/1.35 var(--serif); }
.g-qa p { color: var(--ink); }
html[lang="zh"] .g-article h1, html[lang="zh"] .g-article h2, html[lang="zh"] .g-qa h3 { font-weight: 700; letter-spacing: 0; line-height: 1.35; }
html[lang="zh"] .g-article p, html[lang="zh"] .g-article li, html[lang="zh"] .g-answer p, html[lang="zh"] .g-intro p { line-height: 1.95; }

/* ---------- call to action + about box ---------- */
.g-cta { margin: 52px 0 0; background: var(--walnut); color: var(--walnut-fg); border-radius: 22px; padding: 30px 30px 26px; box-shadow: 0 24px 50px -28px rgba(42, 29, 20, .55); }
.g-cta h2 { color: var(--walnut-fg); margin: 0 0 8px; font: 600 clamp(24px, 3vw, 30px)/1.25 var(--serif); }
.g-cta p { color: var(--walnut-mut); margin: 0 0 20px; font-size: 16px; }
.g-cta .g-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.g-cta small { display: block; margin-top: 16px; color: var(--walnut-mut); font-size: 13px; line-height: 1.6; opacity: .9; }
.g-about { margin: 22px 0 0; border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; background: var(--surface); }
.g-about h2 { font: 700 18px/1.3 var(--sans); margin: 0 0 8px; }
.g-about p { margin: 0 0 12px; font-size: 15px; color: var(--gray); line-height: 1.75; }
.g-about .g-ulinks { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14.5px; font-weight: 700; }
.g-about .g-ulinks a { display: block; padding: 5px 6px; margin: -5px -6px; }
.g-trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--walnut-fg); }
.g-trust li { position: relative; padding: 0; font-size: 14px; }
.g-trust li::before { content: "✓"; margin-right: 6px; color: var(--wood-l); font-weight: 700; }

/* ---------- cards (related guides and the index) ---------- */
.g-related { margin: 56px auto 0; max-width: 760px; }
.g-related .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
nav.g-related { background: transparent; box-shadow: none; position: static; }
.g-related h2 { font: 600 26px/1.25 var(--serif); margin: 0 0 16px; }
.g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.g-card { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit !important; text-decoration: none; transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }
.g-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px var(--card-shadow); }
.g-card b { font: 700 19px/1.3 var(--serif); }
.g-card span { font-size: 14.5px; color: var(--gray); line-height: 1.65; }
.g-card small { font-size: 12.5px; color: var(--gray); }
.g-card em { margin-top: auto; padding-top: 6px; font-style: normal; font-weight: 700; color: var(--accent-text); font-size: 14px; }
.g-more { margin: 18px 0 0; font-weight: 700; }
@media (max-width: 899px) { .g-grid, .g-related .g-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

/* ---------- index page ---------- */
.g-hero { padding: 26px 0 10px; max-width: 760px; }
.g-hero h1 { font: 600 clamp(32px, 5vw, 50px)/1.15 var(--serif); margin: 12px 0 14px; }
.g-hero p { font-size: 18px; color: var(--gray); margin: 0; }
.g-index { margin-top: 30px; }

/* ---------- product pages (/p/<slug>, written by the Worker with the same header, footer and tokens as the guides) ---------- */
.g-prod { max-width: 1040px; margin: 0 auto; padding: 4px 0 24px; }
.g-ptop { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 38px; align-items: start; margin-top: 6px; }
.g-pgal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; position: sticky; top: 92px; }
.g-pgal img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--cream-2); border: 1px solid var(--line); filter: var(--img-dim); }
.g-pgal img:first-child { grid-column: 1 / -1; border-radius: 20px; box-shadow: 0 22px 48px -26px rgba(42, 29, 20, .5); }
.g-pgal img:first-child:last-child { grid-column: 1 / -1; }
.g-pnone { grid-column: 1 / -1; aspect-ratio: 4 / 3; border-radius: 20px; display: grid; place-items: center; text-align: center; padding: 20px; background: var(--walnut); color: var(--walnut-mut); font: 600 22px/1.3 var(--serif); letter-spacing: .02em; }
.g-pinfo h1 { font: 600 clamp(28px, 4vw, 42px)/1.16 var(--serif); letter-spacing: -.01em; margin: 6px 0 14px; overflow-wrap: anywhere; }
.g-pbadges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.g-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 700; line-height: 1.3; background: var(--ok-bg); color: var(--ok-fg); }
.g-badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.g-badge.plain { background: var(--cream-2); color: var(--gray); }
.g-pdesc p { margin: 0 0 14px; font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
html[lang="zh"] .g-pdesc p { line-height: 1.95; }
.g-pbtns { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 8px; }
.g-btn.dark { background: var(--inv-bg); color: var(--inv-fg) !important; }
.g-btn.dark:hover { transform: translateY(-2px); }
.g-pnote { margin: 8px 0 0; font-size: 14.5px; color: var(--gray); line-height: 1.7; }
.g-ptrust { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--gray); }
.g-ptrust li::before { content: "✓"; margin-right: 6px; color: var(--wood); font-weight: 700; }
.g-pbox { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin: 22px 0 0; box-shadow: 0 10px 28px var(--card-shadow); }
.g-pbox h2 { font: 700 13px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 10px; }
.g-pbox p { margin: 0; font-size: 16px; line-height: 1.75; }
.g-pbox ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.g-pbox li { font-size: 16px; }
.g-spec { width: 100%; border-collapse: collapse; }
.g-spec th, .g-spec td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15.5px; line-height: 1.6; overflow-wrap: anywhere; }
.g-spec tr:last-child th, .g-spec tr:last-child td { border-bottom: 0; }
.g-spec th { width: 40%; padding-right: 14px; color: var(--gray); font-weight: 600; }
.g-pwide { max-width: 760px; margin: 0 auto; }
.g-prod .g-related { max-width: none; }
.g-prod .g-related .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-pwide .g-sec { margin-top: 48px; }
@media (max-width: 899px) { .g-ptop { grid-template-columns: minmax(0, 1fr); gap: 22px; } .g-pgal { position: static; } .g-prod .g-related .g-grid { grid-template-columns: minmax(0, 1fr); } }
@media print { .g-pgal { position: static; } }

/* ---------- footer ---------- */
.g-foot { margin-top: 72px; padding: 44px 0 30px; }
.g-foot .g-cols { display: grid; grid-template-columns: 1.6fr 1.2fr 1.2fr; gap: 32px; }
.g-foot h2 { font: 700 13px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #fff; margin: 0 0 10px; }
.g-foot a { display: block; color: #d0c6ba !important; text-decoration: none; padding: 5px 0; font-size: 14.5px; }
.g-foot a:hover { color: #fff !important; text-decoration: underline; }
.g-foot p { margin: 0 0 8px; font-size: 14px; line-height: 1.7; color: #d0c6ba; }
.g-foot .g-bot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--walnut-line); display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 13px; color: #cbbfb1; }
.g-foot .g-bot a { display: inline; padding: 6px 4px; margin: -6px -4px; font-size: 13px; text-decoration: underline; }
@media (max-width: 899px) { .g-foot .g-cols { grid-template-columns: minmax(0, 1fr); gap: 22px; } }

/* ---------- mobile dock ---------- */
.g-dock { display: none; }
@media (max-width: 760px) {
  body.g { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .g-dock { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--nav-bg-solid); box-shadow: 0 -1px 0 var(--line), 0 -10px 30px rgba(0, 0, 0, .08); }
  .g-dock a { display: grid; place-items: center; min-height: 48px; border-radius: 999px; font: 700 15px/1 var(--sans); text-decoration: none; }
  .g-dock .wa { background: #14803f; color: #fff !important; }
  .g-dock .call { background: var(--inv-bg); color: var(--inv-fg) !important; }
}
@media (max-width: 760px) { .g-answer p { font-size: 17px; } .g-cta { padding: 24px 20px 22px; border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .g-card, .g-btn, .g-cta-btn { transition: none; } .g-card:hover, .g-btn.wa:hover, .g-cta-btn:hover { transform: none; } }
@media print { .g-head, .g-dock, .g-cta, .g-related, .g-foot, .g-toc { display: none !important; } body.g { background: #fff; color: #000; } .g-answer { box-shadow: none; } }
