/* News page — premium, responsive, neo-brutalist theme.
   Uses global CSS variables from `neo-styles.css`. */

.news-page {
  --news-signal: #b5179e;
  --news-shadow-hard: color-mix(in srgb, var(--border) 88%, var(--primary));
  --news-deep-1: #2f114a;
  --news-deep-2: #4b1f73;
  --news-soft-1: #b57af3;
  margin: 1.5rem auto 1.2rem;
  width: min(1200px, calc(100% - 2rem));
  box-sizing: border-box;
  counter-reset: news-chapter;
}

/* Framed hero + bold offset shadows (matches Impact hero / KPI treatment) */
.news-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.9rem;
  padding: 0;
  border: var(--border-width) solid var(--border);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--news-shadow-hard);
}

body[data-theme='dark'] .news-hero {
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.52);
}

.news-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 55% at 10% 20%, rgba(155, 93, 229, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 65% 45% at 85% 80%, rgba(224, 170, 255, 0.25) 0%, transparent 50%),
    linear-gradient(170deg, rgba(247, 242, 255, 0.95) 0%, rgba(224, 170, 255, 0.35) 55%, rgba(199, 125, 255, 0.25) 100%);
}

body[data-theme="dark"] .news-hero__bg {
  background:
    radial-gradient(ellipse 70% 55% at 18% 22%, rgba(155, 93, 229, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 85% 78%, rgba(199, 125, 255, 0.18) 0%, transparent 50%),
    linear-gradient(170deg, #1a0f2e 0%, #120a1f 55%, #0a0512 100%);
}

.news-hero__pattern {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.08;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

body[data-theme="dark"] .news-hero__pattern {
  opacity: 0.14;
}

/* Monitor-style lines at hero bottom (Impact page parity: sine + EKG) */
.news-hero__monitor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  height: clamp(76px, 11vw, 118px);
  padding: 0 0 0.65rem;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.news-monitor__sine-wrap,
.news-monitor__ekg-wrap {
  overflow: hidden;
  width: 100%;
  flex: 0 0 auto;
}

.news-monitor__sine-wrap {
  height: clamp(28px, 4.5vw, 40px);
  color: color-mix(in srgb, var(--news-deep-2) 82%, var(--news-soft-1));
  opacity: 0.88;
}

.news-monitor__sine {
  width: 200%;
  height: 100%;
  display: block;
  animation: newsSineFlow 22s linear infinite;
}

.news-monitor__ekg-wrap {
  height: clamp(30px, 4.8vw, 44px);
  color: var(--news-deep-1);
  opacity: 0.92;
}

body[data-theme='dark'] .news-monitor__sine-wrap {
  color: color-mix(in srgb, #c4b5fd 55%, var(--news-soft-1));
  opacity: 0.75;
}

body[data-theme='dark'] .news-monitor__ekg-wrap {
  color: rgba(255, 255, 255, 0.72);
  opacity: 0.88;
}

.news-monitor__ekg {
  width: 200%;
  height: 100%;
  display: block;
  animation: newsEkgSlide 10s linear infinite;
}

@keyframes newsSineFlow {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes newsEkgSlide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.news-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.1rem) 1.25rem clamp(2rem, 5vw, 3.25rem);
  text-align: center;
}

.news-hero__badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: var(--border-width) solid var(--border);
  box-shadow: 5px 5px 0 var(--news-shadow-hard);
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}

body[data-theme='dark'] .news-hero__badge {
  background: rgba(36, 19, 58, 0.8);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.48);
}

.news-hero__title {
  margin: 0 0 0.85rem;
  font-size: clamp(2.25rem, 5vw, 3.1rem);
  line-height: 1.08;
  font-weight: 900;
  color: var(--text);
  text-shadow: 3px 3px 0 rgba(155, 93, 229, 0.2);
  font-family: 'Baloo Da 2', sans-serif;
}

.news-hero__lead {
  margin: 0 auto;
  max-width: 40rem;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  line-height: 1.65;
  opacity: 0.92;
}

.news-kpi-grid {
  margin: 1.35rem auto 0;
  max-width: 62rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.news-kpi-card {
  border: var(--border-width) solid var(--border);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--news-shadow-hard);
  background: rgba(255, 255, 255, 0.62);
  padding: 0.95rem 1rem;
  text-align: center;
  backdrop-filter: blur(8px);
  transform: translateZ(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.news-kpi-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 6px 6px 0 var(--news-shadow-hard);
  filter: brightness(1.04);
}

body[data-theme='dark'] .news-kpi-card {
  background: rgba(36, 19, 58, 0.78);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5);
}

body[data-theme='dark'] .news-kpi-card:hover {
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}

.news-kpi-card__value {
  display: block;
  font-family: 'Baloo Da 2', sans-serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.1;
  color: color-mix(in srgb, var(--primary) 72%, var(--text));
}

.news-kpi-card__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0.88;
}

