/* ==========================================================================
   SPEARPOINT ADVISORS — The 5 D's Page Stylesheet
   ==========================================================================
   Page-specific rules only. Loaded after style.css, so it can rely on all
   design tokens (--color-*, --space-*, --fs-*, --radius-*, --shadow-*,
   --transition-*) and shared components already defined there.

   Reuses as-is (no rules needed here): .hero-decor, .hero__cta-group,
   .eyebrow, .about-section__header, .risk-stats/.risk-stats__item,
   .process-section__header/.process-grid/.process-step,
   .stats-grid/.value-card, .founder-section__grid/__image-wrap/
   __image/__content, .credentials/.credential-tag, .cta-section, .btn —
   only the pieces below are new.

   The 5 Ds were originally five always-visible stacked sections; client
   feedback was that this made the page too tall, so they're now a
   click-to-expand accordion (.d-accordion) — see the .d-accordion rules
   below. Each item keeps its own real id (e.g. #d-divorce) so a link from
   anywhere still lands on and opens the right D (see the-5-ds.js).
   ========================================================================== */

/* --- Hero — centered like Services/How-It-Works, with a preview row of
   the 5 risk icons (same icon set the homepage's .risk-item uses) instead
   of Services' service icons or How-It-Works' gate badges, foreshadowing
   the 5 D sections further down the page. --- */
/* --- Three-stat variant — style.css's .risk-stats is a 4-column grid
   (built for the trust-signals row above, which has 4 items); the
   "your net worth" section only has 3, so it would sit flush left
   instead of centered under its heading. A 3-col track + a max-width
   keeps the row centered without touching the shared 4-stat layout. --- */
.risk-stats--three {
  grid-template-columns: repeat(3, 1fr);
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* This page's hero sits on a dark photo background, so the header's
   default "transparent until scrolled" state (style.css) leaves the nav
   links unreadable at the top of the page — force the scrolled-state glass
   bar on always, just for this page. */
.site-header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.04);
}

.d5-hero {
  padding-top: calc(var(--nav-height) + var(--space-12));
  position: relative;
  z-index: 1;
  background-image:
    linear-gradient(180deg, rgba(8, 7, 6, 0.86), rgba(8, 7, 6, 0.9)),
    url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.d5-hero__content {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  text-align: center;
}

/* Hero sits on a dark photo background — override the default light-bg
   text colors so the copy stays readable against the image rather than
   blending into it. */
.d5-hero__content h1 {
  color: var(--color-white);
  margin-bottom: var(--space-6);
}

.d5-hero__content p {
  color: rgba(255, 255, 255, 0.82);
  max-width: none;
  margin: 0 auto var(--space-4);
}

.d5-hero__subhead {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--color-white);
  max-width: 760px;
  margin: 0 auto var(--space-6);
}

.d5-hero__content .btn--outline {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.4);
}

.d5-hero__content .btn--outline:hover {
  color: var(--color-white);
  border-color: var(--color-white);
  background-color: rgba(255, 255, 255, 0.08);
}

.d5-hero__content .d5-hero__ds {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  font-style: italic;
  color: var(--color-orange);
  margin-bottom: var(--space-8);
}

.d5-hero__content .hero__cta-group {
  justify-content: center;
}

/* --- Tinted-orange variant of the shared .value-card, for the "Every
   Service We Offer" grid — same soft wash used by the homepage's
   .stats-grid--outcomes cards, rebuilt locally per the per-page-CSS
   convention. --- */
.value-card--orange {
  background: linear-gradient(135deg, rgba(232, 83, 14, 0.08), rgba(232, 83, 14, 0.02));
  border: 1px solid rgba(232, 83, 14, 0.15);
}

/* --- Quote block — this page's pull-quote treatment (used 6×): tinted
   background, large faint quote-mark icon, same visual idea as
   how-it-works.css's .quote-card, rebuilt locally per the per-page-CSS
   convention rather than shared across pages. --- */
.quote-block {
  position: relative;
  max-width: 760px;
  margin: var(--space-8) auto 0;
  padding: var(--space-8) var(--space-10);
  background: linear-gradient(160deg, rgba(232, 83, 14, 0.07), transparent);
  border: 1px solid rgba(232, 83, 14, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.quote-block__mark {
  position: absolute;
  top: var(--space-4);
  left: var(--space-6);
  font-size: 3rem;
  color: rgba(232, 83, 14, 0.15);
  z-index: 0;
}

.quote-block blockquote {
  position: relative;
  z-index: 1;
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  font-style: italic;
  color: var(--color-text);
  line-height: var(--lh-relaxed);
  text-align: center;
}

/* --- D accordion — the 5 D's were originally five always-visible
   stacked panels; client feedback was that this made the page far too
   tall, so it's now a click-to-expand accordion (same click-toggle +
   max-height-from-scrollHeight technique as marketing.js's/
   trades.js's .accordion-blocks), one D open at a time or all
   closed. scroll-margin-top is already set globally for every [id]
   (style.css) to clear the fixed nav if something ever links straight
   to a #d-death style anchor. --- */
.d-accordion {
  max-width: 900px;
  margin: 0 auto;
}

.d-accordion__item + .d-accordion__item {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.d-accordion__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.d-accordion__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-hover));
  color: var(--color-white);
  font-size: var(--fs-lg);
}

.d-accordion__title {
  flex: 1;
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  transition: color var(--transition-fast);
}

.d-accordion__trigger:hover .d-accordion__title {
  color: var(--color-orange);
}

.d-accordion__chevron {
  flex-shrink: 0;
  color: var(--color-text-4);
  font-size: var(--fs-md);
  transition: transform var(--transition-base);
}

.d-accordion__item.is-open .d-accordion__chevron {
  transform: rotate(180deg);
}

.d-accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.d-accordion__content-inner {
  padding-top: var(--space-8);
}

/* --- 2x2 subsection grid — the four "What It Is / What It Looks Like in
   Practice / Why It's a Business Risk / What Preparation Looks Like"
   labeled blocks, one consistent icon per category across all 5 tabs so
   the pattern teaches itself instead of four more stacked headings. --- */
.d-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.d-detail-card {
  padding: var(--space-6);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.d-detail-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(232, 83, 14, 0.1);
  color: var(--color-orange);
  font-size: var(--fs-md);
  margin-bottom: var(--space-4);
}

.d-detail-card h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-3);
}

.d-detail-card p {
  font-size: var(--fs-sm);
  color: var(--color-text-2);
  line-height: var(--lh-relaxed);
  margin-bottom: 0;
}

/* --- Small inline link under each Discover/Prepare/Decide teaser step —
   .process-step doesn't carry a link slot in style.css since the
   homepage's own teaser doesn't need one; this page's version does. --- */
.process-step__link {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-orange);
}

/* --- Final CTA — style.css's .cta-section caps its heading/paragraph at
   800px/600px (fine for shorter site-wide CTAs), but this page's copy
   reads cramped at that width — widen both just for this page. --- */
.cta-section h2 {
  max-width: 1200px;
}

.cta-section p {
  max-width: 960px;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .d-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Centered by design on tablet/desktop (see base rules above);
     left-aligned on phones only. */
  .d5-hero__content,
  .quote-block blockquote {
    text-align: left;
  }

  .quote-block {
    padding: var(--space-6);
  }

  .risk-stats--three {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .d-accordion__icon {
    width: 44px;
    height: 44px;
    font-size: var(--fs-base);
  }

  .d-accordion__title {
    font-size: var(--fs-lg);
  }
}
