/* =============================================================================
   PeachPuffTL story page tabs (Synopsis | Chapters | Comments) and "More Stories by"
   The hiding only applies on pages with the tab bar (body.pp-story-tabs).
   No data-pp-view yet (before the script runs) counts as the Synopsis tab.
   ============================================================================= */

/* ---- Tab bar ---- */

.pp-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0 1.5rem;
  margin: 1rem 0 1.25rem;
  overflow-x: auto;
  border-bottom: 2px solid var(--pp-rule, rgb(128 128 128 / 25%));
  scrollbar-width: none;
}

.pp-tabs::-webkit-scrollbar {
  display: none;
}

.pp-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  margin: 0 0 -2px;
  padding: 0.5rem 0.15rem;
  color: var(--fg-300, var(--fg-200));
  font-family: var(--ff-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.pp-tabs__item:hover {
  color: var(--fg-100);
}

.pp-tabs__item.is-current {
  color: var(--primary-500);
  border-bottom-color: var(--primary-500);
}

.pp-tabs__item:focus-visible {
  outline: 3px solid var(--pp-gold, currentcolor);
  outline-offset: 2px;
}

.pp-tabs__count {
  padding: 0.1rem 0.45rem;
  color: var(--fg-200);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--pp-card-2, rgb(128 128 128 / 15%));
  border-radius: 999px;
}

/* ---- Which parts show on which tab ---- */

/* Chapter parts: only on Chapters */
.pp-story-tabs .story:not([data-pp-view="chapters"]) .story__tabs,
.pp-story-tabs .story:not([data-pp-view="chapters"]) .story__filter-reel,
.pp-story-tabs .story:not([data-pp-view="chapters"]) .story__tab-target {
  display: none;
}

/* Story stats footer (views, peaches, status, date, words, rating): only on Chapters */
.pp-story-tabs .story:not([data-pp-view="chapters"]) .story__footer {
  display: none;
}

/* Comments: only on Comments */
.pp-story-tabs .story:not([data-pp-view="comments"]) .comment-section {
  display: none;
}

/* Description, copyright and tags: only on Synopsis (the Start / Continue / shelf buttons stay) */
.pp-story-tabs .story[data-pp-view="chapters"] .story__summary > :not(.pp-cta),
.pp-story-tabs .story[data-pp-view="comments"] .story__summary > :not(.pp-cta),
.pp-story-tabs .story[data-pp-view="chapters"] .story__copyright-notice,
.pp-story-tabs .story[data-pp-view="comments"] .story__copyright-notice,
.pp-story-tabs .story[data-pp-view="chapters"] .story__tags-and-warnings,
.pp-story-tabs .story[data-pp-view="comments"] .story__tags-and-warnings,
.pp-story-tabs .story[data-pp-view="chapters"] .pp-more-author,
.pp-story-tabs .story[data-pp-view="comments"] .pp-more-author {
  display: none;
}

/* Comments tab: no button row, no story stats footer */
.pp-story-tabs .story[data-pp-view="comments"] .story__summary,
.pp-story-tabs .story[data-pp-view="comments"] .story__after-summary,
.pp-story-tabs .story[data-pp-view="comments"] .pp-cta,
.pp-story-tabs .story[data-pp-view="comments"] .story__footer {
  display: none;
}

/* Chapters tab: no Continue / Shelf buttons and no share icons (Subscribe, Read Later, Follow stay) */
.pp-story-tabs .story[data-pp-view="chapters"] .pp-cta,
.pp-story-tabs .story[data-pp-view="chapters"] .story__after-summary .media-buttons {
  display: none;
}

/* Chapters tab: tight spacing around the Subscribe / Read Later / Follow row.
   Fictioneer adds 3rem above the row and 3rem above the list / order toggles, those gaps go away. */
.pp-story-tabs .story[data-pp-view="chapters"] .pp-tabs {
  margin-bottom: 0.6rem;
}

.pp-story-tabs .story[data-pp-view="chapters"] .story__summary {
  min-height: 0;
  margin: 0;
  padding: 0;
}

.pp-story-tabs .story[data-pp-view="chapters"] .story__after-summary {
  margin-top: 0;
}

.pp-story-tabs .story[data-pp-view="chapters"] .story__tabs {
  margin: 0.5rem 0 0.25rem;
}

.pp-story-tabs .story[data-pp-view="chapters"] .story__filter-reel {
  margin: 0.75rem 0 0.5rem;
}

/* Fictioneer's own tab bar when it would only hold "Chapters": keep just the list / order toggles */
.story__tabs.pp-single-tab .tabs {
  display: none;
}

.story__tabs.pp-single-tab {
  justify-content: flex-end;
}

/* ---- More Stories by ... ---- */

.pp-more-author {
  margin: 2rem 0 1rem;
}

.pp-more-author__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
  color: var(--fg-100);
  font-family: var(--ff-heading);
  font-size: 1.5rem;
  line-height: 1.15;
}

.pp-more-author__title svg {
  flex: none;
}

@media (max-width: 640px) {
  .pp-tabs {
    gap: 0 1.1rem;
  }

  .pp-tabs__item {
    font-size: 1rem;
  }

  .pp-more-author__title {
    font-size: 1.25rem;
  }
}
