#storiesHero {
  position: relative;
  width: 100%;
  max-width: 900px;
  min-width: 500px;
  margin: 20px auto 0 auto;
}

#storiesHero .banner {
  background: #1f3c88;
  color: #fff;
  font-family: 'bronic', sans-serif;
  font-size: 80px;
  letter-spacing: 3px;
  text-align: center;
  padding: 12px 40px 22px 40px;
  border-radius: 55px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  text-shadow: -1px 0 1px #000, 0 1px 1px #000, 1px 0 1px #000, 0 -1px 1px #000;
  position: relative;
}

#storiesHero .banner::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: 70%;
  height: 5px;
  background: #4d7fe7;
  border-radius: 3px;
  opacity: 0.9;
}

#whyBlock {
  position: relative;
  width: 100%;
  max-width: 900px;
  min-width: 500px;
  margin: 12px auto 0 auto;
}

#whyBlock .whyPill {
  width: 80%;
  margin: -14px auto 0 auto;
  height: 38px;
  border-radius: 22px;
  background: #252525;
  display: grid;
  place-items: center;
  color: #4d7fe7;
  font-family: 'bronic', sans-serif;
  font-size: 32px;
  letter-spacing: 2px;
  position: relative;
}

#whyBlock .whyIntro {
  width: 50%;
  margin: 20px auto 12px auto;
  color: #e6eeff;
  text-align: center;
  font-family: 'fr-bold', sans-serif;
  font-size: 18px;
  line-height: 22px;
}

#whyBlock .whyPill .plate {
  position: absolute;
  bottom: -16px;
  width: 92px;
  height: 28px;
  background: #393e48;
  border: 1px solid #151515;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#whyBlock .whyPill .plate.left {
  left: 10%;
  transform: translateX(-50%);
}

#whyBlock .whyPill .plate.right {
  left: 90%;
  transform: translateX(-50%);
}

#whyBlock .whyPill .plate .bolt {
  position: absolute;
  top: 11px;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle at 40% 40%, #222 0 4px, #0f0f0f 5px 10px);
  border-radius: 50%;
}

#whyBlock .whyPill .plate .bolt.one { left: 10px; }
#whyBlock .whyPill .plate .bolt.two { right: 10px; }

#whyBlock .whyPill .plate .bolt::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 18px;
  width: 13px;
  background-image: url("../../assets/images/chain.png");
  background-repeat: repeat-y;
  background-size: 13px auto;
}

#whyBlock .whyPill .plate.left  .bolt.one::after { height: 173px; }
#whyBlock .whyPill .plate.left  .bolt.two::after { height: 110px; }
#whyBlock .whyPill .plate.right .bolt.one::after { height: 110px; }
#whyBlock .whyPill .plate.right .bolt.two::after { height: 152px; }

/* Long plate that tabs hang from (between inner chains) */
#whyBlock .whyConnector {
  position: relative;
  width: 80%;
  max-width: 900px;
  margin: 8px auto 6px auto;
}

#whyBlock .whyConnector .connectorBar {
  position: relative;
  width: 74%;
  height: 10px;
  margin: 0 auto;
  background: #252525;
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

#whyBlock .whyConnector .connectorBar::before,
#whyBlock .whyConnector .connectorBar::after { content: none; }

/* Story tabs mimic navbar */
.storyTabs {
  width: 70%;
  min-width: 500px;
  max-width: 900px;
  margin: 6px auto 10px auto;
  display: flex;
  justify-content: center;
  gap: 28px;
  position: relative;
  --bar-gap: 8px; 
}

.story_link {
  width: 260px;
  height: 30px;
  border: 1px solid #151515;
  border-radius: 24px;
  background: #252525;
  color: #e6eeff;
  font-family: 'bronic', sans-serif;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: margin-top 0.5s ease;
  --story-offset: 12px;
  margin-top: var(--story-offset);
  z-index: 1;
}

.story_link::before,
.story_link::after {
  content: "";
  position: absolute;
  bottom: 100%;
  width: 13px;
  height: calc(var(--bar-gap) + var(--story-offset));
  background-image: url("../../assets/images/chain.png");
  background-repeat: repeat-y;
  background-size: 13px auto;
  background-position: top center;
  transition: height 0.5s ease, background-position 0.5s ease;
  z-index: 0;
}

.story_link::before { left: 20%; transform: translateX(-50%); }
.story_link::after  { left: 80%; transform: translateX(-50%); }

.story_link:hover:not(.active) {
  --story-offset: 20px;
  background: #a9a9a9;
  color: #252525;
}

.story_link.active {
  --story-offset: 30px;
  background: #e6eeff;
  color: #252525;
}

/* Story header with plates */
#storyHeader {
  position: relative;
  width: 100%;
  max-width: 900px;
  min-width: 500px;
  margin: 0 auto;
}

