/* ============================================================
   REFINEMENT PASS — Visual Flow & Logo Fixes
   ============================================================
   Fixes logo background issues, improves section transitions,
   integrates tagline, softens decree presentation.
   ============================================================ */

/* --- Utility: Blend Multiply (for images with white backgrounds) --- */
.blend-multiply {
  mix-blend-mode: multiply;
}

/* --- 1. Hero Wordmark: CSS Text Replacement --- */
.hero-wordmark-text {
  text-align: center;
  margin-bottom: var(--space-md);
  line-height: 1;
}

.hero-wordmark-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 0.95;
  display: block;
}

.hero-wordmark-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  color: var(--teal-dark);
  letter-spacing: 0.15em;
  display: block;
  margin-top: 0.3em;
}

@media (min-width: 768px) {
  .hero-wordmark-text {
    text-align: left;
    margin: 0 0 var(--space-md);
  }
}

/* --- 2. Header Wordmark: CSS Text Replacement --- */
.header-monogram {
  mix-blend-mode: multiply;
}

.header-wordmark-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

/* Hide old wordmark image class (safety) */
.site-logo .wordmark {
  display: none;
}

/* --- 3. Footer Wordmark: CSS Text Replacement --- */
.footer-wordmark-text {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: #2C2C2C;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

/* Override old footer-brand img rule (no longer needed) */
.footer-brand img {
  display: none;
}

/* --- 4. Divider Monogram --- */
.divider img {
  mix-blend-mode: multiply;
}

/* --- 5. Ruby & Moon / SDT Profile Image --- */
.sdt-profile-img {
  max-width: 160px;
  mix-blend-mode: multiply;
  margin: 0 auto var(--space-sm);
}

/* Comics page hero image */
.sdt-hero-img {
  mix-blend-mode: multiply;
  border-radius: 50%;
}

/* Podcast monogram */
.podcast-monogram {
  mix-blend-mode: multiply;
}

/* --- 6. SDT Intro Layout (Homepage) --- */
.sdt-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.sdt-intro p {
  max-width: 55ch;
  color: var(--ink-light);
  font-size: 1.05rem;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .sdt-intro {
    flex-direction: row;
    text-align: left;
  }

  .sdt-intro .sdt-profile-img {
    margin: 0;
    flex-shrink: 0;
  }
}

/* --- 7. Decree Carousel (Homepage) — Softer Presentation --- */
.decree-carousel {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.decree-track {
  display: flex;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  width: 100%;
}

.decree-slide {
  min-width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  transition: transform 0.4s ease;
  overflow: hidden;
}

.decree-slide img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  object-fit: contain;
}

.decree-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.decree-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  transition: all var(--transition);
}

.decree-btn:hover {
  background: var(--teal-deep);
  color: var(--white);
}

.decree-dots {
  display: flex;
  gap: 12px;
  align-items: center;
}

.decree-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  position: relative;
}

.decree-dot::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--gray-light);
  transition: background var(--transition), transform var(--transition);
}

.decree-dot.active::after,
.decree-dot:hover::after {
  background: var(--teal-deep);
  transform: scale(1.2);
}

/* --- 8. Decree Gallery (Comics page) — Softer Edges --- */
.decree-gallery-item {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  background: var(--white);
  transition: all var(--transition);
}

.decree-gallery-item:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}

.decree-gallery-item a {
  display: block;
}

.decree-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px 12px 0 0;
}

.decree-gallery-item figcaption {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-light);
  text-align: center;
  line-height: 1.4;
}

/* --- 9. Featured In Card (Homepage) --- */
.featured-in-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--parchment);
  border-radius: 8px;
  padding: var(--space-lg);
  border-left: 4px solid var(--teal);
  box-shadow: var(--shadow-sm);
}

.featured-in-content {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.featured-in-icon {
  flex-shrink: 0;
  color: var(--teal);
  margin-top: 2px;
}

.featured-in-source {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.featured-in-date {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: var(--space-xs);
}

.featured-in-text {
  color: var(--ink-light);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0;
}

/* --- 10. Pillar Quote Styling --- */
.pillar-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--teal-dark);
  font-size: 1rem;
  margin-bottom: var(--space-xs);
  line-height: 1.4;
}

/* --- 11. Hero Primary Tagline — Laugh → Listen → Learn → Act™ --- */
.hero-tagline--primary {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
  font-style: italic;
  color: var(--ember);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
  line-height: 1.3;
  border-left: 3px solid var(--ember);
  padding-left: var(--space-sm);
}

