/* POC Learning Academy — shared styles for chapter pages */

:root {
  --forest: #1a3a2a;
  --forest-light: #2d5a3f;
  --fern: #6ba368;
  --fern-dark: #3d7a4d;
  --river: #1a6b7a;
  --river-light: #2891a5;
  --moon: #b8c9d8;
  --dusk: #2c3e56;
  --gold: #d4a843;
  --gold-light: #e8c76a;
  --sand: #f5f0e8;
  --sand-dark: #e8dfd2;
  --white: #fff;
  --text: #1f1f1f;
  --text-light: #5b5b5b;
  --ink: #0f1a14;
  --shadow: 0 4px 20px rgba(0,0,0,.12);
  --radius: 16px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--sand);
  color: var(--text);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ─── BREADCRUMB NAV ─── */
.crumb {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15,26,20,.95); backdrop-filter: blur(12px);
  padding: .55rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(212,168,67,.3);
  font-size: .8rem;
}
.crumb-trail {
  display: flex; gap: .55rem; align-items: center;
  color: rgba(255,255,255,.35);
  flex-wrap: wrap;
}
.crumb-trail a { color: rgba(255,255,255,.65); transition: color .25s; }
.crumb-trail a:hover { color: var(--gold-light); }
.crumb-tag {
  font-size: .7rem; padding: .25rem .75rem; border-radius: 12px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.7);
}
.navbar-links { display: flex; gap: 1rem; align-items: center; }
.navbar-links a { color: rgba(255,255,255,.65); font-size: .78rem; }
@media (max-width:640px) {
  .crumb { padding: .5rem 1rem; font-size: .72rem; }
  .crumb-trail { gap: .35rem; }
  .navbar-links a { display: none; }
}

/* ─── HERO ─── */
.chapter-hero {
  background: linear-gradient(rgba(15,26,48,0.82), rgba(26,58,82,0.92)), var(--hero-image, url('/images/pacuare/moonlit-lodge.jpg'));
  background-size: cover; background-position: center;
  color: var(--white);
  padding: 130px 2rem 70px;
  text-align: center;
  position: relative; overflow: hidden;
}
.chapter-meta {
  display: inline-flex; gap: 1rem; align-items: center;
  background: rgba(184,201,216,.15);
  border: 1px solid rgba(184,201,216,.45);
  color: var(--moon);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase;
  padding: .45rem 1.2rem; border-radius: 50px;
  margin-bottom: 1.4rem;
}
.chapter-meta .dot { opacity: .5; }
.chapter-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 4.8vw, 3.1rem);
  font-weight: 800; line-height: 1.1;
  margin-bottom: 1.1rem; letter-spacing: -.01em;
  max-width: 820px; margin-left: auto; margin-right: auto;
}
.chapter-hero .chapter-subtitle {
  font-size: 1.05rem; color: rgba(255,255,255,.85);
  max-width: 640px; margin: 0 auto;
  font-weight: 300; line-height: 1.65;
  font-family: 'Playfair Display', serif; font-style: italic;
}

/* ─── CHAPTER PROGRESS BAR ─── */
.chapter-progress {
  background: var(--white);
  border-bottom: 1px solid var(--sand-dark);
  padding: 14px 2rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .82rem;
  position: sticky; top: 44px; z-index: 50;
}
.progress-label {
  color: var(--text-light);
  font-weight: 600; letter-spacing: .05em;
}
.progress-bar {
  flex: 1; max-width: 300px; margin: 0 1.5rem;
  height: 6px; background: var(--sand-dark); border-radius: 3px;
  position: relative; overflow: hidden;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--dusk), var(--river-light));
  border-radius: 3px;
}
.chapter-nav-links { display: flex; gap: .75rem; }
.chapter-nav-links a {
  font-size: .78rem; color: var(--river); font-weight: 600;
  padding: .35rem .8rem; border-radius: 20px;
  border: 1px solid var(--sand-dark);
  background: var(--white); transition: all var(--transition);
}
.chapter-nav-links a:hover { background: var(--river); color: var(--white); border-color: var(--river); }
.chapter-nav-links a.disabled { opacity: .4; pointer-events: none; }
@media (max-width:640px) {
  .chapter-progress { padding: 10px 1rem; flex-wrap: wrap; gap: .5rem; }
  .progress-bar { order: 3; flex-basis: 100%; max-width: 100%; margin: 8px 0 0; }
  .chapter-nav-links { font-size: .72rem; }
}

/* ─── MAIN CONTENT ─── */
main.chapter-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
main.chapter-body p {
  font-size: 1.04rem;
  line-height: 1.8;
  margin-bottom: 1.3rem;
  color: var(--text);
}
main.chapter-body p + p { margin-top: 0; }
main.chapter-body strong { color: var(--forest); font-weight: 700; }
main.chapter-body em { font-style: italic; }

main.chapter-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--forest);
  margin: 2.2rem 0 1rem;
  line-height: 1.25;
  letter-spacing: -.005em;
}
main.chapter-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--forest);
  margin: 1.8rem 0 .6rem;
  line-height: 1.3;
}
main.chapter-body ol, main.chapter-body ul {
  margin: 0 0 1.4rem 1.5rem;
  font-size: 1.02rem;
  line-height: 1.8;
}
main.chapter-body li { margin-bottom: .55rem; }
main.chapter-body li::marker { color: var(--river); font-weight: 700; }

