/* Hero da Home em mosaico — direção C (decisão de 2026-10-16).
   Bloco grafite grande com o carrossel de banners (site.md §6.10) + blocos de
   categoria e "Como pedir". Substitui o hero em tela cheia grafite de 2026-10-15. */

.hero-mosaic {
  padding-top: var(--s-4);
}

.hero-mosaic__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(168px, auto);
  gap: var(--s-3);
}

/* Celular: o carrossel cresce com o texto; o último bloco de categoria fecha a linha */
.hm-main {
  grid-column: 1 / -1;
}

@media (max-width: 767px) {
  .hero-mosaic__grid > a.hm-tile:last-child {
    grid-column: 1 / -1;
  }
}

.hm-tile--steps {
  grid-column: 1 / -1;
  order: 9;
}

@media (min-width: 768px) {
  .hero-mosaic__grid {
    grid-auto-rows: 210px;
    gap: var(--s-4);
  }

  .hm-main { grid-row: span 2; }
  .hm-tile--steps { grid-column: auto; order: 0; }
}

@media (min-width: 1024px) {
  .hero-mosaic {
    padding-top: var(--s-5);
  }

  .hero-mosaic__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    height: clamp(540px, calc(100svh - var(--header-top) - var(--header-nav) - var(--header-faixa) - 56px), 680px);
  }

  .hm-main {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* ---------- Bloco principal (carrossel) ---------- */
.hm-main {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--graphite-900);
  color: var(--on-dark);
}

.hm-main__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(70% 60% at 100% 100%, rgba(21, 133, 84, 0.32), transparent 70%);
}

.hm-main__mark {
  position: absolute;
  right: -14%;
  bottom: -22%;
  width: 72%;
  max-width: 520px;
  aspect-ratio: 1;
  color: var(--white);
  opacity: 0.07;
}

.hm-main__mark path {
  fill: currentColor;
}

.hero__viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.hero__track {
  display: flex;
  height: 100%;
  transition: transform 700ms cubic-bezier(0.65, 0, 0.25, 1);
}

.hero__slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: clamp(24px, 4.2vw, 56px) clamp(20px, 4.2vw, 56px) 0;
  box-sizing: border-box;
}

.banner__text {
  max-width: 36rem;
}

.banner__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-4);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(143, 217, 182, 0.4);
  color: #8fd9b6;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.banner__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8fd9b6;
}

.banner__title {
  margin: 0 0 var(--s-4);
  font-size: clamp(2rem, 1.2rem + 2.4vw, 3.375rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--on-dark);
}

.banner__lead {
  margin: 0 0 var(--s-6);
  max-width: 30rem;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  color: var(--on-dark-muted);
}

.banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.banner__actions .btn {
  min-height: 52px;
  padding-inline: var(--s-5);
  font-size: 1rem;
}

/* Também usado na faixa grafite das categorias */
.btn--outline-light {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(255, 255, 255, 0.08);
  --btn-fg: var(--white);
  --btn-border: rgba(255, 255, 255, 0.5);
}

.hm-main__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) clamp(12px, 3.4vw, 44px) clamp(12px, 2.4vw, 28px);
}

.hero__dots {
  display: flex;
}

.hero__dot {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
}

.hero__dot::before {
  content: "";
  width: 12px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.3);
  transition: width var(--t-med) var(--ease), background-color var(--t-med) var(--ease);
}

.hero__dot[aria-current="true"]::before {
  width: 32px;
  background: #8fd9b6;
}

.hero__arrows {
  display: flex;
  gap: var(--s-2);
}

.hero__arrows .round-btn {
  width: var(--tap);
  height: var(--tap);
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  transition: background-color var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}

.hero__arrows .round-btn:hover {
  background: var(--green-600);
  border-color: var(--green-600);
  color: var(--white);
}

.hero__dot:focus-visible,
.hero .round-btn:focus-visible {
  outline-color: var(--white);
}

/* Entrada do texto ao trocar de slide (uma vez por troca, sem loop) */
.hero.is-ready .banner__text > * {
  opacity: 0;
  translate: 0 20px;
  transition: opacity 0.6s var(--ease), translate 0.7s var(--ease);
}

.hero.is-ready .is-active .banner__text > * {
  opacity: 1;
  translate: 0 0;
}

.hero.is-ready .is-active .banner__text > :nth-child(2) { transition-delay: 0.08s; }
.hero.is-ready .is-active .banner__text > :nth-child(3) { transition-delay: 0.16s; }
.hero.is-ready .is-active .banner__text > :nth-child(4) { transition-delay: 0.24s; }

/* ---------- Blocos laterais ---------- */
.hm-tile {
  --tile-bg: var(--surface-muted);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--s-5);
  border-radius: 24px;
  background: var(--tile-bg);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.hm-tile--mint { --tile-bg: var(--green-50); }
.hm-tile--mist { --tile-bg: var(--surface-muted); }

a.hm-tile:hover {
  color: var(--text);
}

