/* ============================================================
   KireKids — Site Stylesheet
   Warm, literary, editorial design for a children's publisher
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400;1,8..60,500&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* --- Tokens --- */
:root {
  --bg: #FAF6F1;
  --bg-warm: #F4EDE4;
  --bg-card: #FFFFFF;
  --text: #2C3E50;
  --text-light: #5D6D7E;
  --heading: #1B3149;
  --navy: #1B3149;
  --green: #5B7B5E;
  --green-light: #E8F0E8;
  --terracotta: #B8633E;
  --terracotta-light: #F5E6DD;
  --gold: #C49A3C;
  --border: #D4CBB8;
  --border-light: #E8E0D4;
  --shadow: rgba(27, 49, 73, 0.06);
  --shadow-md: rgba(27, 49, 73, 0.1);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-ui: 'DM Sans', -apple-system, sans-serif;
  --max-width: 1140px;
  --max-prose: 720px;
  --radius: 6px;
  --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; }

/* --- Base --- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.25;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; font-weight: 600; }
h5 { font-size: 0.85rem; font-family: var(--font-ui); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); }
p + p { margin-top: 1em; }
strong { font-weight: 600; }
em { font-style: italic; }
blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--green);
  border-left: 3px solid var(--green);
  padding: 0.5em 0 0.5em 1.5em;
  margin: 2rem 0;
}

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.prose { max-width: var(--max-prose); }
.section { padding: 5rem 0; }
.section--warm { background: var(--bg-warm); }
.section--navy { background: var(--navy); color: #E8E0D4; }
.section--navy h2, .section--navy h3 { color: #FFFFFF; }
.section--navy .label { color: var(--gold); }
.text-center { text-align: center; }

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 241, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.nav-logo img { height: 36px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-links a {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg-warm);
  color: var(--heading);
}
.nav-links a.nav-cta {
  background: var(--terracotta);
  color: #FFFFFF;
  font-weight: 600;
}
.nav-links a.nav-cta:hover {
  background: #A35530;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--heading);
  position: absolute;
  left: 7px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle span:nth-child(1) { top: 10px; }
.nav-toggle span:nth-child(2) { top: 17px; }
.nav-toggle span:nth-child(3) { top: 24px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  padding: 1.5rem;
  z-index: 99;
  overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.mobile-nav a:last-child { border-bottom: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

/* --- Back link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  padding: 1.25rem 0 0;
  transition: color var(--transition);
}
.back-link:hover { color: var(--terracotta); }

/* --- Hero --- */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero h1 {
  max-width: 800px;
  margin: 0 auto 1.25rem;
}
.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 2rem;
}
.hero-note {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 2rem;
}
.hero-aside {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--green);
  margin-top: 0.75rem;
}

/* --- Subpage hero --- */
.subpage-hero {
  padding: 3rem 0 2.5rem;
}
.subpage-hero .label {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terracotta);
  margin-bottom: 0.75rem;
}
.subpage-hero h1 { margin-bottom: 1rem; }
.subpage-hero .meta {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--terracotta); color: #FFF; }
.btn--primary:hover { background: #A35530; }
.btn--secondary { background: var(--navy); color: #FFF; }
.btn--secondary:hover { background: #15263A; }
.btn--outline {
  background: transparent;
  color: var(--heading);
  border: 1.5px solid var(--border);
}
.btn--outline:hover { border-color: var(--heading); background: var(--bg-warm); }
.btn--ghost {
  background: transparent;
  color: var(--terracotta);
  padding: 0.5rem 0;
  font-weight: 600;
}
.btn--ghost:hover { color: #A35530; }
.btn-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn-group--center { justify-content: center; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateY(-2px);
}
.card .label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terracotta);
  margin-bottom: 0.5rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--text-light); font-size: 0.95rem; }
.card .card-footer {
  margin-top: 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--terracotta);
}

/* Card grid */
.card-grid {
  display: grid;
  gap: 1.5rem;
}
.card-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* --- Pathway cards (book selection) --- */
.pathway-card {
  display: block;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pathway-card:hover {
  border-color: var(--terracotta);
  box-shadow: 0 4px 20px var(--shadow);
}
.pathway-card .pathway-theme {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.pathway-card h3 { margin-bottom: 0.5rem; font-size: 1.25rem; }
.pathway-card .pathway-meta {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}
.pathway-card .pathway-quote {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--green);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.pathway-card .pathway-desc {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.pathway-card .card-footer {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--terracotta);
}

/* --- Stats --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
}
.stat { text-align: center; }
.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--terracotta);
  line-height: 1.1;
}
.stat-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

/* --- Proverb / pullquote --- */
.proverb {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-warm);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.proverb-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--heading);
  max-width: 500px;
  margin: 0 auto 0.75rem;
}
.proverb-source {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-light);
}

/* --- FAQ / Accordion --- */
.faq-item {
  border-bottom: 1px solid var(--border-light);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1.25rem 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-light);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-item.open .faq-question::after {
  content: '−';
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer-inner {
  padding-bottom: 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
}
.faq-answer-inner a {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Journal / companion list --- */
.companion-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.companion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.companion-item h4 {
  font-family: var(--font-display);
  margin-bottom: 0.4rem;
}
.companion-item p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- Resource links --- */
.resource-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.resource-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--terracotta);
  transition: color var(--transition);
}
.resource-links a:hover { color: #A35530; text-decoration: underline; }

/* --- Pricing table --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.pricing-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.pricing-card .pricing-pct {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--terracotta);
}
.pricing-card .pricing-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* --- Form --- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--heading);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--terracotta);
}
.form-group textarea { min-height: 100px; resize: vertical; }

/* --- Email signup --- */
.signup-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 560px;
}
.signup-box h3 { margin-bottom: 0.75rem; }
.signup-box p { font-size: 0.92rem; color: var(--text-light); margin-bottom: 1.25rem; }
.signup-box ul { margin-bottom: 1.5rem; }
.signup-box li {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text);
  padding: 0.3rem 0 0.3rem 1.25rem;
  position: relative;
}
.signup-box li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}
.signup-fine {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

/* --- Two-column layout --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
}

/* --- Educator tag pills --- */
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.tag-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.tag-card h4 { font-size: 1rem; margin-bottom: 0.4rem; }
.tag-card p { font-size: 0.85rem; color: var(--text-light); }

/* --- Sources --- */
.sources {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 1.5rem;
}

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: #B8C4D0;
  padding: 3.5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.footer-brand p {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: #8899AA;
}
.footer-brand img { height: 28px; margin-bottom: 0.5rem; filter: brightness(10); }
.footer-col h5 {
  color: #E8E0D4;
  text-transform: uppercase;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.footer-col a {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: #B8C4D0;
  padding: 0.25rem 0;
  transition: color var(--transition);
}
.footer-col a:hover { color: #FFFFFF; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding: 1.25rem 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: #8899AA;
  text-align: center;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Utility --- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.5s ease both;
}
.fade-up-d1 { animation-delay: 0.1s; }
.fade-up-d2 { animation-delay: 0.2s; }
.fade-up-d3 { animation-delay: 0.3s; }