/* ─── OPENING SCENE ─── */
.opening {
  font-family: 'Playfair Display', serif;
  font-size: 1.28rem;
  line-height: 1.55;
  color: var(--forest);
  font-style: italic;
  padding: 28px 32px;
  border-left: 4px solid var(--gold);
  background: rgba(212,168,67,.06);
  border-radius: 4px;
  margin-bottom: 2rem;
}

/* ─── PULL QUOTE ─── */
.pull-quote {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--forest);
  text-align: center;
  padding: 36px 20px;
  margin: 2rem 0;
  border-top: 1px solid var(--sand-dark);
  border-bottom: 1px solid var(--sand-dark);
  font-weight: 700;
}
.pull-quote::before { content: '"'; font-size: 3rem; color: var(--gold); display: block; line-height: .3; margin-bottom: 8px; }

/* ─── ON THE PACUARE BOX ─── */
.practice-box {
  background: var(--forest);
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}
.practice-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.practice-box .practice-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.practice-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--white);
  margin: 0 0 10px;
}
.practice-box p {
  color: rgba(255,255,255,.88);
  font-size: .97rem;
  line-height: 1.75;
  margin-bottom: .9rem;
}
.practice-box p:last-child { margin-bottom: 0; }

/* Specificity overrides — main.chapter-body p/h3 rules beat .practice-box
   otherwise, making dark-green box text unreadable. These win. */
main.chapter-body .practice-box,
main.chapter-body .practice-box p,
main.chapter-body .practice-box h3,
main.chapter-body .practice-box strong {
  color: #ffffff;
}
main.chapter-body .practice-box p { color: rgba(255,255,255,.92); }
main.chapter-body .practice-box .practice-label { color: var(--gold-light); }
main.chapter-body .practice-box strong { color: var(--gold-light); }

/* ─── REFLECTION PROMPT ─── */
.reflection {
  background: var(--white);
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius);
  padding: 26px 30px;
  margin: 2rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.reflection .reflection-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--river);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: .5rem;
}
.reflection h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--forest);
  margin: 0 0 10px;
}
.reflection p {
  color: var(--text);
  font-size: .98rem;
  line-height: 1.75;
  margin-bottom: .7rem;
}
.reflection textarea {
  width: 100%;
  min-height: 110px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--sand-dark);
  border-radius: 10px;
  font-family: inherit;
  font-size: .94rem;
  background: var(--sand);
  color: var(--text);
  resize: vertical;
}
.reflection textarea:focus {
  outline: none;
  border-color: var(--river);
  background: var(--white);
}

/* ─── DRAFT TAG ─── */
.draft-tag {
  display: inline-block;
  background: rgba(212,168,67,.18);
  border: 1px solid var(--gold);
  color: #7a5a12;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 4px;
  margin-right: .5rem;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ─── QUIZ ─── */
.quiz {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 34px;
  margin: 2.5rem 0 1.5rem;
  box-shadow: var(--shadow);
}
.quiz h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--forest);
  margin: 0 0 .5rem;
}
.quiz > p { color: var(--text-light); font-size: .92rem; margin-bottom: 1.5rem; }
.quiz-q { margin-bottom: 1.5rem; }
.quiz-q > p { font-weight: 600; color: var(--forest); margin-bottom: .65rem; }
.quiz-opt {
  display: block;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--sand);
  border: 1px solid var(--sand-dark);
  border-radius: 10px;
  cursor: pointer;
  font-size: .95rem;
  transition: all var(--transition);
}
.quiz-opt:hover { border-color: var(--river); }
.quiz-opt input { margin-right: 10px; }
.quiz-opt.correct { background: rgba(107,163,104,.18); border-color: var(--fern); color: var(--fern-dark); font-weight: 600; }
.quiz-opt.incorrect { background: rgba(192,57,43,.1); border-color: #c0392b; color: #922b2b; }
.quiz-feedback {
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .9rem;
  line-height: 1.6;
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.right { background: rgba(107,163,104,.15); color: var(--fern-dark); }
.quiz-feedback.wrong { background: rgba(192,57,43,.08); color: #922b2b; }
.quiz-btn {
  background: var(--river); color: var(--white);
  border: none; padding: 12px 24px;
  border-radius: 30px; font-weight: 600;
  cursor: pointer; font-size: .92rem;
  transition: background .25s;
}
.quiz-btn:hover { background: var(--river-light); }

/* ─── CHAPTER NAV FOOTER ─── */
.chapter-nav-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
}
.chapter-nav-footer a {
  display: flex; flex-direction: column;
  padding: 18px 22px;
  background: var(--white);
  border: 1px solid var(--sand-dark);
  border-radius: 12px;
  transition: all var(--transition);
}
.chapter-nav-footer a:hover {
  border-color: var(--river);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.chapter-nav-footer a.next { text-align: right; }
.chapter-nav-footer .nav-label {
  font-size: .72rem;
  color: var(--text-light);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.chapter-nav-footer .nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--forest);
  font-weight: 700;
  line-height: 1.3;
}
.chapter-nav-footer a.disabled {
  opacity: .35;
  pointer-events: none;
}
@media (max-width:640px) {
  .chapter-nav-footer { grid-template-columns: 1fr; }
}

/* ─── FOOTER ─── */
footer.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 30px 24px;
  font-size: .8rem;
  line-height: 1.9;
}
footer.site-footer strong { color: rgba(255,255,255,.85); }
