/**
 * @file
 * A tweet on its own page. Type sizes and colours follow tweet-card, so a
 * tweet reads the same in the feed and on its page.
 */

.rn-tweet-detail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: Poppins, sans-serif;
}

/* Heading ------------------------------------------------------------------ */

.rn-tweet-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #ececec;
}

/* custom.css forces Poppins/500 on headings with !important. */
.rn-tweet-detail .rn-tweet-detail__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-family: Poppins, sans-serif !important;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600 !important;
  color: #121212;
}

/* "ACR 2025 • Tweet by …": a 4px dot between the two parts. */
.rn-tweet-detail__context::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: currentColor;
}

/* Author and View on X ----------------------------------------------------- */

.rn-tweet-detail__post {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rn-tweet-detail__author {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.rn-tweet-detail__who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rn-tweet-detail__avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  background: #e5e7eb;
}

.rn-tweet-detail .rn-tweet-detail__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.rn-tweet-detail__byline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rn-tweet-detail__name {
  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 19.6px;
  font-weight: 700;
  color: #121212;
}

.rn-tweet-detail__meta {
  font-size: 14px;
  line-height: 20px;
  font-style: italic;
  color: #686868;
}

.rn-tweet-detail .rn-tweet-detail__handle {
  color: #1585fe;
  text-decoration: none;
}

.rn-tweet-detail a.rn-tweet-detail__handle:hover {
  text-decoration: underline;
}

.rn-tweet-detail__handle + .rn-tweet-detail__date::before {
  content: " • ";
}

.rn-tweet-detail .rn-tweet-detail__view {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 8px 16px;
  background: #121212;
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: #fff;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.rn-tweet-detail .rn-tweet-detail__view:hover,
.rn-tweet-detail .rn-tweet-detail__view:focus-visible {
  background: #3a3a3a;
  color: #fff;
}

.rn-tweet-detail__x {
  display: block;
  width: 18px;
  height: 18px;
  background: url(../../assets/images/x-white.svg) center / 18px 18px no-repeat;
}

/* Text and sources --------------------------------------------------------- */

.rn-tweet-detail__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rn-tweet-detail__text {
  font-size: 14px;
  line-height: 21px;
  color: #494949;
  word-break: break-word;
}

.rn-tweet-detail .rn-tweet-detail__text a,
.rn-tweet-detail .rn-tweet-detail__source {
  color: #1585fe;
  text-decoration: none;
}

.rn-tweet-detail .rn-tweet-detail__text a:hover,
.rn-tweet-detail .rn-tweet-detail__source:hover .rn-tweet-detail__source-title {
  text-decoration: underline;
}

.rn-tweet-detail .rn-tweet-detail__source {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 21px;
  word-break: break-word;
}

.rn-tweet-detail__source-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  background: url(../../assets/images/link-news.svg) center / 20px 20px no-repeat;
}

/* Image: the whole picture at the column's width, no click to enlarge. */
.rn-tweet-detail .rn-tweet-detail__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 400px;
  margin: 4px 0 0;
  overflow: hidden;
  background: #f3f4f6;
}

.rn-tweet-detail .rn-tweet-detail__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

/* Phones (Figma "Mobile / Tweet node"): the conference on its own line
   above "Tweet by ...", and View on X as a full-width bar under the image.
   The author row's wrapper drops out (display: contents) so the button can
   be ordered after the image without a second link in the markup. */
@media (max-width: 600px) {
  .rn-tweet-detail__header {
    align-items: flex-start;
    padding-bottom: 16px;
  }

  .rn-tweet-detail .rn-tweet-detail__title {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 18px;
    line-height: 20px;
  }

  .rn-tweet-detail__context::after {
    display: none;
  }

  .rn-tweet-detail__post {
    gap: 24px;
  }

  .rn-tweet-detail__author {
    display: contents;
  }

  .rn-tweet-detail__who {
    order: 1;
  }

  .rn-tweet-detail__body {
    order: 2;
  }

  .rn-tweet-detail .rn-tweet-detail__media {
    order: 3;
    height: 240px;
    margin: 0;
  }

  .rn-tweet-detail .rn-tweet-detail__view {
    order: 4;
    width: 100%;
  }
}