@media (min-width: 768px) {
  .hero-tagline--primary {
    text-align: left;
  }
}

/* --- 12. Smooth Section Transitions (Gradient Fades) --- */

/* Parchment → White (section--alt) */
.section--alt {
  background: var(--white);
  position: relative;
}

.section--alt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--parchment), var(--white));
  pointer-events: none;
  z-index: 0;
}

.section--alt::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--white), var(--parchment));
  pointer-events: none;
  z-index: 0;
}

/* When section--alt is followed by section--teal, override the bottom gradient */
.section--alt + .section--teal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--white), var(--teal-deep));
  pointer-events: none;
  z-index: 0;
}

/* Teal section transitions */
.section--teal {
  position: relative;
}

.section--teal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--parchment), var(--teal-deep));
  pointer-events: none;
  z-index: 0;
}

.section--teal::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--teal-deep), var(--parchment));
  pointer-events: none;
  z-index: 0;
}

/* Ensure section content stays above gradient overlays */
.section--alt > .container,
.section--teal > .container {
  position: relative;
  z-index: 1;
}

/* Soften the divider between sections */
.divider {
  margin: var(--space-lg) auto;
  opacity: 0.7;
}

/* --- 13. Tagline Banner (Comics page) — Subtler Integration --- */
.tagline-banner {
  padding: var(--space-lg) 0;
  position: relative;
}

.tagline-banner::before,
.tagline-banner::after {
  content: '';
  display: block;
  height: 1px;
  max-width: 200px;
  margin: 0 auto;
  background: linear-gradient(to right, transparent, var(--gray-light), transparent);
}

.tagline-banner::before {
  margin-bottom: var(--space-lg);
}

.tagline-banner::after {
  margin-top: var(--space-lg);
}

.tagline-banner .laugh-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--teal-dark);
  opacity: 1;
}

/* --- 14. SDT Hero Layout (Comics page) --- */
.sdt-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-lg);
}

.sdt-hero-img {
  max-width: 200px;
  width: 100%;
  flex-shrink: 0;
}

.sdt-hero-text h2 {
  color: var(--teal);
}

.sdt-hero-text p {
  color: var(--ink-light);
  font-size: 1.05rem;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .sdt-hero {
    flex-direction: row;
    text-align: left;
  }
}

/* --- 15. Page Header Softening --- */
.page-header {
  border-bottom: none;
  padding-bottom: var(--space-xl);
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--teal), transparent);
  border-radius: 2px;
}

/* --- 16. Footer Transition --- */
.site-footer {
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--parchment), var(--ink));
  pointer-events: none;
}

/* Ensure footer content is above gradient */
.site-footer > .container {
  position: relative;
  z-index: 1;
}

/* Increase footer top padding to account for gradient */
.site-footer {
  padding-top: calc(var(--space-xl) + 30px);
}

/* --- 17. Reduced Section Padding for Smoother Reading --- */
/* Slightly reduce padding between sections for document-like flow */
.section {
  padding: var(--space-xl) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-2xl) 0;
  }
}

/* --- 18. Book Waitlist Page --- */
.badge--coming {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--ember);
  padding: 0.4em 1.2em;
  border-radius: 100px;
}

.book-waitlist-form {
  max-width: 560px;
  margin: 0 auto;
}

.waitlist-form .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 600px) {
  .waitlist-form .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.waitlist-form .form-group {
  margin-bottom: var(--space-md);
}

.waitlist-form label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.waitlist-form input,
.waitlist-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--parchment-dark);
  border-radius: var(--border-radius);
  transition: border-color var(--transition);
}

.waitlist-form input:focus,
.waitlist-form select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(19, 92, 84, 0.15);
}

.waitlist-form input::placeholder {
  color: var(--gray-light);
}

/* --- 19. Accessibility Statement in Footer --- */
/* Footer sits on --ink (#1C1C1C). All text must be light for AAA contrast (≥7:1). */
.footer-a11y {
  font-size: 0.85rem;
  color: #D4CFC8; /* 8.2:1 on #1C1C1C — AAA */
  margin-top: var(--space-xs);
}

/* Footer brand and nav text — light on dark, AAA compliant */
.footer-brand p {
  color: #E8E4DE !important; /* 10.5:1 on #1C1C1C — AAA */
}

.footer-heading {
  color: #FFFFFF !important; /* 18.1:1 — AAA */
}

