/* Story detail polish. Keep Fictioneer's story structure and content owners. */

/* Retain Fictioneer's utility header while removing its large site identity. */
body.single-fcn_story.zy-cohesion-view :is(.header, .top-header) {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

body.single-fcn_story.zy-cohesion-view :is(.header, .top-header):has(> :not(.header__title):not(.top-header__title):not(.top-header__content)) {
  min-height: 2.2rem !important;
  margin-bottom: 0.28rem !important;
  padding-block: 0.12rem 0.38rem !important;
}

body.single-fcn_story.zy-cohesion-view :is(.header__title, .top-header__title) {
  display: none !important;
}

body.single-fcn_story.zy-cohesion-view .story__header {
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  padding-bottom: clamp(0.85rem, 1.8vw, 1.3rem);
  border-bottom: 1px solid rgba(255, 214, 140, 0.14);
}

body.single-fcn_story.zy-cohesion-view .story__header .story__identity {
  row-gap: 0.5rem;
}

body.single-fcn_story.zy-cohesion-view .story__identity-title {
  max-width: min(23ch, 100%);
  margin: 0.25rem auto;
  line-height: 1.06;
  text-wrap: balance;
  overflow-wrap: anywhere;
  background: none;
  color: rgba(248, 241, 226, 0.98) !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(0, 0, 0, 0.35), 0 -1px 0 rgba(255, 255, 255, 0.08);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  body.single-fcn_story.zy-cohesion-view .story__identity-title {
    background: linear-gradient(180deg, #fff 0%, #f3dc8a 30%, #d4af37 58%, #8a7122 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
  }
}

body.single-fcn_story.zy-cohesion-view .story__header .story__taxonomies {
  max-width: min(56rem, 100%);
  margin-inline: auto;
  row-gap: 0.5rem;
}

/* Match the chapter author line while retaining Fictioneer's author link. */
body.single-fcn_story.zy-cohesion-view .story__identity-meta {
  margin-top: 0.06rem;
  color: rgba(206, 210, 221, 0.76);
  font-family: "Lato", var(--ff-base);
  font-size: clamp(0.76rem, 0.22vw + 0.72rem, 0.88rem);
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.025em;
  text-transform: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.single-fcn_story.zy-cohesion-view .story__identity-meta a {
  color: inherit;
}

/* Keep the chapter picker and list on one measured, responsive rhythm. */
body.single-fcn_story.zy-cohesion-view .story__tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.48rem;
  min-width: 0;
  margin-block: 1rem 0.58rem;
  padding: 0.48rem 0.62rem;
  border: 1px solid rgba(255, 214, 140, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.075));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body.single-fcn_story.zy-cohesion-view .story__tabs > * {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.single-fcn_story.zy-cohesion-view .story__tabs > :first-child {
  color: rgba(255, 226, 160, 0.94);
  font-family: "Cinzel", var(--ff-heading);
  font-weight: 700;
  letter-spacing: 0.045em;
}

body.single-fcn_story.zy-cohesion-view .story__tabs > :not(:first-child) {
  min-width: 2.6rem;
  min-height: 2.6rem;
}

body.single-fcn_story.zy-cohesion-view .story__chapters .chapter-group__list {
  gap: 0.42rem;
  padding: 0.52rem;
}

body.single-fcn_story.zy-cohesion-view .story__chapters .chapter-group__list-item {
  min-height: 3.6rem;
  padding-block: 0.16rem;
}

@media (max-width: 600px) {
  body.single-fcn_story.zy-cohesion-view .story__header {
    margin-bottom: 0.95rem;
    padding-bottom: 0.75rem;
  }

  body.single-fcn_story.zy-cohesion-view .story__tabs {
    justify-content: center;
    margin-block: 0.88rem 0.52rem;
    padding: 0.42rem;
  }

  body.single-fcn_story.zy-cohesion-view .story__chapters .chapter-group__list {
    gap: 0.34rem;
    padding: 0.38rem;
  }
}

@media screen and (forced-colors: none) {
  :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view .story__header {
    border-bottom-color: rgba(113, 84, 30, 0.18);
  }

  :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view .story__identity-title {
    color: #70541b !important;
    -webkit-text-fill-color: currentColor !important;
    background: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view .story__identity-title {
      background: linear-gradient(180deg, #554018 0%, #836520 36%, #70541b 65%, #493813 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent !important;
      -webkit-text-fill-color: transparent !important;
    }
  }

  :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view .story__identity-meta,
  :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view .story__identity-meta a {
    color: #5b5143;
    text-shadow: none;
  }

  :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view .story__tabs {
    border-color: rgba(113, 84, 30, 0.20);
    background: var(--zy-cohesion-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view .story__tabs > :first-child {
    color: #70541b;
  }
}

@media print {
  body.single-fcn_story.zy-cohesion-view .zy-story-gateway,
  body.single-fcn_story.zy-cohesion-view .story__tabs > :not(:first-child) {
    display: none !important;
  }

  body.single-fcn_story.zy-cohesion-view .story__identity-title,
  body.single-fcn_story.zy-cohesion-view .story__identity-meta {
    background: none !important;
    color: #000 !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none;
  }
}

@media (forced-colors: active) {
  body.single-fcn_story.zy-cohesion-view .story__header,
  body.single-fcn_story.zy-cohesion-view .story__tabs {
    border-color: CanvasText;
    background: Canvas;
  }

  body.single-fcn_story.zy-cohesion-view .story__identity-title,
  body.single-fcn_story.zy-cohesion-view .story__identity-meta {
    background: none;
    color: CanvasText !important;
    -webkit-text-fill-color: CanvasText !important;
    text-shadow: none;
  }
}
