/**
 * HABS TECHNOLOGIES GROUP — Public Newsroom (light editorial)
 */

.news-page {
  min-height: 100vh;
  overflow-x: clip;
  background: #eef2f6;
  /* Pull light newsroom flush under sticky header (avoid double gap with body padding-top) */
  margin-top: -0.35rem;
}

@media (max-width: 1023px) {
  .news-page {
    margin-top: -0.5rem;
  }
}

.news-page__container {
  max-width: min(100%, 72rem);
  margin: 0 auto;
  padding-left: calc(env(safe-area-inset-left, 0px) + clamp(1rem, 4vw, 1.5rem));
  padding-right: calc(env(safe-area-inset-right, 0px) + clamp(1rem, 4vw, 1.5rem));
  box-sizing: border-box;
}

/* --- Hero --- */
.news-page__hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 82% 18%, rgba(7, 47, 122, 0.06) 0%, transparent 52%),
    radial-gradient(95% 80% at 18% 88%, rgba(249, 87, 9, 0.06) 0%, transparent 56%),
    linear-gradient(160deg, #ffffff 0%, #f6f9ff 55%, #f4f7fc 100%);
  border-bottom: 1px solid rgba(7, 47, 122, 0.1);
  text-align: center;
  padding: clamp(0.55rem, 1.4vw, 0.85rem) 0 clamp(0.55rem, 1.2vw, 0.75rem);
  overflow: hidden;
}

