/* ==========================================================================
   NsN — Modern tech homepage
   ========================================================================== */

.nsn-home #primary,
.nsn-home .content-area,
.nsn-home .newsmatic-container,
.nsn-home .site-main {
  max-width: 100%;
}

/* Hide default Newsmatic banner/builder on our custom front page to avoid double UI */
body.nsn-home.nsn-custom-front .newsmatic-section.banner-layout--four,
body.nsn-home.nsn-custom-front .main-banner-wrap,
body.nsn-home.nsn-custom-front .bb-bldr--normal > .row-wrap:not(.nsn-keep),
body.nsn-home.nsn-custom-front .you-may-have-missed-section,
body.nsn-home.nsn-custom-front .left-sidebar,
body.nsn-home.nsn-custom-front .right-sidebar,
body.nsn-home.nsn-custom-front #secondary {
  /* front-page.php replaces main content; keep header/footer */
}

.nsn-home-wrap {
  --pad: clamp(16px, 3vw, 28px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad) 48px;
  color: var(--nsn-text, #e5e7eb);
}

/* ---------- HERO / BANNER ---------- */
.nsn-hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin: 18px 0 28px;
}

.nsn-hero-main {
  position: relative;
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--nsn-shadow);
  background: #0f172a;
}

.nsn-hero-main a.nsn-hero-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.nsn-hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.6s ease;
}

.nsn-hero-main:hover img {
  transform: scale(1.06);
}

.nsn-hero-main .nsn-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.05) 20%, rgba(7, 11, 20, 0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  gap: 10px;
}

.nsn-hero-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nsn-hero-side-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 96px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.nsn-hero-side-item:hover {
  border-color: rgba(14, 165, 233, 0.55);
  transform: translateY(-2px);
}

.nsn-hero-side-item img {
  width: 110px;
  height: 100%;
  object-fit: cover;
  background: #1e293b;
}

.nsn-hero-side-item .meta {
  padding: 10px 12px 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.nsn-hero-side-item h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
}

/* ---------- Ticker / live strip ---------- */
.nsn-ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  border-radius: 999px;
  padding: 8px 8px 8px 8px;
  margin-bottom: 26px;
  overflow: hidden;
}

.nsn-ticker-badge {
  flex: 0 0 auto;
  background: #0ea5e9;
  color: #041018;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
}

.nsn-ticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.nsn-ticker-track a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.92rem;
  margin-right: 28px;
}

.nsn-ticker-track a:hover {
  color: #22d3ee;
}

/* ---------- Section headers ---------- */
.nsn-section {
  margin-bottom: 36px;
}

.nsn-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  padding-bottom: 10px;
}

.nsn-section-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nsn-section-head h2::before {
  content: "";
  width: 6px;
  height: 1.1em;
  border-radius: 4px;
  background: linear-gradient(180deg, #22d3ee, #0ea5e9);
  display: inline-block;
}

.nsn-section-head a.more {
  color: #7dd3fc;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.nsn-section-head a.more:hover {
  color: #fff;
}

/* ---------- Chips / category strip ---------- */
.nsn-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.nsn-cats a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nsn-cats a:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.5);
}

.nsn-cats a span.count {
  opacity: 0.65;
  font-weight: 500;
  font-size: 0.78rem;
}

/* ---------- Card grids ---------- */
.nsn-grid {
  display: grid;
  gap: 16px;
}

.nsn-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.nsn-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.nsn-grid-2 {
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.nsn-card {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.nsn-card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 16px 40px rgba(2, 8, 23, 0.35);
}

.nsn-card-thumb {
  aspect-ratio: 16 / 10;
  background: #1e293b;
  overflow: hidden;
}

.nsn-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.nsn-card:hover .nsn-card-thumb img {
  transform: scale(1.05);
}

.nsn-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nsn-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.nsn-card p.excerpt {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Meta pills ---------- */
.nsn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #041018;
  background: linear-gradient(90deg, #22d3ee, #0ea5e9);
  padding: 3px 9px;
  border-radius: 999px;
  width: fit-content;
}

.nsn-pill.is-soft {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.nsn-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #94a3b8;
  font-size: 0.8rem;
}

/* ---------- Category columns ---------- */
.nsn-cat-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.nsn-cat-col {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  border-radius: 16px;
  padding: 14px;
}

.nsn-cat-col h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nsn-cat-col h3 a {
  color: #7dd3fc;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.nsn-list-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  text-decoration: none;
  color: inherit;
}

.nsn-list-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.nsn-list-item img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: #1e293b;
}

.nsn-list-item h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 650;
}

.nsn-list-item .date {
  color: #94a3b8;
  font-size: 0.75rem;
}

/* ---------- Stats strip ---------- */
.nsn-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 8px 0 28px;
}

.nsn-stat {
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.12), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.nsn-stat .num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: -0.03em;
}

.nsn-stat .label {
  color: #94a3b8;
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ---------- Latest dense grid ---------- */
.nsn-latest-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.nsn-side-panel {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--nsn-border, rgba(148, 163, 184, 0.16));
  border-radius: 16px;
  padding: 16px;
}

.nsn-side-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.nsn-side-panel ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: nsn;
}

.nsn-side-panel ol li {
  counter-increment: nsn;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.nsn-side-panel ol li:first-child {
  border-top: 0;
  padding-top: 0;
}

.nsn-side-panel ol li::before {
  content: counter(nsn, decimal-leading-zero);
  font-weight: 800;
  color: #0ea5e9;
  font-size: 0.85rem;
  padding-top: 2px;
}

.nsn-side-panel ol a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

.nsn-side-panel ol a:hover {
  color: #22d3ee;
}

/* ---------- Placeholder image ---------- */
.nsn-ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b, #0f172a 50%, #164e63);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7dd3fc;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nsn-hero {
    grid-template-columns: 1fr;
  }
  .nsn-hero-main {
    min-height: 320px;
  }
  .nsn-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .nsn-grid-3,
  .nsn-cat-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .nsn-latest-row {
    grid-template-columns: 1fr;
  }
  .nsn-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nsn-grid-3,
  .nsn-grid-4,
  .nsn-cat-cols {
    grid-template-columns: 1fr;
  }
  .nsn-hero-side-item {
    grid-template-columns: 88px 1fr;
  }
  .nsn-stats {
    grid-template-columns: 1fr 1fr;
  }
}
