/* Frontline News — list + detail pages (.news-page / .news-detail-page).
   Visual language matches launcher.css + store.css: chamfered corners,
   HUD mono tags, Russo One display headings, orange #ff6b00 accent,
   gradient-border cards with corner brackets. Loaded AFTER styles.css and
   frontline-index-theme.css so these rules win where selectors collide. */

.news-page,
.news-detail-page {
  --nw-orange: var(--fl-orange, #ff6b00);
  --nw-amber: var(--fl-amber, #ff9e40);
  --nw-amber-soft: var(--fl-amber-soft, #ffb257);
  --nw-ink: #fff;
  --nw-muted: rgba(229, 231, 235, .68);
  --nw-dim: #9ca3af;
  --nw-line: rgba(255, 255, 255, .1);
  --nw-hud-font: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.news-page *,
.news-page *::before,
.news-page *::after,
.news-detail-page *,
.news-detail-page *::before,
.news-detail-page *::after {
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════
   Shared atoms — HUD tag, pulse dot, back chip
═══════════════════════════════════════════════ */
.nw-hud-tag {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--nw-orange);
  font-family: var(--nw-hud-font);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.nw-hud-tag::before {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--nw-orange), transparent);
  content: "";
}

.nw-pulse-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--nw-orange);
  box-shadow: 0 0 0 0 rgba(255, 107, 0, .55);
  animation: nw-pulse 2.2s infinite;
}

@keyframes nw-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 0, .55); }
  70% { box-shadow: 0 0 0 9px rgba(255, 107, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

.nw-back {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: 0 20px;
  color: #e5e7eb;
  font-family: var(--nw-hud-font);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: color .25s ease, background .25s ease, box-shadow .25s ease, transform .2s ease;
}

.nw-back i {
  font-size: .82em;
  color: var(--nw-orange);
  transition: transform .25s ease;
}

.nw-back:hover {
  color: #fff;
  background: rgba(255, 107, 0, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 0, .55);
  transform: translateY(-2px);
}

.nw-back:hover i {
  transform: translateX(-3px);
}

/* Corner brackets (shared with card frames + detail) */
.nw-brackets {
  position: relative;
}

.nw-brackets::before,
.nw-brackets::after {
  position: absolute;
  z-index: 3;
  width: 20px;
  height: 20px;
  content: "";
  pointer-events: none;
}

.nw-brackets::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid rgba(255, 107, 0, .7);
  border-left: 2px solid rgba(255, 107, 0, .7);
}

.nw-brackets::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid rgba(255, 107, 0, .7);
  border-bottom: 2px solid rgba(255, 107, 0, .7);
}

/* ═══════════════════════════════════════════════
   NEWS — list page
═══════════════════════════════════════════════ */
.news-page {
  padding-top: 0;
  padding-bottom: 88px;
}

/* HERO */
.nw-hero {
  position: relative;
  padding: 108px 0 44px;
  overflow: hidden;
}

.nw-hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(560px 360px at 50% -4%, rgba(255, 107, 0, .16), transparent 70%),
    radial-gradient(520px 380px at 88% 30%, rgba(255, 158, 64, .08), transparent 72%);
  pointer-events: none;
}

.nw-hero__inner {
  position: relative;
  z-index: 1;
}

.nw-hero__top {
  margin-bottom: 30px;
}

.nw-hero__badge-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 20px;
}

.nw-hero-title {
  margin: 0;
  max-width: 20ch;
  font-family: var(--heading-font-family);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.08;
  text-transform: uppercase;
  text-wrap: balance;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .nw-hero-title {
    background: linear-gradient(135deg, #ffffff 12%, var(--nw-amber-soft) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.nw-hero-lead {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--nw-muted);
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.65;
}

/* LIST GRID */
.nw-list-section {
  padding-top: 20px;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 8px;
}

/* First card → featured, spans full width with side-by-side layout */
.news-list .nw-card:first-child {
  grid-column: 1 / -1;
}

/* ── Card: chamfered gradient-border shell ── */
.nw-card {
  position: relative;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .03) 38%, rgba(255, 107, 0, .1));
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
}

.nw-card:hover {
  background: linear-gradient(160deg, rgba(255, 158, 64, .55), rgba(255, 255, 255, .06) 40%, rgba(255, 107, 0, .55));
  transform: translateY(-4px);
}

