/* ==========================================================================
   SEÇÃO "PROJETOS NATA" (CARROSSEL DE PROJETOS - FIGMA)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CONTAINER & PADRÃO DE FUNDO (PONTOS COM MÁSCARA RADIAL + GLOW)
   -------------------------------------------------------------------------- */
.projects-section {
  position: relative;
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(48px, 7vw, 96px);
  background-color: var(--color-base, #F1ECDE);
  overflow: hidden;
}

/* Padrão decorativo de pontos no fundo (forte no centro e suavizado para os cantos) */
.projects-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: 32px 32px;
  background-position: center center;
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 30%, transparent 70%);
  mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 30%, transparent 70%);
}

/* Efeito Glow / Blur Radial Suave no Centro */
.projects-section::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(300px, 80vw, 1080px);
  height: clamp(200px, 40vw, 380px);
  background: radial-gradient(50% 50% at 50% 50%, rgba(217, 106, 61, 0.12) 0%, rgba(42, 28, 18, 0.08) 60%, rgba(42, 28, 18, 0) 100%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 1;
}

.projects-container {
  position: relative;
  z-index: 2;
  max-width: var(--container-max-width, 1280px);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 3vw, 32px);
  padding-right: clamp(16px, 3vw, 32px);
}

/* --------------------------------------------------------------------------
   2. CABEÇALHO DA SEÇÃO (BADGE & TÍTULO)
   -------------------------------------------------------------------------- */
.projects-header {
  margin-bottom: clamp(28px, 4.5vw, 44px);
}

