/* Latest News timeline — hero sheet palette. */

.news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 8px 10px 10px;
  position: relative;
  z-index: 1;
}

.news-viewport {
  height: 100%;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  container-name: news;
}

.news-track {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  gap: clamp(8px, 1.2vw, 12px);
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 4px;
  padding: 16px 4px 8px;
  position: relative;
  scrollbar-width: none;
  touch-action: pan-x;
}

.news-track::-webkit-scrollbar {
  display: none;
}

/* Hero .btn */
.news-side-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  align-self: stretch;
  padding: 16px 0 8px;
  position: relative;
  z-index: 2;
}

.news-side-nav button {
  width: clamp(28px, 4vw, 34px);
  height: clamp(40px, 12vh, 52px);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}

.news-side-nav button:hover:not(:disabled) {
  border-color: var(--navy);
}

.news-side-nav button:disabled {
  color: var(--ink-faint);
  border-color: var(--line-soft);
  cursor: default;
}

.news-side-nav svg {
  width: 14px;
  height: 14px;
  display: block;
}

.news-card {
  --news-card-w: clamp(200px, 72%, 280px);
  position: relative;
  flex: 0 0 var(--news-card-w);
  width: var(--news-card-w);
  max-width: 100%;
  scroll-snap-align: start;
  height: calc(100% - 4px);
  max-height: min(100%, 340px);   /* tall iframes: cards stop growing */
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px clamp(8px, 1.5vw, 12px) 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
}

.news-card[hidden],
.news-skel[hidden],
.news-empty[hidden] {
  display: none !important;
}

.news-card.is-link {
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .news-card {
    opacity: 0;
    transform: translateY(8px);
  }

  .news-card.is-in {
    opacity: 1;
    transform: none;
    transition:
      opacity 0.45s var(--ease),
      transform 0.45s var(--ease),
      border-color 0.2s var(--ease),
      box-shadow 0.2s var(--ease);
  }

  .news-card.is-in:hover {
    transform: translateY(-3px);
    border-color: var(--navy);
    box-shadow: 0 8px 14px rgba(16, 43, 134, 0.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-card:hover {
    border-color: var(--navy);
  }
}

.news-card:nth-child(1) { transition-delay: 0ms; }
.news-card:nth-child(2) { transition-delay: 50ms; }
.news-card:nth-child(3) { transition-delay: 100ms; }
.news-card:nth-child(4) { transition-delay: 150ms; }

.news-node {
  position: absolute;
  top: -15px;
  left: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--navy);
  background: #fff;
  z-index: 1;
  pointer-events: none;
}

.news-card[data-tag="Award"] .news-node {
  background: var(--accent);
  border-color: var(--accent-deep);
}

.news-card[data-tag="Paper"] .news-node {
  background: var(--navy);
}

.news-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.news-tag,
.news-date,
.news-det,
.news-open {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* Card tag: hero chip language */
.news-tag {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.7);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-tag[data-tag="Award"] {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
}

.news-tag[data-tag="Paper"] {
  color: var(--navy);
  border-color: var(--navy);
  background: rgba(255, 255, 255, 0.85);
}

.news-tag[data-tag="Project"] {
  color: var(--blue);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.85);
}

.news-tag[data-tag="Event"],
.news-tag[data-tag="Member"] {
  color: var(--ink-dim);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.85);
}

.news-date {
  font-size: clamp(10px, 2.2vw, 11px);
  font-weight: 500;
  color: var(--navy);
  flex: 0 0 auto;
}

.news-rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.news-title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(13px, 2.6vw, 14.5px);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.news-en {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(11px, 2.2vw, 12px);
  line-height: 1.45;
  color: var(--ink-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.news-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
  min-width: 0;
}

.news-det {
  font-size: 9px;
  color: var(--ink-dim);
}

.news-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.news-open2 {
  position: relative;
  z-index: 2;   /* above the stretched OPEN link */
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.news-open2:hover {
  border-bottom-color: var(--navy);
}

.news-open {
  font-size: 10px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
}

.news-card.is-link .news-open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.news-card.is-link:has(.news-open:focus-visible) {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.news-card.is-link .news-open:focus {
  outline: none;
}

.news-open2:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.news-open.is-empty {
  color: var(--ink-dim);
  font-weight: 500;
}

.news-photo {
  display: block;
  width: calc(100% + 2 * clamp(8px, 1.5vw, 12px));
  height: clamp(48px, 14vh, 64px);
  margin: -10px calc(-1 * clamp(8px, 1.5vw, 12px)) 2px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: var(--line-soft);
}

.news-empty,
.news-status {
  margin: 0;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  flex: 1 0 100%;
}

.news-skel {
  flex: 0 0 var(--news-card-w, 240px);
  width: var(--news-card-w, 240px);
  height: calc(100% - 4px);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.7);
}

@media (prefers-reduced-motion: no-preference) {
  .news-skel {
    animation: news-pulse 1.1s ease-in-out infinite;
  }
}

@keyframes news-pulse {
  50% { opacity: 0.45; }
}

@container (max-width: 520px) {
  .news-card,
  .news-skel {
    --news-card-w: calc(100% - 36px);
  }
}

/* Short iframes — Google Sites scales an embed's height with its width, so a
   400px embed can be ~150–250px tall on a phone. Drop the photo and English
   line, tighten spacing, keep date · tag · title · link. */
@media (max-height: 330px) {
  .adam-toolbar { padding-top: 8px; }
  .news-row { margin: 4px 8px 6px; }
  .news-track { padding: 12px 2px 4px; }
  .news-side-nav { padding: 12px 0 4px; }
  .news-side-nav button { height: 34px; }
  .news-card { gap: 4px; padding: 8px 10px; }
  .news-photo, .news-en, .news-det { display: none; }
  .news-title { -webkit-line-clamp: 2; font-size: 13px; }
}
@media (max-height: 210px) {
  .news-rule { display: none; }
  .news-title { -webkit-line-clamp: 2; font-size: 12.5px; line-height: 1.35; }
  .news-node { display: none; }
  .news-track { padding-top: 6px; }
}
/* Very short (≤150px: e.g. Board's 1185×401 box → 355×120 on a phone):
   thin chip row, 1-line titles, small arrows — the card still fits. */
@media (max-height: 150px) {
  .adam-toolbar { padding-top: 4px; }
  .adam-chip { padding: 3px 8px; }
  .news-row { margin: 2px 8px 4px; gap: 4px; }
  .news-track { padding: 4px 2px 2px; }
  .news-side-nav { padding: 4px 0 2px; gap: 4px; }
  .news-side-nav button { height: 26px; width: 26px; }
  .news-card { gap: 3px; padding: 6px 9px; height: 100%; }
  .news-title { -webkit-line-clamp: 1; }
}
