/* ANT_NEWS_SHOWCASE 2026/11/06: News spotlight + header-image cards. Loaded only by the News list and article pages.
   Motion is removed by the site animation switch (head.blade.php), FX LOW (html[data-quality=low]) and prefers-reduced-motion. */

.dnp-spotlight, .dnp-news-card { --accent: #ff4f6d; }
[data-accent="update"] { --accent: #64efff; }
[data-accent="event"] { --accent: #ff4f9d; }
[data-accent="bugfix"] { --accent: #ffb347; }
[data-accent="blog"] { --accent: #8d6bff; }
.dnp-news-card[data-accent] { --page-accent: var(--accent); }

/* -- Spotlight ------------------------------------------------------------ */
.dnp-news__lead.dnp-spotlight {
  --accent-live: #64efff;
  position: relative;
  display: block;
  min-height: 0;
  margin-bottom: 40px;
  isolation: isolate;
}
.dnp-spotlight:has(.dnp-spotlight__slide.is-active[data-accent="event"]) { --accent-live: #ff4f9d; }
.dnp-spotlight:has(.dnp-spotlight__slide.is-active[data-accent="bugfix"]) { --accent-live: #ffb347; }
.dnp-spotlight:has(.dnp-spotlight__slide.is-active[data-accent="blog"]) { --accent-live: #8d6bff; }

.dnp-spotlight:before {
  content: '';
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-live), transparent) no-repeat;
  background-size: 38% 100%;
  animation: dnpSpotScan 6s linear infinite;
  pointer-events: none;
}

.dnp-spotlight__stage {
  position: relative;
  display: grid;
  overflow: hidden;
}

.dnp-spotlight__slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  min-height: clamp(280px, 26vw, 400px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}

.dnp-spotlight__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease, visibility 0s;
}

.dnp-spotlight__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: #070a14;
}

.dnp-spotlight__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  transform-origin: 0 50%;
}

.dnp-spotlight__media:after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 58%, rgba(6, 9, 19, 0.94)), linear-gradient(0deg, rgba(6, 9, 19, 0.5), transparent 38%);
  pointer-events: none;
}

.dnp-spotlight__shine,
.dnp-news-card__shine {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, 0.17) 48%, transparent 60%);
  transform: translateX(-130%);
  pointer-events: none;
}

.dnp-spotlight__slide.is-active .dnp-spotlight__media img { animation: dnpKenBurns calc(var(--spotlight-ms, 7000ms) + 1500ms) ease-out both; }
.dnp-spotlight__slide.is-active .dnp-spotlight__shine { animation: dnpShine 1.7s 0.35s ease-out both; }
.dnp-spotlight__media:hover .dnp-spotlight__shine { animation: dnpShineHover 1.1s ease-out both; }

.dnp-spotlight__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 32px 38px 30px 26px;
}

.dnp-spotlight__body .dnp-news__lead-tag {
  position: static;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 8px;
}

.dnp-spotlight__body .dnp-meta-row { flex-wrap: wrap; }

