/*
  Article share buttons (rendered after the post body).
  Layout: a section heading + a wrapping row of pill buttons.

  Wrapped in <section class="section"> so it inherits perplex's
  standard horizontal padding (matches the see-also block above
  it) and the buttons don't sit flush against the screen edge on
  mobile.
*/

.share--post {
  margin: 0;
}

/* Heading inherits .section > h2 styling from perplex (uppercase,
   2rem horizontal margin so it lines up with section content). */

/* Buttons row needs the same 2rem horizontal indent as .section > h2
   so 微博 doesn't sit flush against the screen edge on mobile. */
.share__list {
  list-style: none;
  margin: 1rem 2rem 0 2rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.share__item {
  display: inline-flex;
}

.share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: var(--c-bg-2);
  box-shadow: 0 0 0 1px var(--c-shadow-3, rgba(127, 127, 127, 0.25));
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-size: 1.5rem;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 150ms, box-shadow 150ms, color 150ms;
}

button.share__btn {
  border: 0;
}

.share__btn:hover,
.share__btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--c-frame-border-active, currentColor);
  color: var(--c-frame-border-active, inherit);
}

.share__btn .brand-icon,
.share__btn svg {
  width: 1.6rem;
  height: 1.6rem;
  display: block;
}

.share__btn.is-copied {
  color: var(--c-frame-border-active, inherit);
  box-shadow: 0 0 0 1px var(--c-frame-border-active, currentColor);
}

.share__btn--poster.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.share__name {
  white-space: nowrap;
}

.poster-modal[hidden] {
  display: none;
}

.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.poster-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 18, 0.72);
}

.poster-modal__panel {
  position: relative;
  width: min(92vw, 52rem);
  max-height: min(88vh, 78rem);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  background: var(--c-bg-2, #f4f0f2);
  box-shadow: 0 1.8rem 5rem rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.poster-modal__preview {
  position: relative;
  min-height: 0;
  overflow: auto;
  background: transparent;
  /* Inset image so the slim nav buttons live entirely in the side padding. */
  padding: 0 2.8rem;
}

.poster-modal__preview img {
  display: block;
  width: 100%;
  height: auto;
}

.poster-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1.8rem;
  height: 3.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.4rem;
  background: var(--c-bg-2);
  color: inherit;
  box-shadow: 0 0 0 1px var(--c-shadow-3, rgba(127, 127, 127, 0.25)),
              0 0.2rem 0.6rem rgba(0, 0, 0, 0.18);
  cursor: pointer;
  appearance: none;
  z-index: 1;
  transition: color 150ms, box-shadow 150ms, background 150ms;
}

.poster-modal__nav[hidden] {
  display: none;
}

.poster-modal__nav:hover,
.poster-modal__nav:focus {
  outline: none;
  color: var(--c-frame-border-active, inherit);
  box-shadow: 0 0 0 1px var(--c-frame-border-active, currentColor),
              0 0.3rem 0.8rem rgba(0, 0, 0, 0.22);
}

.poster-modal__nav svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.poster-modal__nav--prev {
  left: 0.5rem;
}

.poster-modal__nav--next {
  right: 0.5rem;
}

.poster-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 1.2rem;
  background: var(--c-bg-2, #f4f0f2);
  border-top: 1px solid var(--c-shadow-2, #d5d0d3);
}

.poster-modal__btn {
  flex: 1 1 14rem;
  min-height: 4.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, #0aa9df 0%, #337fcb 52%, #df0a73 100%);
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-size: 1.6rem;
  line-height: 1.4;
  cursor: pointer;
  appearance: none;
  box-shadow: none;
}

.poster-modal__btn:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.poster-modal__btn:hover {
  background: linear-gradient(90deg, #0999ca 0%, #2d73b7 52%, #c90967 100%);
}

.poster-modal__btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.poster-modal-open {
  overflow: hidden;
}

@media (max-width: 35em) {
  .poster-modal {
    padding: 1rem;
  }

  .poster-modal__panel {
    width: 100%;
    max-height: 92vh;
  }

  .poster-modal__preview {
    padding: 0 2.2rem;
  }

  .poster-modal__nav {
    width: 1.5rem;
    height: 3rem;
    border-radius: 0.3rem;
  }

  .poster-modal__nav svg {
    width: 0.85rem;
    height: 0.85rem;
  }

  .poster-modal__nav--prev {
    left: 0.35rem;
  }

  .poster-modal__nav--next {
    right: 0.35rem;
  }
}
