/* ===========================================================
   Exemplar REITail — News & Insights page
   (Figma node 100:1067)
   Mobile-first: base styles = phone; media queries scale up.
   Requires exemplar-shared.css (base resets, nav, buttons,
   cards, footer).
   =========================================================== */

.nw-body {
  background: var(--bg);
}

/* ============================ Dark section (hero) ============================ */
.nw-dark {
  position: relative;
  background: var(--bg);
  padding: 132px 0 20px;
}

/* Featured-article cover blended into the dark background with the
   radial vignette from the design. */
.nw-hero {
  position: relative;
}

.nw-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.nw-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nw-hero__shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 50% 50% at 50% 50%,
    rgba(1, 5, 18, 0.4) 0%,
    #010512 100%
  );
}

.nw-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1248px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

.nw-title {
  margin: 0;
  text-align: center;
  font-weight: 200;
  font-size: 44px;
  line-height: 1.15;
  color: #fff;
}
.nw-title .word {
  display: inline-block;
  vertical-align: top;
}
.nw-title .char {
  display: inline-block;
  opacity: 0;
  animation: nwFadeUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.nw-title .word:nth-child(1) .char {
  animation-delay: 0.1s;
}
.nw-title .word:nth-child(2) .char {
  animation-delay: 0.2s;
}
.nw-title .word:nth-child(3) .char {
  animation-delay: 0.3s;
}
.nw-title b {
  font-weight: 500;
}

@keyframes nwFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* featured article (whole block is one link): date + title column on the
   left; excerpt + Read More block pushed to the right edge on desktop */
.nw-featured {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  margin-top: 48px;
  color: #fff;
  opacity: 0;
  animation: nwFadeUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0.4s;
}
.nw-featured__head {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.nw-featured__date {
  font-family: "Roboto Condensed", Arial, sans-serif;
  font-size: 12px;
  line-height: 26px;
}
.nw-featured__title {
  margin: 0;
  max-width: 536px;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  transition: color 0.2s ease;
}
.nw-featured:hover .nw-featured__title {
  color: var(--gold);
}
.nw-featured__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}
.nw-featured__excerpt {
  margin: 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
}

/* ghost variant of the shared button (hero "Read More") */
.ab-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.1);
}
.ab-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* year filter strip */
.nw-years {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1142px;
  margin: 40px auto 0;
  padding: 4px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  opacity: 0;
  animation: nwFadeUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0.5s;
}
.nw-years::-webkit-scrollbar {
  display: none;
}

.nw-years a,
.nw-years span {
  font-size: 18px;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}
.nw-years a:hover {
  color: #fff;
}
.nw-years .is-active {
  color: #fff;
}

/* ============================ Light section (grid) ============================ */
.nw-light {
  background: #fff;
  padding: 48px 0 60px;
}

.nw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1430px;
  margin: 0 auto;
  opacity: 0;
  animation: nwFadeUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0.6s;
}

.nw-card {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  padding: 10px;
  color: #010512;
}
.nw-card.is-hidden {
  display: none;
}

.nw-card__imgwrap {
  flex: none;
  width: 120px;
  height: 84px;
  background: #d9d9d9;
}
.nw-card__imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nw-card__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 10px;
}
.nw-card__date {
  font-family: "Roboto Condensed", Arial, sans-serif;
  font-size: 12px;
  line-height: 26px;
}
.nw-card__title {
  margin: 0 0 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  transition: color 0.2s ease;
}
.nw-card:hover .nw-card__title {
  color: var(--gold);
}

/* load more (dark ghost variant of the shared button) */
.nw-loadmore {
  display: flex;
  margin: 48px auto 0;
  background: transparent;
  border-color: rgba(1, 5, 18, 0.1);
  color: #010512;
}
.nw-loadmore:hover {
  background: rgba(1, 5, 18, 0.06);
}

.nw-empty {
  margin: 0;
  padding: 40px 0;
  text-align: center;
  font-size: 18px;
  color: #010512;
}

.nw-light .ab-cards {
  margin-top: 64px;
}

