/* page-extras.css — consolidated inline styles extracted for CSP tightening (S203).
   Loaded after base.css / cards.css / nav.css / footer.css on every page.

   PHASE 4 DEPENDENCY: The article page template (generate-blog-post.ts)
   must emit <body class="article-page"> for the body.article-page rules
   at the bottom of this file to apply. Without that class, article pages
   lose their dark footer, custom prose widths, and section padding. */

/* =============== book-page =============== */

.affiliate-link-note {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.book-hero {
  padding: var(--space-8) 0 var(--space-12);
}

.book-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (min-width: 768px) {
  .book-hero__grid {
    grid-template-columns: 300px 1fr;
    gap: var(--space-10);
  }
}

@media (min-width: 1024px) {
  .book-hero__grid {
    grid-template-columns: 340px 1fr;
  }
}

.book-hero__cover {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.book-hero__cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.book-hero__meta h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
}

.book-hero__author {
  font-size: var(--text-lg);
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.book-hero__author a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.book-hero__author a:hover {
  color: var(--rose);
}

.book-hero__details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: var(--muted);
}

.book-hero__detail {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.book-hero__detail strong {
  color: var(--charcoal);
}

.book-hero__spice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.book-hero__spice-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--charcoal);
}

.book-hero__tropes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.book-hero__cta {
  margin-bottom: var(--space-6);
}

.book-hero__cta .btn {
  font-size: var(--text-base);
  padding: 0.85rem 2rem;
}

.content-warnings {
  margin-bottom: var(--space-6);
}

.content-warnings__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  padding: var(--space-2) 0;
  transition: color var(--ease-default);
}

.content-warnings__toggle:hover {
  color: var(--charcoal);
}

.content-warnings__toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--ease-default);
}

.content-warnings__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.content-warnings__list {
  display: none;
  padding: var(--space-4);
  margin-top: var(--space-2);
  background: var(--rose-light);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--charcoal);
  line-height: 1.6;
}

.content-warnings__list.is-open {
  display: block;
}

.content-warnings__list ul {
  list-style: disc;
  padding-left: var(--space-5);
}

.content-warnings__list li {
  margin-bottom: var(--space-1);
}

.synopsis {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
}

.synopsis h2 {
  margin-bottom: var(--space-4);
}

.synopsis__text {
  max-width: 720px;
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--charcoal);
}

.synopsis__text p {
  margin-bottom: var(--space-4);
}

.similar-books {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
}

.similar-books h2 {
  margin-bottom: var(--space-6);
}

/* book-page conditional style="" replacements (high-spice only) */
.alt-purchase {
  margin-top: 16px;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 8px;
  font-size: 14px;
  color: #666;
}

.alt-purchase__label {
  margin: 0 0 8px;
}

.alt-purchase__body {
  margin: 0;
}

/* =============== trope-hub =============== */

.trope-hero {
  padding: var(--space-10) 0 var(--space-8);
  text-align: center;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.trope-hero h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.trope-hero h1 span {
  color: var(--rose);
}

.trope-hero__intro {
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto var(--space-6);
  line-height: 1.6;
}

.trope-hero__description {
  font-size: var(--text-base);
  color: var(--charcoal);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
}

.trope-content {
  padding: var(--space-8) 0;
}

.trope-content__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .trope-content__layout {
    grid-template-columns: 1fr 280px;
  }
}

.book-count {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-6);
}

.book-count strong {
  color: var(--charcoal);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.sidebar__section h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--rose);
}

.sidebar__trope-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar__trope-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--charcoal);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: border-color var(--ease-default), background var(--ease-default);
}

.sidebar__trope-link:hover {
  border-color: var(--rose);
  background: var(--rose-light);
  color: var(--charcoal);
}

.sidebar__trope-count {
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--border-light);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
}

.faq {
  padding: var(--space-12) 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.faq h2 {
  text-align: center;
  margin-bottom: var(--space-8);
}

.faq__list {
  max-width: 720px;
  margin: 0 auto;
}

.faq__item {
  border-bottom: 1px solid var(--border);
}

.faq__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-5) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--charcoal);
  text-align: left;
  line-height: 1.4;
  transition: color var(--ease-default);
}

