/* ==========================================================================
   ODEN-STEEL COMPONENT / SZOLGÁLTATÁSOK — SECTION 03
   --------------------------------------------------------------------------
   Prémium sticky + scroll layout:
     - bal oldal: natív sticky összefoglaló (eyebrow, cím, arany vonal,
       lead, benefits, CTA) — nem GSAP pin,
     - jobb oldal: scrollozó szolgáltatáskártyák (2 oszlop, egy wide
       kártyával; mobilon 1 oszlop).
   Kártyák: valódi linkek, picture/img (nem background-image), overlay
   gradiens, visszafogott hover (transform + filter). Számozás nincs.
   Belépő animációt a services.js ad (GSAP, reduced motion nélkül).
   ========================================================================== */

.services-section {
  --services-sticky-gap: clamp(16px, 2.2vh, 28px);
  position: relative;
  background: #090909;
  color: #fff;
  overflow: clip;
  padding: clamp(56px, 7vh, 96px) 0;
  scroll-margin-top: calc(
    var(--site-header-height, var(--header-height, 80px)) + 12px
  );
}

.services-section__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
  display: grid;
  grid-template-columns: minmax(320px, 4fr) minmax(0, 8fr);
  gap: 72px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Bal oldal — sticky összefoglaló
   -------------------------------------------------------------------------- */

.services-section__sticky {
  position: sticky;
  top: calc(
    var(--site-header-height, var(--header-height, 80px)) +
      var(--services-sticky-gap)
  );
  max-height: calc(
    100vh - var(--site-header-height, var(--header-height, 80px)) -
      (2 * var(--services-sticky-gap))
  );
  max-height: calc(
    100svh - var(--site-header-height, var(--header-height, 80px)) -
      (2 * var(--services-sticky-gap))
  );
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
  align-content: start;
  justify-items: start;
  row-gap: clamp(12px, 1.7vh, 24px);
  overflow: visible;
}

.services-section__eyebrow {
  margin: 0;
  color: #d6a300;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.services-section__title {
  margin: 0;
  max-width: min(100%, 14em);
  font-size: clamp(
    3rem,
    min(5.2vw, 8.2vh),
    var(--font-size-display-xl, 4.5rem)
  );
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.055em;
  overflow-wrap: var(--text-wrap-display);
}

