/* ============================================================
   Bushwalking 101 — Design System
   Matching the original WordPress Aesop Story Engine theme
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colours */
  --color-primary: #00838f;          /* NPA teal (logo, accents) */
  --color-primary-light: #00acc1;    /* Link colour, hover states */
  --color-primary-dark: #006064;     /* Dark teal */
  --color-quote-bg: #004c98;         /* Deep blue quote blocks */
  --color-dark-section: #393939;     /* Dark content block bg */
  --color-dark-section-alt: #404040; /* Alternating dark bg */
  --color-text: #333333;             /* Body text */
  --color-text-light: #666666;       /* Secondary text */
  --color-text-muted: #999999;       /* Muted text, citations */
  --color-bg: #ffffff;               /* Main background */
  --color-bg-light: #f5f5f5;         /* Light section bg */
  --color-white: #ffffff;
  --color-overlay: rgba(0, 0, 0, 0.25);

  /* Typography */
  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-xxl: 6rem;

  /* Layout */
  --content-width: 780px;
  --wide-width: 1200px;
  --header-height: 60px;
}


/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  padding-top: var(--header-height);
}

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

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
}


/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-bg);
  height: var(--header-height);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 40px;
  width: auto;
}

/* Nav list */
.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 0 var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  line-height: var(--header-height);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--color-primary-light);
}

/* Search icon in nav */
.nav-search {
  display: flex;
  align-items: center;
  padding: 0 var(--space-sm);
  color: var(--color-text);
  cursor: pointer;
  line-height: var(--header-height);
}

.nav-search svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Dropdowns */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.25s ease;
  z-index: 1001;
}

.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: var(--space-xs) var(--space-md);
  font-size: 0.85rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-bg-light);
  transition: background 0.2s ease;
}

.dropdown-link:hover {
  background: var(--color-bg-light);
  color: var(--color-primary);
}

/* Hamburger (mobile) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

.menu-toggle.is-active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* ============================================================
   HERO BANNERS
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero--home {
  min-height: 35vh;
  background-attachment: fixed;
}

.hero--page {
  min-height: 45vh;
  background-attachment: fixed;
}

.hero--plain {
  background: linear-gradient(135deg, #1a8fc4 0%, #57b4d1 40%, #89cfe0 100%);
  min-height: 25vh;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  width: 100%;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  z-index: 1;
}

/* Diagonal blue stripe at bottom of hero */
.hero::after {
  display: none;
}

.hero-title {
  font-family: var(--font-body);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  font-style: normal;
  color: var(--color-white);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--color-white);
  max-width: 680px;
  margin: 0 auto;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.6;
}

/* Subtitle bar (article pages — white bar at hero bottom) */
.hero-subtitle-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  z-index: 3;
  background: var(--color-white);
  padding: var(--space-sm) var(--space-lg);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hero-subtitle-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}


/* ============================================================
   QUOTE BLOCKS
   ============================================================ */
.quote-block {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--color-bg);
}

.quote-block--home {
  padding: var(--space-lg) var(--space-md);
}

.quote-mark {
  display: block;
  height: 50px;
  font-family: "PT Serif", serif;
  font-size: 104px;
  line-height: 1;
  color: var(--color-text);
  user-select: none;
}

.quote-mark--open {
  margin-bottom: var(--space-sm);
}

.quote-mark--close {
  margin-top: var(--space-sm);
}

.quote-text {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-style: normal;
  color: var(--color-text);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
  border: none;
  padding: 0;
}

.quote-cite {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-style: normal;
  margin-top: var(--space-xs);
}

/* Blockquote in content (from markdown > quote) */
.content-prose blockquote {
  position: relative;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  margin: var(--space-lg) 0;
  border: none;
  border-left: none;
}