/* Subtítulo / Badge: Inter 600 SemiBold | 14px | Line-Height 140% | Letter-Spacing 8% (0.08em) | Terracota 700 (#9C4826) */
.projects-badge {
  font-family: var(--font-family-body, 'Inter', sans-serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-terracota-700, #9C4826);
  display: block;
  margin-bottom: 8px;
}

/* Título Principal: Manrope 600 SemiBold | 36px (Clamp) | Line-Height 120% | Letter-Spacing 2% | Neutro 900 (#151413) */
.projects-title {
    font-size: clamp(24px, 3.5vw, 36px);
    color: var(--color-neutral-900, #151413);
    margin: 0;
    font-family: var(--font-family-title-serif, 'Fraunces', serif);
    font-weight: 400;
    line-height: 120%;
    letter-spacing: 5%;
}

/* --------------------------------------------------------------------------
   3. TRILHO DE CARROSSEL HORIZONTAL (LARGURA TOTAL DA TELA - FULL VIEWPORT WIDTH)
   -------------------------------------------------------------------------- */
.projects-carousel-wrapper {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: clamp(8px, 2vw, 24px);
  padding-bottom: 48px;
  margin-bottom: -16px;
}

.projects-carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.projects-carousel-track {
  display: flex;
  gap: clamp(16px, 2.5vw, 28px);
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  padding-left: clamp(20px, 12vw, calc(50vw - 450px));
  padding-right: clamp(20px, 12vw, calc(50vw - 450px));
}

/* --------------------------------------------------------------------------
   4. ESTRUTURA DO CARTÃO DE PROJETO (COMPOSTO FIGMA: OUTER + INNER + TAG BAR)
   -------------------------------------------------------------------------- */
/* Temas de cores padrão para cada projeto */
.project-card-outer.theme-terracota {
  --project-theme-bg: var(--color-terracota-200, #F0E1DB);
  --project-theme-color: var(--color-terracota-700, #9C4826);
}

.project-card-outer.theme-azul,
.project-card-outer.theme-azul-claro {
  --project-theme-bg: var(--color-indigo-200, #E4F2F7);
  --project-theme-color: var(--color-indigo-700, #2C3F78);
}

.project-card-outer.theme-verde {
  --project-theme-bg: var(--color-verde-200, #DBE2BD);
  --project-theme-color: var(--color-verde-700, #687528);
}

.project-card-outer.theme-areia,
.project-card-outer.theme-azul-escuro,
.project-card-outer.theme-atlantico {
  --project-theme-bg: var(--color-atlantico-200, #ABCBD7);
  --project-theme-color: var(--color-atlantico-700, #426F80);
}

.project-card-outer {
  flex: 0 0 auto;
  width: clamp(280px, 85vw, 900px);
  height: auto;
  min-height: 368px;
  opacity: 0.72;
  border-radius: 20px;
  padding: 0px 0px 8px 0px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--project-theme-bg, #F0E1DB);
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.06);
  transform: scale(0.9);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s ease;
  cursor: pointer;
  user-select: none;
}

/* Estado Ativo: Cartão no Centro em Destaque */
.project-card-outer.is-active {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0px 8px 32px rgba(0, 0, 0, 0.14);
}

.project-card-outer:hover:not(.is-active) {
  opacity: 0.88;
  transform: scale(0.92) translateY(-2px);
}

/* 4.1.5 Paginação (Bullets) para Mobile/Tablet */
.projects-pagination {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .projects-pagination {
    display: flex;
  }
}

.projects-pagination-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-terracota-300, #E5C8BD);
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  transition: background-color 0.25s ease, transform 0.25s ease, width 0.25s ease, border-radius 0.25s ease;
}

.projects-pagination-bullet.is-active {
  background-color: var(--color-terracota-500, #D96A3D);
  width: 24px;
  border-radius: 12px;
}

/* 4.2 Caixa do Cartão Interno (Inner Box: Fundo Branco, Raio 16px, Borda Superior) */
.project-card-inner {
  width: 100%;
  flex: 1;
  background-color: var(--color-base-white, #F5F4F4);
  border-radius: 16px;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid var(--color-neutral-200, #D9D4C7);
  border: 1px solid var(--project-theme-color, #9C4826);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: padding 0.35s ease;
}

@media (min-width: 768px) {
  .project-card-inner {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: clamp(20px, 3vw, 32px);
  }
}

/* Coluna de Conteúdo de Texto */
.project-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.project-card-content-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Elemento de Barra Decorativa no Topo Esquerdo (Progress Bar) */
.project-card-top-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background-color: var(--color-neutral-200, #D9D4C7);
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}

@keyframes projectProgressFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.project-card-top-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: var(--project-theme-color, #9C4826);
  border-radius: 2px;
}

/* Quando em modo Autoplay, a barra enche com animação keyframe */
.project-card-outer.is-active.is-playing .project-card-top-bar::after {
  animation: projectProgressFill var(--progress-transition, 5000ms) linear forwards;
}

/* Congela o preenchimento no ponto exato ao passar o mouse sem resetar */
.projects-carousel-wrapper:hover .project-card-outer.is-playing .project-card-top-bar::after,
.project-card-outer.is-paused .project-card-top-bar::after {
  animation-play-state: paused !important;
}



/* Título do Projeto: Manrope 700 Bold | 20px | Line-Height 160% | Neutro 900 (#151413) */
.project-card-title {
  font-family: var(--font-family-title, 'Manrope', sans-serif);
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 20px);
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--color-neutral-900, #151413);
  margin: 0;
}

/* Descrição do Projeto: Inter 400 Regular | 16px | Line-Height 150% | Neutro 600 (#706E69) */
.project-card-description {
  font-family: var(--font-family-body, 'Inter', sans-serif);
  font-weight: 400;
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--color-neutral-600, #706E69);
  margin: 0;
  margin-top: auto;
}

/* Coluna de Mídia (Imagem do Projeto: 480px x 260px, Raio 16px) */
.project-card-media {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background-color: var(--color-base, #F1ECDE);
}

@media (min-width: 768px) {
  .project-card-media {
    width: clamp(365px, 37.5vw, 480px);
    height: 100%;
    max-height: 260px;
    flex-shrink: 0;
  }
}

.project-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 4.3 Barra Inferior da Tag (Bottom Tag Bar: Altura 38px, Padding 8px 28px) */
.project-card-bottom-bar {
  width: 100%;
  height: 38px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-tag-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--project-theme-color, #9C4826);
}

.project-tag-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Nome da Categoria: Inter 500 Medium | 16px | Line-Height 140% | Cor do Tema */
.project-tag-text {
  font-family: var(--font-family-body, 'Inter', sans-serif);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--project-theme-color, #9C4826);
}
