/* =============================================================
   NEWS.CSS — Assembly Games Egypt
   News page styles: hero, filter bar, grid, modal, cta strip
============================================================= */


/* -------------------------------------------------------------
   SCREEN-READER ONLY UTILITY
------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* =============================================================
   NEWS HERO
============================================================= */
.news-hero {
  position: relative;
  background: var(--c-bg-dark);
  min-height: 60svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  padding-block: calc(var(--nav-h) + var(--pad-y-sm)) var(--pad-y);
  overflow: hidden;
}

/* Subtle dot-grid texture overlay */
.news-hero__bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,122,0,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.news-hero .wrap {
  position: relative;
  z-index: 1;
}

.news-hero__content {
  max-width: 780px;
}

.news-hero__headline {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--c-text-light);
  margin-bottom: 1.5rem;
}

.news-hero__headline em {
  font-style: italic;
  color: var(--c-accent);
}

.news-hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(247, 244, 239, 0.65);
  line-height: 1.7;
  max-width: 560px;
}

/* Dark hero section-label override — color stays orange from global.css */


/* =============================================================
   FILTER BAR
============================================================= */
.news-filter {
  background: var(--c-bg-muted);
  border-bottom: 1px solid var(--c-border);
  padding-block: 1.25rem;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}

.news-filter__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.news-filter__btn {
  font-family: var(--f-display);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 100px;
  border: 1.5px solid var(--c-border);
  background: transparent;
  color: var(--c-text-muted);
  cursor: pointer;
  transition:
    background  0.2s var(--ease-out),
    color       0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    transform   0.2s var(--ease-out);
  white-space: nowrap;
}

.news-filter__btn:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  transform: translateY(-1px);
}

.news-filter__btn.is-active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #0C0B0A;
}

.news-filter__btn.is-active:hover {
  background: var(--c-accent-dim);
  border-color: var(--c-accent-dim);
  color: #0C0B0A;
  transform: translateY(-1px);
}


/* =============================================================
   NEWS SECTION WRAPPER
============================================================= */
.news-section {
  background: var(--c-bg);
  padding-block: var(--pad-y);
}


/* =============================================================
   NEWS GRID
============================================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

@media (max-width: 960px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* Hide filtered-out cards */
.news-card[hidden] {
  display: none;
}


/* =============================================================
   NEWS CARD
============================================================= */
.news-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition:
    transform   0.25s var(--ease-out),
    box-shadow  0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
  outline: none;
}

.news-card:hover,
.news-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(12, 11, 10, 0.12);
  border-color: var(--c-accent);
}

.news-card:focus-visible {
  box-shadow: 0 0 0 3px var(--c-accent), 0 16px 40px rgba(12, 11, 10, 0.12);
}

/* Thumbnail */
.news-card__thumb {
  height: 200px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.news-card__thumb-inner {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.08) 0%, transparent 60%);
}

