.dm-latest {
  --latest-accent: #ff4a4f;
  box-sizing: border-box;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) clamp(16px, 4vw, 40px);
  color: #f2efe8;
  font-family: Onest, system-ui, sans-serif;
}

.dm-latest--contained {
  padding-inline: 0;
  padding-bottom: 0;
}

.dm-latest-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 14px;
}

.dm-latest-header h2 {
  margin: 0;
  font: 600 clamp(18px, 2vw, 22px)/1.25 Onest, system-ui, sans-serif;
}

.dm-latest-header a {
  border: 0;
  color: #f2efe8;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--latest-accent);
  white-space: nowrap;
}

.dm-latest-header a:hover { color: var(--latest-accent); }

.dm-latest-list {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dm-latest-list li { margin: 0; }

.dm-latest-card {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 104px;
  gap: 12px;
  padding: 12px 32px 12px 12px;
  border: 1px solid #3a3733;
  border-radius: 6px;
  background: #1a1917;
  color: #f2efe8;
  text-decoration: none;
  transition: border-color .15s, background-color .15s;
}

.dm-latest-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-top: 2px solid var(--latest-accent);
  border-right: 2px solid var(--latest-accent);
  transform: rotate(45deg);
}

.dm-latest-card:hover {
  border-color: var(--latest-accent);
  background: #221e1c;
  color: #f2efe8;
}

.dm-latest-card-cover {
  display: block;
  flex: none;
  width: clamp(64px, 36%, 128px);
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 4px;
}

.dm-latest-card-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dm-latest-card time {
  color: #b2aca1;
  font: 500 12px/1.25 'JetBrains Mono', Onest, monospace;
}

.dm-latest-card-title {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font: 600 16px/1.35 Onest, system-ui, sans-serif;
}

.dm-latest :is(a, button):focus-visible {
  outline: 2px solid var(--latest-accent);
  outline-offset: -4px;
}

.dm-latest-header a:focus-visible { outline-offset: 3px; }

.dm-latest-controls { display: none; }

@media (max-width: 767px) {
  .dm-latest-list {
    grid-auto-columns: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }

  .dm-latest-list li { scroll-snap-align: start; }

  .dm-latest-controls:not([hidden]) {
    display: flex;
    justify-content: center;
  }

  .dm-latest-controls button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
  }

  .dm-latest-controls button::after {
    content: "";
    width: 22px;
    height: 4px;
    border-radius: 4px;
    background: #77726a;
  }

  .dm-latest-controls button[aria-current="true"]::after { background: var(--latest-accent); }
}

@media (prefers-reduced-motion: reduce) {
  .dm-latest-list { scroll-behavior: auto; }
  .dm-latest-card { transition: none; }
}
