/* ==========================================================================
   Social Feed
   ========================================================================== */

.socialfeed {
  --socialfeed-gap: 20px;
  --socialfeed-columns: 3;
  position: relative;
  font-family: var(--f-family);
  color: rgb(var(--c-neutral-darkest));
  hyphens: manual;
}

.socialfeed__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The template marks external links with an icon, links that only hold a picture go without */
.socialfeed a.socialfeed__avatar[rel]::after {
  content: none;
}

.socialfeed a {
  hyphens: manual;
}

.socialfeed__icon {
  display: block;
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
}

/* ==========================================================================
   Header
   ========================================================================== */

.socialfeed__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0 0 var(--socialfeed-gap);
}

.socialfeed__account {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.socialfeed__avatar {
  flex: 0 0 auto;
  display: block;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  background: rgb(var(--c-neutral-lighter));
}

.socialfeed__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.socialfeed__profile {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.socialfeed__name {
  align-self: flex-start;
  font-size: var(--f-size-l-1);
  font-weight: var(--f-weight-b);
  line-height: 1.3;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.socialfeed__name:hover,
.socialfeed__name:focus-visible {
  color: rgb(var(--c-primary));
}

.socialfeed__username {
  align-self: flex-start;
  font-size: var(--f-size-s-1);
  color: rgb(var(--c-neutral-dark));
  text-decoration: none;
}

.socialfeed__username:hover,
.socialfeed__username:focus-visible {
  color: rgb(var(--c-primary));
}

.socialfeed__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--f-size-s-1);
}

.socialfeed__stat {
  margin: 0;
  padding: 0;
  list-style: none;
}

.socialfeed__stat strong {
  font-weight: var(--f-weight-b);
}

.socialfeed__follow {
  flex: 0 0 auto;
}

/* ==========================================================================
   Slider and grid
   ========================================================================== */

.socialfeed__slider {
  position: relative;
}

.socialfeed__swiper {
  overflow: hidden;
}

.socialfeed__slide {
  height: auto;
}

/* Fallback if Swiper could not be loaded: a horizontally scrollable row */
.socialfeed.-noswiper .swiper-wrapper {
  display: flex;
  gap: var(--socialfeed-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.socialfeed.-noswiper .socialfeed__slide {
  flex: 0 0 85%;
  scroll-snap-align: start;
}

.socialfeed.-noswiper .socialfeed__nav {
  display: none;
}

.socialfeed__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: rgba(var(--c-neutral-darkest), 0.9);
  color: rgb(var(--c-neutral-lightest));
  font-size: 1.1rem;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 0.2s, background-color 0.2s;
}

.socialfeed__nav:hover,
.socialfeed__nav:focus-visible {
  background: rgb(var(--c-neutral-darkest));
  color: rgb(var(--c-neutral-lightest));
}

.socialfeed__nav.-prev {
  left: 0;
}

.socialfeed__nav.-next {
  right: 0;
}

.socialfeed__nav.swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

.socialfeed__nav.swiper-button-lock {
  display: none;
}

.socialfeed__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--socialfeed-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.socialfeed__cell {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ==========================================================================
   Post
   ========================================================================== */

.socialfeed__post {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgb(var(--c-neutral-lighter));
}

.socialfeed__media {
  position: relative;
  display: block;
  aspect-ratio: var(--socialfeed-ratio, 1);
  overflow: hidden;
  background: rgb(var(--c-neutral-light));
}

.socialfeed__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.socialfeed a.socialfeed__media[rel]::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
  background: rgba(var(--c-neutral-darkest), 0);
  transition: background-color 0.3s;
}

.socialfeed__media:hover img,
.socialfeed__media:focus-visible img {
  transform: scale(1.04);
}

.socialfeed a.socialfeed__media[rel]:hover::after,
.socialfeed a.socialfeed__media[rel]:focus-visible::after {
  background: rgba(var(--c-neutral-darkest), 0.15);
}

.socialfeed.-ratioauto .socialfeed__media {
  aspect-ratio: auto;
}

.socialfeed.-ratioauto .socialfeed__media img {
  height: auto;
}

.socialfeed.-ratioauto .socialfeed__media.-text {
  aspect-ratio: 1;
}

.socialfeed__media.-text {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: rgb(var(--c-primary));
  color: rgb(var(--c-neutral-lightest));
  text-decoration: none;
}

.socialfeed__quote {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--f-size-l-1);
  line-height: 1.5;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
}

.socialfeed__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  color: rgb(var(--c-neutral-lightest));
  font-size: 1.25rem;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

.socialfeed__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
}

.socialfeed__text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: var(--f-size-s-1);
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.socialfeed__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: auto;
  font-size: var(--f-size-s-1);
  color: rgb(var(--c-neutral-dark));
}

.socialfeed__count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.socialfeed__platform {
  display: inline-flex;
  align-items: flex-start;
  margin-left: auto;
  color: rgb(var(--c-primary));
  font-size: 1.1rem;
  transition: color 0.2s;
}

.socialfeed__platform:hover,
.socialfeed__platform:focus-visible {
  color: rgb(var(--c-primary-dark));
}

/* ==========================================================================
   Popup
   ========================================================================== */

html:has(.socialfeed__dialog[open]) {
  overflow: hidden;
}

.socialfeed__dialog {
  width: calc(100vw - 1rem);
  max-width: 1100px;
  max-height: calc(100dvh - 1rem);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: rgb(var(--c-neutral-lightest));
  color: rgb(var(--c-neutral-darkest));
}

.socialfeed__dialog::backdrop {
  background: rgba(43, 43, 43, 0.9);
}

