/* /news/ — translated posts from official Riftbound channels. Shares the site tokens in /styles.css. */

.news-frame {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 32px) 64px;
}

.news-feed {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.news-summary {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.news-intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  word-break: keep-all;
}

.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.news-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 999px;
  background: #11181e;
  font-weight: 700;
}

.news-tag-chip[aria-pressed="true"] {
  border-color: rgb(245 158 11 / 52%);
  background: rgb(245 158 11 / 13%);
  color: #fff;
}

.news-tag-count {
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-post {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #11181e;
  scroll-margin-top: 84px;
}

.news-post:target {
  border-color: rgb(245 158 11 / 60%);
}

.news-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.news-tag {
  padding: 3px 9px;
  border: 1px solid rgb(45 212 191 / 40%);
  border-radius: 999px;
  background: rgb(45 212 191 / 10%);
  color: #99f6e4;
  font-size: 12px;
  font-weight: 760;
}

.news-post h2 {
  color: #fff;
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.news-body {
  color: #dbe3ec;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.news-body.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.news-body a,
.news-original-text a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-expand {
  justify-self: start;
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.news-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  border-radius: 8px;
}

.news-media.count-1 {
  grid-template-columns: minmax(0, 1fr);
}

.news-media.count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-image {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #080b0e;
  aspect-ratio: 1 / 1;
}

.news-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.news-media.count-1 .news-image {
  aspect-ratio: auto;
}

.news-media.count-1 .news-image img {
  height: auto;
  max-height: 720px;
  object-fit: contain;
}

.news-image-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(8 11 14 / 62%);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.news-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgb(12 16 19 / 82%);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.news-image-text {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #0f151a;
  color: #dbe3ec;
  font-size: 14px;
  line-height: 1.6;
}

.news-image-text-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.news-video {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 120px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  background: #080b0e;
}

.news-video img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  opacity: 0.8;
}

.news-video-play {
  position: absolute;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgb(12 16 19 / 78%);
  color: #fff;
  font-size: 22px;
}

.news-video-label {
  position: absolute;
  bottom: 8px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgb(12 16 19 / 82%);
  color: #dbe3ec;
  font-size: 12px;
}

.news-link {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f151a;
}

.news-link img {
  width: 96px;
  height: 72px;
  object-fit: cover;
}

.news-link-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 12px 8px 0;
}

.news-link:not(:has(img)) {
  grid-template-columns: minmax(0, 1fr);
}

.news-link:not(:has(img)) .news-link-text {
  padding-left: 12px;
}

.news-link-kind,
.news-link-host {
  color: var(--faint);
  font-size: 12px;
}

.news-link strong {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-original summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.news-original-text {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #0f151a;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.news-post-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding-top: 10px;
  border-top: 1px solid rgb(255 255 255 / 6%);
  color: var(--faint);
  font-size: 12px;
}

.news-post-foot a {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}

.news-more {
  justify-self: center;
  min-width: 160px;
}

/* image viewer */
.news-viewer {
  width: min(1100px, 100vw);
  max-width: 100vw;
  height: min(100dvh, 100vh);
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.news-viewer::backdrop {
  background: rgb(4 6 8 / 88%);
}

.news-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.news-viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.news-viewer-modes {
  display: inline-flex;
  gap: 4px;
}

.news-viewer-modes button {
  min-height: 32px;
  font-size: 13px;
}

.news-viewer-modes button[aria-pressed="true"] {
  border-color: rgb(245 158 11 / 60%);
  background: rgb(245 158 11 / 16%);
  color: #fff;
}

.news-viewer-modes button:disabled {
  opacity: 0.35;
  cursor: default;
}

.news-viewer-count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.news-viewer-close {
  margin-left: auto;
  min-width: 40px;
  font-size: 22px;
  line-height: 1;
}

.news-viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 8px 12px;
}

.news-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.news-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 44px;
  min-height: 56px;
  padding: 0;
  background: rgb(12 16 19 / 70%);
  font-size: 28px;
  transform: translateY(-50%);
}

.news-viewer-nav[data-step="-1"] {
  left: 10px;
}

.news-viewer-nav[data-step="1"] {
  right: 10px;
}

@media (max-width: 640px) {
  .news-post {
    padding: 14px 12px 12px;
  }

  .news-media.count-1 .news-image img {
    max-height: 560px;
  }

  .news-link {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .news-link img {
    width: 72px;
    height: 60px;
  }
}
