/* =============================================================
   eteg-arsenal-bento — tokens do design-system.json (ETEG 2023)
   ─────────────────────────────────────────────────────────────
   card grande:   #cba6ec  (brand.accent - lilás)
   card escuro:   #2d2d2b  (background.dark)
   cards azuis:   #1662ff  (brand.primary)
   título escuro: #2d2d2b  (large card)
   título branco: #ffffff  (dark + blue cards)
   corpo escuro:  #2d2d2b opacity 0.8 (large card)
   corpo dim:     #ffffff opacity 0.7 (dark card)
   font:          Anybody (Figma: fw 800 uppercase)
   border-radius: 20px (NÃO converter)
   grid gap:      16px  (target_container — já em CSS px)
   card padding:  32px  (Figma 40px outer × 0.7204 = 28.8 → DS: 32px)
   row height:    392px (target_container, já em CSS px)
   section padding bottom: 96px (Figma 128px outer × 0.7204 = 92 → DS: 96px)

   Figma: "Section 7: Interactive Showcase & Arsenal (Bento)" node 5:46293
   Grid: 3 colunas × 2 linhas na 1440px target_container
   Card grande: span col 1-2, row 1
   Card escuro: span col 3, rows 1-2
   Cards azuis: col 1-2, row 2

   Seletores para CSS Personalizado no Elementor:
   .eteg-arsenal-bento          → seção raiz
   .eteg-arsenal-bento__grid    → grid dos cards
   .eteg-arsenal-bento__card    → card genérico
   .eteg-arsenal-bento__card--large  → card grande (lilás)
   .eteg-arsenal-bento__card--dark   → card escuro (col direita)
   .eteg-arsenal-bento__card--blue   → cards azuis (bottom)
   .eteg-arsenal-bento__card-title   → título do card
   .eteg-arsenal-bento__card-body    → corpo do card
   .eteg-arsenal-bento__card-illustration → ilustração do card
   .eteg-arsenal-bento__card-icons   → faixa de ícones do rodapé
   .eteg-arsenal-bento__deco-dots    → decoração top-right
   ============================================================= */

/* ── Reset de bloco ──────────────────────────────────────────── */
.eteg-arsenal-bento *,
.eteg-arsenal-bento *::before,
.eteg-arsenal-bento *::after {
  box-sizing: border-box;
}

/* ── BASE: mobile-first ──────────────────────────────────────── */

.eteg-arsenal-bento {
  position: relative;
  overflow-x: clip; /* permite deco-dots sangrar verticalmente */
}

/* ── Container interno — alinha com demais seções ────────────── */
.eteg-arsenal-bento__inner {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 16px; /* lateral — Elementor controla apenas top/bottom */
  padding-bottom: 48px; /* mobile fallback */
}

/* ── Deco dots (top-right) ───────────────────────────────────── */
.eteg-arsenal-bento__deco-dots {
  position: absolute;
  top: -30px;
  right: -60px;
  width: 180px;
  height: auto;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

/* ── Grid ────────────────────────────────────────────────────── */

/* grid-area: independente da ordem no DOM — sem conflito com order */
.eteg-arsenal-bento__card:nth-child(3) { grid-area: blue1; }
.eteg-arsenal-bento__card:nth-child(4) { grid-area: blue2; }

/* Base mobile: large full, blue1/blue2 lado a lado, dark full */
.eteg-arsenal-bento__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "large large"
    "blue1 blue2"
    "dark  dark";
  gap: 10px;
  position: relative;
  z-index: 1;
}

/* ── Cards ───────────────────────────────────────────────────── */
.eteg-arsenal-bento__card {
  position: relative;
  /* overflow: hidden removido — combinação overflow+border-radius+will-change causa repaint por frame */
  clip-path: inset(0 round 20px); /* clip no compositor, após o transform — zero repaint */
  border-radius: 20px;             /* mantido para background rounding e fallback sem clip-path */
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  will-change: transform;
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1); /* M3 standard decel — rápido, sem overshoot */
}