.services-section__line {
  width: 72px;
  height: 2px;
  margin: 0;
  background: linear-gradient(90deg, #d6a300, rgba(214, 163, 0, 0));
}

.services-section__lead {
  max-width: 460px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(1rem, 0.35vw + 0.9rem, 1.25rem);
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.services-section__benefits {
  display: grid;
  gap: clamp(10px, 1.4vh, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.services-section__benefits li {
  position: relative;
  padding-left: 34px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.4;
}

@media (min-width: 1024px) and (min-height: 821px) {
  .services-section__benefits li {
    font-size: 17px;
    line-height: 1.45;
  }
}

/* Arany check jel */
.services-section__benefits li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.28em;
  width: 14px;
  height: 8px;
  border-left: 2px solid #d6a300;
  border-bottom: 2px solid #d6a300;
  transform: rotate(-45deg);
}

.services-section__cta {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(214, 163, 0, 0.68);
  color: #d6a300;
  text-decoration: none;
  font-weight: 800;
  transition:
    background-color 0.24s ease,
    color 0.24s ease,
    transform 0.24s ease;
}

.services-section__cta:hover {
  background-color: #d6a300;
  color: #0b0b0b;
  transform: translateY(-2px);
}

.services-section__cta:focus-visible {
  outline: 2px solid #d6a300;
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Jobb oldal — szolgáltatáskártyák
   -------------------------------------------------------------------------- */

.services-section__cards {
  --services-cards-gap: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--services-cards-gap);
}

.service-card {
  position: relative;
  /* Content-relative floor — absolute copy must fit above the image crop */
  min-height: clamp(26.875rem, 36vw, 28.75rem);
  border-radius: 28px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  isolation: isolate;
}

.service-card--wide {
  grid-column: span 2;
  min-height: clamp(28.75rem, 38vw, 30.625rem);
}

.service-card__link {
  position: relative;
  display: block;
  height: 100%;
  min-height: inherit;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.service-card picture,
.service-card img {
  display: block;
  width: 100%;
  height: 100%;
}

.service-card img {
  position: absolute;
  inset: 0;
  object-fit: cover;
  transform: scale(1);
  transition:
    transform 1.4s ease,
    filter 1.4s ease;
}

/* Windows/doors card: keep interior door + large glass in the crop */
.service-card__link[href="ablakok-es-ajtok-beepitese.html"] img {
  object-position: center 38%;
}

/* Olvashatósági overlay a kép fölött, a tartalom alatt */
.service-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.78) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
}

.service-card__content {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 2;
}

.service-card h3 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(26px, 2.2vw, 34px);
  font-weight: 800;
  line-height: var(--line-height-heading);
  letter-spacing: -0.035em;
  overflow-wrap: var(--text-wrap-display);
}

.service-card p {
  max-width: 520px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 17px;
  line-height: 1.65;
}

/* Hover / focus — visszafogott prémium reakció (csak transform + filter) */

.service-card:hover {
  border-color: rgba(214, 163, 0, 0.28);
}

.service-card:hover img {
  transform: scale(1.045);
  filter: brightness(1.08);
}

.service-card__link:focus-visible {
  outline: 2px solid #d6a300;
  outline-offset: 4px;
}

/* Reduced motion: semmi ne mozogjon hoverre sem */
@media (prefers-reduced-motion: reduce) {
  .service-card img,
  .services-section__cta {
    transition: none;
  }

  .service-card:hover img {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Magasságalapú compact desktop — alacsony laptop / landscape
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) and (max-height: 820px) {
  .services-section {
    --services-sticky-gap: clamp(10px, 1.6vh, 16px);
    padding: clamp(40px, 5.5vh, 64px) 0;
  }

  .services-section__sticky {
    row-gap: clamp(8px, 1.3vh, 14px);
  }

  .services-section__title {
    font-size: clamp(2.75rem, min(4.8vw, 7.2vh), 3.75rem);
  }

  .services-section__lead {
    font-size: 1.0625rem;
    line-height: 1.45;
  }

  .services-section__benefits {
    gap: 8px;
  }

  .services-section__cta {
    min-height: 46px;
    padding: 0 22px;
  }
}

@media (min-width: 1024px) and (max-height: 740px) {
  .services-section {
    --services-sticky-gap: 8px;
    padding: 36px 0;
  }

  .services-section__sticky {
    row-gap: 8px;
  }

  .services-section__title {
    font-size: clamp(2.5rem, min(4.6vw, 7vh), 3.25rem);
    line-height: 0.98;
  }

  .services-section__lead {
    font-size: 1rem;
    line-height: 1.4;
  }

  .services-section__benefits {
    gap: 6px;
  }

  .services-section__benefits li {
    font-size: 16px;
    line-height: 1.3;
  }

  .services-section__cta {
    min-height: 44px;
    padding: 0 20px;
  }
}

/* --------------------------------------------------------------------------
   Tablet (1024px alatt) — sticky feloldva, egy hasáb
   -------------------------------------------------------------------------- */

@media (max-width: 1023px) {
  .services-section {
    padding: 96px 0;
  }

  .services-section__inner {
    padding: 0 40px;
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .services-section__sticky {
    position: relative;
    top: auto;
    max-height: none;
    min-height: 0;
    justify-items: start;
  }

  .services-section__title {
    max-width: 720px;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    line-height: var(--line-height-display);
  }

  .services-section__lead {
    max-width: 680px;
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  }

  .services-section__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card,
  .service-card--wide {
    grid-column: auto;
    min-height: clamp(26.25rem, 52vw, 28.125rem);
  }
}

/* --------------------------------------------------------------------------
   Mobil (767px alatt) — 1 oszlopos kártyalista
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .services-section {
    padding: 96px 0;
  }

  .services-section__inner {
    padding: 0 24px;
    gap: 44px;
  }

  .services-section__sticky {
    align-items: center;
    justify-items: center;
  }

  .services-section__eyebrow {
    font-size: 11px;
    letter-spacing: 0.26em;
    text-align: center;
  }

  .services-section__title {
    width: 100%;
    max-width: min(100%, 16ch);
    margin-inline: auto;
    font-size: clamp(40px, 12vw, 52px);
    line-height: var(--line-height-display);
    overflow-wrap: var(--text-wrap-display);
    text-align: center;
    text-wrap: balance;
  }

  .services-section__line {
    margin-inline: auto;
  }

  .services-section__lead {
    width: 100%;
    max-width: min(100%, 42ch);
    margin-inline: auto;
    font-size: 18px;
    line-height: 1.6;
    text-align: center;
    text-wrap: balance;
  }

  .services-section__benefits {
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    gap: 18px;
    text-align: left;
  }

  .services-section__benefits li {
    text-align: left;
  }

  .services-section__cta {
    margin: 0 auto;
    width: fit-content;
  }

  .services-section__cards {
    --services-cards-gap: 20px;
    grid-template-columns: 1fr;
    gap: var(--services-cards-gap);
  }

  .service-card,
  .service-card--wide {
    min-height: clamp(28.75rem, 120vw, 30.625rem);
    border-radius: 24px;
  }

  .service-card__content {
    left: 22px;
    right: 22px;
    bottom: 22px;
  }

  .service-card h3 {
    font-size: 28px;
  }

  .service-card p {
    font-size: 16px;
  }
}

/* --------------------------------------------------------------------------
   Desktop + tablet — solitary last card centered on the final 2-col row.
   Scales with odd count; no-op when the last card is even or --wide.
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .services-section__cards
    > .service-card:last-child:nth-child(odd):not(.service-card--wide) {
    grid-column: 1 / -1;
    width: calc((100% - var(--services-cards-gap)) / 2);
    justify-self: center;
  }
}
