.twet-related {
  margin: 2rem 0;
}

.twet-related__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.twet-related__title {
  margin: 0;
}

/* Own stacking context: card row at z-index 1, arrows at 10, so no theme
   z-index on lists, items or links can cover the arrows. */
.twet-related .twet-related__viewport {
  position: relative;
  isolation: isolate;
}

/* Arrows overlay the row edges, centred on the images (top set by slider.js). */
.twet-related .twet-related__arrow {
  position: absolute;
  top: var(--twet-arrow-top, 28%);
  z-index: 10;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  margin: 0;
  padding: 0 0 3px;
  border: 0;
  border-radius: 2px;
  background: rgba(232, 232, 232, 0.88);
  color: #333;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.twet-related .twet-related__arrow--prev { left: 0; }
.twet-related .twet-related__arrow--next { right: 0; }

.twet-related .twet-related__arrow:hover,
.twet-related .twet-related__arrow:focus-visible {
  background: rgba(196, 196, 196, 0.95);
  color: #111;
}

.twet-related .twet-related__arrow:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 1px;
}

.twet-related .twet-related__arrow[hidden] {
  display: none !important;
}

/* Theme and Elementor list styles are strong; these resets must win. */
.twet-related ul.twet-related__track,
.twet-related ul.twet-related__track > li.twet-related__card {
  list-style: none !important;
  margin: 0 !important;
}

.twet-related ul.twet-related__track > li.twet-related__card::before,
.twet-related ul.twet-related__track > li.twet-related__card::marker {
  content: none !important;
  display: none !important;
}

.twet-related .twet-related__track {
  position: relative;
  z-index: 1 !important;
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  padding: 0 0 0.5rem !important;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.twet-related__card {
  flex: 0 0 75%;
  margin: 0;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  overflow: hidden;
}

@media (min-width: 600px) {
  .twet-related__card { flex-basis: calc((100% - 2rem) / 3); }
}

@media (min-width: 1024px) {
  .twet-related__card { flex-basis: calc((100% - 3rem) / 4); }
}

.twet-related__link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.twet-related__link:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: -2px;
}

.twet-related__media {
  display: block;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
  overflow: hidden;
}

.twet-related .twet-related__img {
  display: block;
  width: 100% !important;
  max-width: none;
  height: 100% !important;
  margin: 0;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.twet-related__link:hover .twet-related__img {
  transform: scale(1.03);
}

/* Padding lives on the body wrapper, not the clamped element: overflow:hidden
   clips at the padding edge, so padding on the clamped element shows a third line. */
.twet-related .twet-related__body {
  display: block;
  padding: 10px 12px 12px;
}

.twet-related .twet-related__name {
  display: -webkit-box !important;
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  /* Exactly two lines: the fallback cap, and equal card heights for short titles. */
  max-height: calc(1.35em * 2);
  min-height: calc(1.35em * 2);
}

@media (prefers-reduced-motion: reduce) {
  .twet-related__track { scroll-behavior: auto; }
  .twet-related__img { transition: none; }
}
