/* ==========================================================================
   Built to Run — Shared Book Styles
   robmcquade.com/built-to-run
   Referenced by all book pages (introduction, chapters, conclusion)
   ========================================================================== */

/* --- BOOK HERO --- */
.book-hero {
  padding: 8rem 2rem 4rem;
  background: var(--ink);
  color: var(--warm-white);
  text-align: center;
}

.book-hero-inner { max-width: 700px; margin: 0 auto; }

.book-hero-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper-light);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.book-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.8s ease 0.4s forwards;
}

.book-hero-subtitle {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--stone);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.book-hero-author {
  font-size: 0.9rem;
  color: var(--copper-light);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s ease 0.8s forwards;
}

.book-hero-author a {
  color: var(--copper-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 149, 109, 0.4);
  transition: border-color 0.3s;
}

.book-hero-author a:hover { border-color: var(--copper-light); }

/* --- CHAPTER CONTENT --- */
.chapter {
  padding: 5rem 2rem;
  background: var(--warm-white);
}

.chapter-inner {
  max-width: 680px;
  margin: 0 auto;
}

.chapter-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper-dark);
  margin-bottom: 2rem;
  text-align: center;
}

.chapter p {
  font-size: 1.08rem;
  line-height: 1.9;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
}

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

.chapter h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  scroll-margin-top: 5rem;
}

.chapter h3 {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin-top: 3rem;
  margin-bottom: 1rem;
  scroll-margin-top: 5rem;
}

.chapter h4 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 5rem;
}

.chapter strong {
  color: var(--ink);
  font-weight: 600;
}

.chapter em {
  font-style: italic;
}

/* --- PULL QUOTES --- */
.pull-quote {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--ink);
  border-left: 3px solid var(--copper-dark);
  padding: 1.5rem 0 1.5rem 2rem;
  margin: 3rem 0;
}

/* --- FOOTNOTES --- */
.footnotes {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.footnotes-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--copper-dark);
  margin-bottom: 1.5rem;
}

.footnote {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  text-indent: -1.5rem;
}

.footnote a {
  word-break: break-all;
}

/* --- CHAPTER NAVIGATION --- */
.chapter-nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule);
}

.chapter-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--copper-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s, color 0.3s;
}

.chapter-nav a:hover {
  gap: 0.75rem;
  color: var(--ink);
}

.chapter-nav-spacer { flex: 1; }

/* --- FLOATING SIDEBAR TOC --- */
.sidebar-toc {
  position: fixed;
  left: 2rem;
  width: 315px;
  z-index: 50;
  display: none;
  opacity: 0;
}

.sidebar-toc-list {
  list-style: none;
}

.sidebar-toc-item {
  padding: 0.25rem 0;
}

.sidebar-toc-item a {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-light);
  text-decoration: none;
  display: block;
  padding: 0.15rem 0 0.15rem 0.75rem;
  border-left: 1.5px solid var(--rule);
  transition: color 0.3s, border-color 0.3s;
}

.sidebar-toc-item a:hover {
  color: var(--copper-dark);
  border-color: var(--copper-dark);
}

.sidebar-toc-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.1rem;
}

.sidebar-toc-title {
  display: block;
}

.sidebar-toc-item.current > a {
  color: var(--copper-dark);
  border-color: var(--copper-dark);
  font-weight: 500;
}

.sidebar-toc-item.unavailable > a {
  color: #6e7178;
}

.sidebar-toc-item.unavailable > a:hover {
  color: var(--copper-dark);
  border-color: var(--copper-dark);
}

/* Section jump links within current chapter */
.sidebar-sections {
  list-style: none;
  margin: 0.2rem 0 0.3rem 0;
}

.sidebar-sections li {
  padding: 0.1rem 0;
}

.sidebar-sections a {
  font-size: 0.7rem;
  line-height: 1.45;
  color: #6e7178;
  text-decoration: none;
  display: block;
  padding: 0.1rem 0 0.1rem 1.25rem;
  border-left: 1.5px solid var(--rule);
  transition: color 0.3s, border-color 0.3s;
}

.sidebar-sections a:hover {
  color: var(--copper-dark);
  border-color: var(--copper-dark);
}

.sidebar-sections li.active a {
  color: var(--copper-dark);
  border-color: var(--copper-dark);
}

@media (min-width: 1440px) {
  .sidebar-toc {
    display: block;
  }
}

/* --- CHAPTER PREVIEW / BOTTOM TOC --- */
.chapter-preview {
  padding: 5rem 2rem;
  background: var(--stone-light);
  border-top: 1px solid var(--rule);
}

.chapter-preview-inner { max-width: 680px; margin: 0 auto; }

.chapter-preview h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 2rem;
}

.toc-list { list-style: none; }

.toc-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
}

.toc-item:first-child { border-top: 1px solid var(--rule); }

.toc-item a {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  text-decoration: none;
  color: var(--ink);
  width: 100%;
  transition: color 0.3s;
}

.toc-item a:hover { color: var(--copper-dark); }
.toc-item.unavailable a { color: var(--ink-light); }
.toc-item.unavailable a:hover { color: var(--copper-dark); }
.toc-item.current a { color: var(--copper-dark); }

.toc-phase {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper-dark);
  min-width: 6.5rem;
  flex-shrink: 0;
}

.toc-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: inherit;
}

/* --- NOTIFY SIGNUP --- */
.notify {
  padding: 4.5rem 2rem;
  background: var(--warm-white);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.notify-inner { max-width: 480px; margin: 0 auto; }

.notify h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.notify p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin-bottom: 1.75rem;
}

.notify-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
}

.notify-form input[type="email"] {
  padding: 0.8rem 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--stone-light);
  border: 1px solid var(--rule);
  outline: none;
  transition: border-color 0.3s;
}

.notify-form textarea {
  padding: 0.8rem 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--stone-light);
  border: 1px solid var(--rule);
  outline: none;
  resize: vertical;
  min-height: 4.5rem;
  transition: border-color 0.3s;
}

.notify-form input[type="email"]::placeholder,
.notify-form textarea::placeholder {
  color: var(--ink-light);
  opacity: 0.6;
}

.notify-form input[type="email"]:focus,
.notify-form textarea:focus {
  border-color: var(--copper-dark);
}

.notify-form button {
  padding: 0.8rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--warm-white);
  background: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.notify-form button:hover {
  background: var(--copper-dark);
  border-color: var(--copper-dark);
}

.notify-thanks {
  display: none;
  font-size: 0.95rem;
  color: var(--copper-dark);
  font-weight: 500;
}

/* --- AUTHOR CTA --- */
.author-cta {
  padding: 5rem 2rem;
  background: var(--ink);
  color: var(--stone);
}

.author-cta-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.author-cta h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--warm-white);
  margin-bottom: 1.5rem;
}

.author-cta p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--stone);
  opacity: 0.85;
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.author-cta-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.author-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid rgba(232, 226, 217, 0.2);
  color: var(--stone-light);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.author-cta-link:hover {
  border-color: var(--copper);
  color: var(--warm-white);
  background: rgba(158, 124, 90, 0.1);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .book-hero { padding: 6rem 1.5rem 3rem; }
  .chapter { padding: 3.5rem 1.5rem; }
  .chapter-preview { padding: 3.5rem 1.5rem; }
  .author-cta { padding: 3.5rem 1.5rem; }
  .pull-quote { font-size: 1.15rem; padding-left: 1.5rem; }
  .chapter-nav { padding: 2rem 1.5rem; }
  .toc-item { flex-direction: column; gap: 0.25rem; }
  .author-cta-links { flex-direction: column; }
  .author-cta-link { justify-content: center; }
}
