/* -------------------------------------------------------
   News bento (homepage "Latest news" section)
   Behaviour lives in assets/js/news-bento.js.
------------------------------------------------------- */
.news-bento {
  --nw-base: var(--base-color, #dd6531);
  --nw-coral: #ef5f43;
  --nw-peach: #f38c4b;
  --nw-ink: var(--dark-gray, #292d36);
  --nw-muted: var(--medium-gray, #808291);
  --nw-line: rgba(41, 45, 54, 0.08);
  --nw-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --nw-ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.25);
  position: relative;
  overflow: hidden;
  overflow: clip;
  background-color: var(--very-light-gray, #f7f7f7);
}

.nw-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}

.nw-glow-1 {
  width: 440px;
  height: 440px;
  top: -140px;
  right: -120px;
  background: var(--nw-peach);
  opacity: 0.16;
  animation: nw-drift 20s ease-in-out infinite;
}

.nw-glow-2 {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: 20%;
  background: var(--nw-base);
  opacity: 0.1;
  animation: nw-drift 24s ease-in-out infinite reverse;
}

/* Heading */
.nw-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 50px;
}

.nw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--nw-base);
  background: rgba(221, 101, 49, 0.08);
  border: 1px solid rgba(221, 101, 49, 0.25);
}

.nw-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nw-base);
  animation: nw-pulse 1.8s ease-out infinite;
}

.nw-heading {
  margin-bottom: 0;
  font-weight: 600;
  letter-spacing: -2px;
  color: var(--nw-ink);
}

.nw-gradient-text {
  background: linear-gradient(90deg, var(--nw-base), var(--nw-peach), var(--nw-coral), var(--nw-base));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nw-text-flow 7s linear infinite;
}

.nw-sub {
  max-width: 380px;
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--nw-muted);
}

/* Bento grid: featured story + stacked list */
.nw-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px;
}

.nw-feature,
.nw-item {
  --mx: 50%;
  --my: 50%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.nw-spot {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(320px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.nw-feature:hover .nw-spot,
.nw-item:hover .nw-spot {
  opacity: 1;
}

/* Featured story */
.nw-feature {
  display: flex;
  align-items: flex-end;
  min-height: 520px;
  border-radius: 28px;
  background: var(--nw-ink);
  box-shadow: 0 40px 70px -40px rgba(41, 45, 54, 0.6);
  transition: transform 0.6s var(--nw-ease-out), box-shadow 0.5s ease;
}

.nw-feature:hover {
  transform: translateY(-6px);
  box-shadow: 0 50px 80px -40px rgba(221, 101, 49, 0.55);
}

.nw-feature-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.nw-feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: nw-kenburns 18s ease-in-out infinite alternate;
}

.nw-feature-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, rgba(22, 24, 30, 0.95) 8%, rgba(22, 24, 30, 0.55) 45%, rgba(22, 24, 30, 0) 75%),
    linear-gradient(135deg, rgba(221, 101, 49, 0.25), transparent 50%);
}

.nw-feature-body {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 40px;
}

.nw-feature-title {
  margin: 16px 0 12px;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -1px;
  color: #fff;
}

.nw-feature-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.nw-feature .nw-tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.nw-feature time {
  color: rgba(255, 255, 255, 0.7);
}

/* Shared meta row */
.nw-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.nw-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--nw-base);
  background: rgba(221, 101, 49, 0.08);
  border: 1px solid rgba(221, 101, 49, 0.2);
}

/* Pulsing dot on stories that are still to come */
.nw-tag-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nw-peach);
  animation: nw-pulse 1.8s ease-out infinite;
}

.nw-meta time {
  font-size: 14px;
  font-weight: 500;
  color: var(--nw-muted);
}

/* Stacked list */
.nw-list {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.nw-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 22px 14px 14px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--nw-line);
  box-shadow: 0 12px 30px -24px rgba(41, 45, 54, 0.4);
  transition: transform 0.5s var(--nw-ease-out), box-shadow 0.5s ease, border-color 0.4s ease;
}

.nw-item .nw-spot {
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(243, 140, 75, 0.12), transparent 65%);
  z-index: -1;
}

/* Gradient accent that grows along the left edge on hover */
.nw-item::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--nw-base), var(--nw-peach));
  transform: scaleY(0);
  transition: transform 0.5s var(--nw-ease-out);
}

.nw-item:hover {
  transform: translateX(6px);
  border-color: rgba(221, 101, 49, 0.25);
  box-shadow: 0 24px 44px -28px rgba(221, 101, 49, 0.5);
}

.nw-item:hover::after {
  transform: scaleY(1);
}

.nw-thumb {
  width: 140px;
  height: 100%;
  min-height: 120px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
}

.nw-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--nw-ease-out);
}

