/**
 * News listing + detail — compact density & full-width layout
 */

/* ── Wider containers with balanced side padding ── */
body.genpro-futuristic .nd-v2-wrap,
body.genpro-futuristic .news-container,
body.genpro-futuristic .fx-listing-magazine .news-container {
  max-width: min(1720px, 96vw) !important;
  padding-left: clamp(1.35rem, 3vw, 2.5rem) !important;
  padding-right: clamp(1.15rem, 2.5vw, 2.25rem) !important;
}

body.genpro-futuristic .nd-v2-layout {
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) minmax(0, 260px) !important;
  gap: clamp(1rem, 1.8vw, 1.35rem) !important;
}

@media (min-width: 1400px) {
  body.genpro-futuristic .nd-v2-layout {
    grid-template-columns: minmax(0, 168px) minmax(0, 1fr) minmax(0, 280px) !important;
  }
}

/* Detail page — collapse rails on tablet/mobile (must override !important above) */
@media (max-width: 1100px) {
  body.genpro-futuristic .nd-v2-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px) !important;
  }
}

@media (max-width: 900px) {
  body.genpro-futuristic .nd-v2-layout {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  body.genpro-futuristic .nd-v2-wrap {
    padding-left: clamp(1rem, 4vw, 1.35rem) !important;
    padding-right: clamp(1rem, 4vw, 1.35rem) !important;
  }
}

body.genpro-futuristic .fx-listing-magazine .news-layout {
  grid-template-columns: minmax(0, 1fr) min(280px, 26%) !important;
  gap: clamp(1rem, 1.8vw, 1.35rem) !important;
}

/* Listing — single column on tablet/mobile (override !important above) */
@media (max-width: 1024px) {
  body.genpro-futuristic .fx-listing-magazine .news-layout {
    grid-template-columns: 1fr !important;
    gap: 1.35rem !important;
  }

  body.genpro-futuristic .fx-listing-magazine .news-main-content {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  body.genpro-futuristic .fx-listing-magazine .news-sidebar {
    order: 2;
    width: 100%;
  }
}

body.genpro-futuristic .fx-listing-magazine .news-main {
  padding-right: clamp(0.35rem, 1vw, 0.75rem);
}

/* ── News listing — compact type ── */
body.genpro-futuristic .fx-news-page-title {
  font-size: clamp(0.95rem, 2vw, 1.1rem) !important;
}

body.genpro-futuristic .fx-listing-filters .filters-title,
body.genpro-futuristic .news-filters .filters-title {
  font-size: clamp(0.88rem, 1.8vw, 0.98rem) !important;
}

body.genpro-futuristic .fx-listing-filters,
body.genpro-futuristic .news-filters.fx-listing-filters {
  padding: 0.65rem 0.85rem !important;
  margin-bottom: 0.85rem !important;
}

body.genpro-futuristic .fx-icon-tile__label {
  font-size: 0.68rem !important;
}

body.genpro-futuristic .fx-featured-story__title,
body.genpro-futuristic .featured-post-title.fx-featured-story__title {
  font-size: clamp(0.95rem, 2vw, 1.2rem) !important;
  line-height: 1.25 !important;
}

body.genpro-futuristic .fx-featured-story__excerpt,
body.genpro-futuristic .featured-post-excerpt.fx-featured-story__excerpt {
  font-size: 0.8rem !important;
  line-height: 1.45 !important;
  -webkit-line-clamp: 2 !important;
}

body.genpro-futuristic .fx-featured-story__body {
  padding: 0.85rem 1rem !important;
  gap: 0.35rem !important;
}

body.genpro-futuristic .fx-featured-story__media {
  min-height: 140px;
}

body.genpro-futuristic .fx-premium-card .blog-card-title {
  font-size: 0.88rem !important;
  line-height: 1.3 !important;
}

body.genpro-futuristic .fx-premium-card .blog-card-excerpt {
  font-size: 0.76rem !important;
  line-height: 1.4 !important;
  -webkit-line-clamp: 2 !important;
}

body.genpro-futuristic .fx-listing-grid--dense {
  gap: 0.85rem !important;
}

body.genpro-futuristic .fx-listing-grid--dense .blog-card-content {
  padding: 0.55rem 0.65rem !important;
}

body.genpro-futuristic .fx-listing-magazine .news-sidebar .sidebar-widget {
  padding: 0.65rem 0.85rem !important;
  margin-bottom: 0.65rem !important;
}

body.genpro-futuristic .fx-sidebar-newsletter__text {
  font-size: 0.76rem !important;
}

body.genpro-futuristic .news-search-input,
body.genpro-futuristic .fx-listing-magazine .news-search-input {
  font-size: 0.82rem !important;
  padding: 0.55rem 0.75rem !important;
}

/* ═══ News listing — mobile & small tablet redesign ═══ */
@media (max-width: 1024px) {
  body.genpro-futuristic .fx-listing-magazine .news-main-content {
    padding-right: 0 !important;
  }
}

@media (max-width: 900px) {
  body.genpro-futuristic .fx-listing-magazine .news-container {
    padding-left: clamp(1rem, 4vw, 1.35rem) !important;
    padding-right: clamp(1rem, 4vw, 1.35rem) !important;
  }

  body.genpro-futuristic .fx-listing-filters,
  body.genpro-futuristic .news-filters.fx-listing-filters {
    padding: 0.85rem 1rem !important;
    margin-bottom: 1rem !important;
  }

  body.genpro-futuristic .fx-news-page-title {
    font-size: clamp(1.15rem, 4.5vw, 1.4rem) !important;
  }

  /* Featured story — stack image above copy */
  body.genpro-futuristic .fx-featured-story--split .fx-featured-story__link,
  body.genpro-futuristic .fx-featured-story__link {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }

  body.genpro-futuristic .fx-featured-story--split .fx-featured-story__media,
  body.genpro-futuristic .fx-featured-story__media {
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: 52vh;
  }

  body.genpro-futuristic .fx-featured-story--split .fx-featured-story__body,
  body.genpro-futuristic .fx-featured-story__body {
    border-left: none !important;
    border-top: 1px solid rgba(255, 102, 0, 0.15);
    padding: 1rem 1.1rem 1.15rem !important;
    gap: 0.55rem !important;
  }

  body.genpro-futuristic .fx-featured-story__title,
  body.genpro-futuristic .featured-post-title.fx-featured-story__title {
    font-size: clamp(1.2rem, 5vw, 1.55rem) !important;
    line-height: 1.3 !important;
  }

  body.genpro-futuristic .fx-featured-story__excerpt,
  body.genpro-futuristic .featured-post-excerpt.fx-featured-story__excerpt {
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
    -webkit-line-clamp: 4 !important;
  }

  body.genpro-futuristic .featured-post-meta {
    gap: 0.4rem !important;
  }

  body.genpro-futuristic .featured-post-meta-item {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--fx-border, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  body.genpro-futuristic .fx-featured-story__cta,
  body.genpro-futuristic .featured-post-read-more.fx-featured-story__cta {
    margin-top: 0.35rem;
    font-size: 0.82rem;
  }

  /* Sidebar widgets — full width cards below articles */
  body.genpro-futuristic .fx-listing-magazine .news-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  body.genpro-futuristic .fx-listing-magazine .news-sidebar .sidebar-widget {
    padding: 0.85rem 1rem !important;
    margin-bottom: 0 !important;
  }

  body.genpro-futuristic .fx-listing-magazine .news-sidebar .sidebar-widget-title {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
  }

  body.genpro-futuristic .recent-post-item {
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom-color: var(--fx-border, rgba(255, 255, 255, 0.1));
  }

  body.genpro-futuristic .recent-post-image {
    width: 4.75rem;
    height: 4.75rem;
    border-radius: var(--fx-radius-sm, 8px);
    object-fit: cover;
  }

  body.genpro-futuristic .recent-post-title {
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 0.35rem;
  }

  body.genpro-futuristic .recent-post-title a {
    color: var(--fx-text, #fff);
  }

  body.genpro-futuristic .fx-sidebar-newsletter__form .fx-sidebar-newsletter__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  body.genpro-futuristic .fx-sidebar-newsletter__btn {
    width: 100%;
    min-height: 2.6rem;
  }
}

@media (max-width: 640px) {
  /* Category filters — horizontal scroll */
  body.genpro-futuristic .fx-filters-stack .filter-buttons.fx-icon-grid--4 {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 0.45rem !important;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  body.genpro-futuristic .fx-filters-stack .filter-buttons.fx-icon-grid--4::-webkit-scrollbar {
    display: none;
  }

  body.genpro-futuristic .fx-filters-stack .filter-btn.fx-icon-tile {
    flex: 0 0 auto;
    min-width: 4.6rem;
    min-height: 3.25rem;
  }

  body.genpro-futuristic .fx-icon-tile__label {
    font-size: 0.62rem !important;
  }

  /* Article grid — single column cards */
  body.genpro-futuristic .fx-listing-grid--dense,
  body.genpro-futuristic .fx-listing-grid--premium,
  body.genpro-futuristic .blog-grid.fx-listing-grid--dense {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  body.genpro-futuristic .fx-premium-card .blog-card-image {
    height: auto;
    aspect-ratio: 16 / 10;
    max-height: 220px;
  }

  body.genpro-futuristic .fx-premium-card .blog-card-title {
    font-size: 1rem !important;
    line-height: 1.35 !important;
  }

  body.genpro-futuristic .fx-premium-card .blog-card-excerpt {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    -webkit-line-clamp: 3 !important;
  }

  body.genpro-futuristic .fx-listing-grid--dense .blog-card-content {
    padding: 0.85rem 1rem !important;
  }

  body.genpro-futuristic .blog-card-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  body.genpro-futuristic .news-pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  body.genpro-futuristic .news-pagination .pagination-btn {
    min-width: 2.25rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 400px) {
  body.genpro-futuristic .featured-post-meta-item:nth-child(n+4) {
    display: none;
  }
}
