/* ===================================================================
   AfterLoss home diagrams - section #map (donut + cards) and
   #timeline (auto-cycling carousel). Wave 2 / Agent 2.
   Depends on tokens from css/site.css.
   =================================================================== */

/* ---------- shared section header ---------- */
.aw-diag-head,
.aw-timeline-head {
  max-width: 760px;
  margin: 0 auto 48px;
  text-align: center;
  padding: 0 24px;
}
.aw-timeline-head .eyebrow,
.aw-diag-head .eyebrow {
  display: inline-block;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 16px;
}
.aw-timeline-head h2,
.aw-diag-head h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.15;
  font-weight: 500;
  color: var(--ink-deep);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.aw-timeline-head p,
.aw-diag-head p {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(19px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--ink-deep);
  opacity: 0.78;
  margin: 0;
}

/* Section padding control - keep tight on both sides */
#map, #timeline {
  padding-top: 96px;
  padding-bottom: 80px;
  min-height: 0;
}
@media (max-width: 720px) {
  #map, #timeline { padding-top: 64px; padding-bottom: 56px; }
}

/* Kill the placeholder label that was rendered when sections were :empty */
.aw-section[data-wave]:empty::before { content: none; }

/* =========================================================
   Section #map  -  donut + category cards
   ========================================================= */
#map { background: linear-gradient(180deg, var(--cream-warm) 0%, #f4eede 100%); }

.aw-donut-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .aw-donut-wrap { grid-template-columns: 1fr; gap: 36px; }
}

.aw-donut-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.aw-donut-anchor {
  text-align: center;
}
.aw-donut-anchor .num {
  display: block;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(56px, 8vw, 80px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
}
.aw-donut-anchor .lbl {
  display: block;
  margin-top: 8px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

.aw-donut-figure {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.aw-donut-figure svg { width: 100%; height: 100%; overflow: visible; }
.aw-donut-figure .seg {
  fill: none;
  stroke-width: 32;
  stroke-linecap: butt;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 1400ms var(--ease-soft), opacity 320ms var(--ease-soft), stroke-width 320ms var(--ease-soft);
  cursor: pointer;
  opacity: 0.92;
}
.aw-donut-figure .seg:hover,
.aw-donut-figure .seg.is-active { opacity: 1; stroke-width: 38; }
.aw-donut-figure .seg-paperwork { stroke: var(--sage); }
.aw-donut-figure .seg-calls     { stroke: #6e6a64; }
.aw-donut-figure .seg-decisions { stroke: var(--rust); }
.aw-donut-figure .seg-search    { stroke: #b8ad97; }

.aw-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 18%;
}
.aw-donut-center .num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 500;
  color: var(--ink-deep);
  line-height: 1;
}
.aw-donut-center .lbl {
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-top: 10px;
}

/* category cards stacked on the right */
.aw-cat-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.aw-cat-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 22px 18px 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid transparent;
  border-left: 3px solid var(--sage);
  border-radius: 0 12px 12px 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-deep);
  transition: background var(--dur-quick) var(--ease-soft),
              border-color var(--dur-quick) var(--ease-soft),
              transform var(--dur-quick) var(--ease-soft);
}
.aw-cat-card:hover,
.aw-cat-card.is-active,
.aw-cat-card:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  border-left-color: var(--rust);
  outline: none;
  transform: translateX(2px);
}
.aw-cat-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sage-deep);
  background: var(--sage-soft);
  border-radius: 10px;
  flex: 0 0 44px;
}
.aw-cat-card.is-active .aw-cat-icon,
.aw-cat-card:hover .aw-cat-icon {
  color: var(--rust-deep);
  background: var(--rust-soft);
}
.aw-cat-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.aw-cat-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.aw-cat-pct {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(28px, 3vw, 32px);
  font-weight: 500;
  line-height: 1;
  color: var(--ink-deep);
  font-variant-numeric: tabular-nums;
}
.aw-cat-hours {
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.aw-cat-label {
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-deep);
  letter-spacing: 0.01em;
}
.aw-cat-caption {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-deep);
  opacity: 0.72;
}

/* =========================================================
   Section #timeline  -  auto-cycling carousel
   ========================================================= */
#timeline { background: var(--cream-warm); }

.aw-tl-carousel {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.aw-tl-track {
  position: relative;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aw-tl-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(520px, 90%);
  background: var(--cream-bright);
  border: 1px solid rgba(124, 138, 111, 0.18);
  border-radius: 18px;
  padding: 32px 36px;
  box-shadow: var(--shadow-card);
  text-align: center;
  transform: translate(-50%, 0) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition: transform 700ms var(--ease-soft), opacity 700ms var(--ease-soft);
  will-change: transform, opacity;
}
.aw-tl-card.is-active {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  z-index: 3;
  pointer-events: auto;
}
.aw-tl-card.is-prev {
  transform: translate(calc(-50% - 280px), 0) scale(0.85);
  opacity: 0.4;
  z-index: 2;
}
.aw-tl-card.is-next {
  transform: translate(calc(-50% + 280px), 0) scale(0.85);
  opacity: 0.4;
  z-index: 2;
}
.aw-tl-card.is-far { opacity: 0; }

@media (max-width: 720px) {
  .aw-tl-track { height: 240px; }
  .aw-tl-card.is-prev { transform: translate(calc(-50% - 160px), 0) scale(0.82); opacity: 0.25; }
  .aw-tl-card.is-next { transform: translate(calc(-50% + 160px), 0) scale(0.82); opacity: 0.25; }
  .aw-tl-card { padding: 24px 22px; }
}

.aw-tl-card .day {
  display: inline-block;
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust-deep);
  margin-bottom: 14px;
}
.aw-tl-card .label {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink-deep);
}
.aw-tl-card .caption {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.55;
  color: var(--ink-deep);
  opacity: 0.78;
  margin: 0;
}

.aw-tl-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.aw-tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background var(--dur-quick) var(--ease-soft), transform var(--dur-quick) var(--ease-soft);
}
.aw-tl-dot:hover { transform: scale(1.15); }
.aw-tl-dot.is-active { background: var(--sage); }

/* Reduced-motion static stack */
.aw-tl-stack {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.aw-tl-static {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 18px;
  padding: 16px 20px;
  background: var(--cream-bright);
  border-left: 3px solid var(--sage);
  border-radius: 0 10px 10px 0;
}
.aw-tl-static .day {
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-deep);
}
.aw-tl-static .label {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 19px;
  color: var(--ink-deep);
  margin-bottom: 4px;
}
.aw-tl-static .caption {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  color: var(--ink-deep);
  opacity: 0.72;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .aw-donut-figure .seg {
    transition: none;
    stroke-dasharray: 100 100;
  }
  .aw-tl-card { transition: none; }
}
