/* CSS Document */

/* =========================================================
   SECTION VÍDEOS — CSS DEDICADO
   Arquivo: videos.css
   ========================================================= */

.section-videos{
  position: relative;
}

.section-videos .section-header{
  margin-bottom: 24px;
}

/* Grid base: 6 colunas para permitir as combinações 2/3 por linha */
.videos-grid{
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

/* Padrão: 3 por linha (cada item ocupa 2 colunas) */
.videos-item{
  grid-column: span 2;
  background: #ffffff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Wrapper do vídeo com proporção */
.videos-embed{
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  background: #0b1020;
}

.videos-embed iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Descrição */
.videos-desc{
  margin-top: 12px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #334155;
}

/* Estado vazio */
.videos-empty{
  background: #ffffff;
  border-radius: 16px;
  padding: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  color: #475569;
}

/* =========================================================
   LÓGICAS POR QUANTIDADE
   O JS adiciona classes: videos-grid--1..6 e --many
   ========================================================= */

/* 1 vídeo: centralizado ~80% */
.videos-grid--1{
  display: flex;
  justify-content: center;
}

.videos-grid--1 .videos-item{
  width: min(80%, 980px);
  grid-column: auto;
}

/* 2 vídeos: 2 colunas grandes */
.videos-grid--2 .videos-item{
  grid-column: span 3;
}

/* 3 vídeos: padrão 3 por linha (span 2) */

/* 4 vídeos: 2 em cima + 2 em baixo */
.videos-grid--4 .videos-item{
  grid-column: span 3;
}

/* 5 vídeos: 3 em cima + 2 em baixo
   Primeiros 3 => 2 colunas cada
   Últimos 2 => 3 colunas cada
*/
.videos-grid--5 .videos-item{
  grid-column: span 2;
}
.videos-grid--5 .videos-item:nth-child(4),
.videos-grid--5 .videos-item:nth-child(5){
  grid-column: span 3;
}

/* 6 vídeos: 3 + 3 (padrão span 2) */

/* 7+ mantém 3 por linha */
.videos-grid--many .videos-item{
  grid-column: span 2;
}

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 1100px){
  .videos-grid{
    gap: 18px;
  }
}

@media (max-width: 900px){
  .videos-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .videos-item{
    grid-column: auto;
  }

  .videos-grid--1{
    display: block;
  }

  .videos-grid--1 .videos-item{
    width: 100%;
  }
}

@media (max-width: 520px){
  .videos-grid{
    grid-template-columns: 1fr;
  }

  .videos-item{
    padding: 12px;
  }
}