.eteg-arsenal-bento__card:focus-visible {
  clip-path: inset(-6px round 20px); /* abre 6px (2px outline + 4px offset) para o outline aparecer */
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* (0,5,0) — bate Elementor (0,4,0) que carrega depois */
.eteg-arsenal-bento .eteg-arsenal-bento__inner .eteg-arsenal-bento__grid .eteg-arsenal-bento__card:hover {
  transform: scale(1.03);
  /* box-shadow removido — snap no hover start/end dispara repaint mesmo sem transition */
}

.eteg-arsenal-bento__card--large {
  grid-area: large;
  background-color: #cba6ec; /* brand.accent */
  min-height: 300px;
}

.eteg-arsenal-bento__card--dark {
  grid-area: dark;
  background-color: #2d2d2b; /* background.dark */
  min-height: 300px;
}

.eteg-arsenal-bento__card--blue {
  background-color: #1662ff; /* brand.primary */
}

/* ── Card content ────────────────────────────────────────────── */
.eteg-arsenal-bento__card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.eteg-arsenal-bento__card-title {
  font-family: "Anybody", sans-serif;
  font-size: 1.2rem; /* 19px mobile base */
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  color: #2d2d2b;
  margin: 0;
}

/* large e dark têm espaço cheio mesmo no mobile */
.eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-title,
.eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-title {
  font-size: 1.5rem; /* 24px */
}

.eteg-arsenal-bento__card-title--white {
  color: #ffffff;
}

.eteg-arsenal-bento__card-body {
  font-family: "Anybody", sans-serif;
  font-size: var(--eteg-body-size);
  font-weight: 400;
  color: #2d2d2b;
  opacity: 0.8;
  line-height: 1.5;
  margin: 0;
}

.eteg-arsenal-bento__card-body--dim {
  color: #ffffff;
  opacity: 0.7;
}

/* ── Ilustrações ─────────────────────────────────────────────── */
.eteg-arsenal-bento__card-illustration {
  display: block;
  width: auto;
  height: auto;
  max-width: 55%;
  max-height: 160px;
  align-self: flex-end;
  pointer-events: none;
  object-fit: contain;
}

.eteg-arsenal-bento__card-illustration--center {
  align-self: center;
  max-width: 50%;
}

.eteg-arsenal-bento__card-illustration--persona {
  align-self: center;
  max-width: 60%;
}

/* ── Faixa de ícones do rodapé ───────────────────────────────── */
.eteg-arsenal-bento__card-icons {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

/* =============================================================
   LARGE PHONE / SMALL TABLET — min-width: 480px
   Aumenta gap e fonte dos cards
   ============================================================= */
@media (min-width: 480px) {

  .eteg-arsenal-bento__inner {
    padding-inline: 20px;
  }

  .eteg-arsenal-bento__grid {
    gap: 12px;
  }

  .eteg-arsenal-bento__card-title {
    font-size: 1.35rem;
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-title,
  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-title {
    font-size: 1.625rem;
  }
}

/* =============================================================
   LANDSCAPE PHONE — orientation: landscape, max-height: 500px
   ============================================================= */
@media (orientation: landscape) and (max-height: 500px) {

  .eteg-arsenal-bento__card {
    min-height: 180px;
    padding: 20px;
  }

  .eteg-arsenal-bento__card-illustration {
    max-height: 100px;
  }
}

/* =============================================================
   TABLET — min-width: 768px
   Bento 3 colunas via grid-template-areas (sem order/grid-column)
   ============================================================= */
@media (min-width: 768px) {

  .eteg-arsenal-bento__inner {
    padding-inline: 24px;
  }

  .eteg-arsenal-bento__grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "large large dark"
      "blue1 blue2 dark";
    gap: 14px;
  }

  .eteg-arsenal-bento__card--large { min-height: 300px; }
  .eteg-arsenal-bento__card--dark  { min-height: 480px; }
  .eteg-arsenal-bento__card--blue  { min-height: 220px; }

  .eteg-arsenal-bento__card {
    padding: 28px;
  }

  .eteg-arsenal-bento__card-title {
    font-size: 1.5rem; /* 24px */
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-title,
  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-title {
    font-size: 1.875rem; /* 30px */
  }

  .eteg-arsenal-bento__card-body {
    font-size: 1rem; /* 16px */
  }

  .eteg-arsenal-bento__deco-dots {
    width: 300px;
    right: -80px;
    top: -40px;
    opacity: 0.65;
  }
}

/* =============================================================
   DESKTOP — min-width: 1024px
   ============================================================= */
@media (min-width: 1024px) {

  .eteg-arsenal-bento__inner {
    padding-inline: 24px; /* Figma: bottom 128px outer × 0.7204 = 92 → DS: 96px */
  }

  /* Grid Bento: alturas fixas no desktop — target_container, sem conversão */
  .eteg-arsenal-bento__grid {
    grid-template-rows: 392px 392px; /* fixa altura; colunas já herdadas do 768px */
    gap: 16px;
  }

  .eteg-arsenal-bento__card {
    padding: 32px; /* Figma: 40px outer × 0.7204 = 28.8 → DS: 32px */
    min-height: unset;
  }

  .eteg-arsenal-bento__card--large,
  .eteg-arsenal-bento__card--dark,
  .eteg-arsenal-bento__card--blue {
    min-height: unset;
  }

  /* Tipografia desktop — Figma px, NÃO converter */
  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-title,
  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-title {
    font-size: 2.25rem; /* 36px */
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-title {
    font-size: 1.875rem; /* 30px */
  }

  .eteg-arsenal-bento__card-body {
    font-size: 1.25rem; /* 20px */
  }

  /* Texto do card grande: limita à coluna esquerda (ilustração ocupa direito ~45%) */
  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-content {
    max-width: 65%;
  }

  /* Texto do card escuro: limita largura para o <p> não vazar além do título */
  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-content {
    max-width: 85%;
  }

  /* Ilustração do card grande: top-right, ~90% altura — Figma: top:37px em 392px card */
  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-illustration {
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    height: 90%;
    max-width: 45%;
    max-height: none;
    object-fit: contain;
    object-position: right top;
    align-self: unset;
  }

  /* Ilustração do card escuro: bottom-right — Figma: left:266px em 469px card */
  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-illustration--persona {
    position: absolute;
    bottom: 0;
    right: 0;
    width: auto;
    height: 52%;
    max-width: 75%;
    max-height: none;
    object-fit: contain;
    object-position: right bottom;
    align-self: unset;
  }

  /* Ilustrações dos cards azuis: ancoradas no bottom-right */
  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-illustration--center {
    position: absolute;
    right: 24px;
    bottom: 48px; /* espaço para a icon row */
    width: auto;
    height: 52%;
    max-width: 45%;
    max-height: none;
    object-fit: contain;
    object-position: right bottom;
    align-self: unset;
  }

  /* Icon rows: absolutas no desktop */
  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-icons {
    position: absolute;
    bottom: 32px;
    left: 32px;
    max-width: calc(55% - 32px);
    width: auto;
    height: auto;
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-icons {
    position: absolute;
    bottom: 28px;
    left: 28px;
    max-width: 50%;
    width: auto;
    height: auto;
  }

  .eteg-arsenal-bento__deco-dots {
    width: 380px;
    right: -40px;
    top: -40px;
    opacity: 0.85;
  }
}

/* ── NOTEBOOK: min-width 1280px ─────────────────────────────── */
@media (min-width: 1280px) {

  .eteg-arsenal-bento__inner {
    padding-inline: 48px; /* era 24px */
  }

  .eteg-arsenal-bento__grid {
    grid-template-rows: 300px 300px; /* era 392px */
    gap: 12px; /* era 16px */
  }

  .eteg-arsenal-bento__card {
    padding: 24px; /* era 32px */
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-content {
    max-width: 65%; /* mantém */
  }

  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-content {
    max-width: 85%; /* mantém */
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-title,
  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-title {
    font-size: 1.75rem; /* era 2.25rem */
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-title {
    font-size: 1.5rem; /* era 1.875rem */
  }

  .eteg-arsenal-bento__card-body {
    font-size: 1rem; /* era 1.25rem */
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-icons {
    bottom: 24px; /* era 32px */
    left: 24px;
    max-width: calc(55% - 24px);
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-icons {
    bottom: 20px; /* era 28px */
    left: 20px;
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-illustration--center {
    bottom: 36px; /* era 48px — card mais curto */
  }

  .eteg-arsenal-bento__deco-dots {
    width: 280px;  /* era 380px */
    right: -40px;
    top: -30px;
    opacity: 0.7;  /* era 0.85 */
  }
}

/* =============================================================
   WIDE — min-width: 1440px
   ============================================================= */
@media (min-width: 1440px) {

  .eteg-arsenal-bento__inner {
    padding-inline: 80px; /* restaura */
  }

  .eteg-arsenal-bento__grid {
    grid-template-rows: 392px 392px; /* restaura */
    gap: 16px; /* restaura */
  }

  .eteg-arsenal-bento__card {
    padding: 32px; /* restaura */
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-content {
    max-width: 65%; /* restaura */
  }

  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-content {
    max-width: 85%; /* restaura */
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-title,
  .eteg-arsenal-bento__card--dark .eteg-arsenal-bento__card-title {
    font-size: 2.25rem; /* restaura */
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-title {
    font-size: 1.875rem; /* restaura */
  }

  .eteg-arsenal-bento__card-body {
    font-size: 1.25rem; /* restaura */
  }

  .eteg-arsenal-bento__card--large .eteg-arsenal-bento__card-icons {
    bottom: 32px; /* restaura */
    left: 32px;
    max-width: calc(55% - 32px);
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-icons {
    bottom: 28px; /* restaura */
    left: 28px;
  }

  .eteg-arsenal-bento__card--blue .eteg-arsenal-bento__card-illustration--center {
    bottom: 48px; /* restaura */
  }

  .eteg-arsenal-bento__deco-dots {
    width: 420px; /* restaura */
    right: -20px;
    top: -40px;   /* restaura */
    opacity: 0.85; /* restaura */
  }
}

/* ── Animação: reveal sequencial "quebra-cabeça" ─────────────
   js-anim: adicionado pelo JS quando IntersectionObserver está disponível
   is-visible: adicionado quando o grid entra na viewport (threshold 10%)  */

.eteg-arsenal-bento__grid.js-anim .eteg-arsenal-bento__card {
  opacity: 0;
  transform: scale(0.96) translateY(20px);
  transition: opacity 420ms cubic-bezier(0, 0, 0.2, 1),
              transform 420ms cubic-bezier(0, 0, 0.2, 1);
}

.eteg-arsenal-bento__grid.is-visible .eteg-arsenal-bento__card {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Stagger: cada card "encaixa" 150ms depois do anterior */
.eteg-arsenal-bento__grid.is-visible .eteg-arsenal-bento__card:nth-child(1) { transition-delay:   0ms; }
.eteg-arsenal-bento__grid.is-visible .eteg-arsenal-bento__card:nth-child(2) { transition-delay: 150ms; }
.eteg-arsenal-bento__grid.is-visible .eteg-arsenal-bento__card:nth-child(3) { transition-delay: 300ms; }
.eteg-arsenal-bento__grid.is-visible .eteg-arsenal-bento__card:nth-child(4) { transition-delay: 450ms; }

/* =============================================================
   ACESSIBILIDADE — prefers-reduced-motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {

  .eteg-arsenal-bento__card {
    will-change: auto; /* economiza memória quando animações desativadas */
    transition: none;
  }

  .eteg-arsenal-bento__grid.js-anim .eteg-arsenal-bento__card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .eteg-arsenal-bento .eteg-arsenal-bento__inner .eteg-arsenal-bento__grid .eteg-arsenal-bento__card:hover {
    transform: none;
  }
}