.storyHeaderPill {
  width: 85%;
  max-width: 900px;
  min-width: 500px;
  margin: 56px auto 8px auto; /* extra space from tabs */
  height: 48px;
  background: #252525;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #e6eeff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.storyHeaderPill .storyTitle {
  font-family: 'bronic', sans-serif;
  font-size: 38px;
  letter-spacing: 2px;
  display: inline-block;
  text-align: center;
}

/* Story header: vertical side plates with single chains (match site style) */
#storyHeader .plate {
  position: absolute;
  top: -4px;
  width: 22px;
  height: 54px;
  background: #393e48;
  border: 1px solid #151515;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#storyHeader .plate.left  { left: 77px; }
#storyHeader .plate.right { right: 77px; }

#storyHeader .plate .bolt {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: radial-gradient(circle at 40% 40%, #222 0 3px, #0f0f0f 4px 8px);
  border-radius: 50%;
}

#storyHeader .plate .bolt.one { top: 35px; }
#storyHeader .plate .bolt.two { top: 11px; }

/* Disable chains from bolts; use single centered chain from plate bottom */
#storyHeader .plate .bolt::after { content: none !important; }
#storyHeader .plate::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  width: 13px;
  height: 270px;
  background-image: url("../../assets/images/chain.png");
  background-repeat: repeat-y;
  background-size: 13px auto;
  pointer-events: none;
  z-index: -1;
}

.storyBody {
  width: 33%; /* content fits between inner chains */
  margin: 12px auto 60px auto;
  color: #e6eeff;
  text-align: center;
  font-family: 'fr-bold', sans-serif;
  line-height: 25px;
  font-size: 18px;
}

/* BEGIN: DCG_CUSTOM_CSS */
#dcg-root {
  text-align: left; /* override .storyBody center */
}

/* Make the Legends timeline look like Collections tables */
.story-timeline {
  margin: 20px auto 30px auto;
  padding: 0;
  position: relative;
  width: 100%;
  min-width: 500px;
}

/* Each chapter row */
.chapter { position: relative; margin: 0; }

/* Chapter clickable row styled like .collectionsTable tbody td */
.chapter-link {
  font-family: 'fr-bold', sans-serif;
  font-size: 16px;
  color: #e6eeff;
  cursor: pointer;
  position: relative;
  display: block;
  padding: 10px 12px;
  line-height: 22px;
  background: #242b33;
  border-top: 1px solid #00000055;
  border-bottom: 1px solid #00000055; /* ensure bottom border on last entry when collapsed */
  border-left: 1px solid #00000055;
  border-right: 1px solid #00000055;
  letter-spacing: .08px;
}