/* Thumb colour variants */
.news-card__thumb--orange {
  background: linear-gradient(135deg, #FF7A00 0%, #C85F00 60%, #7A3A00 100%);
}
.news-card__thumb--dark {
  background: linear-gradient(135deg, #2A2825 0%, #0C0B0A 60%, #1a1917 100%);
}
.news-card__thumb--teal {
  background: linear-gradient(135deg, #006D77 0%, #004D55 60%, #003D44 100%);
}
.news-card__thumb--purple {
  background: linear-gradient(135deg, #5E3DAD 0%, #3D2373 60%, #2A1A52 100%);
}
.news-card__thumb--green {
  background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 60%, #0A2818 100%);
}
.news-card__thumb--amber {
  background: linear-gradient(135deg, #E9851D 0%, #A85E00 60%, #6B3C00 100%);
}

/* Card body */
.news-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

/* Category badge */
.news-card__cat {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  white-space: nowrap;
}

.news-card__cat--announcement {
  background: rgba(255, 122, 0, 0.12);
  color: var(--c-accent);
}
.news-card__cat--industry {
  background: rgba(12, 11, 10, 0.08);
  color: var(--c-text);
}
.news-card__cat--programs {
  background: rgba(0, 109, 119, 0.12);
  color: #006D77;
}
.news-card__cat--events {
  background: rgba(45, 106, 79, 0.12);
  color: #2D6A4F;
}
.news-card__cat--studios {
  background: rgba(94, 61, 173, 0.12);
  color: #5E3DAD;
}

/* Date */
.news-card__date {
  font-family: var(--f-body);
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

/* Title */
.news-card__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin-bottom: 0.75rem;
}

/* Excerpt */
.news-card__excerpt {
  font-family: var(--f-body);
  font-size: 0.875rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read More link */
.news-card__btn {
  font-family: var(--f-display);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.news-card__btn:hover {
  opacity: 0.75;
  transform: translateX(3px);
}


/* =============================================================
   EMPTY STATE
============================================================= */
.news-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--c-text-muted);
  font-family: var(--f-body);
  font-size: 1rem;
}


/* =============================================================
   NEWS MODAL
============================================================= */
.news-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.news-modal[hidden] {
  display: none;
}

.news-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.news-modal__card {
  position: relative;
  background: #fff;
  max-width: 720px;
  width: 100%;
  border-radius: 8px;
  padding: 2.5rem;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);

  /* Smooth entrance */
  animation: modalIn 0.3s var(--ease-out) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.news-modal__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg-muted);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--c-text);
  transition:
    background 0.2s var(--ease-out),
    color      0.2s var(--ease-out),
    transform  0.2s var(--ease-out);
  flex-shrink: 0;
}

.news-modal__close:hover {
  background: var(--c-accent);
  color: #fff;
  transform: rotate(90deg);
}

.news-modal__close:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

.news-modal__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.news-modal__cat {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  background: rgba(255, 122, 0, 0.12);
  color: var(--c-accent);
}

.news-modal__date {
  font-family: var(--f-body);
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

.news-modal__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin-bottom: 1.5rem;
  padding-right: 2.5rem; /* clearance for close btn */
}

.news-modal__body {
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text-muted);
}

/* Body paragraphs spacing */
.news-modal__body p + p {
  margin-top: 1rem;
}

/* Mobile modal adjustments */
@media (max-width: 560px) {
  .news-modal__card {
    padding: 1.75rem 1.25rem;
    border-radius: 6px;
  }

  .news-modal__title {
    font-size: 1.15rem;
    padding-right: 2rem;
  }
}


/* =============================================================
   PREVENT BODY SCROLL WHEN MODAL OPEN
============================================================= */
body.modal-open {
  overflow: hidden;
}


/* =============================================================
   NEWS CTA STRIP
============================================================= */
.news-cta {
  background: var(--c-bg-dark);
  padding-block: var(--pad-y);
  position: relative;
  overflow: hidden;
}

.news-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 80% 50%, rgba(255,122,0,0.08) 0%, transparent 65%);
  pointer-events: none;
}

.news-cta__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}

.news-cta .section-label {
  justify-content: center;
}

.news-cta__headline {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--c-text-light);
  margin-bottom: 1rem;
}

.news-cta__headline em {
  font-style: italic;
  color: var(--c-accent);
}

.news-cta__sub {
  font-family: var(--f-body);
  font-size: 1rem;
  color: rgba(247, 244, 239, 0.6);
  margin-bottom: 2.25rem;
  line-height: 1.6;
}

.news-cta__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}


/* =============================================================
   RTL OVERRIDES
============================================================= */
[dir="rtl"] .news-hero__content {
  text-align: right;
}

[dir="rtl"] .news-card__btn:hover {
  transform: translateX(-3px);
}

[dir="rtl"] .news-modal__title {
  padding-right: 0;
  padding-left: 2.5rem;
}

[dir="rtl"] .news-modal__close {
  right: auto;
  left: 1.25rem;
}

[dir="rtl"] .news-filter__bar {
  justify-content: flex-end;
}
