/* Hallmark · genre: modern-minimal · macrostructure: Ficha de produto (abertura com foto do equipamento, índice ao lado e texto em coluna) · design-system: design.md
 * Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4
 *
 * Ficha de produto (/reb/produtos/<nome>/). O HTML e os textos são os do protótipo original, sem alteração.
 * Este arquivo soma ao rb-site.css só a abertura da ficha. O índice, o texto, a tabela, as fontes e os
 * produtos relacionados são peças de "página de leitura" e ficam no rb-site.css.
 */

/* ---------- Abertura ---------- */

.crumb:has(+ .product-hero) {
  background: var(--color-paper-2);
}

main > .product-hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  column-gap: var(--space-md);
  padding-block: var(--space-xl) var(--space-2xl);
  background: var(--color-paper-2);
}

/* Fio de laser que fecha a abertura */
.product-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--beam);
  background: var(--color-accent);
  transform-origin: left;
}

.product-hero > div {
  grid-column: 1 / 8;
}

.product-hero h1 {
  margin-bottom: var(--space-md);
  font-size: clamp(2.75rem, 1.2rem + 5.4vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.022em;
}

.product-hero .lead {
  max-width: 34rem;
  margin-bottom: var(--space-lg);
  color: var(--color-ink-2);
  font-size: var(--text-lg);
  line-height: 1.5;
}

/* Foto do equipamento: quadro branco, foto inteira, sem corte */
.hero-product {
  position: relative;
  grid-column: 8 / 13;
}

.hero-product > img,
.hero-product .rb-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-paper);
  border-radius: var(--radius-md);
}

.hero-product img {
  height: auto;
  padding: var(--space-xl);
  object-fit: contain;
}

.hero-product .rb-frame img {
  width: 100%;
  height: 100%;
}

/* No quadro branco as marcas de mira são laranja */
.hero-product .rb-frame::after {
  --mark: var(--color-accent);
}

.hero-product figcaption {
  margin-top: var(--space-xs);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.hero-product .zoom-hint {
  top: var(--space-sm);
  left: var(--space-sm);
}

.hero-product:focus-visible {
  outline-offset: 6px;
}

@media (hover: hover) {
  .hero-product:hover .rb-frame::after {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Entrada da abertura (sem depender de script) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .product-hero > div > * {
    animation: rb-rise var(--dur-long) var(--ease-out) backwards;
  }

  .product-hero > div > h1 {
    animation-name: rb-unmask;
    animation-delay: 120ms;
  }

  .product-hero > div > .lead {
    animation-delay: 320ms;
  }

  .product-hero > div > .button {
    animation-delay: 440ms;
  }

  .product-hero figcaption,
  .product-hero .zoom-hint {
    animation: rb-fade var(--dur-long) var(--ease-out) 700ms backwards;
  }

  .product-hero::after {
    animation: rb-beam 1500ms var(--ease-in-out) 250ms backwards;
  }
}

/* ---------- Telas médias e celular ---------- */

@media (max-width: 900px) {
  main > .product-hero {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-xl);
    padding-block: var(--space-lg) var(--space-xl);
  }

  .product-hero > div,
  .hero-product {
    grid-column: 1 / -1;
  }

  .hero-product {
    max-width: 34rem;
  }
}

@media (max-width: 640px) {
  .hero-product img {
    padding: var(--space-lg);
  }
}
