/* ============================================================
   TugTale — Global Styles
   Baloo 2 (headings) + Nunito (body)
   Mobile-first, single-column, max-width 720px
   ============================================================ */

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

/* ---- Reset & Base ----------------------------------------- */

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

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: #2c2c2c;
  background-color: var(--color-bg, #fdfaf5);
}

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

a {
  color: var(--color-primary, #c8922a);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid var(--color-primary, #c8922a);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Typography ------------------------------------------- */

h1, h2, h3, h4 {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-primary, #c8922a);
}

p {
  margin-bottom: 1.25rem;
}

p:last-child {
  margin-bottom: 0;
}

/* ---- Layout Container ------------------------------------- */

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Ad Slot ---------------------------------------------- */

.ad-slot {
  border: 1px dashed rgba(0, 0, 0, 0.15);
  padding: 1.5rem 1rem;
  text-align: center;
  color: #999;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5rem auto;
  max-width: 728px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.02);
}

/* ---- Story Nav -------------------------------------------- */

.story-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-primary, #c8922a);
  color: #fff;
  padding: 0.6rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.story-nav .container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.story-nav .nav-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.story-nav .nav-chapters {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  flex: 1;
}

.story-nav .nav-chapters a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.story-nav .nav-chapters a:hover,
.story-nav .nav-chapters a:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
}

.story-nav .nav-donate {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  white-space: nowrap;
  transition: background 0.15s;
}

.story-nav .nav-donate:hover,
.story-nav .nav-donate:focus-visible {
  background: rgba(255, 255, 255, 0.35);
  text-decoration: none;
}

/* ---- Hero Section ----------------------------------------- */

.hero {
  padding: 3rem 0 2.5rem;
  text-align: center;
  background-color: var(--color-accent, #e8d5a3);
}

.hero-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.hero-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary, #c8922a);
  margin-bottom: 0.6rem;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.25rem);
  color: var(--color-primary, #c8922a);
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  color: #4a4a4a;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---- Chapter Sections ------------------------------------- */

.chapter {
  padding: 3rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.chapter:last-of-type {
  border-bottom: none;
}

.chapter-number {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 5rem;
  line-height: 1;
  color: var(--color-accent, #e8d5a3);
  margin-bottom: -0.75rem;
  user-select: none;
}

.chapter-title {
  font-size: 1.6rem;
  color: var(--color-primary, #c8922a);
  margin-bottom: 1.5rem;
}

.chapter-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ---- Field Notes ------------------------------------------ */

.field-notes {
  background-color: var(--color-accent, #e8d5a3);
  padding: 2.5rem 0;
  margin: 2rem 0;
}

.field-notes h2 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.field-notes ul {
  list-style: none;
  padding: 0;
}

.field-notes ul li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
  line-height: 1.6;
}

.field-notes ul li:last-child {
  border-bottom: none;
}

.field-notes ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary, #c8922a);
}

/* ---- Donate CTA ------------------------------------------- */

.donate-section {
  padding: 3rem 0;
  text-align: center;
  background-color: var(--color-secondary-bg, var(--color-bg, #fdfaf5));
}

.donate-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.donate-section p {
  color: #555;
  max-width: 520px;
  margin: 0 auto 1.75rem;
}

.donate-btn {
  display: inline-block;
  background-color: var(--color-primary, #c8922a);
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.donate-btn:hover,
.donate-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  background-color: var(--color-secondary, #c8922a);
  filter: brightness(1.08);
}

/* ---- Footer ----------------------------------------------- */

.site-footer {
  background-color: #2c2c2c;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
}

.site-footer .footer-dot {
  margin: 0 0.6em;
  opacity: 0.4;
}

/* ---- Back link -------------------------------------------- */

.back-link-bar {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  background: var(--color-bg, #fdfaf5);
}

.back-link-bar a {
  font-weight: 700;
  color: var(--color-primary, #c8922a);
}

/* ---- Homepage Styles -------------------------------------- */

.homepage {
  background: #fdf8f2;
}

.homepage-header {
  text-align: center;
  padding: 3.5rem 1.25rem 2.5rem;
  background: linear-gradient(160deg, #fef3e2 0%, #fdf8f2 60%);
}

.homepage-header .site-logo {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 5.5rem);
  color: #c8732a;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.homepage-header .site-tagline {
  font-size: 1.05rem;
  font-weight: 600;
  color: #7a6a55;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.homepage-header .header-desc {
  margin-top: 1rem;
  font-size: 1rem;
  color: #5a4e40;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.stories-grid {
  padding: 2rem 1.25rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.stories-grid h2 {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #b8a080;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 580px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.story-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.story-card:focus-within {
  outline: 3px solid #c8732a;
  outline-offset: 2px;
}

.story-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e8ddd0;
}

.story-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.story-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.story-card-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 1.1rem;
  color: #2c2c2c;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.story-card-tagline {
  font-size: 0.88rem;
  color: #6a5e50;
  line-height: 1.5;
  flex: 1;
  margin-bottom: 1rem;
}

.story-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--card-color, #c8732a);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: gap 0.15s;
}

.story-card-link:hover {
  gap: 0.5rem;
  text-decoration: none;
}

.story-card a.story-card-link::after {
  content: '';
}

.homepage-ad {
  max-width: 728px;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
}

/* ---- Responsive tweaks for story pages ------------------- */

@media (min-width: 720px) {
  .hero {
    padding: 4rem 0 3rem;
  }

  .chapter {
    padding: 4rem 0;
  }

  .chapter-number {
    font-size: 7rem;
  }
}
