/* Topics
 * -------------------------------------------------------------------------- */

.topic__link {
  outline: none;
}

.topic--snippet {
  padding-bottom: 0;

  @media (min-width: 40em) {
    padding-bottom: var(--half-space);

    .topic__title { padding-top: 0 !important; }
  }

  .topic__header {
    display: flex;
    flex-direction: column;
    text-align: left;

    @media (max-width: 39.95em) { padding-bottom: 0.8rem; }
  }

  .topic__filings:not(:empty) {
    margin-bottom: var(--half-space);
  }

  .posting__status::before {
    top: 1em;
    left: -0.75em;
  }

  .entry {
    padding-top: 0;
    padding-bottom: 0;
    min-height: inherit !important;
  }

  .entry__time {
    top: 0.3rem;

    @media (min-width: 40em) { top: 0.25rem; }
  }

  .bulk-actions,
  .bulk-actions__checkbox {
    top: 0;
    left: 0;
    width: 2.5em;
    height: 2.5em;
    border-radius: 2.5em;
  }
}

.topic--spam,
.topic--netted {
  .entry__wrapper { pointer-events: none; }
  .topic-people { pointer-events: none; }

  .page-toolbar,
  .entry-prompt-container { display: none; }
}

.topic__header {
  position: relative;
  z-index: 3;
  text-align: center;

  .topic:not(.topic--snippet) & {
    @media (max-width: 39.95em) {
      background: var(--color-bg--main);
      margin: 0 var(--negative-page-padding);
      padding-left: var(--page-padding);
      padding-right: var(--page-padding);
      padding-bottom: 1.6rem;
    }
  }
}

.topic__header--stuck {
  .topic__meta,
  .topic__title { opacity: 0; }

  .topic__title-scrolled {
    display: block !important;
    background: var(--color-bg--main-thick);
    position: fixed;
    top: 4.8rem;
    left: 0;
    right: 0;
    padding: 1rem 1.6rem;
    z-index: 7;
    border-radius: 0;
  }
}

.topic__name {
  display: inline-block;
  max-width: 100%;
}

.topic__title {
  font-size: var(--font-size-x-large);
  word-wrap: break-word;

  @media (min-width: 40em) { font-size: var(--font-size-xx-large); }
  body.topic & { @media (min-width: 60em) { margin-left: 14rem !important; margin-right: 14rem !important; } }
}

.topic__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;

  &::after {
    content: ' ';
    width: 10rem;
    display: block;
    position: absolute;
    inset: 0 0 0 auto;
    background: linear-gradient(90deg, var(--color-bg--main-transparent) 0%, var(--color-bg--main) 95%);
    z-index: 1;
    pointer-events: none;
  }

  .sheet & {
    &::after {
      background: linear-gradient(90deg, var(--color-bg--main-transparent) 0%, var(--color-bg--sheet) 95%);
    }
  }
}

.topic__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 2;
}

/* Collections
 * -------------------------------------------------------------------------- */

.topic__header--collection {
  padding: 1em 1em 2em;
  margin: -1em -1em 0;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, var(--color-bg--collection-glint) 50%); /* rgba used here because Safari cannot form a gradient between one opaque and one alpha color */

  @media (min-width: 40em) {
    padding: 1.5em 2em 2.5em;
    margin: -2em -2em 0;
    border-radius: 1.5em 1.5em 0 0;
  }

  @media (min-width: 60em) {
    padding: 4rem 6rem 5rem;
    margin: -6rem -6rem 0;
  }
}

.topic__title--collection {
  position: relative;
  padding-left: 1em;

  &::before {
    filter: var(--colorize-ink);
    content: '';
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 0.8em;
    height: 0.8em;
    background: url("/assets/icons/collection-e2a7cb63.svg") left center / 0.8em no-repeat;
  }
}

/* Breakouts
 * -------------------------------------------------------------------------- */

.topic__breakout-notice {
  &::before {
    content: "";
    background: url("/assets/icons/breakout-02b62e62.svg") center center / 100% no-repeat;
    width: 1em;
    height: 1.4em;
    margin-right: 0.25em;
  }
}

.breakout-topics {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;

  .popup-menu {
    top: -0.5rem;
    left: -0.5rem;
    right: auto;
    z-index: -1;
  }
}