.footer-nav a {
  color: #E8E4DE !important; /* 10.5:1 on #1C1C1C — AAA */
}

.footer-nav a:hover {
  color: #FFFFFF !important;
}

/* --- 20. WCAG AAA Focus Indicators --- */
/* Ensure all interactive elements have visible focus indicators */
*:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* Override any ember-based focus indicators to use teal for better contrast */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* --- 21. Hero Quote — Large, Bold, AAA Contrast --- */
.hero-quote {
  border-left: none;
  background: none;
  text-align: center;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
  padding: var(--space-lg) 0;
  margin: 0;
  max-width: 38ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-quote cite {
  display: block;
  margin-top: var(--space-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.85);
}

/* --- 22. Featured Pull-Quote Section --- */
.pull-quote-section {
  padding: var(--space-xl) 0;
}

.pull-quote-text {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 600;
  font-style: italic;
  color: var(--ember);
  line-height: 1.4;
  letter-spacing: 0.01em;
  max-width: 28ch;
  margin: 0 auto;
  position: relative;
  padding: var(--space-md) 0;
}

.pull-quote-text::before,
.pull-quote-text::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--ember), transparent);
  margin: 0 auto var(--space-md);
}

.pull-quote-text::after {
  margin: var(--space-md) auto 0;
}

/* --- 23. Decree Carousel — Full Image Display (No Cropping) --- */
.decree-slide img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  object-fit: contain;
  background: var(--parchment);
}

.decree-track {
  background: var(--parchment);
}

/* Comics page gallery — also fix cropping */
.decree-gallery-item {
  background: var(--parchment);
}

.decree-gallery-item img {
  object-fit: contain;
  background: var(--parchment);
}

/* ============================================================
   ORNAMENTAL DIVIDERS
   Black-on-white PNGs blended into parchment via multiply
   ============================================================ */

.ornamental-divider {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 0;
  overflow: hidden;
  /* Vertical rhythm — breathing room around each divider */
  margin: 0;
  padding: 0;
  /* Ensure the divider area doesn't collapse */
  position: relative;
}

.ornamental-divider img {
  mix-blend-mode: multiply;
  display: block;
  margin: 0 auto;
  /* Prevent white halos on parchment */
  background: transparent;
}

/* Simple line with center flourish — workhorse between sections */
.ornamental-divider--simple img {
  max-width: 600px;
  width: 80%;
  height: auto;
  opacity: 0.7;
}

/* Fleur-de-lis — vertical ornament, used as accent point */
.ornamental-divider--fleur img {
  max-width: 120px;
  width: 18%;
  height: auto;
  opacity: 0.75;
}

/* Scrollwork with center cameo — medium horizontal ornament */
.ornamental-divider--scrollwork img {
  max-width: 560px;
  width: 70%;
  height: auto;
  opacity: 0.72;
}

/* Full baroque ornament — large statement divider */
.ornamental-divider--ornate img {
  max-width: 700px;
  width: 85%;
  height: auto;
  opacity: 0.68;
}

/* Wrapper that provides vertical spacing for dividers between sections */
.section-divider-wrap {
  text-align: center;
  padding: var(--space-sm) 0;
  background: var(--parchment);
  /* Ensure no section background bleeds through */
  position: relative;
  z-index: 1;
}

/* Alt background variant — for dividers between section--alt sections */
.section-divider-wrap--alt {
  background: var(--parchment-dark);
}

@media (max-width: 600px) {
  .ornamental-divider--simple img  { width: 90%; }
  .ornamental-divider--fleur img   { width: 28%; max-width: 90px; }
  .ornamental-divider--scrollwork img { width: 90%; }
  .ornamental-divider--ornate img  { width: 95%; }
}

/* --- 16. Header Collision Fix: keep the wordmark and navigation from overlapping --- */
.header-inner {
  gap: clamp(1rem, 2vw, 2rem);
}

.site-logo {
  flex: 0 0 auto;
  min-width: max-content;
}

.main-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.main-nav ul {
  justify-content: flex-end;
  gap: clamp(0.8rem, 1.4vw, 1.35rem);
}

.main-nav a {
  font-size: clamp(0.72rem, 0.78vw, 0.86rem);
  letter-spacing: 0.055em;
  white-space: nowrap;
}

@media (max-width: 1179px) {
  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 420px) {
  .header-wordmark-text {
    font-size: 1.05rem;
  }

  .site-logo {
    gap: 0.45rem;
  }

  .site-logo img {
    height: 42px;
  }
}
