/* Top 5 — layout alinhado ao /grupos (card v2, largura ampla no desktop) */

body.page-top5 {
  background: linear-gradient(165deg, #fff7f3 0%, #fff0ea 42%, #ffe8df 100%);
  background-attachment: fixed;
}

:root[data-theme="dark"] body.page-top5 {
  background: linear-gradient(165deg, #100e0d 0%, #1a1512 48%, #12100f 100%);
  background-attachment: fixed;
}

/* Hero — bloco único com a mesma largura para todos os textos */
.page-top5 .top5-hero {
  padding: 40px 0 24px;
}

.page-top5 .top5-hero > .container {
  max-width: min(1440px, 100%);
}

.page-top5 .top5-hero__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.page-top5 .top5-hero__inner .breadcrumb {
  margin-bottom: 12px;
}

.page-top5 .top5-hero__inner h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-top5 .top5-hero__inner > p:not(.top5-updated) {
  margin: 0 auto;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.page-top5 .top5-hero__inner .hero__actions {
  margin-top: 20px;
  justify-content: center;
}

.page-top5 .top5-updated {
  margin: 16px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Conteúdo — mesma largura do feed /grupos */
.page-top5 .top5-layout {
  max-width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 20px 48px;
}

.page-top5 .top5-content {
  padding: 8px 0 0;
}

.page-top5 .top5-state {
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.page-top5 .top5-state--error {
  color: var(--danger, #c0392b);
}

.page-top5 .top5-section {
  margin-bottom: 40px;
}

.page-top5 .top5-section__head {
  margin-bottom: 14px;
  text-align: left;
}

.page-top5 .top5-section__title {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.page-top5 .top5-section__rank {
  color: var(--accent, #ff5c42);
  font-weight: 800;
}

.page-top5 .top5-section__meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.page-top5 .top5-section__empty {
  padding: 24px 20px;
  border-radius: 12px;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.page-top5 .top5-section__empty a {
  color: var(--accent);
  font-weight: 600;
}

.page-top5 .top5-carousel {
  position: relative;
}

.page-top5 .top5-carousel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 92, 66, 0.35) transparent;
  padding: 4px 0 10px;
}

.page-top5 .top5-carousel__viewport:focus-visible {
  outline: 2px solid rgba(255, 92, 66, 0.45);
  outline-offset: 2px;
  border-radius: 12px;
}

.page-top5 .top5-carousel__track {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* Largura dos cards = célula do grid /grupos; altura natural (sem esticar) */
.page-top5 .top5-carousel__track > .gc {
  flex: 0 0 min(400px, calc(100vw - 40px));
  max-width: 400px;
  scroll-snap-align: start;
  height: auto;
  align-self: flex-start;
}

@media (min-width: 560px) {
  .page-top5 .top5-carousel__track > .gc {
    flex: 0 0 calc((min(1440px, 100vw - 40px) - 16px) / 2);
    max-width: none;
  }
}

@media (min-width: 900px) {
  .page-top5 .top5-carousel__track > .gc {
    flex: 0 0 calc((min(1440px, 100vw - 40px) - 32px) / 3);
  }
}

@media (min-width: 1200px) {
  .page-top5 .top5-carousel__track > .gc {
    flex: 0 0 calc((min(1440px, 100vw - 40px) - 48px) / 4);
  }
}

.page-top5 .top5-carousel__btn {
  position: absolute;
  top: 42%;
  z-index: 2;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.page-top5 .top5-carousel__btn:hover {
  border-color: rgba(255, 92, 66, 0.35);
  background: rgba(255, 92, 66, 0.06);
}

.page-top5 .top5-carousel__btn:focus-visible {
  outline: 2px solid rgba(255, 92, 66, 0.45);
  outline-offset: 2px;
}

.page-top5 .top5-carousel__btn[hidden] {
  display: none;
}

.page-top5 .top5-carousel__btn--prev {
  left: -12px;
}

.page-top5 .top5-carousel__btn--next {
  right: -12px;
}

.page-top5 .top5-carousel__btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

@media (max-width: 640px) {
  .page-top5 .top5-carousel__btn {
    display: none;
  }

  .page-top5 .top5-layout {
    padding-inline: 16px;
  }
}

@media (min-width: 641px) {
  .page-top5 .top5-carousel__viewport {
    margin-inline: 36px;
  }
}

/* CTA antes do rodapé */
.page-top5 .top5-footer-cta {
  max-width: min(1440px, 100%);
  margin: 0 auto;
  padding: 16px 20px 64px;
  text-align: center;
}

.page-top5 .top5-footer-cta .btn {
  margin-bottom: 14px;
}

.page-top5 .top5-footer-cta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 36ch;
  margin-inline: auto;
}

@media (max-width: 640px) {
  .page-top5 .top5-footer-cta {
    padding-inline: 16px;
    padding-bottom: 48px;
  }
}