/* Zebra stripes and hover (match Collections) */
.chapter:nth-child(even) .chapter-link { background: #29313c; }
.chapter:hover .chapter-link        { background: #313b4c; }

/* Rounded corners for the first and when open */
/* Collapsed entries have fully rounded corners */
.chapter .chapter-link { border-radius: 10px; }

/* Remove the circular bolt accents for a cleaner table look */
.chapter-link::before,
.chapter-link::after { content: none; }

/* Expanded cell under the clickable row */
.chapter-content {
  display: none;
  margin: 0;              /* align with table rows */
  padding: 12px 12px 16px 12px;
  font-size: 14px;
  background: #242b33;
  border-left: 1px solid #00000055;
  border-right: 1px solid #00000055;
  border-bottom: 1px solid #00000055;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  color: #e6eeff;
}
.chapter:nth-child(even) .chapter-content { background: #29313c; }

.chapter-content p { margin: 0 0 8px 0; }

.chapter-content a {
  color: #a9c5ff;
  text-decoration: none;
}

.chapter-content a:hover { text-decoration: underline; }

/* Translucent pill for the Watch Stream link */
.chapter-content a.watch-stream {
  display: block;
  padding: 4px 10px;
  margin: 15px auto 5px auto;
  background: rgba(10, 15, 26, 0.55);
  border: 1px solid #1d2630;
  border-radius: 25px;
  color: #a9c5ff;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  width: 80%;
}

.chapter-content a.watch-stream:hover {
  background: linear-gradient(180deg, rgba(46,46,46,0.96) 0%, rgba(58,63,73,0.90) 100%);
  color: #e6eeff;
  text-decoration: none;
}

/* Subtle emphasis on hover already handled above; when open keep same bg */
.chapter.open .chapter-link {
  background: #313b4c;
  border-bottom: none;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Remove chain decorations from timeline rows */
.chapter::before,
.chapter::after { content: none !important; display: none !important; }

/* Chains under bolts: grow/shrink with chapter height */
.chapter {
  position: relative;
}
.chapter::before,
.chapter::after {
  content: "";
  position: absolute;
  top: 23px;                /* align to bolt bottom (line-height 30 + padding 6) */
  bottom: -33px;            /* extend to meet next chapter's bolt when closed */
  width: 13px;
  background-image: url("../../assets/images/chain.png");
  background-repeat: repeat-y;
  background-size: 13px auto;
  background-position: top center;
  opacity: 1;               /* always visible */
  transition: bottom 0.25s ease;
  pointer-events: none;
  z-index: 3;               /* above most, below bolt caps */
}
.chapter::before { left: 12px; }
.chapter::after  { right: 13px; }
.chapter.open::before,
.chapter.open::after {
  bottom: -23px;                /* extend to chapter bottom when open */
}

/* END: DCG_CUSTOM_CSS */
/* DCG_READ_MORE + READ_ALOUD enhancements */
#dcg-root {
  /* Controls for chapter CTAs, divider line, and fade */
  --cta-width: 75%;
  --cta-height: 30px; /* a bit smaller */
  --line-thickness: 5px; /* slightly thicker again */
  --line-nudge: 5px;      /* move line a bit further down */
  --fade-size: 120px;     /* fade starts this far from bottom */
  --page-img-bg: #2B2F37; /* approx avg of assets/images/pageBack.png */
}

#dcg-root .chapter-content { position: relative; }

/* Stack actions; each on its own line */
#dcg-root .chapter-actions {
  display: block;
  margin: 10px 0 8px;
}

/* Unify CTA look: watch-stream, read-aloud, read-more */
#dcg-root .chapter-actions a.watch-stream,
#dcg-root .chapter-actions .read-aloud,
#dcg-root .chapter-content .read-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--cta-width);
  min-height: var(--cta-height);
  margin: 0 auto 10px auto;
  padding: 6px 12px;
  /* smaller and more dark-gray forward */
  background: linear-gradient(180deg, rgba(37,37,37,0.94) 0%, rgba(52,58,68,0.92) 100%);
  border: 1px solid #1d2630;
  border-radius: 25px;
  color: #a9c5ff;
  text-decoration: none;
  font-family: 'fr-bold', sans-serif;
  font-size: 14px;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: background 0.2s ease, color 0.2s ease, transform 0.06s ease;
  cursor: pointer;
}

#dcg-root .chapter-actions a.watch-stream:hover,
#dcg-root .chapter-actions .read-aloud:hover,
#dcg-root .chapter-content .read-more:hover {
  background: linear-gradient(180deg, rgba(45,51,62,0.98) 0%, rgba(60,67,80,0.96) 100%);
  color: #e6eeff;
  text-decoration: none;
}

#dcg-root .chapter-actions .read-aloud:active,
#dcg-root .chapter-content .read-more:active {
  transform: translateY(1px);
}

#dcg-root .chapter-actions .read-aloud:focus,
#dcg-root .chapter-content .read-more:focus {
  outline: 2px solid #4d7fe7;
  outline-offset: 2px;
}

/* Text container with extra bottom padding for overlapping Read more button */
#dcg-root .chapter-text {
  overflow: hidden;
  transition: max-height 0.25s ease;
  position: relative;
  padding-bottom: calc(var(--cta-height) / 2 + 22px);
}

.chapter-date {
  font-size: 18px;
  padding: 20px 15px 0px 15px;
  color: #6db9fb;
}

#dcg-root .chapter-text .chapter-text-inner { 
  display: block;
  padding: 20px;
}

#dcg-root .chapter-text.collapsed { max-height: 12em; }
#dcg-root .chapter-text.expanded { max-height: 10000px; }

/* Divider line: centered vertically with the Read more button */
#dcg-root .chapter-text.collapsed::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: var(--line-thickness);
  /* Center the line on the same plane as the Read more button's vertical center */
  bottom: calc((var(--cta-height) / -2) - (var(--line-thickness) / 2) + var(--line-nudge));
  background: rgba(77,127,231,0.65);
  z-index: 2; /* above text and fade overlay */
}

/* Pull Read more up so its vertical center meets the bottom edge/line */
#dcg-root .chapter-content .read-more {
  margin-top: calc(var(--cta-height) / -2 + 20px);
  position: relative;
  z-index: 3; /* above the divider */
}

/* When expanded, restore normal spacing for the Read more/less button */
#dcg-root .chapter-text.expanded + .read-more,
#dcg-root .chapter-text.expanded ~ .read-more {
  margin-top: 10px;
}

/* Simple visual fade using a background-color overlay to match page */
#dcg-root .chapter-text.collapsed::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--fade-size);
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, var(--page-img-bg) 100%);
  z-index: 1; /* below the divider line */
}

/* Side chapters (side projects) rendered as indented, slightly smaller entries */
#dcg-root .chapter.side { margin-left: 20px; }
#dcg-root .chapter.side .chapter-link { 
  font-size: 15px;
  height:  10px;
  line-height: 10px;
}
#dcg-root .chapter.side .chapter-actions a.watch-stream,
#dcg-root .chapter.side .chapter-actions .read-aloud,
#dcg-root .chapter.side .chapter-content .read-more { width: 65%; }
