/**
 * Westside Child Page Layout
 *
 * Reuses:
 *   - .wad-about__hero / .wad-parent__hero  → hero
 *   - .wad-about__contact-band              → final CTA band
 *   - .wad-parent__h2 / __h3 / __h4 / __h5 / __h6  → typography
 *   - .wad-child__body-h1                 → content H1 typography
 *   - .wad-faq__item / __button / __panel / __arrow  → H3 accordions
 *   - .wad-parent__leaf                     → ambient decoration
 *
 * Adds:
 *   - Two-column body grid (sticky TOC + content)
 *   - TOC styling + active-link affordance
 *   - Inline image polish for content body
 */

/* ── Hero override (kept minimal, parent rules carry it) ───────────── */
.wad-child__hero {
  /* parent provides background-image via custom property */
}

/* ── Body shell ────────────────────────────────────────────────────── */
.wad-child__body {
  position: relative;
  padding: 96px 0;
  background: #FFFEF7;
  overflow-x: clip;
  overflow-y: visible;
  isolation: isolate;
}

.wad-child__shell {
  position: relative;
  z-index: 1;
  width: min(1290px, calc(100% - 4rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
  gap: 96px;
  align-items: start;
}

/* ── Table of contents (sticky) ────────────────────────────────────── */
/* v2 */
.wad-child__toc-wrap {
  position: sticky;
  top: 140px;
  align-self: start;
}

.wad-child__toc {
  padding: 24px;
  outline: 1px solid #C0A971;
  outline-offset: -1px;
  backdrop-filter: blur(3px);
  background: rgba(255, 254, 247, 0.6);
}

.wad-child__toc-inner {
  padding: 24px;
  background: #FFFCEC;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wad-child__toc-eyebrow {
  margin: 0;
  font-family: 'Tenor Sans', serif;
  font-weight: 400;
  font-size: 22.78px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #000;
}

.wad-child__toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: wad-toc;
}

.wad-child__toc-item {
  margin: 0;
}

.wad-child__toc-link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  color: #000;
  font-family: var(--font-body, Montserrat, "Avenir Next", sans-serif);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.7;
  text-decoration: none;
  transition: color 0.2s ease;
}

.wad-child__toc-link:hover,
.wad-child__toc-link:focus-visible {
  color: #8A7346;
}

.wad-child__toc-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 17px;
  flex: 0 0 auto;
  color: transparent;
  transform: translateX(-4px);
  transition:
    color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
  opacity: 0;
}

.wad-child__toc-link.is-active {
  color: #8A7346;
}

.wad-child__toc-link.is-active .wad-child__toc-caret {
  color: #8A7346;
  transform: translateX(0);
  opacity: 1;
}

/* ── Body content ─────────────────────────────────────────────────── */
.wad-child__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 740px;
}

.wad-child__intro,
.wad-child__lead {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wad-child__intro > *,
.wad-child__lead > * {
  margin: 0;
}

.wad-child__intro > * + *,
.wad-child__lead > * + * {
  margin-top: 16px;
}

.wad-child__section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-margin-top: 140px;
}

.wad-child__body-h1 {
  margin: 0;
  font-family: 'Tenor Sans', serif;
  font-weight: 400;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
}

.wad-child__h2 {
  margin: 0;
}

.wad-child__content p {
  font-family: var(--font-body, Montserrat, "Avenir Next", sans-serif);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #000;
  margin: 0;
}

.wad-child__content a {
  color: #8A7346;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.wad-child__content a:hover {
  color: #6c5a35;
}

.wad-child__content ul,
.wad-child__content ol {
  margin: 0;
  padding-left: 1.4em;
  font-family: var(--font-body, Montserrat, "Avenir Next", sans-serif);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #000;
}

.wad-child__content li + li {
  margin-top: 6px;
}

.wad-child__content img,
.wad-child__content figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 16px 0;
  outline: 1px solid rgba(192, 169, 113, 0.4);
  outline-offset: -1px;
}

.wad-child__content figure {
  margin: 16px 0;
}

.wad-child__content figcaption {
  margin-top: 8px;
  font-family: var(--font-body, Montserrat, "Avenir Next", sans-serif);
  font-size: 14px;
  color: #5a5a5a;
}

.wad-child__content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 3px solid #C0A971;
  background: rgba(192, 169, 113, 0.08);
  font-style: italic;
  color: #000;
}

/* ── H3 accordions ─────────────────────────────────────────────────── */
.wad-child__accordions {
  margin-top: 8px;
}

.wad-child__accordion {
  border-top: 1px solid #C0A971;
}

.wad-child__accordion:last-child {
  border-bottom: 1px solid #C0A971;
}

/* Slightly tighter button than the homepage FAQ since the column is narrower */
.wad-child__accordion-button {
  width: 100%;
  min-height: 92px;
  padding: 24px 16px;
  font-size: clamp(20px, 1.6vw, 22.78px);
  line-height: 1.3;
  transition:
    padding-left 0.25s ease,
    color 0.2s ease;
}

.wad-child__accordion-button:hover {
  color: #8A7346;
  padding-left: 24px;
}

.wad-child__accordion .wad-faq__arrow svg {
  width: 32px;
  height: 32px;
}

.wad-child__accordion .wad-faq__panel > * {
  overflow: hidden;
  padding: 0 16px;
}

.wad-child__accordion .wad-faq__panel .wad-rich {
  padding-bottom: 0;
}

.wad-child__accordion.is-open .wad-faq__panel .wad-rich {
  padding-bottom: 24px;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .wad-child__shell {
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 48px;
  }
}

