@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Quicksand:wght@500;600;700&display=swap');

:root {
  --cream: #FFF8ED;
  --coral: #FF6B6B;
  --coral-dark: #E8534F;
  --teal: #2FBFB0;
  --teal-dark: #1F9C90;
  --yellow: #FFD93D;
  --purple: #8A6FDF;
  --ink: #2E2440;
  --ink-soft: #524a63;
  --radius: 20px;
  --shadow: 0 6px 0 rgba(46,36,64,0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 19px;
  line-height: 1.6;
}

h1, h2, h3, .title-font {
  font-family: 'Baloo 2', cursive;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--coral);
  color: #fff;
  padding: 22px 0;
  border-bottom: 6px solid var(--coral-dark);
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.site-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0;
}
.site-title a { display: flex; align-items: baseline; gap: 10px; }
.byline {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.95;
}
.main-nav {
  margin-top: 10px;
}
.main-nav a {
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: 22px;
  padding: 6px 4px;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover, .main-nav a:focus { border-bottom-color: #fff; }

main { padding: 40px 0 60px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease;
  min-height: 48px;
}
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0; }

/* Story cards / grid */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 28px;
}
.story-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.story-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
}
.story-card-link img { width: 100%; height: 170px; object-fit: cover; background: #eee; }
.story-card-link .card-body { padding: 18px 20px 10px; flex: 1; display: flex; flex-direction: column; }
.story-card h3 { margin: 0 0 6px; font-size: 1.4rem; }
.story-meta { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; }
.tag {
  background: var(--cream);
  border: 2px solid var(--yellow);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 6px;
}
.section-lede { color: var(--ink-soft); margin-top: 0; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--teal) 0%, var(--purple) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-bottom: 10px;
}
.hero h2 { font-size: 2.1rem; margin: 0 0 10px; }
.hero p { font-size: 1.15rem; margin: 0; opacity: 0.96; }

/* Category chips list */
.category-list { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.category-chip {
  background: #fff;
  border: 3px solid var(--purple);
  color: var(--purple);
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.category-chip:hover { background: var(--purple); color: #fff; }

/* Story page */
.story-cover {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.story-title { font-size: 2.4rem; margin: 0 0 6px; }
.story-byline { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 20px; }
.story-body { font-size: 1.2rem; }
.story-body p { margin: 0 0 22px; }
.illustration-block { margin: 30px 0; text-align: center; }
.illustration-block img { border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 auto; }
.illustration-caption { font-size: 0.95rem; color: var(--ink-soft); margin-top: 10px; font-style: italic; }

/* Share buttons */
.share-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 26px 0; }
.share-label { font-weight: 700; font-family: 'Baloo 2', cursive; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 700;
  min-height: 44px;
}
.share-whatsapp { background: #25D366; color: #fff; }
.share-email { background: var(--ink); color: #fff; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 30px 0;
  text-align: center;
  font-size: 0.95rem;
}
.site-footer a { text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
  .site-title { font-size: 1.9rem; }
  .story-title { font-size: 1.9rem; }
  body { font-size: 18px; }
  .hero { padding: 28px 20px; }
}

/* No-JS friendly focus states for accessibility */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* The print-book layout is a print-only view built from the same story
   content. It must stay hidden on screen — only print.css should reveal
   it (during window.print). Without this rule it rendered right below
   the normal story text on every story page. */
.print-book {
  display: none;
}
