/* Forense: ad gutters + homepage top + capa stack (layout-fix 2026-09-22) */

/* —— Capa / featured: stacked image top, text below (override app.min md:grid-cols-2) —— */
#site-content .news-capa,
#site-content .news-capa.news-capa--stack {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1rem;
  align-items: start;
  float: none !important;
}

#site-content .news-capa__media,
#site-content .news-capa .news-capa__media {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  grid-column: 1 / -1;
}

#site-content .news-capa__body {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-column: 1 / -1;
}

#site-content .news-capa__img {
  width: 100%;
  max-height: min(420px, 56vw);
  object-fit: cover;
}

@media (max-width: 639px) {
  #site-content .news-capa__title {
    font-size: 1.35rem;
    line-height: 1.25;
  }
  #site-content .news-capa__lead {
    font-size: 0.95rem;
  }
}

/* —— Homepage top: capa/destaques | Mais lidas (missing from some app.min builds) —— */
.homepage-top-section {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.homepage-top-main {
  min-width: 0;
  width: 100%;
}

.homepage-top-sidebar {
  order: 2;
  width: 100%;
  min-width: 0;
}

@media (min-width: 1024px) {
  .homepage-top-section {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .homepage-top-sidebar {
    order: 0;
  }
}

/* —— Ad placement gutters (desktop only for skyscrapers) —— */
.homepage-top-with-gutters {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.promo-rail {
  display: none;
  min-width: 0;
}

.promo-rail .promo-unit {
  width: 100%;
}

.promo-rail .promo-unit__html,
.promo-rail .promo-unit__image-link,
.promo-rail .promo-unit a,
.promo-rail .promo-unit > div {
  margin-left: auto;
  margin-right: auto;
}

/* xl+: left skyscraper | main+sidebar | right skyscraper */
@media (min-width: 1024px) {
  .homepage-top-with-gutters {
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    gap: 1.25rem;
  }

  .promo-rail {
    display: block !important;
    width: 160px;
    position: sticky;
    top: 6rem;
    z-index: 1;
    align-self: start;
  }

  .promo-rail .promo-unit__html {
    max-width: 160px !important;
  }

  .promo-rail .promo-unit__img,
  .promo-rail .promo-unit img {
    display: block !important;
    width: 100%;
    max-width: 160px !important;
    height: auto;
    opacity: 1 !important;
    visibility: visible;
  }
}

/* Never overflow / leave float holes on mobile / tablet */
@media (max-width: 1023px) {
  .promo-rail,
  .homepage-top-with-gutters > .promo-rail {
    display: none !important;
  }

  .homepage-top-with-gutters {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Article banner under hero */
.promo-unit--banner {
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
}

.promo-unit--banner .promo-unit__html,
.promo-unit--banner .promo-unit__image-link {
  width: 100%;
}

.promo-unit--skyscraper {
  margin: 0;
}

.promo-unit__image-link {
  display: block;
  line-height: 0;
}

.promo-unit__img {
  display: block;
  height: auto;
}

/* Keep AdSense iframes from blowing layout */
.promo-unit__html ins.adsbygoogle {
  display: block;
  max-width: 100%;
}

@media print {
  .promo-rail,
  .promo-unit {
    display: none !important;
  }
}

/* Allow room for skyscrapers beside max-w-6xl content */
#site-content .homepage-ad-shell.mx-auto {
  max-width: 72rem !important;
}
@media (min-width: 1024px) {
  #site-content .homepage-ad-shell.mx-auto {
    max-width: min(90rem, 100%) !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}