.nw-card__frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(170deg, #101014 0%, #0a0a0e 60%, #0c0a09 100%);
  clip-path: polygon(17.5px 0, 100% 0, 100% calc(100% - 17.5px), calc(100% - 17.5px) 100%, 0 100%, 0 17.5px);
  overflow: hidden;
}

.nw-card__media {
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--nw-line);
}

.nw-card__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform .4s ease, opacity .3s ease;
}

.nw-card:hover .nw-card__media img {
  transform: scale(1.045);
}

.nw-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px 26px 26px;
}

.nw-card__date {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 14px;
  color: var(--nw-amber-soft);
  font-family: var(--nw-hud-font);
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.nw-card__date::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--nw-orange);
  content: "";
}

.nw-card__title {
  margin: 0 0 12px;
  font-family: var(--heading-font-family);
  font-size: 1.18rem;
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: var(--heading-letter-spacing);
  color: #fff;
}

.nw-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

.nw-card:hover .nw-card__title a {
  color: var(--nw-amber-soft);
}

.nw-card__summary {
  margin: 0;
  flex: 1;
  color: var(--nw-muted);
  font-size: .95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nw-card__link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 22px;
  color: var(--nw-amber-soft);
  font-family: var(--nw-hud-font);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .2s ease, gap .2s ease;
}

.nw-card__link i {
  transition: transform .25s ease;
}

.nw-card__link:hover {
  color: #fff;
  gap: .8rem;
}

.nw-card__link:hover i {
  transform: translateX(4px);
}

/* Featured (first) card: media + body side by side on desktop */
@media (min-width: 720px) {
  .news-list .nw-card:first-child .nw-card__frame {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: stretch;
  }

  .news-list .nw-card:first-child .nw-card__media {
    height: 100%;
    border-bottom: 0;
    border-right: 1px solid var(--nw-line);
  }

  .news-list .nw-card:first-child .nw-card__media img {
    height: 100%;
    aspect-ratio: auto;
    min-height: 260px;
  }

  .news-list .nw-card:first-child .nw-card__body {
    justify-content: center;
    padding: 34px 38px;
  }

  .news-list .nw-card:first-child .nw-card__title {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.16;
  }

  .news-list .nw-card:first-child .nw-card__summary {
    -webkit-line-clamp: 3;
    font-size: 1rem;
  }
}

/* Card with no cover image: brackets guide the eye */
.nw-card--no-media .nw-card__body {
  padding-top: 30px;
}

/* ── Reveal-on-render (staggered) ── */
@keyframes nw-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.nw-card {
  animation: nw-rise .6s cubic-bezier(.22, .61, .36, 1) both;
}

.news-list .nw-card:nth-child(1) { animation-delay: .02s; }
.news-list .nw-card:nth-child(2) { animation-delay: .09s; }
.news-list .nw-card:nth-child(3) { animation-delay: .16s; }
.news-list .nw-card:nth-child(4) { animation-delay: .23s; }
.news-list .nw-card:nth-child(5) { animation-delay: .30s; }
.news-list .nw-card:nth-child(6) { animation-delay: .37s; }
.news-list .nw-card:nth-child(n+7) { animation-delay: .42s; }

/* ── Loading skeleton ── */
.nw-loading {
  margin-top: 8px;
}

.nw-loading__status {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 24px;
  color: var(--nw-dim);
  font-family: var(--nw-hud-font);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.news-loading-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .14);
  border-top-color: var(--nw-orange);
  animation: spin .7s linear infinite;
}

.nw-skel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.nw-skel {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(16, 16, 20, .5);
  clip-path: polygon(17.5px 0, 100% 0, 100% calc(100% - 17.5px), calc(100% - 17.5px) 100%, 0 100%, 0 17.5px);
  overflow: hidden;
}

.nw-skel:first-child {
  grid-column: 1 / -1;
}

.nw-skel__media {
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, .04);
}

.nw-skel:first-child .nw-skel__media {
  aspect-ratio: 21 / 7;
}

.nw-skel__body {
  padding: 24px 26px;
}

.nw-skel__line {
  height: 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
  margin-bottom: 12px;
}

.nw-skel__line--tag { width: 34%; height: 9px; }
.nw-skel__line--title { width: 78%; height: 18px; }
.nw-skel__line--wide { width: 96%; }
.nw-skel__line--short { width: 60%; margin-bottom: 0; }

.nw-skel::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .06) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: nw-shimmer 1.4s ease-in-out infinite;
  content: "";
}

@keyframes nw-shimmer {
  100% { transform: translateX(100%); }
}