.faq__question:hover {
  color: var(--rose);
}

.faq__question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-left: var(--space-4);
  color: var(--muted);
  transition: transform var(--ease-default);
}

.faq__question[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq__answer {
  display: none;
  padding: 0 0 var(--space-5) 0;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.7;
}

.faq__answer.is-open {
  display: block;
}

@media (max-width: 640px) {
  .trope-hero h1 {
    font-size: var(--text-2xl);
  }
}

/* =============== author-hub =============== */

.author-hero {
  padding: var(--space-10) 0 var(--space-8);
  text-align: center;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.author-hero h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.author-hero h1 span {
  color: var(--rose);
}

.author-hero__subtitle {
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

.author-content {
  padding: var(--space-8) 0;
}

@media (max-width: 640px) {
  .author-hero h1 {
    font-size: var(--text-2xl);
  }
}

/* =============== homepage =============== */

.home-hero {
  padding: var(--space-8) 0 var(--space-6);
  border-bottom: 1px solid var(--border);
}

.home-hero .container {
  display: block;
}

.home-hero__left {
  max-width: 100%;
  margin-bottom: var(--space-6);
}

.home-hero__headline {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-4);
  color: var(--charcoal);
}

.home-hero__headline span {
  color: var(--rose);
}

.home-hero__headline span:not(.trope-rotate) {
  font-style: italic;
}

.trope-rotate {
  display: inline-block;
  min-width: 0;
  transition: opacity 0.5s ease;
}

.trope-rotate.fade-out { opacity: 0; }
.trope-rotate.fade-in  { opacity: 1; }

@media (max-width: 640px) {
  .trope-rotate { display: block; }
}

.trope-scroll-strip {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: var(--space-2) 0;
}

.trope-scroll-strip::-webkit-scrollbar { display: none; }

.trope-scroll-strip .trope-card {
  display: inline-block;
  vertical-align: top;
  white-space: normal;
  width: 180px;
  margin-right: var(--space-3);
  text-align: center;
}

.trope-scroll-strip .trope-card:last-child {
  margin-right: 0;
}

.trope-scroll-strip .all-tropes-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: top;
  width: 140px;
  height: 100%;
  min-height: 120px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--rose);
  text-decoration: none;
  white-space: normal;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  transition: border-color var(--ease-default), background var(--ease-default);
}

.trope-scroll-strip .all-tropes-link:hover {
  border-color: var(--rose);
  background: var(--rose-light);
}

.home-hero__sub {
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: var(--space-5);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.home-hero__search {
  position: relative;
  max-width: 480px;
}

.home-hero__search input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  font-size: var(--text-sm);
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  color: var(--charcoal);
  outline: none;
  transition: border-color var(--ease-default);
}

.home-hero__search input:focus {
  border-color: var(--rose);
}

.home-hero__search input::placeholder {
  color: var(--muted-light);
}

.home-hero__search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted-light);
  pointer-events: none;
}

.home-hero__right {
  flex: 1;
  min-width: 0;
}

.trope-selector__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.trope-selector__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (max-width: 640px) {
  .trope-selector__pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-2);
  }
  .trope-selector__pills::-webkit-scrollbar { display: none; }
}

.trope-pill-link {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--charcoal);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all var(--ease-default);
  white-space: nowrap;
}

.trope-pill-link:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--rose-light);
}

.trope-pill-link--more {
  color: var(--rose);
  border-color: var(--rose);
  font-weight: 600;
}

.trope-pill-link--more:hover {
  background: var(--rose);
  color: #fff;
}

.grid--6 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.home-grid .book-card__cover {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: top center;
}

.home-grid .book-card__body {
  padding: var(--space-3) var(--space-3) var(--space-4);
}

.home-grid .book-card__title {
  font-size: var(--text-sm);
  line-height: 1.25;
}

