/* Dos Crayones — grandparent guide site, draft v1
   Brand colors from the approved Facebook cover (build_cover.py):
   cream #FFF8E7, blue #1F52D6, red #E63946, navy #283454, green #1F855A
   Fredoka is self-hosted under the SIL Open Font License (see /fonts/OFL.txt).
   No third-party scripts, fonts, or analytics. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #fff8e7;
  --paper: #fffcf5;
  --card: #ffffff;
  --blue: #1f52d6;
  --blue-ink: #173fa8;
  --red: #e63946;
  --navy: #283454;
  --green: #1f855a;
  --green-dark: #176544;
  --yellow: #facc15;
  --pink: #ec4879;
  --orange: #f97316;
  --muted: #5a6274;
  --line: #eadfca;
  --shadow: 0 8px 24px rgba(40, 52, 84, 0.08);
  --radius: 18px;
  --max: 44rem;
  --font-brand: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); }
a:hover { color: var(--blue-ink); }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { top: 0.75rem; }

/* Top crayon stripe, matching the Facebook cover */
.crayon-stripe {
  display: flex;
  height: 12px;
  width: 100%;
}
.crayon-stripe span { flex: 1; }
.crayon-stripe span:nth-child(1) { background: #e63946; }
.crayon-stripe span:nth-child(2) { background: #1f52d6; }
.crayon-stripe span:nth-child(3) { background: #facc15; }
.crayon-stripe span:nth-child(4) { background: #22c55e; }
.crayon-stripe span:nth-child(5) { background: #ec4879; }
.crayon-stripe span:nth-child(6) { background: #f97316; }
.crayon-stripe span:nth-child(7) { background: #784828; }

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

.header-inner {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cream);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--blue);
}
.brand-name span { color: var(--red); }
.brand-tag {
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--navy);
}

.nav-toggle { position: relative; }
.nav-toggle > summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-brand);
  font-weight: 600;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
}
.nav-toggle > summary::-webkit-details-marker { display: none; }

.site-nav ul,
.nav-toggle .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-nav a {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--navy);
  padding: 0.25rem 0;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom-color: var(--yellow);
}
.site-nav a .es {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.2;
}

/* Desktop nav visible, hamburger hidden */
.nav-desktop { display: none; }
.nav-mobile { display: block; }

@media (min-width: 820px) {
  .nav-desktop { display: block; }
  .nav-mobile { display: none; }
  .site-nav a { text-align: center; }
}

@media (max-width: 819px) {
  .nav-toggle .nav-list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.6rem 0.9rem;
    flex-direction: column;
    min-width: 12rem;
    gap: 0.45rem;
  }
}

main {
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.4rem 1.1rem 3rem;
}

.hero, .page-body, .section-card, .notes, .toc, .callout {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.hero {
  text-align: left;
  margin-bottom: 1.6rem;
}

.hero h1 {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.2;
  margin: 0 0 0.35rem;
  color: var(--blue);
}

.hero .subtitle {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--red);
  margin: 0 0 1rem;
  line-height: 1.3;
}

.callout {
  background: #fff6d4;
  border: 1px solid #f0d56a;
  border-left: 6px solid var(--yellow);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0 auto 1.4rem;
  font-size: 0.98rem;
}

.callout strong { color: var(--navy); }

.lede p { margin: 0 0 0.9rem; }
.lede .es-block {
  color: var(--muted);
}

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem 1.15rem;
  margin: 0 auto 1.6rem;
  box-shadow: var(--shadow);
}
.toc h2 {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  margin: 0 0 0.55rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.3rem;
}
.toc li { margin: 0.25rem 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .es { color: var(--muted); font-size: 0.92em; }

.section-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.4rem;
  margin: 0 auto 1.2rem;
  box-shadow: var(--shadow);
}

.section-card h2 {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--blue);
  margin: 0 0 0.15rem;
  line-height: 1.25;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

/* Cycle the number colors like the crayon stripe */
.section-card:nth-of-type(7n+1) .num { background: #e63946; }
.section-card:nth-of-type(7n+2) .num { background: #1f52d6; }
.section-card:nth-of-type(7n+3) .num { background: #c99600; }
.section-card:nth-of-type(7n+4) .num { background: #1f855a; }
.section-card:nth-of-type(7n+5) .num { background: #ec4879; }
.section-card:nth-of-type(7n+6) .num { background: #f97316; }
.section-card:nth-of-type(7n+7) .num { background: #784828; }

.section-card h3 {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--red);
  margin: 0 0 0.85rem;
  padding-left: 2.6rem;
}

.section-card p { margin: 0 0 0.8rem; }
.section-card .es-block { color: var(--muted); }

.product {
  background: var(--cream);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0 0;
}
.product p { margin: 0 0 0.45rem; }
.product p:last-child { margin-bottom: 0; }
.product .name {
  font-weight: 700;
  color: var(--navy);
}

.paid-flag {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.notes {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1.35rem;
  margin: 1.5rem auto 0;
}
.notes h2 {
  font-family: var(--font-brand);
  font-size: 1.3rem;
  color: var(--blue);
  margin: 0 0 0.2rem;
}
.notes .sub {
  font-family: var(--font-brand);
  font-weight: 600;
  color: var(--red);
  margin: 0 0 0.8rem;
}
.notes ul { margin: 0 0 0.8rem; padding-left: 1.2rem; }
.notes li { margin: 0.35rem 0; }

.page-body h1 {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  color: var(--blue);
  margin: 0 0 0.25rem;
  line-height: 1.2;
}
.page-body .subtitle {
  font-family: var(--font-brand);
  font-weight: 600;
  color: var(--red);
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
}
.page-body h2 {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--blue);
  margin: 1.6rem 0 0.5rem;
}
.page-body p, .page-body li { margin: 0 0 0.8rem; }
.page-body ul { padding-left: 1.2rem; }
.placeholder {
  display: inline-block;
  background: #fff0c7;
  border: 1px dashed #c9a227;
  border-radius: 6px;
  padding: 0 0.4rem;
  font-weight: 700;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--navy);
}

.site-footer {
  background: var(--navy);
  color: #f3efe4;
  padding: 1.6rem 1.1rem 2.2rem;
  margin-top: 1rem;
}
.footer-inner {
  max-width: 70rem;
  margin: 0 auto;
}
.site-footer a { color: #ffd666; }
.site-footer a:hover { color: #fff; }
.footer-disclosure {
  font-weight: 700;
  margin: 0 0 0.7rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}
.footer-meta {
  font-size: 0.9rem;
  color: #c9c3b6;
  margin: 0;
}
.footer-meta + .footer-meta { margin-top: 0.4rem; }

@media (max-width: 600px) {
  .section-card { padding: 1.05rem 0.95rem 1.15rem; }
  .section-card h3 { padding-left: 0; margin-top: 0.35rem; }
  .header-inner { padding: 0.55rem 0.85rem; }
  .brand img { width: 48px; height: 48px; }
}
