/*
 * REPORTAGES V1 — CANDIDATE
 *
 * Scope:
 * - Reports section only
 * - Content-type and topic filters
 * - Editorial card grid
 * - Internal scrolling
 *
 * Foundation, Hero, Events and Guide are locked and untouched.
 */

[data-home-section="reports"] {
  --reports-inline: clamp(12px, 2.5vw, 42px);
  --reports-top-gap: clamp(10px, 1.7vh, 20px);
  --reports-bottom-gap: clamp(10px, 1.7vh, 18px);
  --reports-filter-gap: clamp(6px, .8vw, 10px);
  --reports-card-gap: clamp(8px, 1vw, 14px);

  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  padding:
    var(--reports-top-gap)
    var(--reports-inline)
    var(--reports-bottom-gap);
}

[data-home-section="reports"] > .container,
[data-home-section="reports"] .home-section-shell,
[data-home-section="reports"] .reports-shell,
[data-home-section="reports"] .editorial-shell {
  width: min(100%, 1540px);
  height: 100%;
  min-height: 0;
  margin-inline: auto;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.4vh, 18px);
}

/* Filter bar */
[data-home-section="reports"] .home-filter-bar,
[data-home-section="reports"] .reports-filter-bar,
[data-home-section="reports"] .editorial-filter-bar,
[data-home-section="reports"] .filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 26px);
  min-width: 0;
}

[data-home-section="reports"] .filter-group,
[data-home-section="reports"] .filters-left,
[data-home-section="reports"] .filters-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--reports-filter-gap);
  min-width: 0;
}

[data-home-section="reports"] .filter-chip,
[data-home-section="reports"] .filter-button,
[data-home-section="reports"] [data-filter] {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

/* Editorial grid */
[data-home-section="reports"] .reports-grid,
[data-home-section="reports"] .editorial-grid,
[data-home-section="reports"] .home-editorial-grid,
[data-home-section="reports"] .articles-grid {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: var(--reports-card-gap);
  padding: 1px 2px 4px;
}

[data-home-section="reports"] .report-card,
[data-home-section="reports"] .editorial-card,
[data-home-section="reports"] .article-card,
[data-home-section="reports"] .home-editorial-card {
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(10px, 1vw, 16px);
  cursor: pointer;
  box-sizing: border-box;
}

/* Consistent editorial thumbnail */
[data-home-section="reports"] .report-card img,
[data-home-section="reports"] .editorial-card img,
[data-home-section="reports"] .article-card img,
[data-home-section="reports"] .home-editorial-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

/* Text safety */
[data-home-section="reports"] .report-card *,
[data-home-section="reports"] .editorial-card *,
[data-home-section="reports"] .article-card *,
[data-home-section="reports"] .home-editorial-card * {
  min-width: 0;
  box-sizing: border-box;
}

[data-home-section="reports"] .report-card h3,
[data-home-section="reports"] .editorial-card h3,
[data-home-section="reports"] .article-card h3,
[data-home-section="reports"] .home-editorial-card h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Laptop */
@media (min-width: 1024px) and (max-width: 1365px) {
  [data-home-section="reports"] .reports-grid,
  [data-home-section="reports"] .editorial-grid,
  [data-home-section="reports"] .home-editorial-grid,
  [data-home-section="reports"] .articles-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  [data-home-section="reports"] .reports-grid,
  [data-home-section="reports"] .editorial-grid,
  [data-home-section="reports"] .home-editorial-grid,
  [data-home-section="reports"] .articles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 767px) {
  [data-home-section="reports"] {
    --reports-inline: 8px;
    --reports-top-gap: 8px;
    --reports-card-gap: 7px;
  }

  [data-home-section="reports"] .home-filter-bar,
  [data-home-section="reports"] .reports-filter-bar,
  [data-home-section="reports"] .editorial-filter-bar,
  [data-home-section="reports"] .filter-row {
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  [data-home-section="reports"] .filter-group,
  [data-home-section="reports"] .filters-left,
  [data-home-section="reports"] .filters-right {
    flex-wrap: nowrap;
  }

  [data-home-section="reports"] .filter-chip,
  [data-home-section="reports"] .filter-button,
  [data-home-section="reports"] [data-filter] {
    min-height: 31px;
    padding: 6px 10px;
    font-size: .72rem;
  }

  [data-home-section="reports"] .reports-grid,
  [data-home-section="reports"] .editorial-grid,
  [data-home-section="reports"] .home-editorial-grid,
  [data-home-section="reports"] .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Very narrow phones */
@media (max-width: 340px) {
  [data-home-section="reports"] .reports-grid,
  [data-home-section="reports"] .editorial-grid,
  [data-home-section="reports"] .home-editorial-grid,
  [data-home-section="reports"] .articles-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
