/* Content layer stylesheet — shared by /faq/ and /knowledge/ static pages */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600&family=Noto+Serif+SC:wght@400;600;700&display=swap');

/* Theme tokens — matches homepage ThemeVars */
:root {
  --bg: #F7F6F4;
  --card: #FFFFFF;
  --line: #E1E6EE;
  --title: #1A1F27;
  --text: #536070;
  --muted: #8490A3;
  --brand: #E9DCC8;
  --brand-ink: #1A1F27;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Site header (supports both .site-header and .content-header) ---- */

.site-header,
.content-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner,
.content-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
}

.site-header__wordmark,
.content-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--title);
  text-decoration: none;
}

.site-header__wordmark:hover,
.content-logo:hover {
  opacity: 0.8;
}

/* ---- Content wrapper (generated pages use .content-wrap for centering) ---- */

.content-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Breadcrumb ---- */

nav[aria-label="breadcrumb"] {
  padding: 1rem 1.5rem 0;
}

/* Center when not inside .content-wrap (existing approved HTML files) */
body > nav[aria-label="breadcrumb"],
body > header + nav[aria-label="breadcrumb"] {
  max-width: 760px;
  margin: 0 auto;
}

.content-wrap nav[aria-label="breadcrumb"] {
  padding-left: 0;
  padding-right: 0;
}

nav[aria-label="breadcrumb"] ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

nav[aria-label="breadcrumb"] ol li + li::before {
  content: '/';
  margin-right: 0.25rem;
  color: var(--line);
}

nav[aria-label="breadcrumb"] a {
  color: var(--muted);
  text-decoration: none;
}

nav[aria-label="breadcrumb"] a:hover { color: var(--title); }

/* ---- Main content card ---- */

main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-top: 0.875rem;
  margin-bottom: 0;
}

/* Center when not inside .content-wrap */
body > main,
body > nav + main,
body > header ~ main,
body > header + nav + main {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Headings ---- */

h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 600;
  color: var(--title);
  line-height: 1.35;
  margin: 0 0 1.5rem;
}

h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--title);
  line-height: 1.45;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--title);
  margin: 1.25rem 0 0.5rem;
}

/* ---- Body text ---- */

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--title); }
a:hover { opacity: 0.75; }

ul, ol { margin: 0 0 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; line-height: 1.7; }
strong { font-weight: 600; color: var(--title); }

blockquote {
  border-left: 3px solid var(--brand);
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--title);
}

blockquote p:last-child { margin-bottom: 0; }

/* ---- FAQ-specific styles ---- */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
}

.faq-item h2 {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--title);
  margin: 0 0 0.75rem;
}

.faq-answer { color: var(--text); }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---- Family index list ---- */

section[data-content-template="familyIndexSkeleton"] ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

section[data-content-template="familyIndexSkeleton"] li a {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--title);
  font-size: 0.9375rem;
  transition: border-color 0.15s;
}

section[data-content-template="familyIndexSkeleton"] li a:hover {
  border-color: var(--muted);
  opacity: 1;
}

/* ---- Site footer (supports both .site-footer and .content-footer) ---- */

.site-footer,
.content-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}

.site-footer__inner,
.content-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.site-footer__brand,
.content-footer a {
  font-family: 'Noto Serif SC', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--title);
  text-decoration: none;
}

.site-footer__brand:hover,
.content-footer a:hover {
  opacity: 0.8;
}

.site-footer span,
.content-footer p {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.375rem 0 0;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  nav[aria-label="breadcrumb"] { padding: 0.875rem 1rem 0; }
  .content-wrap { padding: 0 1rem; }
  main { padding: 1.25rem; margin-top: 0.625rem; }
  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.05rem; }
  .faq-item { padding: 1rem 1.125rem; }
}
