/* ABOUTME: Closing (lezáró/kilépő) section styles for the home page.
   ABOUTME: Scroll-driven word-swap and description parallax in a 6-column grid. */

/* ===========================
   Section Wrapper (scroll space)
   =========================== */

#lezaro {
  position: relative;
  z-index: 1;
  height: 300vh;
  padding: 0;
  text-align: left;
  overflow-x: clip;
}

/* ===========================
   Sticky Inner (grid layout)
   =========================== */

.lezaro__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
}

/* --- Large serif words --- */

.lezaro__words {
  display: contents;
}

.lezaro__line {
  grid-column: 2 / 5;
  font-family: var(--font-primary);
  font-size: clamp(5rem, 16vw, 16rem);
  font-weight: 400;
  line-height: 0.9;
  color: var(--color-black);
  overflow: visible;
}

.lezaro__line:nth-child(1) {
  justify-self: end;
}

.lezaro__line:nth-child(2) {
  justify-self: start;
}

.lezaro__line:nth-child(3) {
  justify-self: center;
}

/* ===========================
   Word Swap
   =========================== */

.lezaro__static,
.lezaro__swap {
  display: inline-block;
  vertical-align: bottom;
}

.lezaro__swap {
  overflow-x: visible;
  overflow-y: clip;
}

.lezaro__swap-track {
  position: relative;
  display: block;
  will-change: transform;
}

.lezaro__swap-word {
  display: block;
}

.lezaro__swap-word--alt {
  position: absolute;
  top: 100%;
  left: 0;
}

.lezaro__line:nth-child(1) .lezaro__swap-word--alt {
  left: auto;
  right: 0;
}

/* ===========================
   Description: stacked labels
   =========================== */

.lezaro__description {
  grid-column: 5 / 7;
  grid-row: 1 / 4;
  padding: 1em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  will-change: transform;
}

.lezaro__label {
  white-space: nowrap;
  background: var(--color-black);
  color: var(--color-bg);
  font-family: var(--font-secondary);
  font-size: 1.5rem;
  font-weight: 400;
  text-transform: uppercase;
  padding: 0.3em 0.4em;
  line-height: 1.3;
  width: fit-content;
}

.lezaro__label:first-child {
  padding-bottom: 0;
}

.lezaro__label:last-child {
  padding-top: 0;
  padding-bottom: 0;
}

.lezaro__label--no-vpad {
  padding-top: 0;
  padding-bottom: 0;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
  #lezaro {
    height: auto;
    padding: 4rem 0;
  }

  .lezaro__sticky {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    padding: 0 1rem;
  }

  .lezaro__words {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
  }

  .lezaro__line {
    grid-column: 1;
    font-size: clamp(3rem, 12vw, 5rem);
  }

  /* Show only the first word variant on mobile (no swap animation) */
  .lezaro__swap-word--alt {
    display: none;
  }

  .lezaro__description {
    grid-column: 1;
    grid-row: 2;
    padding-top: 0;
    align-self: start;
  }

  .lezaro__label {
    font-size: 1.1rem;
  }
}