.home-grid .book-card__author {
  font-size: var(--text-xs);
  margin-bottom: var(--space-2);
}

.home-grid .book-card__tropes {
  display: none;
}

.home-grid .book-card__spice-badge {
  top: var(--space-2);
  right: var(--space-2);
  padding: 0.15rem 0.3rem;
}

.home-grid .book-card__spice-dot {
  width: 6px;
  height: 6px;
}

@media (max-width: 768px) {
  .home-hero .container {
    flex-direction: column;
    gap: var(--space-6);
  }

  .home-hero__left {
    max-width: 100%;
  }

  .home-hero__headline {
    font-size: 2.5rem;
  }

  .home-hero__search {
    max-width: 100%;
  }
}

.trope-quiz-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  color: #1c1917;
  background: #fff;
  border: 2px solid #e7e5e4;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.trope-quiz-pill:hover {
  border-color: #e11d48;
  color: #e11d48;
}

.trope-quiz-pill.selected {
  background: #e11d48;
  border-color: #e11d48;
  color: #fff;
}

/* homepage inline style="" replacements */

.trope-selector__link {
  text-decoration: none;
  color: inherit;
}

.trope-selector__arrow {
  color: var(--rose);
  margin-left: 4px;
}

.search-results {
  display: none;
  padding: var(--space-6) 0;
}

.section--pt-8 {
  padding-top: var(--space-8);
}

/* Modifier for homepage section-header (replaces inline margin-bottom override).
   Phase 4 adds .section-header--tight to the specific homepage usage. */
.section-header--tight {
  margin-bottom: var(--space-6);
}

.email-cta {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, #fff1f2 0%, #faf5f0 100%);
}

.email-cta__heading {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: #1c1917;
}

.email-cta__subhead {
  color: #78716c;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

.subscribe-form {
  max-width: 640px;
  margin: 0 auto;
}

.quiz-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #78716c;
  margin-bottom: 0.75rem;
}

.trope-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.quiz-next-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: #d4d4d4;
  border: none;
  border-radius: 50px;
  cursor: not-allowed;
  transition: all 0.2s;
}

.quiz-step {
  display: none;
}

.spice-slider-wrap {
  max-width: 360px;
  margin: 0 auto 1.5rem;
}

.spice-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #78716c;
  margin-bottom: 0.25rem;
}

.spice-slider {
  width: 100%;
  accent-color: #e11d48;
}

.spice-display {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  letter-spacing: 0.15em;
}

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

.subscribe-input {
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #e7e5e4;
  border-radius: 50px;
  background: #fff;
  color: #1c1917;
  outline: none;
  transition: border-color 0.2s;
}

.subscribe-btn {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: #e11d48;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}

.subscribe-msg {
  font-size: 0.8rem;
  color: #a8a29e;
  margin-top: 1rem;
}

/* =============== hand-written pages (about, 404, spice-guide, privacy, disclosure) =============== */

.about-content {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-12) var(--gutter);
}

.about-content h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
  text-align: center;
}

.about-content h1 span {
  color: var(--rose);
}

.about-content h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.about-content p {
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--charcoal);
  margin-bottom: var(--space-4);
}

.about-content .lead {
  font-size: var(--text-lg);
  color: var(--muted);
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.about-content a {
  color: var(--rose);
}

.about-content a:hover {
  color: var(--berry);
}

.about-highlight {
  background: var(--rose-light);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin: var(--space-8) 0;
}

.about-highlight p {
  margin-bottom: 0;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  text-align: center;
  margin: var(--space-8) 0;
}

.about-stats__item {
  padding: var(--space-4);
}

.about-stats__number {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--rose);
  display: block;
}

.about-stats__label {
  font-size: var(--text-sm);
  color: var(--muted);
}

@media (max-width: 640px) {
  .about-content h1 {
    font-size: var(--text-2xl);
  }

  .about-stats {
    grid-template-columns: 1fr;
  }
}

