/* ==========================================================================
   Página Home
   ========================================================================== */

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  height: clamp(640px, 100vh, 960px);
  overflow: hidden;
  background-color: var(--color-bg);
}

.hero__slides {
  position: absolute;
  inset: 0;
}

/* O slide anterior fica embaixo durante o fade */
.hero__slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
}

.hero__slide.is-leaving {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.hero__slide.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transition: opacity 1.6s ease-in-out;
}

.hero__slide.is-active .hero__content > * {
  animation: fade-up 1.1s var(--ease-out) backwards;
}

/* Cada parte do h1 anima separada */
.hero__slide.is-active .hero__content > .hero__heading {
  animation: none;
}

.hero__slide.is-active .hero__heading > * {
  animation: fade-up 1.1s var(--ease-out) backwards;
}

.hero__slide.is-active .hero__kicker {
  animation-delay: 0.35s;
}

.hero__slide.is-active .hero__title {
  animation-name: hero-title;
  animation-duration: 1.4s;
  animation-delay: 0.5s;
}

.hero__slide.is-active .hero__text {
  animation-delay: 0.75s;
}

.hero__slide.is-active .btn {
  animation-delay: 0.9s;
}

.hero__slide.is-leaving .hero__content > * {
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes hero-title {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.js .hero__tabs {
  animation: fade-in 1.2s ease 1.1s backwards;
}

.hero__media {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 43.65% 1fr;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__stone {
  filter: brightness(0.2);
}

.hero__ambient {
  filter: brightness(0.62);
}

/* --hero-scroll vem do JS (0 a 1) */
.hero__content {
  position: relative;
  z-index: 1;
  padding-top: clamp(40px, 5vw, 80px);
  opacity: calc(1 - var(--hero-scroll, 0) * 1.2);
  transform: translate3d(0, calc(var(--hero-scroll, 0) * -80px), 0);
}

.hero__content > * {
  max-width: min(600px, 43.65vw - var(--gutter) - 24px);
}

.hero__heading {
  font-size: inherit;
  font-weight: inherit;
}

.hero__heading > * {
  display: block;
}

.hero__kicker {
  font-size: clamp(18px, 1.25vw, 24px);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.hero__title {
  margin: 0.12em 0 0.3em;
  color: var(--color-gold);
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: -0.025em;
}

.hero__text {
  margin-bottom: 40px;
  line-height: 2.06;
}

/* Abas do slider */
.hero__tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(28px, 3.4vw, 65px);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px clamp(18px, 1.5vw, 29px);
}

.hero__tab {
  position: relative;
  padding-bottom: 4px;
  color: var(--color-text-dim);
  font-size: var(--fs-small);
  font-weight: 500;
  text-transform: uppercase;
  transition: color var(--transition);
}

.hero__tab::before,
.hero__tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
}

.hero__tab::after {
  height: 2px;
  background-color: var(--color-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.hero__tab:hover,
.hero__tab.is-active {
  color: var(--color-text);
}

.hero__tab:hover::after,
.hero__tab.is-active::after {
  transform: scaleX(1);
}

/* --hero-interval vem do JS */
.hero.is-autoplay .hero__tab.is-active::after {
  animation: hero-progress var(--hero-interval, 7s) linear both;
}

@keyframes hero-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ==========================================================================
   Nossos produtos
   ========================================================================== */
.products {
  padding-bottom: 0;
}

.products__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 1.6vw, 30px);
}

.products__list .reveal:nth-child(2) {
  --i: 1;
}

.products__list .reveal:nth-child(3) {
  --i: 2;
}

.product-card__link {
  position: relative;
  display: block;
  aspect-ratio: 533 / 331;
  overflow: hidden;
}

.product-card__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(10, 12, 13, 0.55), transparent 55%);
  transition: opacity var(--transition);
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.product-card__link:hover .product-card__img {
  transform: scale(1.06);
}

.product-card__body {
  position: absolute;
  left: clamp(18px, 1.6vw, 30px);
  right: clamp(18px, 1.6vw, 30px);
  bottom: clamp(18px, 1.3vw, 25px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.product-card__title {
  max-width: 260px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.4vw, 27px);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.product-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-card__more::after {
  content: "";
  width: 32px;
  height: 8px;
  background: url("../../assets/icons/icon-arrow.svg") center / contain no-repeat;
  transition: transform var(--transition);
}

.product-card__link:hover .product-card__more::after {
  transform: translateX(6px);
}

/* ==========================================================================
   Sobre e Showroom
   ========================================================================== */
.feature__inner {
  display: grid;
  align-items: center;
}

.feature__media img {
  width: 100%;
  height: auto;
}

.feature__content .btn {
  margin-top: 22px;
}

/* Sobre */
.feature--about {
  padding-top: var(--section-space);
  padding-bottom: clamp(56px, 3.6vw, 70px);
}

.feature--about .feature__inner {
  grid-template-columns: minmax(0, 1fr) 555px;
  gap: 10px;
}

.feature__media--fade {
  position: relative;
}

.feature__media--fade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 80%, var(--color-bg) 100%);
}

/* Showroom */
.feature--showroom {
  padding-top: clamp(56px, 3.6vw, 70px);
  padding-bottom: clamp(40px, 3.6vw, 70px);
}

.feature--showroom .feature__inner {
  grid-template-columns: 560px minmax(0, 1fr);
  gap: clamp(28px, 2.1vw, 35px);
}

/* ==========================================================================
   Parallax
   ========================================================================== */
.parallax {
  position: relative;
  height: clamp(300px, 32.3vw, 620px);
  overflow: hidden;
}

.parallax__img {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: 50% 36%;
  filter: brightness(0.54);
  transform: translate3d(0, var(--parallax-offset, 0px), 0);
  will-change: transform;
}

/* ==========================================================================
   Galeria de inspirações
   ========================================================================== */
.gallery {
  padding-bottom: var(--section-space);
}

.gallery__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.1vw, 20px);
  align-items: start;
}