.nw-item:hover .nw-thumb img {
  transform: scale(1.1);
}

.nw-item-body {
  min-width: 0;
}

.nw-item-title {
  margin: 10px 0 6px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.3px;
  color: var(--nw-ink);
  transition: color 0.3s ease;
}

.nw-item:hover .nw-item-title {
  color: var(--nw-base);
}

.nw-item-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--nw-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Scroll reveal (only hidden once JS is running) */
.nw-js .nw-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.8s var(--nw-ease-out);
  transition-delay: calc(var(--nw-i, 0) * 120ms);
}

.nw-js .nw-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* List items slide in from the right instead */
.nw-js .nw-item.nw-reveal {
  transform: translateX(50px);
}

.nw-js .nw-item.nw-reveal.is-visible {
  transform: none;
}

/* Images wipe in once their card is visible */
.nw-js .nw-feature-media,
.nw-js .nw-thumb {
  clip-path: inset(0 100% 0 0 round 16px);
  transition: clip-path 1.1s var(--nw-ease-out);
  transition-delay: calc(var(--nw-i, 0) * 120ms + 200ms);
}

.nw-js .is-visible .nw-feature-media,
.nw-js .is-visible .nw-thumb {
  clip-path: inset(0 0 0 0 round 16px);
}

.nw-js .is-visible .nw-feature-media {
  clip-path: inset(0);
}

/* Featured copy rises after the image */
.nw-js .nw-feature .nw-feature-body > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.8s var(--nw-ease-out);
}

.nw-js .nw-feature.is-visible .nw-feature-body > * {
  opacity: 1;
  transform: none;
}

.nw-js .nw-feature.is-visible .nw-feature-body > :nth-child(1) { transition-delay: 0.6s; }
.nw-js .nw-feature.is-visible .nw-feature-body > :nth-child(2) { transition-delay: 0.72s; }
.nw-js .nw-feature.is-visible .nw-feature-body > :nth-child(3) { transition-delay: 0.84s; }

/* Once revealed, the cards' own hover transitions take over again */
.nw-js .nw-feature.nw-reveal.is-visible {
  transition: transform 0.6s var(--nw-ease-out), box-shadow 0.5s ease, opacity 0.7s ease;
  transition-delay: 0s;
}

.nw-js .nw-item.nw-reveal.is-visible {
  transition: transform 0.5s var(--nw-ease-out), box-shadow 0.5s ease, border-color 0.4s ease, opacity 0.7s ease;
}

.nw-js .nw-feature.nw-reveal.is-visible:hover {
  transform: translateY(-6px);
}

.nw-js .nw-item.nw-reveal.is-visible:hover {
  transform: translateX(6px);
}

/* Keyframes */
@keyframes nw-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.12); }
}

@keyframes nw-pulse {
  0% { box-shadow: 0 0 0 0 rgba(221, 101, 49, 0.6); }
  100% { box-shadow: 0 0 0 10px rgba(221, 101, 49, 0); }
}

@keyframes nw-text-flow {
  to { background-position: 300% 0; }
}

@keyframes nw-kenburns {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.18) translate(-2%, -2%); }
}

/* Responsive */
@media (max-width: 1199px) {
  .nw-feature-title {
    font-size: 28px;
  }

  .nw-thumb {
    width: 120px;
  }
}

@media (max-width: 991px) {
  .nw-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 36px;
  }

  .nw-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nw-feature {
    min-height: 440px;
  }

  .nw-list {
    grid-template-rows: none;
    gap: 16px;
  }
}

@media (max-width: 575px) {
  .nw-heading {
    letter-spacing: -1px;
  }

  .nw-sub {
    font-size: 16px;
  }

  .nw-feature {
    min-height: 380px;
    border-radius: 22px;
  }

  .nw-feature-body {
    padding: 26px 22px;
  }

  .nw-feature-title {
    font-size: 24px;
  }

  .nw-feature-text {
    font-size: 16px;
  }

  .nw-item {
    gap: 14px;
    padding: 10px 14px 10px 10px;
    border-radius: 20px;
  }

  .nw-thumb {
    width: 92px;
    min-height: 92px;
    border-radius: 14px;
  }

  .nw-item-title {
    margin-top: 8px;
    font-size: 16px;
  }

  .nw-item-text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nw-glow,
  .nw-eyebrow-dot,
  .nw-gradient-text,
  .nw-tag-live::before,
  .nw-feature-media img {
    animation: none;
  }

  .nw-js .nw-reveal,
  .nw-js .nw-feature-media,
  .nw-js .nw-thumb,
  .nw-js .nw-feature .nw-feature-body > *,
  .nw-feature,
  .nw-item,
  .nw-thumb img {
    transition: none;
  }
}