@media (max-width: 900px) {
  .news-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .news-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.news-section-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px dashed color-mix(in srgb, var(--primary) 22%, var(--border));
}

.news-section-title::before {
  grid-column: 1;
  grid-row: 1;
  counter-increment: news-chapter;
  content: counter(news-chapter, decimal-leading-zero);
  font-family: 'Baloo Da 2', sans-serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1;
  padding: 0.5rem 0.4rem 0.4rem;
  min-width: 2.6rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(
    155deg,
    var(--news-signal) 0%,
    color-mix(in srgb, var(--primary) 35%, var(--news-signal)) 100%
  );
  border: var(--border-width) solid var(--border);
  border-radius: 16px 8px 16px 8px;
  box-shadow: 4px 4px 0 var(--border);
  align-self: center;
}

body[data-theme='dark'] .news-section-title::before {
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--news-signal) 92%, #fff) 0%,
    color-mix(in srgb, var(--primary) 40%, var(--news-signal)) 100%
  );
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}

.news-section-title h2 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  justify-self: start;
  min-width: 0;
  font-size: 1.45rem;
  padding: 0.55rem 1rem;
  box-shadow: 3px 3px 0 var(--border);
  border: var(--border-width) solid var(--border);
  border-radius: 10px;
  background: var(--yellow);
}

.news-section-title .news-meta,
.news-section-title > .news-hero__badge {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  justify-self: end;
  max-width: min(100%, 22rem);
  text-align: right;
}

.news-section-title > .news-hero__badge {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .news-section-title {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: start;
  }

  .news-section-title::before {
    grid-column: 1;
    grid-row: 1;
  }

  .news-section-title h2 {
    grid-column: 2;
    grid-row: 1;
  }

  .news-section-title .news-meta,
  .news-section-title > .news-hero__badge {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    max-width: none;
    text-align: left;
  }
}

.news-section-title--announcements {
  margin-top: 1.6rem;
}

/* Announcements cards: refined hover look (lift + sheen + smart pin motion) */
#news-announcements-grid .news-card {
  position: relative;
  overflow: visible;
  transform: translateY(0);
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.28s ease;
}

#news-announcements-grid .news-card::before {
  content: '';
  position: absolute;
  top: -11px;
  right: 16px;
  width: 64px;
  height: 28px;
  border: var(--border-width) solid var(--border);
  border-radius: 6px;
  background: rgba(181, 122, 243, 0.78);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--border) 88%, transparent);
  transform: rotate(4deg);
  z-index: 4;
  pointer-events: none;
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    background 0.3s ease;
}

#news-announcements-grid .news-card::after {
  content: '+';
  position: absolute;
  top: -3px;
  right: 38px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: linear-gradient(180deg, #8c8f98, #5f6471);
  color: #f2f5fb;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.26);
  z-index: 5;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.45, 0.64, 1);
}

#news-announcements-grid .news-card .news-card__media {
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

#news-announcements-grid .news-card .news-card__media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    108deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.52) 50%,
    transparent 60%,
    transparent 100%
  );
  transform: translateX(-130%);
}

#news-announcements-grid .news-card .news-card__media img {
  transition: transform 0.42s ease;
}

#news-announcements-grid .news-card .news-card__title {
  transition: color 0.26s ease;
}

#news-announcements-grid .news-card:hover {
  transform: translateY(-8px);
  box-shadow:
    12px 14px 0 color-mix(in srgb, var(--primary) 26%, var(--border)),
    0 12px 28px color-mix(in srgb, var(--primary) 18%, transparent);
  filter: saturate(1.04);
}

#news-announcements-grid .news-card:hover::before {
  transform: rotate(-1deg) translateY(-5px);
  background: color-mix(in srgb, var(--accent) 48%, rgba(200, 150, 255, 0.95));
  box-shadow: 6px 7px 0 color-mix(in srgb, var(--primary) 34%, var(--border));
}

#news-announcements-grid .news-card:hover::after {
  transform: translateY(-3px) scale(1.08);
}

#news-announcements-grid .news-card:hover .news-card__media::before {
  opacity: 1;
  animation: newsAnnSheen 0.95s ease;
}

#news-announcements-grid .news-card:hover .news-card__media img {
  transform: scale(1.05);
}

#news-announcements-grid .news-card:hover .news-card__title {
  color: color-mix(in srgb, var(--primary) 40%, var(--text));
}