.dnp-spotlight__body h2 {
  display: -webkit-box;
  margin: 14px 0 12px;
  overflow: hidden;
  font-size: clamp(24px, 2.4vw, 38px);
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: -0.04em;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.dnp-spotlight__body p {
  display: -webkit-box;
  max-width: 560px;
  margin: 0 0 22px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.75;
  color: var(--v7-muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.dnp-spotlight__slide.is-active .dnp-spotlight__body > * { animation: dnpRise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.dnp-spotlight__slide.is-active .dnp-spotlight__body > :nth-child(2) { animation-delay: 0.08s; }
.dnp-spotlight__slide.is-active .dnp-spotlight__body > :nth-child(3) { animation-delay: 0.16s; }
.dnp-spotlight__slide.is-active .dnp-spotlight__body > :nth-child(4) { animation-delay: 0.24s; }
.dnp-spotlight__slide.is-active .dnp-spotlight__body > :nth-child(5) { animation-delay: 0.32s; }

.dnp-spotlight__new,
.dnp-news-card__new {
  padding: 3px 7px;
  background: #ff3b5c;
  color: #fff;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.16em;
  animation: dnpPulse 2.4s ease-out infinite;
}

.dnp-spotlight__embers {
  position: absolute;
  z-index: 3;
  inset: 0 38% 0 0;
  overflow: hidden;
  pointer-events: none;
}

.dnp-spotlight__embers i {
  position: absolute;
  bottom: -12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffb27a;
  box-shadow: 0 0 10px 2px rgba(255, 128, 72, 0.7);
  opacity: 0;
  animation: dnpEmber 9s linear infinite;
}
.dnp-spotlight__embers i:nth-child(1) { left: 6%; animation-delay: 0s; }
.dnp-spotlight__embers i:nth-child(2) { left: 18%; animation-delay: 2.4s; animation-duration: 11s; }
.dnp-spotlight__embers i:nth-child(3) { left: 31%; animation-delay: 4.1s; width: 3px; height: 3px; }
.dnp-spotlight__embers i:nth-child(4) { left: 46%; animation-delay: 1.2s; animation-duration: 10s; }
.dnp-spotlight__embers i:nth-child(5) { left: 59%; animation-delay: 5.6s; width: 5px; height: 5px; }
.dnp-spotlight__embers i:nth-child(6) { left: 73%; animation-delay: 3.3s; animation-duration: 12s; }
.dnp-spotlight__embers i:nth-child(7) { left: 88%; animation-delay: 6.8s; width: 3px; height: 3px; }

.dnp-spotlight__rail {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--v7-line);
  background: rgba(4, 7, 15, 0.78);
}

.dnp-spotlight__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dnp-spotlight__thumbs a {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px;
  overflow: hidden;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.dnp-spotlight__thumbs a:hover,
.dnp-spotlight__thumbs a:focus-visible,
.dnp-spotlight__thumbs a.is-active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: rgba(255, 255, 255, 0.035);
}

.dnp-spotlight__thumb-img {
  display: block;
  aspect-ratio: 1600 / 576;
  overflow: hidden;
  background: #0a0f1f;
}

.dnp-spotlight__thumb-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.dnp-spotlight__thumb-copy { min-width: 0; }

.dnp-spotlight__thumb-copy small {
  display: block;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--v7-muted-2);
}

.dnp-spotlight__thumb-copy strong {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dnp-spotlight__thumbs a i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.dnp-spotlight__thumbs a.is-active i { transform: scaleX(1); }
.dnp-spotlight.is-running .dnp-spotlight__thumbs a.is-active i { animation: dnpProgress var(--spotlight-ms, 7000ms) linear both; }

.dnp-spotlight__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--v7-muted-2);
}

.dnp-spotlight__controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--v7-line);
  background: rgba(255, 255, 255, 0.03);
  color: #e8eefc;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dnp-spotlight__controls button:hover,
.dnp-spotlight__controls button:focus-visible {
  border-color: var(--accent-live);
  background: rgba(255, 255, 255, 0.08);
}

.dnp-spotlight:not(.is-ready) .dnp-spotlight__controls { display: none; }

/* Posts without a header image get a painted placeholder instead of an empty box. */
.dnp-spotlight__slide.is-fallback .dnp-spotlight__media,
.dnp-news-card__media.is-fallback,
.dnp-spotlight__thumb-img.is-fallback {
  background: radial-gradient(circle at 28% 42%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 56%),
    url('/assets/launcher/paradox-logo.png') right 7% center / auto 74% no-repeat,
    linear-gradient(135deg, #170c24, #070b17 70%);
}

.dnp-spotlight__glyph,
.dnp-news-card__glyph {
  position: absolute;
  left: 22px;
  bottom: 16px;
  font-size: clamp(26px, 3.6vw, 52px);
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--accent) 65%, transparent);
}

