/**
 * Projects Page Stylesheet — RN Carpintaria
 * Layout de vitrine com efeito cortina sobreposta (stacking curtain),
 * física de parallax suave e seção "O que fazemos" inspirada em design editorial.
 */

/* ==========================================================================
   1. DOBRA DE PROJETOS: VITRINE CORTINA COM PARALLAX (ESTILO EDITORIAL)
   ========================================================================== */
.projects-page {
  background-color: #282828;
  color: #FFFFFF;
}

.projects-showcase-section {
  position: relative;
  background-color: #282828;
  padding-top: 0;
  padding-bottom: 0;
}

/* Layout de 2 Colunas Fiel aos Prints:
   Coluna Esquerda Vazia (Espaçamento Arquitetônico #282828) e Coluna Direita (Galeria Encostada na Margem) */
.projects-showcase-layout {
  display: grid;
  grid-template-columns: 35% 65%;
  width: 100%;
  min-height: 100vh;
  background-color: #282828;
}

.projects-spacer-col {
  background-color: #282828;
  width: 100%;
}

.projects-showcase-content {
  position: relative;
  width: 100%;
  background-color: #282828;
  padding-top: clamp(20rem, 18vh, 220px);
}

.projects-showcase-header {
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
  padding-left: 0;
  padding-right: clamp(1rem, 2.5vw, 3rem);
}