.news-page__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(7, 47, 122, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 47, 122, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.news-page__eyebrow {
  margin: 0 0 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  color: #072f7a;
  font-family: var(--font-heading);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.news-page__eyebrow-accent {
  width: 3px;
  height: 1rem;
  border-radius: 2px;
  background: #f95709;
  flex-shrink: 0;
}

.news-page__title {
  position: relative;
  z-index: 1;
  margin: 0 0 0.35rem;
  color: #072f7a;
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.news-page__subtitle {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: 40rem;
  color: #475569;
  font-size: clamp(0.88rem, 1.6vw, 0.98rem);
  line-height: 1.5;
}

/* --- Main --- */
.news-page__main {
  padding: clamp(0.65rem, 1.6vw, 0.95rem) 0 clamp(1.75rem, 3.5vw, 2.5rem);
  background: #eef2f6;
}

.news-page__filters {
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2vw, 1.15rem);
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.news-page__search-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.news-page__search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.news-page__search-input {
  width: 100%;
  max-width: 26rem;
  padding: 0.52rem 0.85rem;
  font-size: 0.92rem;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid rgba(7, 47, 122, 0.18);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-page__search-input::placeholder {
  color: #94a3b8;
}

.news-page__search-input:focus {
  outline: none;
  border-color: rgba(7, 47, 122, 0.45);
  box-shadow: 0 0 0 3px rgba(7, 47, 122, 0.12);
}

.news-page__categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.news-page__category-btn {
  padding: 0.38rem 0.72rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #475569;
  background: #ffffff;
  border: 1px solid rgba(7, 47, 122, 0.14);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.news-page__category-btn:hover {
  border-color: rgba(7, 47, 122, 0.35);
  color: #072f7a;
}

.news-page__category-btn--active {
  color: #ffffff;
  background: #072f7a;
  border-color: #072f7a;
}

.news-page__category-btn--active:hover {
  color: #ffffff;
  background: #062661;
  border-color: #062661;
}

/* --- Cards --- */
.news-page__article {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(7, 47, 122, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  min-width: 0;
  height: 100%;
}

.news-page__article--featured {
  width: 100%;
  max-width: min(100%, 72rem);
  margin: 0 auto clamp(1rem, 2.2vw, 1.35rem);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.news-page__article--featured-only {
  margin-bottom: 0;
}

.news-page__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.5vw, 1.35rem);
  margin-top: 0;
}

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

@media (min-width: 1024px) {
  .news-page__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.news-page__article-media {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  background: linear-gradient(155deg, #e8eef7 0%, #edf2f8 100%);
  line-height: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 10.5rem;
}

.news-page__article-media .news-page__article-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.news-page__article--featured .news-page__article-media {
  min-height: 0;
}

/*
 * Editorial fallback — same footprint as real covers; deterministic visual-* variants (see page.tsx).
 */
.news-page__article-media--fallback {
  overflow: hidden;
}

/* 0 — Navy editorial gradient */
.news-page__article-media--fallback-visual-0 {
  background:
    radial-gradient(110% 85% at 12% 18%, rgba(255, 255, 255, 0.1) 0%, transparent 45%),
    radial-gradient(95% 75% at 96% 92%, rgba(249, 87, 9, 0.14) 0%, transparent 55%),
    linear-gradient(152deg, #051c4d 0%, #072f7a 42%, #094a8f 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* 1 — Navy with orange diagonal accent */
.news-page__article-media--fallback-visual-1 {
  background:
    linear-gradient(135deg, rgba(249, 87, 9, 0.22) 0%, rgba(249, 87, 9, 0) 42%),
    linear-gradient(155deg, #041a40 0%, #072f7a 45%, #085a8c 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.news-page__article-media--fallback-visual-1 .news-page__fallback-pattern {
  opacity: 0.18;
}

/* 2 — Light report / grid (dark typography) */
.news-page__article-media--fallback-visual-2 {
  background: linear-gradient(168deg, #f8fafc 0%, #e8eef7 52%, #e2e8f0 100%);
  border-bottom: 1px solid rgba(7, 47, 122, 0.12);
}

.news-page__article-media--fallback-visual-2 .news-page__fallback-pattern {
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(7, 47, 122, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 47, 122, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
}

.news-page__article-media--fallback-visual-2 .news-page__fallback-badge {
  color: #072f7a;
  background: rgba(7, 47, 122, 0.08);
  border-color: rgba(7, 47, 122, 0.22);
}

.news-page__article-media--fallback-visual-2 .news-page__fallback-title {
  color: #0f172a;
}

.news-page__article-media--fallback-visual-2 .news-page__fallback-brand {
  color: #64748b;
}

.news-page__article-media--fallback-visual-2 .news-page__fallback-accent {
  background: linear-gradient(90deg, #f95709 0%, #d94808 100%);
}

/* 3 — Dark slate newsroom */
.news-page__article-media--fallback-visual-3 {
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 42%, #0f172a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.news-page__article-media--fallback-visual-3 .news-page__fallback-pattern {
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* 4 — Blue technical pattern */
.news-page__article-media--fallback-visual-4 {
  background: linear-gradient(180deg, #051334 0%, #072f7a 58%, #0a4982 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.news-page__article-media--fallback-visual-4 .news-page__fallback-pattern {
  opacity: 0.26;
  background-size: 12px 12px;
  background-image:
    linear-gradient(rgba(147, 197, 253, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 197, 253, 0.14) 1px, transparent 1px);
}

/* 5 — Orange-accent corporate panel */
.news-page__article-media--fallback-visual-5 {
  background: linear-gradient(148deg, #061f52 0%, #072f7a 48%, #094872 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 4px 0 0 0 #f95709;
}

.news-page__article-media--fallback-visual-5 .news-page__fallback-pattern {
  opacity: 0.16;
}

.news-page__fallback-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}

.news-page__fallback-editorial {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: clamp(0.85rem, 2.8vw, 1.35rem);
  box-sizing: border-box;
  text-align: left;
  min-width: 0;
}

.news-page__fallback-editorial--featured {
  padding: clamp(1rem, 3vw, 1.65rem);
  gap: 0.5rem;
}

/* Inset orange bar (visual-5) — clear space beside accent stripe */
.news-page__article-media--fallback-visual-5 .news-page__fallback-editorial {
  padding-left: calc(clamp(0.85rem, 2.8vw, 1.35rem) + 0.35rem);
}

.news-page__article-media--fallback-visual-5 .news-page__fallback-editorial--featured {
  padding-left: calc(clamp(1rem, 3vw, 1.65rem) + 0.35rem);
}

.news-page__fallback-badge {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  padding: 0.2rem 0.48rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow-wrap: anywhere;
}

.news-page__fallback-title {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-page__fallback-editorial--grid .news-page__fallback-title {
  font-size: clamp(0.76rem, 2vw, 0.88rem);
}

.news-page__fallback-editorial--featured .news-page__fallback-title {
  font-size: clamp(0.88rem, 2.35vw, 1.08rem);
}

.news-page__fallback-accent {
  width: 2.25rem;
  height: 3px;
  flex-shrink: 0;
  margin-top: auto;
  border-radius: 2px;
  background: linear-gradient(90deg, #f95709 0%, rgba(249, 87, 9, 0.45) 100%);
}

.news-page__fallback-brand {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.72);
}

.news-page__article-cover-img {
  object-fit: contain;
}

.news-page__video-shell {
  position: absolute;
  inset: 0;
  background: #0f172a;
}

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

.news-page__article-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: clamp(1rem, 2vw, 1.25rem);
  flex: 1;
  min-width: 0;
}

/* Featured — desktop: media left, content right */
@media (min-width: 900px) {
  .news-page__article--featured {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 0;
  }

  .news-page__article--featured .news-page__article-media {
    width: 100%;
    align-self: center;
    border-right: 1px solid rgba(7, 47, 122, 0.08);
  }

  .news-page__article--featured .news-page__article-body {
    align-self: stretch;
    justify-content: center;
    min-height: min(100%, 22rem);
    padding: clamp(1.15rem, 2.2vw, 1.65rem);
    gap: 0.55rem;
  }
}

.news-page__article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.news-page__article-badge {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #072f7a;
  background: rgba(7, 47, 122, 0.08);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.news-page__article-date {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

.news-page__article-title {
  margin: 0;
  color: #072f7a;
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.news-page__article-title-link {
  color: inherit;
  text-decoration: none;
}

.news-page__article-title-link:hover,
.news-page__article-title-link:focus-visible {
  text-decoration: underline;
}

.news-page__article-media-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.news-page__article--featured .news-page__article-title {
  font-size: clamp(1.15rem, 2.4vw, 1.38rem);
}

.news-page__article-excerpt {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.news-page__article-actions {
  margin-top: auto;
  padding-top: 0.35rem;
}

.news-page__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.55rem 1rem;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.news-page__btn--primary {
  background: #072f7a;
  color: #ffffff;
  border-color: #072f7a;
}

.news-page__btn--primary:hover {
  background: #062661;
  border-color: #062661;
}

/* --- Empty --- */
.news-page__empty {
  text-align: center;
  max-width: 28rem;
  margin: 0 auto;
  padding: clamp(1.35rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.5rem);
  background: #ffffff;
  border: 1px solid rgba(7, 47, 122, 0.12);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.news-page__empty-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
  color: rgba(7, 47, 122, 0.45);
}

.news-page__empty-svg {
  flex-shrink: 0;
}

.news-page__empty-title {
  margin: 0 0 0.55rem;
  color: #072f7a;
  font-family: var(--font-heading);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  font-weight: 700;
}

.news-page__empty-text {
  margin: 0 0 1rem;
  color: #475569;
  font-size: 0.94rem;
  line-height: 1.58;
}

.news-page__empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.62rem 1.15rem;
  border-radius: 10px;
  background: #f95709;
  color: #ffffff;
  border: 1px solid #f95709;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.news-page__empty-cta:hover {
  background: #e04f08;
  border-color: #e04f08;
}

/* --- Detail modal --- */
.news-page__overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 1.25rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.news-page__dialog {
  position: relative;
  width: min(100%, 42rem);
  margin: clamp(0.5rem, 2vw, 1rem) auto;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(7, 47, 122, 0.12);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.news-page__dialog-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  font-size: 1.45rem;
  line-height: 1;
  color: #475569;
  cursor: pointer;
}

.news-page__dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 900px);
}

.news-page__detail-media {
  position: relative;
  width: 100%;
  background: #e8eef7;
  line-height: 0;
}

.news-page__detail-media .news-page__article-cover-img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  z-index: 0;
}

.news-page__detail-media .news-page__video-shell {
  position: absolute;
  inset: 0;
}

.news-page__dialog-body {
  padding: 1.15rem 1.25rem 1.35rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.news-page__detail-title {
  margin: 0 0 0.35rem;
  color: #072f7a;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.news-page__detail-author {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: #64748b;
}

.news-page__detail-highlights {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem 0.65rem 1.35rem;
  border-radius: 8px;
  border-left: 3px solid #f95709;
  background: rgba(7, 47, 122, 0.05);
  color: #1e293b;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* globals.css sets `li { color: #fff }` — list items must be forced dark on this light panel */
.news-page__detail-highlights li {
  margin-bottom: 0.35rem;
  color: #1e293b;
}

.news-page__detail-highlights li:last-child {
  margin-bottom: 0;
}

.news-page__detail-content {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.65;
}

.news-page__detail-content p {
  margin: 0 0 0.85rem;
  color: #334155;
}

.news-page__detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.news-page__detail-tag {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: rgba(100, 116, 139, 0.12);
}

/* --- Loading --- */
.news-page__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: #64748b;
  background: #eef2f6;
}

.news-page__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(7, 47, 122, 0.15);
  border-top-color: #072f7a;
  border-radius: 50%;
  animation: news-spin 0.85s linear infinite;
  margin-bottom: 0.75rem;
}

@keyframes news-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 560px) {
  .news-page__categories {
    justify-content: flex-start;
  }

  .news-page__article-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-page__btn {
    width: 100%;
  }
}