.dnp-news-card__glyph { font-size: 30px; }

/* -- Cards ---------------------------------------------------------------- */
.dnp-news-card > a { padding: 0; min-height: 0; }

.dnp-news-card__media {
  position: relative;
  flex: none;
  aspect-ratio: 1600 / 576;
  overflow: hidden;
  border-bottom: 1px solid var(--v7-line);
  background: #070a14;
}

.dnp-news-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 0 50%;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s ease;
}

.dnp-news-card__media:after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 9, 19, 0.6), transparent 45%);
  pointer-events: none;
}

.dnp-news-card__new {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 12px;
}

.dnp-news-card:hover .dnp-news-card__media img { transform: scale(1.07); filter: saturate(1.15) brightness(1.06); }
.dnp-news-card:hover .dnp-news-card__shine { animation: dnpShineHover 1.1s ease-out both; }
.dnp-news-card:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 -40px 60px -40px color-mix(in srgb, var(--accent) 30%, transparent); }

.dnp-news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 20px 16px;
}

.dnp-news-card__body header { margin-bottom: 12px; }

.dnp-news-card__body h3 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 17px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dnp-news-card__body p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dnp-news-card__body footer { padding-top: 14px; margin-top: auto; }

/* Cards rise in as they scroll into view (time-based stagger where scroll timelines are unsupported).
   Only the individual translate / scale / opacity properties animate, so the existing hover transform keeps working. */
body[data-effects="on"] .dnp-news__grid .dnp-news-card {
  animation: dnpCardIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(min(var(--i, 0), 11) * 70ms);
}

@supports (animation-timeline: view()) {
  body[data-effects="on"] .dnp-news__grid .dnp-news-card {
    animation: dnpCardIn linear both;
    animation-delay: 0s;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}

/* -- Keyframes ------------------------------------------------------------ */
@keyframes dnpKenBurns { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes dnpShine { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes dnpShineHover { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes dnpRise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes dnpProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dnpSpotScan { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes dnpPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(255, 59, 92, 0); } }
@keyframes dnpEmber {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15% { opacity: 0.9; }
  80% { opacity: 0.45; }
  100% { opacity: 0; transform: translate(34px, -420px) scale(1.15); }
}
@keyframes dnpCardIn { from { opacity: 0; translate: 0 28px; scale: 0.97; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* -- Responsive ----------------------------------------------------------- */
@media (max-width: 1180px) {
  .dnp-spotlight__thumbs a { grid-template-columns: 70px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .dnp-spotlight__slide { grid-template-columns: 1fr; min-height: 0; }
  .dnp-spotlight__media { aspect-ratio: 1600 / 576; }
  .dnp-spotlight__media:after { background: linear-gradient(0deg, rgba(6, 9, 19, 0.85), transparent 45%); }
  .dnp-spotlight__body { padding: 16px 20px 22px; }
  .dnp-spotlight__body h2 { font-size: clamp(22px, 6vw, 30px); }
  .dnp-spotlight__embers { inset: 0; }
  .dnp-spotlight__rail { grid-template-columns: 1fr; }
  .dnp-spotlight__thumbs { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .dnp-spotlight__thumbs a { flex: 0 0 76%; scroll-snap-align: start; }
  .dnp-spotlight__controls { justify-content: space-between; }
}

/* -- Reduced motion / FX LOW ---------------------------------------------- */
html[data-quality="low"] .dnp-spotlight__embers { display: none; }
html[data-quality="low"] .dnp-spotlight:before,
html[data-quality="low"] .dnp-spotlight *,
html[data-quality="low"] .dnp-news-card,
html[data-quality="low"] .dnp-news-card * { animation: none !important; }
.dnp-spotlight.is-static .dnp-spotlight__thumbs a i { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .dnp-spotlight__embers { display: none; }
  .dnp-spotlight:before,
  .dnp-spotlight *,
  .dnp-news-card,
  .dnp-news-card * { animation: none !important; transition: none !important; }
}