.projects-showcase-title {
  font-family: var(--font-family-display);
  font-size: clamp(2.35rem, 3.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #FFFFFF;
  margin: 0;
}

/* Galeria com posicionamento das imagens ocupando a coluna da direita até a borda */
.projects-curtain-gallery {
  position: relative;
  width: 100%;
}

/* Card Individual em Efeito Cortina (Sem sombras, sem bordas, cantos vivos)
   Cada card trava no topo (sticky top: 0) e o próximo sobe por cima cobrindo-o */
.curtain-card {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  margin-bottom: 0;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background-color: #1e1e20;
  overflow: hidden;
}

.curtain-card:last-child {
  margin-bottom: 0;
}

/* Empilhamento de Cortina: Card 1 sob Card 2, Card 2 sob Card 3, etc. */
.curtain-card:nth-child(1) {
  z-index: 10;
}

.curtain-card:nth-child(2) {
  z-index: 20;
}

.curtain-card:nth-child(3) {
  z-index: 30;
}

.curtain-card:nth-child(4) {
  z-index: 40;
}

.curtain-card:nth-child(5) {
  z-index: 50;
}

.curtain-card:nth-child(6) {
  z-index: 60;
}

.curtain-card:nth-child(7) {
  z-index: 70;
}

.curtain-card:nth-child(8) {
  z-index: 80;
}

.curtain-card:nth-child(9) {
  z-index: 90;
}

/* Moldura e Imagem Interna com Parallax */
.curtain-media-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.curtain-img {
  position: absolute;
  top: -12%;
  left: 0;
  width: 100%;
  height: 124%;
  object-fit: cover;
  object-position: center;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* ==========================================================================
   3. DOBRA 2: "O QUE FAZEMOS" (SOLUÇÕES INTEGRALIZADAS DE ALTO PADRÃO)
   ========================================================================== */
.what-we-do-section {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #636363;
  color: #FFFFFF;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: clamp(4.5rem, 8vw, 7rem);
  padding-bottom: clamp(4.5rem, 8vw, 7rem);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.what-we-do-section .container {
  transform-origin: center top;
  will-change: transform, opacity, filter;
  width: 100%;
}

.what-we-do-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: start;
}

/* Coluna Esquerda: Título e Lista com Divisórias */
.what-we-do-left {
  display: flex;
  flex-direction: column;
}

.what-we-do-title {
  font-family: var(--font-family-display);
  font-size: clamp(2.5rem, 3.5vw, 3.5rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  letter-spacing: var(--letter-spacing-tight);
  color: #FFFFFF;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.what-we-do-list {
  display: flex;
  flex-direction: column;
}

.what-we-do-item {
  position: relative;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background-color var(--transition-fast), padding-left var(--transition-fast);
}

.what-we-do-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.what-we-do-item.is-active,
.what-we-do-item:hover {
  padding-left: 0.5rem;
  background-color: rgba(255, 255, 255, 0.02)
}

.what-we-do-item-title {
  font-family: var(--font-family-display);
  font-size: clamp(1.375rem, 2vw, 1.875rem);
  font-weight: var(--font-weight-semibold);
  color: #FFFFFF;
  line-height: 1.25;
  margin-bottom: 0.45rem;
  transition: color var(--transition-fast);
}

.what-we-do-item-desc {
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.55;
  max-width: 580px;
}

/* Coluna Direita: Descrição no Topo e Foto de Impacto */
.what-we-do-right {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 2.5vw, 2.25rem);
}

.what-we-do-lead {
  font-family: var(--font-family-body);
  font-size: clamp(0.9375rem, 1.15vw, 1.0625rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  font-weight: var(--font-weight-regular);
}

.what-we-do-visual-card {
  position: relative;
  width: 100%;
  border-radius: 0 !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.what-we-do-img {
  width: 100%;
  height: auto;
  max-height: clamp(520px, 68vh, 720px);
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.what-we-do-visual-card:hover .what-we-do-img {
  transform: scale(1.02);
}

.what-we-do-badge {
  display: none !important;
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  padding: 0.45rem 1rem;
  background-color: rgba(18, 16, 14, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font-family-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: #FFFFFF;
  letter-spacing: 0.02em;
  z-index: 2;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}


/* ==========================================================================
   4. DOBRA FINAL: CTA COM EFEITO CORTINA & FOOTER REVEAL
   ========================================================================== */
.projects-page main {
  position: relative;
  z-index: 10;
  background-color: #282828;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.projects-page .cta-overlay-section {
  position: relative;
  z-index: 110;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #12100E;
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.3), 0 -12px 24px rgba(0, 0, 0, 0.3);
}

.projects-page .site-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
}

/* ==========================================================================
   6. RESPONSIVIDADE RIGOROSA (TABLET & MOBILE)
   ========================================================================== */

/* --------------------------------------------------------------------------
   A. TABLET / DISPOSITIVOS MÉDIOS (810px a 1199.98px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .projects-showcase-layout {
    grid-template-columns: 22% 78%;
  }

  .projects-showcase-content {
    padding-top: clamp(15rem, 15vh, 160px);
  }

  .projects-showcase-title {
    font-size: clamp(2.15rem, 3vw, 3rem);
  }

  .curtain-card {
    top: 0;
    height: 100vh;
    height: 100svh;
    min-height: 500px;
    margin-bottom: 0;
  }

  .curtain-card:last-child {
    margin-bottom: 0;
  }

  /* Segunda Dobra (O que fazemos) no Tablet */
  .what-we-do-section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .what-we-do-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.25rem;
    align-items: start;
  }

  .what-we-do-title {
    font-size: 2.75rem;
    margin-bottom: 2rem;
  }

  .what-we-do-item {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .what-we-do-item-title {
    font-size: 1.45rem;
  }
}

/* --------------------------------------------------------------------------
   B. MOBILE / SMARTPHONES (<= 767.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .projects-showcase-layout {
    grid-template-columns: 1fr;
  }

  .projects-spacer-col {
    display: none;
  }

  .projects-showcase-content {
    padding-top: clamp(12rem, 14vh, 140px);
  }

  .projects-showcase-header {
    padding-left: 16px;
    padding-right: 16px;
    margin-bottom: 1.75rem;
  }

  .projects-showcase-title {
    font-size: clamp(2rem, 3.5vw, 2.65rem);
  }

  .projects-curtain-gallery {
    width: 100%;
  }

  .curtain-card {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    width: 100%;
    height: 75vh;
    height: 75svh;
    min-height: 420px;
    margin-bottom: 0;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  .curtain-card:last-child {
    margin-bottom: 0;
  }

  /* Dobra 2: "O que fazemos" no Mobile */
  .what-we-do-section {
    position: relative !important;
    top: auto !important;
    min-height: auto !important;
    padding-top: 3.25rem;
    padding-bottom: 3.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .what-we-do-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* No mobile, desagrupar as colunas para ordenar: 1º Título, 2º Texto introdutório, 3º Imagem, 4º Lista de serviços */
  .what-we-do-left,
  .what-we-do-right {
    display: contents;
  }

  .what-we-do-title {
    order: 1;
    font-size: clamp(2rem, 6.5vw, 2.5rem);
    margin-bottom: 0;
    line-height: 1.15;
  }

  .what-we-do-lead {
    order: 2;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0;
  }

  .what-we-do-visual-card {
    order: 3;
  }

  .what-we-do-badge {
    display: none !important;
  }

  .what-we-do-list {
    order: 4;
    margin-top: 0.5rem;
  }

  .what-we-do-item {
    padding-top: 1rem;
    padding-bottom: 1rem;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  .what-we-do-item-title {
    font-size: 1.25rem;
    line-height: 1.25;
  }

  .what-we-do-item-desc {
    font-size: 0.8125rem;
    line-height: 1.5;
  }

  /* CTA e Rodapé no Mobile */
  .projects-page main {
    box-shadow: none;
  }

  .projects-cta-curtain {
    min-height: 480px;
    height: auto;
    padding: clamp(4.5rem, 12vw, 6.5rem) 0;
    box-shadow: none;
  }

  .projects-page .site-footer {
    position: relative !important;
    bottom: auto !important;
    z-index: 10 !important;
    padding-bottom: clamp(2rem, 6vw, 3.5rem);
  }
}

/* --------------------------------------------------------------------------
   D. TELAS MOBILE ULTRA-COMPACTAS (<= 390px)
   -------------------------------------------------------------------------- */
@media (max-width: 390px) {
  .projects-hero-title {
    font-size: 1.75rem;
  }

  .curtain-project-title {
    font-size: 1.125rem;
  }

  .what-we-do-title {
    font-size: 1.85rem;
  }

  .what-we-do-item-title {
    font-size: 1.15rem;
  }
}