.gallery__grid::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 20%;
  background: linear-gradient(
    to bottom,
    rgba(10, 12, 13, 0) 0%,
    rgba(10, 12, 13, 0.1) 25%,
    rgba(10, 12, 13, 0.3) 40%,
    rgba(10, 12, 13, 0.65) 64%,
    rgba(10, 12, 13, 0.86) 88%,
    var(--color-bg) 100%
  );
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.gallery__grid.is-expanded::after {
  opacity: 0;
}

.gallery__column {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.1vw, 20px);
}

.gallery__item {
  position: relative;
  overflow: hidden;
}

.gallery__item img {
  position: absolute;
  top: var(--img-y, 0);
  left: var(--img-x, 0);
  width: var(--img-w, 100%);
  max-width: none;
  height: auto;
  filter: brightness(0.8);
  transform-origin: var(--img-origin, center);
  transition: transform 0.8s ease;
}

.gallery__item:hover img {
  transform: scale(1.05);
}

.gallery__item--01 {
  aspect-ratio: 399 / 493;
  --img-w: 203.51%;
  --img-x: -15.54%;
  --img-y: -6.29%;
  --img-origin: 32.2% 51.2%;
}

.gallery__item--02 {
  aspect-ratio: 395 / 368;
  --img-w: 111.39%;
  --img-x: -5.82%;
  --img-y: -12.77%;
  --img-origin: 50.1% 52.5%;
}

.gallery__item--03 {
  aspect-ratio: 401 / 409;
  --img-w: 110.72%;
  --img-x: -7.23%;
  --img-y: -4.16%;
  --img-origin: 51.7% 49.9%;
}

.gallery__item--04 {
  aspect-ratio: 401 / 443;
  --img-w: 106.23%;
  --img-x: -2.99%;
  --img-y: -3.84%;
  --img-origin: 49.9% 44.7%;
}