@keyframes newsAnnSheen {
  from {
    transform: translateX(-130%);
  }
  to {
    transform: translateX(125%);
  }
}

body[data-theme='dark'] #news-announcements-grid .news-card:hover {
  box-shadow:
    12px 14px 0 rgba(0, 0, 0, 0.52),
    0 12px 32px rgba(155, 93, 229, 0.2);
}

/* Minimal animated divider to match screenshot style */
.news-wavy-divider {
  margin: 2rem 0 0.75rem;
  padding: 0;
}

.news-wavy-divider__line {
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='14' viewBox='0 0 160 14'%3E%3Cpath d='M0 7 C 10 2, 20 12, 30 7 S 50 2, 60 7 S 80 12, 90 7 S 110 2, 120 7 S 140 12, 160 7' fill='none' stroke='%23472267' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 160px 14px;
  opacity: 0.58;
  animation: newsWavyLineMove 8s linear infinite;
}

.news-wavy-divider--featured .news-wavy-divider__line {
  animation: newsWavyLineMove 8s linear infinite;
  opacity: 0.58;
}

.news-wavy-divider--announcements .news-wavy-divider__line {
  animation: newsWavyLineMoveReverse 6.8s linear infinite;
  opacity: 0.64;
}

/* Featured */
.news-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2.2vw, 1.5rem);
  margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
  .news-featured {
    grid-template-columns: 1fr;
  }
}

.news-featured-card {
  background: var(--white);
  border: var(--border-width) solid var(--border);
  box-shadow: 8px 8px 0 var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transform: translateZ(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-featured-card:hover {
  transform: translate(3px, 3px);
  box-shadow: 10px 10px 0 var(--border);
}

.news-featured-card__img {
  position: relative;
  height: 220px;
  background: var(--bg);
}

.news-featured-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-featured-card__img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(47, 23, 79, 0.12) 100%);
}

.news-featured-card__body {
  padding: 1.1rem 1.2rem 1.2rem;
}

.news-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.news-meta {
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 800;
}

.news-reading-time {
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0.7;
}

.news-reading {
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0.7;
}

.news-reading {
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0.7;
}

.news-featured-card__title {
  margin: 0 0 0.65rem;
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.25;
}

.news-featured-card__excerpt {
  margin: 0 0 1rem;
  opacity: 0.92;
  line-height: 1.6;
}

.news-featured-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.news-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--border);
}

.news-readmore-btn {
  appearance: none;
  border: var(--border-width) solid var(--border);
  background: var(--cyan);
  color: var(--text);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--border);
  cursor: pointer;
  font-weight: 900;
  padding: 0.55rem 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.news-readmore-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border);
  filter: brightness(1.05);
}

.news-readmore-btn:focus-visible {
  outline: none;
  box-shadow: 4px 4px 0 var(--border), 0 0 0 4px rgba(155, 93, 229, 0.35);
}

/* Controls */
.news-controls {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 1rem;
  /* Make both panels (Categories + Search) same height */
  align-items: stretch;
  margin-bottom: 1.25rem;
  margin-top: 40px;
}

@media (max-width: 900px) {
  .news-controls {
    grid-template-columns: 1fr;
  }
}

.news-filters {
  background: rgba(255, 255, 255, 0.5);
  border: var(--border-width) solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
  border-radius: 16px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

body[data-theme="dark"] .news-filters {
  background: rgba(36, 19, 58, 0.65);
}

.news-filter-title {
  font-weight: 900;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.news-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  /* Keep content at top; allow equal-height stretching */
  align-content: flex-start;
}

.news-cat-btn {
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.4);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--border);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.news-cat-btn:hover {
  transform: translate(1px, 1px);
}

.news-cat-btn[aria-pressed="true"] {
  background: var(--accent);
}

