/* ================================================================
   Ganzin Newsroom 2026 – news.css
   ================================================================ */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
               'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #0a0a0a;
  color: #fff;
}

h1, h2, h3, h4, p { margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }

/* ─── Page ─── */
.news-page {
  background: #0a0a0a;
  min-height: calc(100vh - 50px);   /* matches updated navbar height */
}

/* ─── Container ─── */
.news-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ════════════════════════════
   Sub-nav
════════════════════════════ */
.news-subnav {
  position: sticky;
  top: 50px;                        /* matches updated navbar height */
  /*
   * z-index: 10 — deliberately kept LOW.
   * Must be BELOW the navbar's effective stacking level so the
   * #ganzin-navbar dropdown (.nav-dropdown-wrap) always paints on top.
   * 10 is enough to float above regular page content (z-index: auto)
   * while staying clear of the navbar's stacking context (z-index: 1000).
   * In WordPress the theme header may wrap the navbar in its own stacking
   * context; even then the header z-index is typically ≥ 100 > 10, so
   * the dropdown still wins.
   */
  z-index: 10;
  background: #B5C8D9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
}

.news-subnav-inner {
  position: relative;               /* needed for JS-driven tab alignment */
  max-width: 1300px;                /* matches .nav-container */
  margin: 0 auto;
  padding: 0 20px;                  /* matches .nav-container padding */
  display: flex;
  align-items: center;
  height: 50px;                     /* same height as navbar */
  gap: 0;                           /* gap is handled via JS margin on tabs */
}

.news-subnav-title {
  font-size: 30px;
  font-weight: 600;
  color: #000;
  flex-shrink: 0;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

/* Tabs – margin-left is set precisely by JS to align "All" under "Products" */
.news-subnav-tabs {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: nowrap;
  margin-left: 160px;               /* fallback before JS runs */
}

.news-tab {
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  color: #000;
  padding: 3px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.news-tab:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.06);
}

.news-tab.active {
  color: #000;
  background: rgba(0, 0, 0, 0.10);
}

/* ════════════════════════════
   Mobile Filter Button & Panel
   Shown only on narrow screens (≤ 900 px) via media query below.
════════════════════════════ */

/* Hidden on desktop; shown in the ≤900px breakpoint */
.news-filter-btn {
  display: none;
  align-items: center;
  gap: 7px;
  margin-left: auto;            /* push to right edge */
  padding: 5px 14px;
  background: none;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.70);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.news-filter-btn:hover,
.news-filter-btn.open {
  border-color: rgba(0, 0, 0, 0.50);
  color: #0d0d0d;
}

.news-filter-chevron {
  transition: transform 0.2s ease;
}

.news-filter-btn.open .news-filter-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.news-filter-panel {
  background: #B5C8D9;
  border-top: 1px solid rgba(0, 0, 0, 0.09);
  padding: 6px 0 10px;
}

.news-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.55);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.news-filter-option:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.80);
}

.news-filter-option.active {
  color: #0d0d0d;
  font-weight: 600;
}

/* Fixed-width slot for the checkmark so text stays aligned */
.news-filter-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  color: #0d0d0d;
}

/* ════════════════════════════
   Section Titles
   Both "Featured News" and "Latest News" share the same style
════════════════════════════ */
.news-section-title {
  font-size: 32px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 1.74px;
  margin-bottom: 50px;
}

/* ════════════════════════════
   Featured Section
════════════════════════════ */
.news-featured-section {
  padding: 120px 0 0;
}

/* ─── Featured Grid: large card top row, 2 small cards bottom row ─── */
/* 70px extra inset on the grid only — title stays at container alignment */
.featured-grid {
  display: flex;
  flex-direction: column;
  gap: 80px;          /* top row → bottom row spacing */
  padding: 0 70px;    /* 70px extra inset left + right */
}

/* ─── Card base ─── */
.featured-card {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  background: #141414;             /* image-area fallback bg */
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.55);
}

/* ─── Large card: horizontal layout, 1080 × 360 (image 640 × 360) ─── */
.featured-large {
  flex-direction: row;
  height: 360px;
}

.featured-large .featured-img-wrap {
  flex: 0 0 59.26%;   /* 640 / 1080 */
  height: 100%;
  overflow: hidden;
}

.featured-large .featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.36s ease;
}

.featured-large:hover .featured-img-wrap img {
  transform: scale(1.045);
}

.featured-large .featured-body {
  flex: 1;
  padding: 36px 32px;
}

/* ─── Small cards: 2-column grid, 520 × 463 each (image 520 × 293) ─── */
.featured-small-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.featured-small {
  flex-direction: column;
}

.featured-small .featured-img-wrap {
  height: 293px;
  overflow: hidden;
  flex-shrink: 0;
}

.featured-small .featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.36s ease;
}

.featured-small:hover .featured-img-wrap img {
  transform: scale(1.045);
}

.featured-small .featured-body {
  padding: 18px 22px 22px;
  flex: 1;
}

/* ─── Shared: featured-body layout ─── */
.featured-body {
  display: flex;
  flex-direction: column;
  background: #1D1D1D;             /* card text-area background */
}