.not-found { text-align: center; padding: var(--space-16) 0; }
.not-found h1 { font-size: var(--text-3xl); margin-bottom: var(--space-4); }
.not-found p { font-size: var(--text-md); color: var(--muted); max-width: 480px; margin: 0 auto var(--space-8); line-height: 1.7; }
.not-found .btn {
  display: inline-block;
  background: var(--rose);
  color: #fff;
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-md);
}
.not-found .btn:hover { opacity: 0.9; }

/* spice-guide .prose (scoped to .spice-guide-page to avoid colliding with
   other .prose usages site-wide). Phase 4 adds class="spice-guide-page" to
   the spice-guide.html body. */
.spice-guide-page .prose { max-width: 720px; margin: 0 auto; }
.spice-guide-page .prose h2 { margin-top: var(--space-10); margin-bottom: var(--space-4); font-size: var(--text-xl); }
.spice-guide-page .prose p { font-size: var(--text-md); line-height: 1.7; color: var(--charcoal); }

.spice-scale { display: flex; flex-direction: column; gap: var(--space-6); margin: var(--space-8) 0; }

.spice-level {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-6);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--ease-default), box-shadow var(--ease-default);
}

.spice-level:hover {
  border-color: var(--rose);
  box-shadow: var(--shadow-sm);
}

.spice-level__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.spice-level__number {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--rose);
  line-height: 1;
}

.spice-level__flames {
  font-size: var(--text-sm);
  letter-spacing: 1px;
  line-height: 1;
}

.spice-level__name {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--charcoal);
}

.spice-level__desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

@media (max-width: 540px) {
  .spice-level {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .spice-level__badge { flex-direction: row; justify-content: center; gap: var(--space-3); }
}

.spice-gradient {
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, #fecdd3, #e11d48, #881337);
  margin: var(--space-6) 0 var(--space-2);
}

.spice-gradient-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--space-8);
}

.info-box {
  background: var(--rose-light);
  border-left: 3px solid var(--rose);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  margin: var(--space-8) 0;
}
.info-box h3 { font-size: var(--text-md); margin-bottom: var(--space-3); }
.info-box p { font-size: var(--text-sm); color: var(--muted); line-height: 1.6; margin-bottom: 0; }

/* =============== tropes/authors index hero =============== */

.hero--index {
  padding: var(--space-10) 0 var(--space-8);
  text-align: center;
}

.hero__heading {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.text-rose {
  color: var(--rose);
}

.hero__subhead {
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

.trope-index__group {
  margin-bottom: var(--space-10);
}

.trope-index__group h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--rose);
  display: inline-block;
}

.trope-index__group:first-child {
  margin-top: 0;
}

.author-index__group {
  margin-bottom: var(--space-10);
}

.author-index__group h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--rose);
  display: inline-block;
}

.author-index__group:first-child {
  margin-top: 0;
}

/* =============== article page infographic =============== */

.article-figure {
  margin: 32px 0;
  text-align: center;
}

.article-figure__img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.article-figure__caption {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 8px;
}

/* =============== articles index =============== */

.blog-hero { padding: var(--space-10) 0 var(--space-8); text-align: center; border-bottom: 1px solid var(--border); }
.blog-hero h1 { font-size: var(--text-4xl); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--space-3); }
.blog-hero p { font-size: var(--text-md); color: var(--muted); max-width: 600px; margin: 0 auto; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-8); padding: var(--space-10) 0; }
.blog-card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-card__body { padding: var(--space-6); }
.blog-card__title { font-size: var(--text-xl); font-weight: 700; color: var(--charcoal); margin-bottom: var(--space-2); line-height: 1.3; }
.blog-card__desc { font-size: var(--text-sm); color: var(--muted); line-height: 1.6; }
.blog-card__image { width: 100%; height: 200px; object-fit: cover; display: block; }
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-hero h1 { font-size: var(--text-3xl); }
}

/* =============== shared: affiliate, filter-bar, legal-content =============== */