.news-search {
  background: rgba(255, 255, 255, 0.5);
  border: var(--border-width) solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
  border-radius: 16px;
  padding: 0.85rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  /* When the parent row stretches to equal height, center the search block */
  justify-content: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

body[data-theme="dark"] .news-search {
  background: rgba(36, 19, 58, 0.65);
}

/* Categories + Search: subtle hover/focus glow parity with article cards */
.news-filters:hover,
.news-search:hover,
.news-search:focus-within {
  transform: translateY(-2px);
  box-shadow:
    8px 8px 0 var(--border),
    0 8px 18px color-mix(in srgb, var(--primary) 16%, transparent);
}

body[data-theme="dark"] .news-filters:hover,
body[data-theme="dark"] .news-search:hover,
body[data-theme="dark"] .news-search:focus-within {
  box-shadow:
    8px 8px 0 rgba(0, 0, 0, 0.52),
    0 10px 22px rgba(155, 93, 229, 0.22);
}

.news-search label {
  display: block;
  font-weight: 900;
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
}

.news-search input[type="search"] {
  width: 100%;
  border: var(--border-width) solid var(--border);
  border-radius: 12px;
  /* Give placeholder/text more left breathing room */
  padding: 0.6rem 1rem 0.6rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  min-height: 44px;
  box-shadow: inset 0 2px 8px rgba(47, 23, 79, 0.07);
  outline: none;
}

.news-search input[type="search"]:focus {
  box-shadow: inset 0 2px 8px rgba(47, 23, 79, 0.07), 0 0 0 4px rgba(155, 93, 229, 0.35);
  border-color: var(--primary);
}

/* Grid */
.news-grid {
  display: grid;
  /* Keep exactly 4 cards per row on desktop */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

@media (max-width: 1100px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-card {
  background: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transform: translateZ(0);
}

.news-card:hover {
  transform: translate(3px, 3px);
  box-shadow: 8px 8px 0 var(--border);
}

/* All Articles: smart hover (pointer tilt + spotlight) */
#news-grid .news-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50;
  --my: 50;
  transform: perspective(920px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(0);
  transform-style: preserve-3d;
  transition:
    transform 0.14s ease-out,
    box-shadow 0.24s ease,
    filter 0.24s ease;
}

#news-grid .news-card:hover {
  transform: perspective(920px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px);
  box-shadow:
    10px 12px 0 var(--border),
    0 10px 24px color-mix(in srgb, var(--primary) 18%, transparent);
  filter: saturate(1.03);
}

#news-grid .news-card .news-card__media {
  position: relative;
  overflow: hidden;
}

#news-grid .news-card .news-card__media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle 140px at calc(var(--mx) * 1%) calc(var(--my) * 1%),
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.09) 42%,
    transparent 62%
  );
  transition: opacity 0.2s ease;
}

#news-grid .news-card:hover .news-card__media::before {
  opacity: 1;
}

#news-grid .news-card .news-card__media img {
  transition: transform 0.22s ease-out;
}

#news-grid .news-card:hover .news-card__media img {
  transform: scale(1.035);
}

body[data-theme='dark'] #news-grid .news-card:hover {
  box-shadow:
    10px 12px 0 rgba(0, 0, 0, 0.52),
    0 12px 28px rgba(155, 93, 229, 0.23);
}

body[data-theme='dark'] #news-grid .news-card .news-card__media::before {
  background: radial-gradient(
    circle 125px at calc(var(--mx) * 1%) calc(var(--my) * 1%),
    rgba(200, 170, 255, 0.34) 0%,
    rgba(121, 89, 173, 0.11) 46%,
    transparent 66%
  );
}

.news-card__media {
  height: 140px;
  background: var(--bg);
  position: relative;
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(47, 23, 79, 0.12) 100%);
}

.news-card__body {
  padding: 1rem 1.05rem 1.05rem;
}

.news-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.news-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 900;
  font-size: 0.82rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--border);
}

.news-card__date {
  font-size: 0.85rem;
  font-weight: 900;
  opacity: 0.75;
}

.news-card__title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.25;
}

.news-card__excerpt {
  margin: 0 0 0.85rem;
  opacity: 0.92;
  line-height: 1.55;
  font-size: 0.98rem;
}

.news-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.news-readmore-link {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.news-readmore-link:hover {
  color: var(--pink);
}

.news-card__reading {
  font-weight: 900;
  opacity: 0.65;
  font-size: 0.85rem;
}

/* Skeleton */
.news-skeleton-card {
  background: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--border);
  overflow: hidden;
}

.news-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-top: 0.9rem;
}

.news-skeleton-card__media {
  height: 140px;
  background: linear-gradient(90deg, rgba(47, 23, 79, 0.08), rgba(47, 23, 79, 0.14), rgba(47, 23, 79, 0.08));
  background-size: 200% 100%;
  animation: newsShimmer 1.2s ease-in-out infinite;
}

.news-skeleton-card__body {
  padding: 1rem;
}

.news-skeleton-line {
  height: 14px;
  margin-bottom: 0.6rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 23, 79, 0.08), rgba(47, 23, 79, 0.14), rgba(47, 23, 79, 0.08));
  background-size: 200% 100%;
  animation: newsShimmer 1.2s ease-in-out infinite;
}

@keyframes newsShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Load more */
.news-loadmore-wrap {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 2rem;
}