/* Date ordering: tags-group → headline → date(bottom) */
.featured-body .news-tags         { order: 1; }
.featured-body .featured-headline { order: 2; margin-top: 12px; flex: 1; }
.featured-body .news-date         { order: 3; margin-top: 12px; }

/* ─── Featured headline sizes ─── */
.featured-large .featured-headline {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.38;
  color: #fff;
}

.featured-small .featured-headline {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.42;
  color: #fff;
}

/* ─── Shared: tag, date ─── */

/* Tags group – horizontal wrap for multi-category cards */
.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Base pill tag */
.news-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;          /* overridden per context below */
  font-weight: 600;
  letter-spacing: 1.0px;
  text-transform: uppercase;
  white-space: nowrap;
  /* Default (no data-cat) = brand cyan */
  color: #4dccff;
  background: rgba(77, 204, 255, 0.12);
}

/* ─── Category-specific pill colours ─── */
.news-tag[data-cat="News"]         { color: #4dccff; background: rgba( 77, 204, 255, 0.12); }
.news-tag[data-cat="Events"]       { color: #ff9f4a; background: rgba(255, 159,  74, 0.12); }
.news-tag[data-cat="User Stories"] { color: #a78bfa; background: rgba(167, 139, 250, 0.12); }
.news-tag[data-cat="Learning"]     { color: #4ade80; background: rgba( 74, 222, 128, 0.12); }
.news-tag[data-cat="Research"]     { color: #fb7185; background: rgba(251, 113, 133, 0.12); }

/* Featured cards: 12px */
.featured-body .news-tag {
  font-size: 12px;
}

/* Latest news cards: 11px */
.news-card-body .news-tag {
  font-size: 11px;
}

.news-date {
  display: block;
  font-size: 12px;          /* overridden per context below */
  font-weight: 500;
  color: #A0A0A0;
  font-style: normal;
}

/* Featured cards: 16px */
.featured-body .news-date {
  font-size: 16px;
}

/* Latest news cards: 13px */
.news-card-body .news-date {
  font-size: 13px;
}

/* ════════════════════════════
   Latest News Section
════════════════════════════ */
.news-latest-section {
  padding: 120px 0 120px;   /* last section → 120px gap to footer */
}

/* ─── 3-column grid ─── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* ─── News card ─── */
.news-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: #141414;             /* image-area fallback */
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.55);
}

.news-card-img {
  height: 214px;     /* 380 × 214 per spec */
  overflow: hidden;
  flex-shrink: 0;
}

.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.36s ease;
}

.news-card:hover .news-card-img img {
  transform: scale(1.045);
}

/* ─── Card body ─── */
.news-card-body {
  padding: 18px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1D1D1D;
}

/* Date ordering: tags-group → headline → date(bottom) */
.news-card-body .news-tags          { order: 1; }
.news-card-body .news-card-headline { order: 2; margin-top: 8px; flex: 1; }
.news-card-body .news-date          { order: 3; margin-top: 14px; }

.news-card-headline {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  color: #fff;
}

/* ─── Load More ─── */
.news-load-more-wrap {
  margin-top: 56px;
  text-align: center;
}

.btn-load-more {
  display: inline-block;
  padding: 7px 26px;
  background: rgba(181, 200, 217, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 100px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: rgba(0,0,0,0.75)
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-load-more:hover {
  background: rgba(181, 200, 217, 1);
}

.btn-load-more.hidden {
  display: none;
}

/* ─── Empty state ─── */
.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 0;
  color: rgba(255, 255, 255, 0.28);
  font-size: 15px;
}

/* ════════════════════════════
   Responsive
════════════════════════════ */
@media (max-width: 920px) {
  /* Remove featured grid extra inset on tablet/mobile */
  .featured-grid {
    padding: 0;
  }

  .featured-large {
    flex-direction: column;
    height: auto;
  }

  .featured-large .featured-img-wrap {
    flex: none;
    height: 280px;
  }

  .featured-large .featured-body {
    padding: 24px 28px 28px;
  }

  .featured-large .featured-headline {
    font-size: 22px;
  }

  /* Stack small cards to single column on tablet */
  .featured-small-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .featured-small .featured-img-wrap {
    height: 220px;
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── 900 px: switch sub-nav tabs → filter button ── */
@media (max-width: 900px) {
  /* Hide desktop tabs */
  .news-subnav-tabs {
    display: none;
  }

  /* Show filter trigger button */
  .news-filter-btn {
    display: flex;
  }

  /* On narrow screens the alignment margin is irrelevant (tabs hidden),
     so reset it to avoid empty space on the right */
  .news-subnav-inner {
    gap: 0;
  }
}

@media (max-width: 640px) {
  .news-subnav-inner {
    padding: 0 16px;
  }

  .news-container {
    padding: 0 20px;
  }

  .featured-small .featured-img-wrap {
    height: 200px;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-featured-section {
    padding: 64px 0 0;
  }

  .news-latest-section {
    padding: 80px 0 64px;
  }

  .news-section-title {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .featured-large .featured-img-wrap {
    height: 220px;
  }
}