.hm-tile__name {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hm-tile__count {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.hm-tile__name,
.hm-tile__count {
  position: relative;
  z-index: 1;
}

/* Fotos ancoradas no canto; o multiply some com o fundo branco das fotos.
   Sem z-index aqui: criaria um contexto próprio e isolaria o multiply do fundo do bloco. */
.hm-tile__imgs {
  position: absolute;
  right: -4%;
  bottom: -6%;
  height: 92%;
  width: 72%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.hm-tile__imgs img {
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: translate 0.55s var(--ease), scale 0.55s var(--ease);
}

.hm-tile__imgs--2 img {
  max-width: 58%;
  height: 86%;
}

.hm-tile__imgs--2 img + img {
  height: 100%;
  margin-left: -14%;
}

.hm-tile__arrow {
  position: absolute;
  z-index: 1;
  left: var(--s-5);
  bottom: var(--s-5);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--green-600);
  color: var(--white);
  transition: background-color 0.3s var(--ease), translate 0.35s var(--ease);
}

.hm-tile__arrow svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  a.hm-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 40px -20px rgba(35, 39, 43, 0.35);
  }

  a.hm-tile:hover .hm-tile__imgs img { translate: 0 -6px; scale: 1.05; }
  a.hm-tile:hover .hm-tile__imgs img + img { transition-delay: 70ms; }
  a.hm-tile:hover .hm-tile__arrow { background: var(--green-700); translate: 4px 0; }
}

a.hm-tile:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 3px;
}

a.hm-tile:active {
  transform: scale(0.98);
  transition-duration: 0.12s;
}

/* "Como pedir" */
.hm-tile--steps {
  justify-content: space-between;
  gap: var(--s-4);
  background: var(--green-600);
  color: var(--white);
}

.hm-tile--steps .hm-tile__name {
  color: var(--white);
}

.hm-steps {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.hm-steps li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.hm-steps span {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--green-700);
  font-weight: 700;
  font-size: var(--fs-small);
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hm-tile--steps .hm-steps { gap: var(--s-2); }
}

@media (max-width: 767px) {
  .hm-tile { padding: var(--s-4); }
  .hm-tile__arrow { left: var(--s-4); bottom: var(--s-4); width: 36px; height: 36px; }
  .hm-tile--steps .hm-steps { flex-direction: row; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--fs-small); }
  .hm-tile__imgs { width: 66%; }
}

/* ---------- Abertura da Home ----------
   Decisão de 2026-10-16: substitui, só na Home, "o que está na tela ao carregar não anima".
   ~1,2 s, uma vez por carregamento. fill-mode "backwards": depois de tocar, devolve o controle
   às transições do carrossel. Sem JS funciona igual; com "reduzir movimento" não roda. */
@keyframes intro-down {
  from { opacity: 0; translate: 0 -100%; }
}

@keyframes intro-up {
  from { opacity: 0; translate: 0 28px; }
}

@keyframes intro-tile {
  from { opacity: 0; translate: 0 40px; scale: 0.96; }
}

@keyframes intro-zoom {
  from { opacity: 0; scale: 1.08; }
}

@keyframes intro-mark {
  from { opacity: 0; rotate: -10deg; scale: 0.85; }
}

@keyframes intro-fade {
  from { opacity: 0; }
}

[data-page="home"] .site-header {
  animation: intro-down 0.7s var(--ease) backwards;
}

[data-page="home"] .main-nav li {
  animation: intro-up 0.6s var(--ease) backwards;
  animation-delay: calc(0.25s + var(--n, 0) * 70ms);
}

[data-page="home"] .main-nav li:nth-of-type(2) { --n: 1; }
[data-page="home"] .main-nav li:nth-of-type(3) { --n: 2; }
[data-page="home"] .main-nav li:nth-of-type(4) { --n: 3; }
[data-page="home"] .main-nav li:nth-of-type(5) { --n: 4; }

.hm-main {
  animation: intro-tile 0.8s var(--ease) 0.15s backwards;
}

.hm-main__bg {
  animation: intro-zoom 1.4s var(--ease) 0.2s backwards;
}

.hm-main__mark {
  animation: intro-mark 1.6s var(--ease) 0.4s backwards;
}

.hero__slide:first-child .banner__text > * {
  animation: intro-up 0.8s var(--ease) backwards;
  animation-delay: calc(0.45s + var(--n, 0) * 90ms);
}

.hero__slide:first-child .banner__text > :nth-child(2) { --n: 1; }
.hero__slide:first-child .banner__text > :nth-child(3) { --n: 2; }
.hero__slide:first-child .banner__text > :nth-child(4) { --n: 3; }

.hero-mosaic .hm-tile {
  animation: intro-tile 0.8s cubic-bezier(0.2, 0.9, 0.25, 1.05) backwards;
  animation-delay: calc(0.4s + var(--n, 0) * 110ms);
}

.hero-mosaic .hm-tile:nth-child(3) { --n: 1; }
.hero-mosaic .hm-tile:nth-child(4) { --n: 2; }
.hero-mosaic .hm-tile:nth-child(5) { --n: 3; }

.hm-main__foot {
  animation: intro-fade 0.8s var(--ease) 1s backwards;
}

@media (prefers-reduced-motion: reduce) {
  [data-page="home"] .site-header,
  [data-page="home"] .main-nav li,
  .hm-main,
  .hm-main__bg,
  .hm-main__mark,
  .hero__slide:first-child .banner__text > *,
  .hero-mosaic .hm-tile,
  .hm-main__foot {
    animation: none;
  }

  .hero.is-ready .banner__text > * {
    opacity: 1;
    translate: none;
    transition: none;
  }
}