.news-loadmore-btn {
  appearance: none;
  border: var(--border-width) solid var(--border);
  background: var(--cyan);
  color: var(--text);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--border);
  cursor: pointer;
  padding: 0.85rem 1.2rem;
  font-size: 1.02rem;
  font-weight: 950;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.news-loadmore-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--border);
  filter: brightness(1.05);
}

.news-loadmore-btn:focus-visible {
  outline: none;
  box-shadow: 5px 5px 0 var(--border), 0 0 0 4px rgba(155, 93, 229, 0.35);
}

.news-loadmore-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Pagination */
.news-pagination-wrap {
  display: flex;
  justify-content: center;
  margin: 1.65rem 0 2rem;
}

.news-pagination {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: 16px;
  border: var(--border-width) solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}

body[data-theme="dark"] .news-pagination {
  background: rgba(36, 19, 58, 0.85);
}

.news-page-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.35);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.45rem 0.75rem;
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  user-select: none;
}

.news-page-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--border);
  filter: brightness(1.05);
}

.news-page-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.news-page-btn[aria-current="page"] {
  background: #b5179e !important;
  color: #ffffff !important;
}

.news-ellipsis {
  font-weight: 950;
  opacity: 0.7;
  padding: 0 0.2rem;
}

@media (max-width: 640px) {
  .news-pagination-wrap {
    margin: 1rem 0 1.75rem;
    padding: 0 0.2rem;
  }

  .news-page-btn {
    padding: 0.35rem 0.55rem;
  }
}

/* Animations */
.news-anim {
  opacity: 0;
  transform: translateY(14px);
  animation: newsFadeUp 0.55s ease forwards;
}

@keyframes newsFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes newsWavyLineMove {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: 160px;
  }
}

@keyframes newsWavyLineMoveReverse {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: -160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-anim {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .news-wavy-divider__line {
    animation: none;
  }

  .news-kpi-card:hover {
    transform: none;
    filter: none;
  }

  .news-monitor__sine,
  .news-monitor__ekg {
    animation: none;
  }

  #news-grid .news-card {
    transform: none !important;
    transition: none;
  }

  #news-grid .news-card:hover {
    transform: translateY(-3px) !important;
    box-shadow:
      8px 8px 0 var(--border),
      0 8px 18px color-mix(in srgb, var(--primary) 16%, transparent);
    filter: none;
  }

  #news-grid .news-card .news-card__media::before {
    opacity: 0 !important;
    transition: none;
  }

  #news-grid .news-card:hover .news-card__media img {
    transform: none;
  }

  #news-announcements-grid .news-card {
    transition: none;
    transform: none;
  }

  #news-announcements-grid .news-card:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 0 var(--border);
    filter: none;
  }

  #news-announcements-grid .news-card:hover .news-card__media::before {
    animation: none;
    opacity: 0;
  }

  #news-announcements-grid .news-card:hover .news-card__media img {
    transform: none;
  }

  body[data-theme='dark'] #news-announcements-grid .news-card:hover {
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.52);
  }

  body[data-theme='dark'] #news-grid .news-card:hover {
    box-shadow:
      8px 8px 0 rgba(0, 0, 0, 0.52),
      0 10px 22px rgba(155, 93, 229, 0.22);
  }
}

/* Modal */
.news-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 5, 17, 0.62);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

/* Ensure the modal never renders when using the `hidden` attribute */
.news-modal-overlay[hidden] {
  display: none !important;
}

body[data-theme="dark"] .news-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.news-modal {
  width: 100%;
  max-width: 860px;
  max-height: 84vh;
  overflow: auto;
  background: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: 16px;
  box-shadow: 10px 10px 0 var(--border);
  padding: 1.1rem 1.1rem 1.25rem;
  position: relative;
}

.news-modal__close {
  position: sticky;
  top: 0;
  float: right;
  border: var(--border-width) solid var(--border);
  background: var(--yellow);
  color: var(--text);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--border);
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  font-weight: 950;
}

.news-modal__close:hover {
  transform: translate(2px, 2px);
}

.news-modal__header {
  padding-right: 5rem;
  margin-bottom: 0.75rem;
}

.news-modal__meta {
  font-weight: 900;
  opacity: 0.75;
  margin: 0 0 0.5rem;
}

.news-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
  font-weight: 950;
}

.news-modal__content {
  line-height: 1.8;
  opacity: 0.95;
}

.news-modal__content p {
  margin-bottom: 0.9rem;
}

/* No results */
.news-empty {
  padding: 1.15rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  border: var(--border-width) solid var(--border);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--border);
  margin: 1rem 0 1.25rem;
}

body[data-theme="dark"] .news-empty {
  background: rgba(36, 19, 58, 0.65);
}