@media (max-width: 860px) {
  .wad-child__body {
    padding: 64px 0;
  }
  .wad-child__shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .wad-child__toc-wrap {
    order: -1;
    position: static;
    top: auto;
  }
  .wad-child__toc {
    position: static;
    top: auto;
  }
  .wad-child__content {
    max-width: 100%;
  }
  .wad-child__section {
    scroll-margin-top: 96px;
  }
}

@media (max-width: 480px) {
  .wad-child__toc {
    padding: 16px;
  }
  .wad-child__toc-inner {
    padding: 20px;
    gap: 16px;
  }
  .wad-child__accordion-button {
    min-height: 72px;
    padding: 18px 12px;
    font-size: 18px;
  }
  .wad-child__accordion-button:hover {
    padding-left: 16px;
  }
}

/* ── Page-load entrance animations ───────────────────────────────── */
@keyframes wad-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wad-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/*
 * Hero entrance sequence (all scoped to .wad-child__hero so the About
 * and Parent pages are never touched):
 *
 *   0.00s  ::before overlay — fades out from opaque gold tint, revealing the image
 *   0.10s  title card — fades in from slight vertical offset
 *   0.30s  title inner — fades up with frosted box
 *   0.35s  breadcrumb — fades up individually
 *   0.50s  display H1 — fades up with the longest delay for emphasis
 *
 * The ::before approach avoids touching the background shorthand set in
 * about.css (which hardcodes background-size: cover and can't be keyframed).
 */
@keyframes wad-hero-veil-out {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

@keyframes wad-hero-image-settle {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}

.wad-child__hero {
  isolation: isolate;
  background: none;
}

.wad-child__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(192, 169, 113, 0.4), rgba(192, 169, 113, 0.4)),
    var(--wad-about-hero-image) center/cover no-repeat;
  transform-origin: 50% 50%;
  animation: wad-hero-image-settle 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s both;
  pointer-events: none;
}

.wad-child__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #FFFEF7;
  animation: wad-hero-veil-out 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both;
  pointer-events: none;
}

.wad-child__hero .wad-about__hero-title-card {
  animation: wad-fade-in 0.5s ease 0.1s both;
}

.wad-child__hero .wad-about__hero-title-inner {
  animation: wad-fade-up 0.6s ease 0.3s both;
}

.wad-child__hero .wad-about__breadcrumbs {
  animation: wad-fade-up 0.5s ease 0.35s both;
}

.wad-child__hero .wad-about__display,
.wad-child__hero .wad-child__display {
  animation: wad-fade-up 0.65s ease 0.5s both;
}

.wad-child__toc {
  animation: wad-fade-in 0.6s ease 0.25s both;
}

/* ── Scroll-driven section reveals ───────────────────────────────── */
.wad-child__section {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

.wad-child__section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Intro block fades in immediately (no scroll trigger needed) */
.wad-child__intro {
  animation: wad-fade-up 0.6s ease 0.15s both;
}

/* ── TOC link hover — subtle left-border accent ───────────────────── */
.wad-child__toc-link {
  border-left: 2px solid transparent;
  padding-left: 8px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    padding-left 0.2s ease;
}

.wad-child__toc-link:hover,
.wad-child__toc-link:focus-visible {
  border-left-color: #C0A971;
  padding-left: 12px;
}

.wad-child__toc-link.is-active {
  border-left-color: #8A7346;
  padding-left: 12px;
}

/* ── TOC card subtle lift on hover ───────────────────────────────── */
.wad-child__toc {
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.wad-child__toc:hover {
  box-shadow: 0 8px 28px rgba(138, 115, 70, 0.12);
  transform: translateY(-2px);
}

/* ── Section H2 underline reveal ─────────────────────────────────── */
.wad-child__h2 {
  position: relative;
  display: block;
}

.wad-child__h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: #C0A971;
  transition: width 0.4s ease;
}

.wad-child__section.is-visible .wad-child__h2::after {
  width: 48px;
}

/* ── Image hover — gentle zoom + gold frame ──────────────────────── */
.wad-child__content figure {
  overflow: hidden; /* clips the scale() zoom on the child img */
}

.wad-child__content img,
.wad-child__content figure img {
  transition:
    transform 0.35s ease,
    outline-color 0.3s ease;
}

.wad-child__content img:hover,
.wad-child__content figure img:hover {
  transform: scale(1.015);
  outline-color: rgba(192, 169, 113, 0.75);
}

/* ── Blockquote entrance shimmer on reveal ───────────────────────── */
.wad-child__content blockquote {
  transition:
    border-left-color 0.3s ease,
    background 0.3s ease;
}

.wad-child__section.is-visible .wad-child__content blockquote {
  border-left-color: #8A7346;
}

/* ── Accordion enhanced transitions ─────────────────────────────── */
.wad-child__accordion {
  transition: background 0.2s ease;
}

.wad-child__accordion:hover {
  background: rgba(192, 169, 113, 0.05);
}

.wad-child__accordion.is-open {
  background: rgba(255, 252, 236, 0.7);
}

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .wad-child__toc-link,
  .wad-child__toc-caret,
  .wad-child__accordion-button,
  .wad-child__toc,
  .wad-child__section,
  .wad-child__intro,
  .wad-child__hero::before,
  .wad-child__hero::after,
  .wad-child__hero .wad-about__hero-title-card,
  .wad-child__hero .wad-about__hero-title-inner,
  .wad-child__hero .wad-about__breadcrumbs,
  .wad-child__hero .wad-about__display,
  .wad-child__hero .wad-child__display,
  .wad-child__content img,
  .wad-child__content figure img {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .wad-child__hero::after {
    opacity: 0 !important;
  }
}
