/**
 * @file
 * Tweet card for content feeds.
 *
 * Slot content arrives with the theme's own wrappers (.tweet-left-img,
 * .video-thumb-wrap, list markup for links); they are flattened here so the
 * card decides the layout.
 */

/* Full width even inside a flex or floated parent, so the image always
   sits at the right edge however short the text is. */
.rn-tweet-card {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  align-items: flex-start;
  gap: 20px;
  margin: 0 0 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid #ececec;
}

.rn-tweet-card__text {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Header ------------------------------------------------------------------ */

.rn-tweet-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.rn-tweet-card .rn-tweet-card__avatar .tweet-left-img {
  float: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.rn-tweet-card .rn-tweet-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}

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

.rn-tweet-card__name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

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

.rn-tweet-card .rn-tweet-card__meta,
.rn-tweet-card .rn-tweet-card__meta span,
.rn-tweet-card .rn-tweet-card__meta time {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-style: italic;
  font-weight: 400;
  color: #686868;
}

.rn-tweet-card .rn-tweet-card__meta a {
  font: inherit;
  color: #1585fe;
  text-decoration: none;
}

.rn-tweet-card .rn-tweet-card__meta a:hover {
  text-decoration: underline;
}

.rn-tweet-card__handle + .rn-tweet-card__date::before {
  content: " • ";
}

/* Body -------------------------------------------------------------------- */

.rn-tweet-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rn-tweet-card .rn-tweet-card__content,
.rn-tweet-card .rn-tweet-card__content p {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: #494949;
  word-break: break-word;
}

.rn-tweet-card .rn-tweet-card__content a,
.rn-tweet-card .rn-tweet-card__links a {
  color: #1585fe;
  text-decoration: none;
}

.rn-tweet-card .rn-tweet-card__content a:hover,
.rn-tweet-card .rn-tweet-card__links a:hover {
  text-decoration: underline;
}

/* Links arrive as a list with a Font Awesome icon per item. */
.rn-tweet-card .rn-tweet-card__links ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rn-tweet-card .rn-tweet-card__links li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  line-height: 21px;
}

.rn-tweet-card .rn-tweet-card__links li::before {
  content: "";
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  background: url(../../assets/images/link-news.svg) center / 20px 20px no-repeat;
}

.rn-tweet-card .rn-tweet-card__links li i {
  display: none;
}

.rn-tweet-card .rn-tweet-card__links li a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Media ------------------------------------------------------------------- */

.rn-tweet-card__media {
  flex: 0 0 234px;
  width: 234px;
  height: 130px;
  overflow: hidden;
  background: #e5e7eb;
}

.rn-tweet-card .rn-tweet-card__media figure,
.rn-tweet-card .rn-tweet-card__media div,
.rn-tweet-card .rn-tweet-card__media a {
  display: block;
  float: none;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

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

/* The image opens the existing popup (custom.js binds .tweet-img). */
.rn-tweet-card .rn-tweet-card__media .tweet-img {
  cursor: zoom-in;
}

@media (max-width: 600px) {
  .rn-tweet-card {
    flex-direction: column;
  }

  .rn-tweet-card__text {
    flex: 0 0 auto;
    width: 100%;
  }

  .rn-tweet-card__media {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