.affiliate-disclosure {
  text-align: center;
  padding: 6px 0;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.affiliate-disclosure p {
  margin: 0;
}

.filter-bar {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  position: sticky;
  top: 60px;
  z-index: 50;
}

.filter-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.filter-bar__book-count {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

.filter-bar__book-count strong {
  color: var(--charcoal);
}

.filter-bar__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.85rem;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  color: var(--charcoal);
  cursor: pointer;
  transition: border-color var(--ease-default), background var(--ease-default);
}

.filter-bar__toggle:hover {
  border-color: var(--rose);
  background: var(--rose-light);
}

.filter-bar__toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--ease-default);
}

.filter-bar__toggle.is-open svg {
  transform: rotate(180deg);
}

.filter-bar__content {
  display: none;
  padding-top: var(--space-3);
}

.filter-bar__content.is-open {
  display: block;
}

.filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.filter-bar__row:last-child {
  margin-bottom: 0;
}

.filter-bar__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
}

.filter-bar__separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.sort-buttons {
  display: flex;
  gap: var(--space-2);
}

.sort-btn {
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  transition: background var(--ease-default), border-color var(--ease-default),
    color var(--ease-default);
}

.sort-btn:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.sort-btn.is-active {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.spice-toggle {
  display: flex;
  gap: var(--space-2);
}

.spice-toggle__btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0.35rem 0.65rem;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  transition: background var(--ease-default), border-color var(--ease-default),
    color var(--ease-default);
}

.spice-toggle__btn:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.spice-toggle__btn.is-active {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.spice-toggle__btn svg {
  width: 12px;
  height: 12px;
}

.subgenre-select {
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  outline: none;
  transition: border-color var(--ease-default), color var(--ease-default);
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2378716c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 10px 6px;
}

.subgenre-select:focus {
  border-color: var(--rose);
  color: var(--charcoal);
}

@media (max-width: 640px) {
  .filter-bar__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.load-more-wrap {
  text-align: center;
  padding: var(--space-8) 0 var(--space-4);
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 2rem;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  border: 2px solid var(--rose);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--rose);
  cursor: pointer;
  transition: background var(--ease-default), color var(--ease-default),
    transform 0.1s ease;
}

.load-more-btn:hover {
  background: var(--rose);
  color: #fff;
}

.load-more-btn:active {
  transform: scale(0.98);
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-12) var(--gutter);
}

.legal-content h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
  text-align: center;
}

.legal-content .last-updated {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-8);
}

.legal-content h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.legal-content p,
.legal-content li {
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--charcoal);
}

.legal-content p {
  margin-bottom: var(--space-4);
}