@media (min-width: 900px) {
  .nw-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================================
   TABLET  ≥ 768px
   ===================================================================== */
@media (min-width: 768px) {
  .nw-title {
    font-size: 60px;
  }

  .nw-featured__title {
    font-size: 34px;
  }

  .nw-grid {
    gap: 28px 40px;
  }

  .nw-card__imgwrap {
    width: 158px;
    height: 110px;
  }
  .nw-card__title {
    font-size: 18px;
    line-height: normal;
  }
}

/* =====================================================================
   DESKTOP  ≥ 1200px  — pixel-accurate reproduction of the design
   ===================================================================== */
@media (min-width: 1200px) {
  .nw-dark {
    padding-top: 170px;
  }

  .nw-hero {
    min-height: 841px;
  }
  .nw-hero__media {
    inset: 0 clamp(24px, 10.2vw, 196px);
  }
  .nw-hero__inner {
    padding: 96px 24px 60px;
  }

  .nw-title {
    font-size: 70px;
  }

  /* head column pinned left, excerpt/button block pinned to the right
       edge of the 1200px container, as in the design */
  .nw-featured {
    align-items: flex-end;
    gap: 31px;
    margin-top: 118px;
  }
  .nw-featured__head {
    align-self: flex-start;
    width: 536px;
    gap: 49px;
  }
  .nw-featured__title {
    max-width: none;
    font-size: 40px;
    line-height: normal;
  }
  .nw-featured__body {
    width: 687px;
    padding: 10px;
    gap: 52px;
  }

  /* strip overlaps the bottom of the hero image, as in the design */
  .nw-years {
    justify-content: space-between;
    margin-top: -49px;
    padding: 4px 24px 0;
  }
  .nw-years a,
  .nw-years span {
    font-size: 24px;
  }

  .nw-light {
    padding: 74px 0 0;
  }

  .nw-grid {
    /* grid-template-columns: repeat(3, 1fr); */
    gap: 28px 28px;
  }

  .nw-loadmore {
    margin-top: 68px;
  }

  .nw-light .ab-cards {
    margin-top: 183px;
  }
}

@media (min-width: 1400px) {
  .nw-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================ Year filtering & reveal ============================ */
/* Off-screen cards skip layout/paint entirely, so a fully "Load More"-expanded
   grid stays cheap to scroll; 130px matches the desktop card height so the
   scrollbar doesn't jump as cards render in. */
.nw-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 130px;
}

/* driven by js/news.js: cards outside the active year get is-filtered-out,
   cards beyond the current page get is-hidden */
.nw-card.is-filtered-out {
  display: none;
}

.nw-loadmore[hidden],
.nw-empty[hidden] {
  display: none !important;
}

/* whole-grid crossfade while the filter swaps cards
   (duration must match fadeDuration in js/news.js) */
#nwGridWrap {
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}
#nwGridWrap.nw-fade-out {
  opacity: 0;
  transform: translateY(12px);
}

/* cards revealed by Load More ease in instead of popping */
.nw-card.nw-reveal {
  animation: nwCardIn 0.35s ease backwards;
}
@keyframes nwCardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #nwGridWrap {
    transition: none;
  }
  .nw-card.nw-reveal {
    animation: none;
  }
}

/* ===========================================================
   Article detail page (Figma node 100:1512)
   Hero + body come from the CMS post; the "Other Articles"
   sidebar reuses the .nw-card component from the grid above.
   =========================================================== */

/* ---------------- Hero: cover image behind the fixed nav ---------------- */
.na-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 420px;
  padding: 160px 0 36px;
  background: var(--bg);
}
.na-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.na-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.na-hero__shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 50% 50% at 50% 50%,
    rgba(1, 5, 18, 0.4) 0%,
    #010512 100%
  );
}

.na-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: #fff;
}
/* back to the news index (shared ghost button, arrow flipped to point left) */
.na-back {
  align-self: flex-start;
}
.na-back .ab-arrow {
  transform: scaleX(-1);
}

