/* TotalDesign curated article TOC: extends shared Reading Navigator without
   introducing a second headings parser, scrollspy or navigation state. */
.td-single .tdrn--curated {
  --td-curated-ink: #102344;
  --td-curated-blue: #336fae;
  --td-curated-line: #dbe6f2;
  width: 100%;
  max-width: none;
  margin: 24px 0 30px;
  color: var(--td-curated-ink);
}

.td-single .tdrn--curated,
.td-single .tdrn--curated *,
.td-single .tdrn--curated *::before,
.td-single .tdrn--curated *::after {
  box-sizing: border-box;
}

.td-single .tdrn--curated > .tdrn__details {
  position: relative;
  border: 1px solid #d9e5f0;
  border-radius: 20px;
  background: linear-gradient(135deg, #fbfdff 0%, #f3f8fe 65%, #eaf4fc 100%);
  box-shadow: 0 10px 30px rgba(19, 47, 84, .065);
  overflow: hidden;
}

.td-single .tdrn--curated .tdrn__summary {
  align-items: center;
  gap: 13px;
  padding: 20px 21px 12px;
  background: transparent;
  color: var(--td-curated-ink);
}

.td-single .tdrn--curated .tdrn__summary-main {
  position: relative;
  display: grid;
  flex: 1;
  gap: 5px;
  padding-left: 54px;
  min-height: 43px;
  align-content: center;
}

.td-single .tdrn--curated .tdrn__summary-main::before {
  content: "☷";
  display: flex;
  position: absolute;
  left: 0;
  top: 0;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: #e1eefb;
  color: #246eae;
  font-size: 1.5rem;
  font-weight: 700;
}

.td-single .tdrn--curated .tdrn__title {
  font-size: clamp(1.08rem, 2vw, 1.27rem);
  font-weight: 800;
  letter-spacing: -.018em;
  line-height: 1.25;
  color: #0b1c3a;
}

.td-single .tdrn--curated .tdrn__meta {
  color: #66819e;
  font-size: .79rem;
}

.td-single .tdrn--curated .tdrn__reading-time {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 30px;
  background: #e3effb;
  color: #315f8f;
  font-weight: 750;
  white-space: nowrap;
}

.td-single .tdrn--curated .tdrn__summary::after {
  margin-left: 7px;
}

.td-single .tdrn--curated .tdrn__progress {
  height: 3px;
  background: #dceafb;
}

.td-single .tdrn--curated .tdrn__nav {
  max-height: none;
  overflow: visible;
  padding: 0 17px 17px;
  background: transparent;
}

.td-single .tdrn--curated .td-visual-toc__intro {
  margin: 0 0 13px;
  color: #647d98;
  font-size: .91rem;
  line-height: 1.5;
}

.td-single .tdrn--curated .td-visual-toc__chapters {
  display: grid;
  gap: 9px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.td-single .tdrn--curated .td-visual-toc__chapter {
  display: block;
  padding: 0;
  margin: 0;
  list-style: none;
  border: 1px solid var(--td-curated-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .91);
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.td-single .tdrn--curated .td-visual-toc__chapter:hover,
.td-single .tdrn--curated .td-visual-toc__chapter.is-active-ancestor {
  border-color: #b7cfe9;
  box-shadow: 0 5px 18px rgba(22, 60, 110, .05);
}

.td-single .tdrn--curated .td-visual-toc__chapter-summary {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 74px;
  padding: 13px 15px;
  list-style: none;
  cursor: pointer;
  color: #142a4b;
}

.td-single .tdrn--curated .td-visual-toc__chapter-summary::-webkit-details-marker {
  display: none;
}

.td-single .tdrn--curated .td-visual-toc__chapter-summary::marker {
  content: "";
}

.td-single .tdrn--curated .td-visual-toc__chapter-summary:focus-visible,
.td-single .tdrn--curated .td-visual-toc__link:focus-visible {
  outline: 3px solid rgba(46, 111, 180, .35);
  outline-offset: -3px;
  border-radius: 10px;
}

.td-single .tdrn--curated .td-visual-toc__icon {
  display: flex;
  flex: 0 0 43px;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: #e3effc;
  color: #2469a8;
}

.td-single .tdrn--curated [data-td-curated-icon="check"] .td-visual-toc__icon {
  color: #26806c;
  background: #e1f4eb;
}
.td-single .tdrn--curated [data-td-curated-icon="ruler"] .td-visual-toc__icon {
  color: #a46d1b;
  background: #fff0d9;
}
.td-single .tdrn--curated [data-td-curated-icon="corner"] .td-visual-toc__icon {
  color: #7755b7;
  background: #efe8fb;
}
.td-single .tdrn--curated [data-td-curated-icon="bed"] .td-visual-toc__icon {
  color: #be627b;
  background: #fce8ef;
}
.td-single .tdrn--curated [data-td-curated-icon="layers"] .td-visual-toc__icon {
  color: #5373a2;
  background: #e7ebf9;
}

.td-single .tdrn--curated .td-visual-toc__chapter-copy {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.td-single .tdrn--curated .td-visual-toc__chapter-copy strong {
  color: #0d2446;
  font-size: .97rem;
  font-weight: 800;
  line-height: 1.3;
}

.td-single .tdrn--curated .td-visual-toc__chapter-copy > span {
  color: #687b91;
  font-size: .78rem;
  line-height: 1.35;
}

.td-single .tdrn--curated .td-visual-toc__chevron {
  flex: 0 0 auto;
  color: #517699;
  transition: transform .16s ease;
}

.td-single .tdrn--curated .td-visual-toc__chapter-details[open] .td-visual-toc__chevron {
  transform: rotate(180deg);
}

.td-single .tdrn--curated .td-visual-toc__links {
  list-style: none;
  margin: 0 13px 13px;
  padding: 7px 0 0;
  border-top: 1px solid #e4edf7;
}

.td-single .tdrn--curated .td-visual-toc__link-item {
  display: block;
  padding: 0;
  margin: 0;
  list-style: none;
}

.td-single .tdrn--curated .td-visual-toc__link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #384e68;
  font-size: .86rem;
  font-weight: 570;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.td-single .tdrn--curated .td-visual-toc__dot {
  display: block;
  flex: 0 0 8px;
  height: 8px;
  border-radius: 50%;
  background: #a9b7ca;
}

.td-single .tdrn--curated .td-visual-toc__link:hover,
.td-single .tdrn--curated .td-visual-toc__link:focus-visible,
.td-single .tdrn--curated .td-visual-toc__link.is-active {
  color: #174d8f;
  background: #e5f1ff;
}

.td-single .tdrn--curated .td-visual-toc__link.is-active .td-visual-toc__dot {
  background: #2677d4;
}

@media (max-width: 767px) {
  .td-single .tdrn--curated {
    margin: 16px 0 25px;
  }
  .td-single .tdrn--curated > .tdrn__details {
    border-radius: 16px;
  }
  .td-single .tdrn--curated .tdrn__summary {
    padding: 15px 13px 10px;
    gap: 7px;
  }
  .td-single .tdrn--curated .tdrn__summary-main {
    padding-left: 46px;
  }
  .td-single .tdrn--curated .tdrn__summary-main::before {
    width: 37px;
    height: 37px;
    font-size: 1.3rem;
  }
  .td-single .tdrn--curated .tdrn__reading-time {
    font-size: .72rem;
    padding: 5px 7px;
  }
  .td-single .tdrn--curated .tdrn__nav {
    padding: 0 10px 12px;
  }
  .td-single .tdrn--curated .td-visual-toc__chapter-summary {
    min-height: 66px;
    padding: 10px;
    gap: 10px;
  }
  .td-single .tdrn--curated .td-visual-toc__icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .td-single .tdrn--curated .td-visual-toc__chapter-copy strong {
    font-size: .9rem;
  }
  .td-single .tdrn--curated .td-visual-toc__chapter-copy > span {
    font-size: .74rem;
  }
  .td-single .tdrn--curated .td-visual-toc__links {
    margin: 0 8px 9px;
  }
  .td-single .tdrn--curated .td-visual-toc__intro {
    padding: 0 3px;
    font-size: .83rem;
  }
}


/* Desktop variant: the very same TDRN markup is mounted in the existing
   single-article rail at >=1100px. At smaller widths it stays inline. */
@media (min-width: 1100px) {
  /* The legacy aside uses align-self:start, giving it only the TOC's height.
     Stretch it ONLY for a curated nav so sticky can follow the whole article. */
  .td-single-style--editorial .td-single-sidebar:has(> .tdrn--curated) {
    align-self: stretch;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated {
    width: 100%;
    max-width: none;
    margin: 0;
    position: sticky;
    top: var(--tdrn-sticky-top, 96px);
    align-self: start;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated > .tdrn__details {
    display: flex;
    flex-direction: column;
    max-block-size: calc(100dvh - var(--tdrn-sticky-top, 96px) - 20px);
    min-height: 0;
    border-radius: 16px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__summary {
    flex: 0 0 auto;
    min-height: 66px;
    padding: 12px 11px 9px;
    border-bottom: 0;
    gap: 7px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__summary-main {
    min-height: 36px;
    padding-left: 41px;
    gap: 2px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__summary-main::before {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    font-size: 1.15rem;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__title {
    font-size: .95rem;
  }

  /* The generic sidebar adds a book icon to the title. The curated header
     already has its own icon, so never render both on top of one another. */
  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__title::before {
    content: none;
    display: none;
    background-image: none;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__meta {
    font-size: .71rem;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__reading-time {
    font-size: .69rem;
    padding: 5px 6px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .tdrn__nav {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    max-block-size: none;
    padding: 0 8px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__intro {
    margin-bottom: 9px;
    font-size: .76rem;
    line-height: 1.4;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__chapters {
    gap: 7px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__chapter-summary {
    min-height: 58px;
    padding: 9px 8px;
    gap: 9px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__icon svg {
    width: 20px;
    height: 20px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__chapter-copy strong {
    font-size: .84rem;
    line-height: 1.24;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__chapter-copy > span {
    font-size: .7rem;
    line-height: 1.3;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__links {
    margin: 0 6px 8px;
    padding-top: 5px;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__link-item {
    border-top: 0;
  }

  .td-single-style--editorial .td-single-sidebar .tdrn--curated .td-visual-toc__link {
    min-height: 36px;
    padding: 7px 8px;
    font-size: .78rem;
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .td-single .tdrn--curated .td-visual-toc__chevron,
  .td-single .tdrn--curated .td-visual-toc__chapter {
    transition: none;
  }
}
