/* Shared stylesheet for Family Harbor help pages (FAQ + Wiki).
   Kawaii paper style — mirrors the landing theme tokens
   (landing-dashboard/src/landing-theme.css) and the Flutter kawaii contract
   (cream canvas, white cards, warm line borders, Fredoka headings,
   Plus Jakarta Sans body, cozyYellow emphasis with dark text).
   Copied verbatim to public/help/_style.css by tools/generate_help_pages.mjs. */
:root {
  /* Landing tokens (source of truth for the public site). */
  --fh-blue: #375998;
  --fh-blue-soft: rgba(55, 89, 152, 0.72);
  --fh-yellow: #ffd13d;
  --fh-yellow-dark: #e6b82c;
  --fh-cream: #fff8ef;
  --fh-cream-2: #fbf0de;
  --fh-line: #eadcc8;
  --fh-dot: rgba(205, 183, 151, 0.38);
  --fh-ink: #1c2538;
  /* Flutter kawaii contract tokens used for shared surfaces. */
  --kawaii-canvas: #fcf6ed; /* AppColors.softBackground */
  --kawaii-teal: #16716b;  /* AppColors.commandTeal */
  --radius-card: 18px;
  --radius-pill: 14px;
  --max: 780px;
  --shadow-card: 0 10px 28px rgba(46, 31, 12, 0.07);
  --shadow-lift: 0 16px 36px rgba(46, 31, 12, 0.11);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--fh-ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  /* Cream canvas + subtle dotted grid, like the landing paper shell. */
  background-color: var(--kawaii-canvas);
  background-image: radial-gradient(var(--fh-dot) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 20px 72px;
}

h1 {
  /* Kawaii display heading: Fredoka (AppTextStyles.displayKawaii family). */
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  margin: 6px 0 8px;
  color: var(--fh-blue);
}

h2 {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 12px;
  color: var(--fh-blue);
  /* Kawaii sticker underline in cozyYellow. */
  padding-bottom: 8px;
  background: linear-gradient(90deg, var(--fh-yellow), rgba(255, 209, 61, 0.25)) left bottom / 64px 5px no-repeat;
}

h3 {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 16.5px;
  font-weight: 600;
  margin-top: 22px;
  margin-bottom: 6px;
  color: var(--fh-blue);
}

p, li { font-size: 15.5px; }

a {
  color: var(--kawaii-teal);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(22, 113, 107, 0.35);
}

a:hover { text-decoration-color: currentColor; }

a:focus-visible,
summary:focus-visible,
select:focus-visible {
  outline: 3px solid var(--fh-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.lead {
  color: var(--fh-blue-soft);
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 6px;
}

ul, ol { padding-left: 22px; }
li + li { margin-top: 4px; }

code {
  background: var(--fh-cream-2);
  border: 1px solid var(--fh-line);
  border-radius: 8px;
  padding: 1px 7px;
  font-size: 0.9em;
}

blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 4px solid var(--fh-yellow);
  background: var(--fh-cream);
  border-radius: 0 14px 14px 0;
  color: var(--fh-blue-soft);
}

.wiki-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14.5px;
  background: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--fh-line);
}

.wiki-body th, .wiki-body td {
  border-bottom: 1px solid var(--fh-line);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

.wiki-body th {
  background: var(--fh-cream-2);
  font-weight: 700;
  color: var(--fh-blue);
}

/* Header block: mascot + title */
.help-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.help-mascot {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  object-fit: contain;
  /* Gentle sticker float, disabled for reduced motion below. */
  animation: help-float 5s ease-in-out infinite;
}

@keyframes help-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .help-mascot { animation: none; }
  * { transition: none !important; }
}

/* Top bar: rounded paper card like the landing nav */
.help-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: var(--max);
  margin: 18px auto 0;
  padding: 10px 16px;
  border: 1px solid var(--fh-line);
  border-radius: var(--radius-pill);
  background: rgba(255, 250, 243, 0.92);
  box-shadow: var(--shadow-card);
}

.help-topbar .help-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--fh-blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.help-topbar .help-home::before { content: "←"; font-weight: 500; }
.help-topbar .help-home:hover { text-decoration: underline; text-underline-offset: 4px; }

.help-nav {
  display: inline-flex;
  gap: 8px;
  font-size: 14px;
}

.help-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--fh-line);
  border-radius: 999px;
  background: var(--fh-cream);
  color: var(--fh-blue);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.help-nav a:hover { border-color: var(--fh-blue); background: #fff; }

.help-nav a[aria-current="page"] {
  /* Selected state: cozyYellow with dark text (kawaii contract). */
  background: var(--fh-yellow);
  border-color: var(--fh-yellow-dark);
  color: var(--fh-ink);
}

.help-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.help-lang span {
  color: var(--fh-blue-soft);
  font-size: 13px;
}

.help-lang select {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--fh-blue);
  background: var(--fh-cream);
  border: 1px solid var(--fh-line);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.help-lang select:hover { border-color: var(--fh-blue); }

/* FAQ accordion: white paper cards on the cream canvas */
.faq-category h2 { margin-bottom: 14px; }

.faq-item {
  border: 1px solid var(--fh-line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.86);
  margin: 10px 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.faq-item:hover { border-color: var(--fh-blue); }

.faq-item[open] {
  border-color: var(--fh-yellow-dark);
  box-shadow: var(--shadow-lift);
}

.faq-item summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--fh-ink);
  list-style-position: outside;
}

.faq-item summary::marker { color: var(--fh-yellow-dark); }
.faq-item summary:hover { background: var(--fh-cream); }

.faq-item[open] summary {
  background: var(--fh-cream-2);
  border-bottom: 1px dashed var(--fh-line);
}

.faq-answer {
  padding: 4px 18px 16px;
}

.faq-answer :first-child { margin-top: 10px; }
.faq-answer :last-child { margin-bottom: 0; }

/* Wiki index: guide cards */
.wiki-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.wiki-card {
  border: 1px solid var(--fh-line);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-card);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.wiki-card:hover {
  border-color: var(--fh-blue);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .wiki-card:hover { transform: none; }
}

.wiki-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiki-card-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.wiki-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  padding-bottom: 0;
  background: none;
}

.wiki-card h2 a {
  color: var(--fh-blue);
  text-decoration: none;
}

.wiki-card h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }

.wiki-card p { margin: 0 0 12px; color: var(--fh-blue-soft); font-size: 14.5px; }

.wiki-more {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--fh-yellow);
  border: 1px solid var(--fh-yellow-dark);
  color: var(--fh-ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.wiki-more:hover { background: var(--fh-yellow-dark); text-decoration: none; }

/* Wiki article */
.wiki-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 4px;
  color: var(--fh-blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.wiki-back:hover { text-decoration: underline; text-underline-offset: 4px; }

.wiki-body { margin-top: 10px; }
.wiki-body img { max-width: 100%; border-radius: var(--radius-card); }

.help-footer-links {
  margin-top: 44px;
  padding-top: 16px;
  border-top: 1px dashed var(--fh-line);
  color: var(--fh-blue-soft);
  font-size: 14px;
}

@media (max-width: 560px) {
  .help-topbar { flex-wrap: wrap; justify-content: center; }
  .help-nav { order: 3; width: 100%; justify-content: center; }
  .help-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .help-mascot { width: 56px; height: 56px; }
  h1 { font-size: 26px; }
}