.legal-content ul {
  list-style: disc;
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.legal-content li {
  margin-bottom: var(--space-2);
}

.legal-content a {
  color: var(--rose);
}

.legal-content a:hover {
  color: var(--berry);
}

@media (max-width: 640px) {
  .legal-content h1 {
    font-size: var(--text-2xl);
  }
}

.disclosure-callout {
  background: var(--rose-light);
  border-left: 4px solid var(--rose);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}

.disclosure-callout p {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: 0;
}

/* =============== article page (SCOPED to body.article-page) =============== */
/* These rules previously lived inline in generate-blog-post.ts:790-856 and
   globally overrode .footer, .section, .page-header, and .prose with
   article-specific values. Scoped here so they only apply when
   <body class="article-page"> is set by Phase 4. */

body.article-page .page-header { padding: 48px 0 32px; text-align: center; }
body.article-page .page-header h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 8px; }
body.article-page .page-header p { color: #64748b; font-size: 1.1rem; }
body.article-page .section { padding: 0 0 64px; }
body.article-page .prose { max-width: 680px; margin: 0 auto; }
body.article-page .prose h2 { margin-top: 48px; margin-bottom: 16px; font-size: 1.4rem; font-weight: 700; }
body.article-page .prose h3 { margin-top: 32px; margin-bottom: 8px; font-size: 1.15rem; color: #e11d48; font-weight: 600; }
body.article-page .prose p { font-size: 1.05rem; line-height: 1.75; color: #334155; margin-bottom: 16px; }
body.article-page .prose ul,
body.article-page .prose ol { margin: 16px 0; padding-left: 28px; }
body.article-page .prose li { font-size: 1.05rem; line-height: 1.75; color: #334155; margin-bottom: 10px; }
body.article-page .prose strong { color: #1e293b; }
body.article-page .prose em { font-style: italic; }
body.article-page .prose .intro { font-size: 1.15rem; color: #334155; margin-bottom: 32px; line-height: 1.8; }
body.article-page .prose .trope-link { color: #e11d48; text-decoration: underline; }
body.article-page .prose .cta-box {
  margin-top: 48px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(225,29,72,.06), rgba(190,24,93,.06));
  border: 1px solid rgba(225,29,72,.15);
  border-radius: 12px;
  text-align: center;
}
body.article-page .prose .cta-box p { margin-bottom: 8px; }
body.article-page .prose .cta-box a {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: #e11d48;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
body.article-page .prose .cta-box a:hover { opacity: 0.9; }
body.article-page .publish-date { font-size: 0.85rem; color: #94a3b8; margin-bottom: 16px; }
body.article-page .footer { background: #1e293b; color: #94a3b8; padding: 48px 0 24px; margin-top: 64px; }
body.article-page .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
body.article-page .footer-logo { font-size: 1.1rem; font-weight: 700; color: #fff; text-decoration: none; }
body.article-page .footer-tagline { font-size: 0.85rem; margin-top: 8px; }
body.article-page .footer h4 { color: #fff; font-size: 0.85rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
body.article-page .footer a { display: block; color: #94a3b8; text-decoration: none; font-size: 0.85rem; margin-bottom: 8px; }
body.article-page .footer a:hover { color: #e11d48; }
body.article-page .footer-bottom { border-top: 1px solid rgba(148,163,184,0.15); padding-top: 16px; font-size: 0.8rem; text-align: center; }
@media (max-width: 768px) {
  body.article-page .page-header h1 { font-size: 1.6rem; }
  body.article-page .footer-grid { grid-template-columns: 1fr; }
  body.article-page .nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid #e2e8f0; padding: 16px 24px; gap: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); z-index: 100; }
  body.article-page .nav.is-open { display: flex; }
  body.article-page .nav-toggle { display: block; background: none; border: none; cursor: pointer; padding: 8px; color: #1e293b; }
  body.article-page .nav-toggle svg { width: 24px; height: 24px; }
}

/* ── Book page email capture (mirrors homepage .email-cta pattern) ──────────────────────────────────── */
.book-page-subscribe {
  margin-top: 24px;
  padding: 28px 24px;
  background: linear-gradient(135deg, #fff1f2 0%, #faf5f0 100%);
  border-radius: var(--radius-lg);
  text-align: center;
}
.book-page-subscribe__headline {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--charcoal);
  line-height: 1.25;
}
.book-page-subscribe__headline em {
  color: var(--rose);
  font-style: normal;
}
.book-page-subscribe__sub {
  margin: 0 auto 18px;
  max-width: 420px;
  font-size: 0.95rem;
  color: #78716c;
  line-height: 1.5;
}
.book-page-subscribe__fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
  margin: 0 auto;
}
.book-page-subscribe__input {
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #e7e5e4;
  border-radius: 50px;
  background: #fff;
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.2s;
}
.book-page-subscribe__input:focus {
  border-color: var(--rose);
}
.book-page-subscribe__btn {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--rose);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}
.book-page-subscribe__btn:hover:not(:disabled) { background: var(--berry); }
.book-page-subscribe__btn:disabled { opacity: 0.6; cursor: wait; }
.book-page-subscribe__msg {
  font-size: 0.8rem;
  color: #a8a29e;
  margin: 14px 0 0;
  min-height: 1.2em;
  line-height: 1.4;
}
.book-page-subscribe__msg.is-success { color: #166534; font-weight: 600; }
.book-page-subscribe__msg.is-error { color: var(--berry); font-weight: 600; }
.book-page-subscribe__more {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--rose);
  text-decoration: none;
  font-weight: 600;
}
.book-page-subscribe__more:hover { text-decoration: underline; }
