/* Rich methodology-guide layer (extracted from the approved leading-tasks v3).
 * Scoped entirely under body.gd-rich; stacked over home-parity.css + guides.css
 * by guide_rich_base.html. Components: sticky/mobile outline (nav.gd-outline),
 * gd-ref citation links, gd-steps-c colored step circles, gd-kicker--1/2/3
 * colored walkthrough kickers, offset-shadow instructional frames,
 * gd-product-chapter overrides (frameless evidence), gd-cta-glow animated CTA.
 * Guides opt in per component and may re-tint via the custom properties below.
 * Drift stops = the product setup-guide palette (dendropad/setup-guide.html).
 */

.gd-rich {
  --gd-drift-gradient: linear-gradient(90deg,
    #FFB3D9, #E0BBF5, #BBDAFF, #BBFFF0, #D4FFBB, #FFFFBB, #FFE5BB, #FFD1BB,
    #FFB3D9, #E0BBF5, #BBDAFF, #BBFFF0, #D4FFBB, #FFFFBB, #FFE5BB, #FFD1BB, #FFB3D9);
  --gd-step-1: #E0BBF5;   /* lavender — step 1 */
  --gd-step-2: #FFD1BB;   /* peach — step 2 */
  --gd-step-3: #D4FFBB;   /* mint — step 3 */
  --gd-ink: #185FA5;      /* citations + captions (product --color-link) */
  --gd-cta-drift: 18s;    /* CTA gradient drift duration */
}

/* ---------- Outline: mobile pill row / desktop sticky rail ---------- */

.gd-rich .gd-outline {
  margin: 0 0 24px;
}

.gd-rich .gd-outline__title {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #303030;
}

.gd-rich .gd-outline__list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.gd-rich .gd-outline__list li {
  margin: 0;
}

.gd-rich .gd-outline__list a {
  display: inline-block;
  white-space: nowrap;
  padding: 4px 12px;
  border: 1.5px solid #303030;
  border-radius: 999px;
  background-color: white;
  color: #303030;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.gd-rich .gd-outline__list a:hover {
  box-shadow: 2px 2px 0 #E0BBF5;
}

.gd-rich .gd-outline a:focus-visible {
  outline: 2px solid #643995;
  outline-offset: 2px;
}

@media (min-width: 1100px) {
  .gd-rich .gd-layout {
    display: grid;
    grid-template-columns: minmax(0, 740px) 180px;
    gap: 56px;
    justify-content: center;
  }

  .gd-rich .gd-content {
    grid-column: 1;
    grid-row: 1;
  }

  .gd-rich .gd-outline {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    position: sticky;
    top: 96px;
    margin: 6px 0 0;
  }

  .gd-rich .gd-outline__list {
    display: block;
    overflow: visible;
    padding: 0;
  }

  .gd-rich .gd-outline__list a {
    display: block;
    white-space: normal;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    background: none;
    color: #6d6d6d;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.4;
  }

  .gd-rich .gd-outline__list a:hover {
    color: #303030;
    box-shadow: none;
    background: linear-gradient(90deg, #f8f4fd, transparent);
  }

  .gd-rich .gd-outline__list a.is-active {
    background: linear-gradient(90deg, #f5f0ff, #eafcf5);
    color: #303030;
    font-weight: 700;
  }
}

/* ---------- H1 gradient underline ---------- */

.gd-rich .gd-content > h1::after {
  content: '';
  display: block;
  width: 150px;
  height: 6px;
  border-radius: 3px;
  margin-top: 14px;
  background: var(--gd-drift-gradient);
  background-size: 300% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .gd-rich .gd-content > h1::after {
    animation: gd-rich-drift 25s linear infinite;
  }
}

/* ---------- Gradient hairlines above sections ---------- */

.gd-rich .gd-content > h2 {
  position: relative;
  padding-top: 26px;
}

.gd-rich .gd-content > h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, #E0BBF5, #BBFFF0 60%, transparent);
}

/* ---------- Citations: ink-dot direction, dark blue, sentence case ---------- */

.gd-rich a.gd-ref {
  display: inline-block;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--gd-ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: background-size 0.25s ease;
}

.gd-rich a.gd-ref::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
  background: linear-gradient(135deg, #BBDAFF, var(--gd-ink));
}

.gd-rich a.gd-ref:hover {
  background-size: 100% 1.5px;
}

.gd-rich a.gd-ref:focus-visible {
  outline: 2px solid var(--gd-ink);
  outline-offset: 2px;
}

/* ---------- Offset hard-shadow instructional frames ---------- */

.gd-rich .gd-glance {
  border: 2px solid #303030;
  background-color: white;
  box-shadow: 6px 6px 0 #E0BBF5;
}

.gd-rich .gd-example {
  border: 2px solid #303030;
  background-color: white;
  box-shadow: 6px 6px 0 #FFD1BB;
}

.gd-rich .gd-tree-sample {
  border: 2px solid #303030;
  background-color: white;
  box-shadow: 6px 6px 0 #BBDAFF;
}

.gd-rich .gd-example .gd-rewrite {
  border: 1px solid #c9edb3;
}

/* ---------- Rich skins for shared grammar components ----------
 * Family treatment (2px #303030 border + pastel offset shadow) for components
 * from guides.css when they appear on a rich page. None of these classes are
 * used by the leading-tasks v3 page, so v3 is unaffected.
 */

.gd-rich .gd-card {
  border: 2px solid #303030;
  box-shadow: 4px 4px 0 var(--gd-step-1);
}

.gd-rich .gd-card:nth-child(3n+2) {
  box-shadow: 4px 4px 0 #BBDAFF;
}

.gd-rich .gd-card:nth-child(3n) {
  box-shadow: 4px 4px 0 var(--gd-step-3);
}

.gd-rich .gd-note {
  border-left: none;
  border: 2px solid #303030;
  border-radius: 8px;
  background-color: white;
  box-shadow: 6px 6px 0 #FFFFBB;
}

/* colored fill for the classic gd-steps workflow circles, cycling the step palette */
.gd-rich .gd-steps > li::before {
  border: none;
  background-color: var(--gd-step-1);
  color: #303030;
}

.gd-rich .gd-steps > li:nth-child(3n+2)::before {
  background-color: var(--gd-step-2);
}

.gd-rich .gd-steps > li:nth-child(3n)::before {
  background-color: var(--gd-step-3);
}

/* ---------- Colored step circles (generic numbered method lists) ---------- */

.gd-rich ol.gd-steps-c {
  list-style: none;
  counter-reset: gd-c;
  margin: 20px 0;
  padding: 0;
}

.gd-rich ol.gd-steps-c > li {
  counter-increment: gd-c;
  position: relative;
  padding: 2px 0 22px 54px;
}

.gd-rich ol.gd-steps-c > li:last-child {
  padding-bottom: 0;
}

.gd-rich ol.gd-steps-c > li::before {
  content: counter(gd-c);
  position: absolute;
  left: 0;
  top: -3px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--gd-step-1);
  color: #303030;
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gd-rich ol.gd-steps-c > li:nth-child(2)::before {
  background-color: var(--gd-step-2);
}

.gd-rich ol.gd-steps-c > li:nth-child(3)::before {
  background-color: var(--gd-step-3);
}

/* ---------- Product chapter: bordered container, colored steps, frameless shots ---------- */

.gd-rich .gd-product-chapter {
  border: 2px solid #303030;
  background-color: white;
  box-shadow: 8px 8px 0 #E0BBF5;
}

.gd-rich .gd-kicker {
  gap: 12px;
  font-size: 16px;
}

.gd-rich .gd-kicker__num {
  border: none;
  width: 32px;
  height: 32px;
  font-size: 15px;
  font-weight: 800;
  color: #303030;
  background-color: var(--gd-step-1);
}

.gd-rich .gd-kicker--2 .gd-kicker__num {
  background-color: var(--gd-step-2);
}

.gd-rich .gd-kicker--3 .gd-kicker__num {
  background-color: var(--gd-step-3);
}

/* captions share the citation dark blue — both are supporting apparatus */
.gd-rich .gd-figure figcaption {
  color: var(--gd-ink);
}

/* screenshots: no frames, soft definition shadow only */
.gd-rich .gd-product-chapter .gd-frame {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.gd-rich .gd-product-chapter .gd-frame img {
  border-radius: 8px;
}

/* ---------- CTA: animated gradient field, thin frame, no tilt ---------- */

.gd-rich .gd-cta-glow {
  margin-top: 56px;
  padding: 8px;
  border-radius: 16px;
  background: var(--gd-drift-gradient);
  background-size: 300% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .gd-rich .gd-cta-glow {
    animation: gd-rich-drift var(--gd-cta-drift) linear infinite;
  }
}

@keyframes gd-rich-drift {
  to {
    background-position: 300% 0%;
  }
}

.gd-rich .gd-cta-glow .gd-cta {
  margin-top: 0;
  border: 2px solid #303030;
  border-radius: 10px;
  background-color: white;
}

.gd-rich .gd-cta h2 {
  font-size: 26px;
}

@media (max-width: 640px) {
  .gd-rich .gd-cta-glow {
    padding: 6px;
  }
}

/* ---------- Outline lane: the chapter breakout must never slide under the rail.
 * The parity .container is a fixed 1080px (1004px inner), so the whole rail
 * range has one budget: 740 column + 84 gutter + 180 rail = 1004. The chapter
 * caps at 860px (60px overhang per side + 8px shadow < 84px gutter) and also
 * yields to the viewport's left edge near 1100px. ---------- */

@media (min-width: 1100px) {
  .gd-rich .gd-layout {
    gap: 84px;
  }

  .gd-rich .gd-product-chapter {
    width: min(860px, calc(100vw - 280px));
  }
}
