/*
 * News — a centered row of outlined cards floating on the shared starfield,
 * using the same visual vocabulary as the Media landing (assets/css/media.css):
 * transparent fill, 1px border, 12px radius, soft floating shadow, and the
 * shared site-nav drawn-border hover (assets/js/nav-hover.js injects the SVG;
 * assets/css/nav-fx.css line-draws it). Minimal: no images.
 */

.news {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 20px 140px; /* top breathing room; bottom clears the fixed nav */
}

.news-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  /* flex-start (not stretch) so a card that grows on hover extends on its own,
     without stretching its row-mates. */
  align-items: flex-start;
  width: 100%;
  max-width: 1040px;
}

/* Card ------------------------------------------------------------------- */
.news-card {
  position: relative; /* anchors the injected .nav-fx border overlay + link */
  flex: 1 1 300px;
  max-width: 340px;
  min-height: 240px;
  /* Column with the text pinned to the bottom at rest; as the details reveal,
     the card grows to fit so the title stays below the top border and "Read
     more" stays visible (no clipping, no percentage-height quirks). */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--color-border-default);
  border-radius: 12px;
  background: transparent;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}
.news-card:active {
  transform: translateY(1px);
}

/* Optional image: when an item has one, it fills the card behind the text
   (with a bottom scrim for legibility) and scales gently on hover — kept from
   the original news-card style. Cards without an image stay the plain outline. */
.news-card__image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms ease;
}
.news-card:hover .news-card__image,
.news-card:focus-within .news-card__image {
  transform: scale(1.06);
}
.news-card.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(6, 10, 18, 0.9) 0%,
    rgba(6, 10, 18, 0.35) 45%,
    rgba(6, 10, 18, 0) 80%);
}
/* Taller when it carries an image, so there's room above the text for it. */
.news-card.has-image {
  min-height: 300px;
}

/* Whole-card click target, above the content but below the drawn border. */
.news-card__card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.news-card__card-link:focus-visible {
  outline: none;
}

/* Text block is anchored to the bottom of the card. The title + date show at
   rest; on hover the details reveal and the block grows upward, so the title &
   date "rise" (kept from the original news-card style). Sits above the injected
   .nav-fx overlay. */
.news-card__body {
  position: relative; /* in-flow so the card sizes to it; above image + nav-fx */
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  width: 100%;
}

.news-card__title {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--color-text-primary);
  transition: color 300ms ease;
  /* Bound the title so a long one can't push the raised block past the top
     border. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.news-card__date {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* Excerpt + read-more: collapsed at rest, revealed on hover/focus. */
.news-card__details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 550ms ease, opacity 400ms ease;
}
.news-card:hover .news-card__details,
.news-card:focus-within .news-card__details {
  max-height: 12rem;
  opacity: 1;
}

.news-card__excerpt {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-soft);
  /* Clamp the preview so the raised block always fits the card: the title stays
     below the top border and "Read more" (which follows, outside this clamp)
     stays visible no matter how long the body is. Full text lives on the item. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.news-card__more {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-brand);
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #cb3ed4; /* Steel Pink, matching the nav accent */
}

/* Hover/focus: the title turns Steel Pink and the shared nav border draws
   itself around the card edge (same as the Media cards). */
.news-card:hover .news-card__title,
.news-card:focus-within .news-card__title {
  color: #cb3ed4;
}

/* Reduced motion: reveal instantly, no grow/fade. */
@media (prefers-reduced-motion: reduce) {
  .news-card__details { transition: none; }
}

/* Align the injected nav-fx border to the card's rounded outline. */
.news-card .nav-fx {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.news-card .nav-fx-rect {
  rx: 12px;
  ry: 12px;
}

/* Phone: single column. */
@media (max-width: 560px) {
  .news-card {
    flex: 1 1 100%;
    max-width: 400px;
  }
}