.content-prose blockquote::before {
  content: '\275D';
  display: block;
  font-size: 3rem;
  line-height: 1;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.content-prose blockquote::after {
  content: '\275E';
  display: block;
  font-size: 3rem;
  line-height: 1;
  color: var(--color-text);
  margin-top: var(--space-xs);
}

.content-prose blockquote p {
  font-style: italic;
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Blue quote blocks (from aesop_quote with blue bg) */
.content-prose .quote-blue {
  background: var(--color-quote-bg);
  color: var(--color-white);
  padding: var(--space-lg) var(--space-md);
  margin: var(--space-lg) calc(-50vw + 50%);
  width: 100vw;
}

.content-prose .quote-blue blockquote::before,
.content-prose .quote-blue blockquote::after {
  color: var(--color-white);
}

.content-prose .quote-blue p {
  color: var(--color-white);
}


/* ============================================================
   CARD GRIDS
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 100%;
}

.card-grid--home {
  margin: 0;
}

.card-grid--section,
.card-grid--children {
  margin: var(--space-lg) 0;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.card {
  position: relative;
  overflow: hidden;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--color-dark-section);
}

.card--image {
  cursor: pointer;
}

.card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.card:hover .card-bg {
  transform: scale(1.05);
  opacity: 0.85;
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  padding: var(--space-lg);
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  z-index: 2;
}

.card-title {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}


/* ============================================================
   CHAPTER BANNERS (Aesop Story Engine sections)
   Full-width image dividers between article sections
   ============================================================ */
.chapter-banner {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  min-height: 45vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.chapter-banner--plain {
  background: var(--color-dark-section);
  min-height: 25vh;
}

.chapter-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  width: 100%;
}

.chapter-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.chapter-title {
  font-family: "Old Standard TT", serif;
  font-size: 52px;
  line-height: 57px;
  font-weight: 300;
  color: var(--color-white);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  margin-bottom: var(--space-xs);
}

.chapter-subtitle {
  font-family: "Old Standard TT", serif;
  font-size: 29px;
  line-height: 29px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e8a735;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  margin: 0;
}


/* ============================================================
   FOOTNOTES
   ============================================================ */
.footnote a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.8em;
  font-weight: 700;
}

.footnote a:hover {
  color: var(--color-primary-dark);
}

.footnotes {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.footnotes hr {
  border: none;
  border-top: 1px solid #ddd;
  margin-bottom: var(--space-md);
}

.footnotes ol {
  padding-left: var(--space-md);
}

.footnotes li {
  margin-bottom: var(--space-xs);
}

.footnotes a {
  color: var(--color-primary);
  text-decoration: none;
}


/* ============================================================
   FIGURE / CAPTION
   ============================================================ */
.wp-caption {
  margin: var(--space-md) auto;
  max-width: 100%;
  text-align: center;
}

.wp-caption img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.wp-caption figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-xs) var(--space-sm);
  margin-top: var(--space-xs);
}


/* ============================================================
   VIDEO EMBEDS
   ============================================================ */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: var(--space-lg) auto;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* ============================================================
   CONTENT PROSE
   ============================================================ */
.content-article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) var(--space-xl);
}

.content-prose > h2:first-child {
  display: none;
}

.content-prose {
  font-size: 1.05rem;
  line-height: 1.8;
}

.content-prose h2 {
  margin: var(--space-lg) 0 var(--space-sm);
  color: #ffffff;
  font-size: 45px;
  line-height: 57px;
  font-family: "Old Standard TT", serif;
  font-weight: 300;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
}

.content-prose h3 {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 700;
  margin: var(--space-lg) 0 var(--space-xs);
  color: var(--color-text);
}

.content-prose p {
  margin-bottom: var(--space-sm);
  font-family: var(--font-heading);
}

.content-prose ul,
.content-prose ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-lg);
  font-family: var(--font-heading);
}

.content-prose li {
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
}

.content-prose img {
  margin: var(--space-md) auto;
  border-radius: 2px;
}

.content-prose strong {
  font-weight: 700;
}

.content-prose a {
  color: #3bb2d0;
  text-decoration: none;
}

.content-prose a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.content-prose a:hover {
  color: var(--color-primary-dark);
}

/* Tables */
.content-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 0.95rem;
}

.content-prose th,
.content-prose td {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid #ddd;
  text-align: left;
}

.content-prose th {
  background: var(--color-bg-light);
  font-weight: 700;
}

.content-prose tr:nth-child(even) {
  background: var(--color-bg-light);
}

/* Character/Author bios */
.author-bio {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.author-bio img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-bio .author-info {
  flex: 1;
}

.author-bio .author-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: var(--space-xs);
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-dark-section);
  color: var(--color-white);
  padding: var(--space-lg) var(--space-md);
  margin-top: var(--space-xl);
}

.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.footer-brand a {
  color: var(--color-primary-light);
  font-weight: 600;
}

.footer-brand a:hover {
  color: var(--color-white);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-white);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #333;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 999;
  }

  .main-nav.is-open {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    padding: var(--space-md);
  }

  .nav-link {
    line-height: 3;
    font-size: 0.9rem;
    padding: 0;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: var(--space-md);
  }

  .dropdown-link {
    border-bottom: none;
    padding: var(--space-xs) 0;
  }

  .hero--home,
  .hero--page {
    background-attachment: scroll; /* Fix parallax on mobile */
    min-height: 35vh;
  }

  .chapter-banner {
    background-attachment: scroll;
    min-height: 30vh;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .hero-subtitle-bar {
    margin-left: var(--space-sm);
    margin-right: var(--space-sm);
  }

  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .content-article {
    padding: var(--space-md) var(--space-sm);
  }
}