.gallery__item--05 {
  aspect-ratio: 401 / 381;
  --img-w: 102.24%;
  --img-x: -2.24%;
  --img-y: -11.55%;
  --img-origin: 51.1% 45.7%;
}

.gallery__item--06 {
  aspect-ratio: 401 / 498;
  --img-w: 189.53%;
  --img-x: -28.93%;
  --img-y: -7.23%;
  --img-origin: 41.6% 50%;
}

.gallery__item--07 {
  aspect-ratio: 401 / 466;
  --img-w: 189.53%;
  --img-x: -46.63%;
  --img-y: -7.73%;
  --img-origin: 51% 44.2%;
}

.gallery__item--08 {
  aspect-ratio: 1 / 1;
  --img-w: 113.22%;
  --img-x: -8.23%;
  --img-y: -4.99%;
  --img-origin: 51.4% 48.6%;
}

/* Fotos escolhidas no painel do WordPress */
.gallery__item--livre img {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.gallery__column:nth-child(2) .gallery__item {
  --i: 1;
}

.gallery__column:nth-child(3) .gallery__item {
  --i: 2;
}

.gallery__column:nth-child(4) .gallery__item {
  --i: 3;
}

.gallery__item.is-new {
  animation: fade-up 0.8s ease both;
}

.gallery__actions {
  display: flex;
  justify-content: center;
  margin-top: clamp(24px, 2vw, 40px);
}

.gallery__actions.is-hidden {
  display: none;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1024px) {
  .feature--about .feature__inner,
  .feature--showroom .feature__inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .feature--showroom .feature__media {
    order: -1;
  }

  .feature__media--fade::after {
    background: linear-gradient(to bottom, transparent 75%, var(--color-bg) 100%);
  }

  .feature__content {
    max-width: 640px;
  }
}

@media (max-width: 768px) {
  /* Hero */
  .hero {
    height: auto;
  }

  .hero__slides {
    position: relative;
    display: grid;
  }

  .hero__slide {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
    display: block;
    padding: var(--header-height) 0 120px;
  }

  .hero__media {
    display: block;
  }

  .hero__media .hero__stone {
    position: absolute;
    inset: 0;
  }

  .hero__media .hero__ambient {
    position: absolute;
    top: var(--header-height);
    left: 0;
    height: auto;
    aspect-ratio: 1081 / 909;
    object-fit: cover;
    filter: brightness(0.85);
  }

  /* Altura da foto do ambiente */
  .hero__content {
    padding-top: calc(100vw * 909 / 1081 + 36px);
  }

  .hero__content > * {
    max-width: none;
  }

  .hero__text {
    line-height: 1.8;
  }

  .hero__tabs {
    gap: 10px 18px;
  }

  .hero__tab {
    font-size: 12px;
  }

  .products__list {
    grid-template-columns: 1fr;
  }

  /* Parallax */
  .parallax {
    height: auto;
  }

  .parallax__img {
    position: static;
    width: 100%;
    height: auto;
    transform: none;
  }

  /* Galeria */
  .gallery__grid {
    display: block;
    columns: 2;
    column-gap: 12px;
  }

  .gallery__column {
    display: contents;
  }

  .gallery__item {
    aspect-ratio: auto;
    margin-bottom: 12px;
    break-inside: avoid;
  }

  .gallery__item img {
    position: static;
    width: 100%;
    height: auto;
    transform-origin: center;
  }
}

@media (max-width: 420px) {
  .hero__slide {
    padding-bottom: 130px;
  }
}

/* Telas largas e baixas */
@media (min-width: 769px) and (max-height: 800px) {
  .hero__content {
    padding-top: clamp(40px, 5vh, 64px);
  }

  .hero__title {
    font-size: min(var(--fs-hero), 14vh);
  }

  .hero__text {
    margin-bottom: 28px;
    line-height: 1.75;
  }
}

@media (prefers-reduced-motion: reduce) {
  .parallax__img {
    transform: none;
  }
}