.na-hero__date {
  font-family: "Roboto Condensed", Arial, sans-serif;
  font-size: 12px;
  line-height: 26px;
}
.na-hero__title {
  margin: 0;
  max-width: 1227px;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
}

/* ---------------- Light section: body + sidebar ---------------- */
.na-light {
  background: #fff;
  padding: 48px 0 60px;
}

.na-layout {
  display: flex;
  flex-direction: column;
  gap: 56px;
  max-width: 1565px;
  margin: 0 auto;
}

/* CMS-authored HTML */
.na-body {
  color: #010512;
  font-size: 16px;
  line-height: normal;
  overflow-wrap: break-word;
}
.na-body p {
  margin: 0 0 1.25em;
}
.na-body p:last-child {
  margin-bottom: 0;
}
.na-body img {
  max-width: 100%;
  height: auto;
}
.na-body a {
  color: var(--gold);
}

.na-aside__title {
  margin: 0;
  padding: 0 10px; /* lines up with the .nw-card inner padding */
  font-weight: 400;
  font-size: 18px;
  color: #010512;
}
.na-aside__list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 28px;
}

.na-light .ab-cards {
  margin-top: 64px;
}

/* =====================================================================
   DESKTOP  ≥ 1200px  — pixel-accurate reproduction of the design
   ===================================================================== */
@media (min-width: 1200px) {
  .na-hero {
    min-height: 576px;
    padding-bottom: 40px;
  }
  .na-hero__inner {
    gap: 33px;
  }
  .na-hero__title {
    font-size: 40px;
    line-height: normal;
  }

  .na-light {
    padding: 114px 0 59px;
  }

  /* article column left, divider + 400px sidebar pinned right */
  .na-layout {
    flex-direction: row;
    gap: 64px;
  }
  .na-body {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 1052px;
  }
  .na-aside {
    flex: none;
    width: 449px; /* 48px gutter + 1px rule + 400px list */
    border-left: 1px solid rgba(1, 5, 18, 0.15);
    padding-left: 48px;
  }

  .na-light .ab-cards {
    margin-top: 90px;
  }
}

/* =====================================================================
   MOBILE  ≤ 767px — the hero cover stops sitting behind the text and
   becomes a band between the title and the featured article. It keeps
   the same treatment (cover image + radial vignette), so it still reads
   as a background rather than an inline article image.
   ===================================================================== */
@media (max-width: 767px) {
  /* just clears the fixed nav (40px pad + 80px logo) */
  .nw-dark {
    padding-top: 124px;
  }

  .nw-hero {
    display: flex;
    flex-direction: column;
  }
  /* lift the title and the featured block into the hero's flex flow so
     the media can be ordered between them */
  .nw-hero__inner {
    display: contents;
  }

  .nw-title {
    order: 1;
    padding: 0 24px;
  }

  .nw-hero__media {
    order: 2;
    position: relative;
    inset: auto;
    flex: none;
    height: clamp(320px, 92vw, 420px);
    margin-top: -20%;
  }
  /* lighter centre and a wider ellipse than the desktop vignette — the
     band is short enough that the full-strength gradient swallowed the
     image. The outer stop stays opaque so the edges still melt into the
     section background. */
  .nw-hero__media .nw-hero__shade {
    background: radial-gradient(
      ellipse 60% 60% at 50% 50%,
      rgba(1, 5, 18, 0.15) 0%,
      rgba(1, 5, 18, 0.6) 65%,
      #010512 100%
    );
  }

  #nwFeaturedWrap {
    order: 3;
    padding: 0 24px 40px;
    margin-top: -30%;
  }
  .nw-featured {
    margin-top: 20px;
  }
}

@media (max-width: 500px) {
  .nw-card {
    flex-direction: column;
    border: 1px solid rgba(1, 5, 18, 0.1);
  }
  .nw-card__imgwrap,
  .nw-card__img {
    width: 100%;
    max-height: 110px;
    height: 100%;
    overflow: hidden;
  }
}

@media (min-width: 981px) {
  .nw-card__text {
    transform: translateY(-5px);
  }
}