.socialfeed__dialog-inner {
  position: relative;
}

.socialfeed__dialog-content {
  max-height: calc(100dvh - 1rem);
  overflow: auto;
}

.socialfeed__dialog-button {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: rgba(var(--c-neutral-darkest), 0.75);
  color: rgb(var(--c-neutral-lightest));
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.socialfeed__dialog-button:hover,
.socialfeed__dialog-button:focus-visible {
  background: rgb(var(--c-primary));
  color: rgb(var(--c-neutral-lightest));
}

.socialfeed__dialog-button:disabled {
  opacity: 0;
  pointer-events: none;
}

.socialfeed__dialog-button.-close {
  top: 0;
  right: 0;
}

.socialfeed__dialog-button.-prev,
.socialfeed__dialog-button.-next {
  bottom: 0;
}

.socialfeed__dialog-button.-prev {
  left: 0;
}

.socialfeed__dialog-button.-next {
  right: 0;
}

.socialfeed__detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.socialfeed__detail-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: rgb(var(--c-neutral-darkest));
}

.socialfeed__detail-media > .socialfeed__image,
.socialfeed__detail-media > .socialfeed__video {
  max-height: 80dvh;
}

.socialfeed__detail-swiper {
  width: 100%;
  --swiper-pagination-bullet-inactive-color: rgb(var(--c-neutral-lightest));
  --swiper-pagination-bullet-inactive-opacity: 0.6;
}

.socialfeed__detail-swiper .swiper-slide {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
}

.socialfeed__image,
.socialfeed__video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80dvh;
  object-fit: contain;
  background: rgb(var(--c-neutral-darkest));
}

.socialfeed__detail-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--c-neutral-darkest), 0.55);
  color: rgb(var(--c-neutral-lightest));
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.2s;
}

.socialfeed__detail-nav:hover,
.socialfeed__detail-nav:focus-visible {
  background: rgba(var(--c-neutral-darkest), 0.85);
  color: rgb(var(--c-neutral-lightest));
}

.socialfeed__detail-nav.-prev {
  left: 0.5rem;
}

.socialfeed__detail-nav.-next {
  right: 0.5rem;
}

.socialfeed__detail-nav.swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

.socialfeed__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(var(--c-neutral-darkest), 0.8);
  color: rgb(var(--c-neutral-lightest));
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.socialfeed__play:hover,
.socialfeed__play:focus-visible {
  background: rgb(var(--c-primary));
  color: rgb(var(--c-neutral-lightest));
}

.socialfeed__detail-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.25rem 1.25rem 4rem;
}

.socialfeed__detail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 2.5rem;
}

.socialfeed__detail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.socialfeed__detail-name {
  font-weight: var(--f-weight-b);
  color: inherit;
  text-decoration: none;
}

.socialfeed__detail-name:hover,
.socialfeed__detail-name:focus-visible {
  color: rgb(var(--c-primary));
}

.socialfeed__detail-text {
  font-size: var(--f-size-s-1);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.socialfeed__detail-text a {
  color: rgb(var(--c-primary));
  text-decoration: none;
}

.socialfeed__detail-text a:hover,
.socialfeed__detail-text a:focus-visible {
  text-decoration: underline;
}

.socialfeed__detail-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgb(var(--c-neutral-light));
}

.socialfeed__detail-footer .socialfeed__meta {
  margin-top: 0;
}

.socialfeed__detail-link {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: rgb(var(--c-primary));
  color: rgb(var(--c-neutral-lightest));
  font-weight: var(--f-weight-sb);
  text-decoration: none;
  transition: background-color 0.2s;
}

.socialfeed__detail-link:hover,
.socialfeed__detail-link:focus-visible {
  background: rgb(var(--c-primary-dark));
  color: rgb(var(--c-neutral-lightest));
}

.socialfeed__detail-grid.-text .socialfeed__detail-text {
  font-size: var(--f-size);
}

/* ==========================================================================
   Media Queries
   ========================================================================== */

@media (min-width: 640px) {
  .socialfeed__grid {
    grid-template-columns: repeat(min(2, var(--socialfeed-columns)), minmax(0, 1fr));
  }

  .socialfeed.-noswiper .socialfeed__slide {
    flex-basis: calc(50% - var(--socialfeed-gap) / 2);
  }
}

@media (min-width: 1024px) {
  .socialfeed__grid {
    grid-template-columns: repeat(var(--socialfeed-columns), minmax(0, 1fr));
  }

  .socialfeed__dialog {
    width: calc(100vw - 9rem);
  }

  .socialfeed__dialog-content {
    max-height: calc(100dvh - 4rem);
  }

  .socialfeed__detail-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    max-height: calc(100dvh - 4rem);
  }

  .socialfeed__detail-grid.-text {
    grid-template-columns: minmax(0, 1fr);
  }

  .socialfeed__detail-body {
    overflow-y: auto;
    padding: 1.5rem;
  }

  .socialfeed__detail-media > .socialfeed__image,
  .socialfeed__detail-media > .socialfeed__video,
  .socialfeed__image,
  .socialfeed__video {
    max-height: calc(100dvh - 4rem);
  }

  .socialfeed__dialog-button {
    background: transparent;
    font-size: 1.6rem;
  }

  .socialfeed__dialog-button.-close {
    top: 0;
    right: -3.75rem;
  }

  .socialfeed__dialog-button.-prev,
  .socialfeed__dialog-button.-next {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .socialfeed__dialog-button.-prev {
    left: -3.75rem;
  }

  .socialfeed__dialog-button.-next {
    right: -3.75rem;
  }
}
