/* Phase four: the news section becomes an editorial game-studio desk. */

#news .home-news {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(240px, 0.72fr);
  grid-template-rows: repeat(2, minmax(184px, 1fr));
  gap: clamp(16px, 2.2vw, 28px);
  counter-reset: home-news;
}

#news .home-news::before {
  position: absolute;
  top: -16px;
  right: 7%;
  width: 38%;
  height: 1px;
  background: rgba(217, 182, 118, 0.42);
  content: "";
  transform: rotate(-7deg);
  pointer-events: none;
}

#news .home-news .card {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  grid-row: span 1;
  counter-increment: home-news;
  border: 1px solid rgba(243, 244, 236, 0.24);
  border-radius: 0;
  background: var(--ink-panel);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.2);
  clip-path: polygon(0 0, 98.5% 0, 100% 10%, 98.5% 100%, 2% 100%, 0 90%);
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

#news .home-news .card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: 3px;
  background: var(--cinnabar);
  content: "";
  opacity: 0.82;
  transition: width 0.28s ease;
  pointer-events: none;
}

#news .home-news .card::after {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 4;
  color: rgba(217, 182, 118, 0.18);
  content: counter(home-news, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: clamp(3.8rem, 7vw, 6rem);
  font-weight: 900;
  line-height: 0.8;
  transform: skewX(-12deg);
  pointer-events: none;
}

#news .home-news .card:first-child {
  grid-row: 1 / -1;
  grid-template-rows: minmax(300px, 1fr) auto;
  background: var(--ink-blue);
}

#news .home-news .card:not(:first-child) {
  grid-template-columns: minmax(104px, 0.78fr) minmax(0, 1.22fr);
  grid-template-rows: 1fr;
  min-height: 190px;
}

#news .home-news .card__media {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: auto !important;
  background: var(--ink-blue);
}

#news .home-news .card:first-child .card__media {
  min-height: 300px;
}

#news .home-news .card__media::before {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(217, 182, 118, 0.55);
  content: "";
  transform: rotate(45deg);
  pointer-events: none;
}

#news .home-news .card__media::after {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 2;
  width: 38px;
  height: 38px;
  background: var(--cinnabar);
  content: "";
  clip-path: polygon(0 0, 100% 0, 100% 84%, 74% 100%, 0 100%);
  box-shadow: 6px 6px 0 var(--paper-mark-dark);
  opacity: 0.9;
  transition: transform 0.28s ease;
  pointer-events: none;
}

#news .home-news .card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: saturate(0.86) contrast(1.08);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

#news .home-news .card__body {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(18px, 2.2vw, 30px);
  border-top: 1px solid rgba(217, 182, 118, 0.28);
  background: rgba(5, 11, 15, 0.82);
}

#news .home-news .card:not(:first-child) .card__body {
  border-top: 0;
  border-left: 1px solid rgba(217, 182, 118, 0.28);
}

#news .home-news .card__title {
  max-width: 16ch;
  margin-bottom: 10px;
  color: var(--paper-light);
  font-size: clamp(1.05rem, 1.7vw, 1.48rem);
  font-weight: 800;
  line-height: 1.16;
}

#news .home-news .card:first-child .card__title {
  max-width: 13ch;
  font-size: clamp(1.65rem, 3vw, 2.8rem);
  line-height: 1.04;
  transform: skewX(-2deg);
  transform-origin: left center;
}

#news .home-news .card__summary {
  max-width: 42ch;
  margin-bottom: 18px;
  color: rgba(243, 244, 236, 0.66);
  font-size: 0.86rem;
  line-height: 1.7;
}

#news .home-news .card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(121, 185, 171, 0.24);
  color: var(--paper-mark);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

#news .home-news .badge--muted {
  padding: 2px 8px;
  border: 1px solid rgba(121, 185, 171, 0.34);
  border-radius: 0;
  background: transparent;
  color: var(--jade);
}

#news .home-news .card:hover,
#news .home-news .card:focus-visible {
  border-color: var(--cinnabar);
  box-shadow: 16px 16px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

#news .home-news .card:hover::before,
#news .home-news .card:focus-visible::before {
  width: 7px;
}

#news .home-news .card:hover .card__media img,
#news .home-news .card:focus-visible .card__media img {
  filter: saturate(1) contrast(1.08);
  transform: scale(1.045);
}

#news .home-news .card:hover .card__media::after,
#news .home-news .card:focus-visible .card__media::after {
  transform: translate(-5px, -5px) rotate(-4deg);
}

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

  #news .home-news .card:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1.12fr) minmax(230px, 0.88fr);
    grid-template-rows: 1fr;
    min-height: 360px;
  }

  #news .home-news .card:first-child .card__media {
    min-height: 360px;
  }

  #news .home-news .card:not(:first-child) {
    min-height: 220px;
  }

  #news .home-news .card:not(:first-child) .card__body {
    border-top: 1px solid rgba(217, 182, 118, 0.28);
    border-left: 0;
  }
}

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

  #news .home-news .card,
  #news .home-news .card:first-child,
  #news .home-news .card:not(:first-child) {
    display: grid;
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  #news .home-news .card__media,
  #news .home-news .card:first-child .card__media {
    height: clamp(190px, 54vw, 280px);
    min-height: 0;
    aspect-ratio: 16 / 9 !important;
  }

  #news .home-news .card__body,
  #news .home-news .card:not(:first-child) .card__body {
    min-height: 168px;
    border-top: 1px solid rgba(217, 182, 118, 0.28);
    border-left: 0;
  }

  #news .home-news .card:first-child .card__title {
    font-size: clamp(1.55rem, 8vw, 2.3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  #news .home-news .card,
  #news .home-news .card::before,
  #news .home-news .card__media img,
  #news .home-news .card__media::after {
    transition: none;
  }
}