/* ── Empty / error states ── */
.news-empty,
.news-error {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 8px;
  padding: 22px 26px;
  color: var(--nw-muted);
  font-size: .98rem;
  background: rgba(16, 16, 20, .55);
  border-left: 2px solid rgba(255, 107, 0, .5);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.news-empty::before,
.news-error::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--nw-orange);
  content: "\f05a"; /* info-circle */
}

.news-error {
  color: #ffd3ce;
  border-left-color: rgba(239, 68, 68, .7);
}

.news-error::before {
  color: #ff6b5c;
  content: "\f071"; /* triangle-exclamation */
}

/* ═══════════════════════════════════════════════
   NEWS — detail page
═══════════════════════════════════════════════ */
.news-detail-page {
  padding-top: 0;
  padding-bottom: 88px;
}

.nw-detail-shell {
  padding-top: 108px;
}

/* article becomes the gradient-border shell */
.news-detail-page .news-detail {
  position: relative;
  margin-top: 30px;
  max-width: 880px;
  padding: 1px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03) 42%, rgba(255, 107, 0, .12));
  box-shadow: 0 26px 70px rgba(0, 0, 0, .5);
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}

.nw-detail__frame {
  background: linear-gradient(170deg, #101014 0%, #0a0a0e 62%, #0c0a09 100%);
  clip-path: polygon(19.5px 0, 100% 0, 100% calc(100% - 19.5px), calc(100% - 19.5px) 100%, 0 100%, 0 19.5px);
  padding: 42px 48px;
}

.news-detail-page .news-meta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 16px;
  color: var(--nw-amber-soft);
  font-family: var(--nw-hud-font);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.news-detail-page .news-meta::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--nw-orange);
  content: "";
}

.news-detail-page .news-detail-title {
  margin: 0 0 18px;
  font-family: var(--heading-font-family);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 400;
  line-height: 1.14;
  text-transform: uppercase;
  text-wrap: balance;
}

.news-detail-page .news-detail-summary {
  margin: 0 0 26px;
  padding-left: 18px;
  border-left: 3px solid var(--nw-orange);
  color: #e2e6ee;
  font-size: 1.12rem;
  line-height: 1.65;
}

.news-detail-page .news-detail-cover {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border: 1px solid var(--nw-line);
  border-radius: 0;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  margin: 6px 0 30px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
}

.news-detail-page .news-detail-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #050507;
  border: 1px solid var(--nw-line);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  margin: 6px 0 30px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
}

.news-detail-page .news-detail-cover.news-detail-cover--poster {
  display: none;
}

.news-detail-page .news-detail-content {
  display: grid;
  gap: 15px;
  color: var(--nw-muted);
  font-size: 1.04rem;
  line-height: 1.78;
}

.news-detail-page .news-detail-content p {
  margin: 0;
}

.news-detail-page .news-detail-content h2,
.news-detail-page .news-detail-content h3 {
  margin: 24px 0 4px;
  font-family: var(--heading-font-family);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: var(--heading-letter-spacing);
  color: #fff;
  text-transform: none;
}

.news-detail-page .news-detail-content ul,
.news-detail-page .news-detail-content ol {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 8px;
}

.news-detail-page .news-detail-content blockquote {
  margin: 6px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--nw-orange);
  background: rgba(255, 107, 0, .07);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  color: #f1d9c6;
  font-style: italic;
}

.news-detail-page .news-detail-content a {
  color: var(--nw-amber-soft);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-detail-page .news-detail-content a:hover {
  color: #fff;
}

.news-detail-page .news-detail-content img {
  width: 100%;
  height: auto;
  border: 1px solid var(--nw-line);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

/* detail loading / error reuse list styling */
.news-detail-page .nw-loading__status {
  margin-top: 24px;
  margin-bottom: 0;
}

.news-detail-page .news-error {
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════
   Motion & responsive
═══════════════════════════════════════════════ */
@media (max-width: 720px) {
  .news-list,
  .nw-skel-grid {
    grid-template-columns: 1fr;
  }

  .nw-hero {
    padding-top: 92px;
  }

  .nw-card__body {
    padding: 20px 22px 22px;
  }

  .nw-detail__frame {
    padding: 30px 24px;
  }

  .nw-detail-shell {
    padding-top: 92px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nw-card,
  .nw-card__media img,
  .nw-pulse-dot,
  .nw-skel::after,
  .news-loading-dot {
    animation: none !important;
    transition: none !important;
  }

  .nw-card {
    opacity: 1;
    transform: none;
  }
}
