/* ffn.css — FFN-TJH shared stylesheet (mobile-first, clean, validator-friendly) */
/* VERSION: 2026-02-12 */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  line-height: 1.65;
  font-size: 1.125rem; /* ~18px */
  color: #111;
  background: #fff;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 0.8rem;
  background: #fff;
  color: #003399;
  border: 2px solid #01a9db;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

/* --- links --- */
a { color: #003399; text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid #01a9db; outline-offset: 2px; }

/* --- layout --- */
.wrap {
  width: min(78ch, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.article { padding-bottom: 1rem; }

/* --- headings / lede --- */
.article-header { text-align: center; margin: 1.25rem 0 1rem; }

h1, h2, h3 {
  line-height: 1.2;
  margin: 0.85rem 0 0.5rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  letter-spacing: 0.2px;
}

h2 { font-size: clamp(1.25rem, 2.5vw, 1.65rem); color: #0b7ea3; }
h3 { font-size: 1.15rem; color: #222; }

.lede {
  margin: 0.75rem auto 0;
  max-width: 62ch;
  color: #333;
  font-size: 1.05em;
}

/* --- text blocks --- */
p { margin: 0.85rem 0; }
ul, ol { margin: 0.75rem 0 0.9rem 1.25rem; padding: 0; }
li { margin: 0.6rem 0; }

blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 5px solid #cfefff;
  background: #f6fbff;
  border-radius: 10px;
}

/* --- images (0–N per page) --- */
img {
  display: block;         /* avoids baseline gaps + “mystery lines” */
  max-width: 100%;
  height: auto;
}

/* Any figure in article is centered and spaced consistently */
.article figure {
  margin: 1.25rem auto;
  text-align: center;
}

.article figure img {
  margin: 0 auto;
}

/* Optional “hero” class for primary figures (same centering, more breathing room if desired) */
.hero { margin: 1.5rem auto; }

.caption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #444;
}

/* --- callout boxes --- */
.callout {
  margin: 1.25rem 0;
  padding: 1rem 1rem 0.8rem;
  border: 2px solid #d7eef6;
  background: #f5fcff;
  border-radius: 12px;
}
.callout h2 { margin-top: 0; }
.callout ul { margin-left: 1.15rem; }

.callout.warn { border-color: #ffe3b8; background: #fff9f0; }
.callout.note { border-color: #dfe7ff; background: #f6f8ff; }

/* --- rules --- */
.rule {
  border: 0;
  border-top: 2px solid #e6e6e6;
  margin: 1.25rem 0;
}

/* --- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(#11A1D6, #0E86B2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(1.03);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.2),
    inset 0 1.5em 1em rgba(255,255,255,0.25);
}
.btn:active {
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.2),
    inset 0 1.5em 1em rgba(0,0,0,0.25);
}

.btn-ghost {
  background: #f0f0f0;
  color: #111;
  border: 1px solid #ddd;
  box-shadow: none;
}
.btn-ghost:hover { background: #e9e9e9; filter: none; }

.btn-compact { /* default: same as .btn */ }

/* --- header/nav --- */
.site-header { background: #000; color: #fff; }

.topnav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.brand {
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  margin-right: auto;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.nav-links {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0 0;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 0.65rem;
  border-radius: 10px;
}
.nav-links a:hover { background: rgba(255,255,255,0.12); }

.nav-links a.active,
.nav-links a[aria-current="page"] {
  background: rgba(255,255,255,0.18);
  color: #ffe600;
  font-weight: 900;
}
.nav-links.open { display: flex; }

/* Subhead */
.subhead {
  padding: 1rem;
  background: #111;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.series-title {
  margin: 0;
  text-align: center;
  color: #cfefff;
}

.chapter-title {
  margin: 0.75rem 0 0.25rem;
  text-align: center;
  color: #cfefff;
  font-size: 1.05rem;
}

.cta-row {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.topics {
  margin: 0.9rem auto 0;
  text-align: center;
  line-height: 1.7;
  font-size: 0.95rem;
  color: #eaeaea;
}
.topics a { color: #eaeaea; text-decoration: none; }
.topics a:hover { text-decoration: underline; }
.topic-current { color: #ffe600 !important; font-weight: 900; }
.topics-label { color: #7fd6ee; font-weight: 900; }

/* --- pager/footer --- */
.pager {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.article-footer {
  text-align: center;
  font-size: 0.95rem;
  color: #333;
}

.footer-links { margin: 0.5rem 0; }
.footer-links a { color: #003399; }

.footer-logo { margin: 1rem 0 0.5rem; }
.footer-logo img { margin: 0 auto; }

.copyright { margin-top: 0.75rem; color: #444; font-size: 0.9rem; }

/* --- small screens: compact CTAs --- */
@media (max-width: 480px) {
  .subhead { padding: 0.75rem 0.9rem; }
  .cta-row { gap: 0.4rem; }
  .cta-row .btn-compact {
    padding: 0.42rem 0.65rem;
    border-radius: 9px;
  }
}

/* --- desktop enhancements --- */
@media (min-width: 860px) {
  body { font-size: 1.2rem; }

  .topnav { max-width: 1200px; margin: 0 auto; }
  .nav-toggle { display: none; }

  .nav-links {
    display: flex;
    flex-direction: row;
    width: auto;
    padding: 0;
    margin-left: auto;
    align-items: center;
  }

  .nav-links a { padding: 0.5rem 0.75rem; }
  .subhead { padding: 1.25rem 1rem 1rem; }
  .wrap { padding: 1.5rem 1rem; }
}



