/* Awakened to Grace — shared styling for legal and policy pages.
 *
 * Palette and type match the app: colours resolve to constants in
 * lib/theme/garden_theme.dart, and the Fraunces/Inter pairing to
 * lib/theme/typography.dart.
 *
 * These documents get read on a phone, printed, and exported to PDF, so the
 * print rules below are load-bearing rather than an afterthought.
 */

:root {
  --ground: #FBF8F3;
  --surface: #FFFFFF;
  --sunk: #F7F5EF;
  --ink: #1F2937;
  --ink-2: #55534E;
  --ink-3: #6E6E6E;
  --rule: rgba(58, 104, 88, 0.16);
  --rule-soft: rgba(58, 104, 88, 0.09);
  --green: #3A6858;
  --green-deep: #2C5644;
  --leaf: #4A7A4A;
  --sage: #DEE2C1;
  --sage-bg: #EFF4E7;
  --gold: #FFD54F;
  --gold-ink: #8A6A2F;
  --amber-bg: #FFF9EE;
  --amber-rule: rgba(255, 213, 79, 0.55);
  --alert: #CE541C;
  --alert-bg: #FDF1EA;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111827;
    --surface: #1F2937;
    --sunk: #19212F;
    --ink: #F9FAFB;
    --ink-2: #C9CDD3;
    --ink-3: #9AA1AA;
    --rule: rgba(143, 188, 143, 0.22);
    --rule-soft: rgba(143, 188, 143, 0.12);
    --green: #8FBC8F;
    --green-deep: #A8CBA8;
    --leaf: #86C46A;
    --sage: #2C4239;
    --sage-bg: #1E2C27;
    --gold-ink: #D9B266;
    --amber-bg: #2A2416;
    --amber-rule: rgba(255, 213, 79, 0.34);
    --alert: #F08A50;
    --alert-bg: #2E1D16;
  }
}

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

body {
  margin: 0 auto;
  max-width: 44rem;
  padding: 3rem 1.5rem 6rem;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- headings ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.3px;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--rule);
}

h2 {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 2.75rem 0 0.75rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

h4 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
}

p { margin: 0 0 1rem; text-wrap: pretty; }
strong { font-weight: 600; }

a {
  color: var(--green);
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--green-deep); }
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

ul, ol { margin: 0 0 1rem; padding-left: 1.35rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--green); }

hr { border: 0; border-top: 1px solid var(--rule-soft); margin: 2.5rem 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--sunk);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--ink-2);
}
pre {
  background: var(--sunk);
  padding: 1rem;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--rule-soft);
}
pre code { background: none; padding: 0; }

/* --- the date line ----------------------------------------------------- */

.last-updated {
  display: inline-block;
  margin: 0 0 2.25rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  background: var(--sage-bg);
  border: 1px solid var(--rule);
  color: var(--gold-ink);
  font-size: 0.8rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.4px;
}

/* --- callouts ---------------------------------------------------------- */

.coppa-notice,
.notice,
.important-box,
.safety-notice,
.safety-box,
.welcome-box {
  padding: 1.1rem 1.25rem;
  margin: 1.75rem 0;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--sage-bg);
}
.coppa-notice > :last-child,
.notice > :last-child,
.important-box > :last-child,
.safety-notice > :last-child,
.safety-box > :last-child,
.welcome-box > :last-child { margin-bottom: 0; }

/* Child-safety and legal-obligation notices carry the warm accent so they
   read as "read this one" rather than as another paragraph. */
.coppa-notice,
.safety-notice,
.safety-box {
  background: var(--amber-bg);
  border-color: var(--amber-rule);
}

.important-box {
  background: var(--alert-bg);
  border-color: color-mix(in srgb, var(--alert) 30%, transparent);
}

/* --- grids and cards --------------------------------------------------- */

.container { max-width: 44rem; margin: 0 auto; }

.values-grid,
.feature-grid,
.do-dont-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.value-card,
.feature-card,
.do-section,
.dont-section {
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
}
.value-card > :last-child,
.feature-card > :last-child,
.do-section > :last-child,
.dont-section > :last-child { margin-bottom: 0; }

.feature-card.allowed,
.do-section {
  background: var(--sage-bg);
  border-color: var(--rule);
}
.feature-card.blocked,
.dont-section {
  background: var(--alert-bg);
  border-color: color-mix(in srgb, var(--alert) 28%, transparent);
}

.value-card h3,
.feature-card h3,
.do-section h3,
.dont-section h3 { margin-top: 0; }

.icon, .emoji { font-style: normal; line-height: 1; }

/* --- tables ------------------------------------------------------------ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--ink-3);
  font-size: 0.8rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom-color: var(--rule);
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--sage);
  color: var(--ink-2);
}

/* Wide content must scroll in its own box, never the page. */
.table-wrap, .scroll-x { overflow-x: auto; }

/* --- print ------------------------------------------------------------- *
 * These are printed and saved as PDF often enough to matter. Ink-heavy
 * fills are dropped, links show their destination, and headings are kept
 * with the text that follows them.
 */

@media print {
  :root {
    --ground: #FFFFFF;
    --surface: #FFFFFF;
    --sunk: #FFFFFF;
    --ink: #000000;
    --ink-2: #222222;
    --ink-3: #444444;
    --rule: #999999;
    --rule-soft: #CCCCCC;
    --sage-bg: #FFFFFF;
    --amber-bg: #FFFFFF;
    --alert-bg: #FFFFFF;
  }
  body {
    max-width: 100%;
    padding: 0;
    font-size: 11pt;
    line-height: 1.45;
    background: #FFFFFF;
    color: #000000;
  }
  @page { margin: 18mm; }

  h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }
  p, li, blockquote { orphans: 3; widows: 3; }
  table, .coppa-notice, .notice, .important-box, .safety-notice,
  .safety-box, .value-card, .feature-card { break-inside: avoid; page-break-inside: avoid; }

  .coppa-notice, .notice, .important-box, .safety-notice, .safety-box,
  .welcome-box, .value-card, .feature-card, .do-section, .dont-section {
    border: 1px solid #999999;
  }

  a { color: #000000; text-decoration: underline; }
  /* Show real destinations, but not for in-page or mailto links. */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444444;
    word-break: break-all;
  }

  .no-print, nav, .doc-nav { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
