/* Transguard Living — home hero slider
   Prefix: .tgl-hero-slider  (safe to drop into any theme)
   Fonts: Poppins (headings/UI) + Roboto (body) — enqueue separately. */

.tgl-hero-slider {
  --tgl-red: #ae1f26;
  --tgl-red-bright: #e21f26;
  --tgl-navy: #0f3557;
  --tgl-white: #fff;
  --tgl-duration: 6000ms;
  --tgl-min-height: 100vh;
  --tgl-max-width: 1180px;
  position: relative;
  display: grid;
  min-height: var(--tgl-min-height);
  background: var(--tgl-navy);
  overflow: hidden;
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

.tgl-hero-slider__viewport {
  display: grid;
  grid-area: 1 / 1;
}

/* --- slides: grid stack, so the section grows to the tallest slide --- */
.tgl-hero-slider__slide {
  position: relative;
  grid-area: 1 / 1;
  display: grid;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.75s cubic-bezier(0.2, 0.7, 0.3, 1),
    visibility 0.75s;
}
.tgl-hero-slider__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}
.tgl-hero-slider__slide:not(.is-active) a,
.tgl-hero-slider__slide:not(.is-active) button {
  pointer-events: none;
}

.tgl-hero-slider__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
}
.tgl-hero-slider__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.tgl-hero-slider__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--tgl-max-width);
  margin: 0 auto;
  padding: 120px 24px 150px;
}
.tgl-hero-slider__content {
  max-width: 560px;
  color: var(--tgl-white);
}
.tgl-hero-slider__slide.is-active .tgl-hero-slider__content {
  animation: tgl-hero-up 0.7s 0.08s both;
}

@keyframes tgl-hero-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tgl-hero-slider__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tgl-white);
}
.tgl-hero-slider__rule {
  display: block;
  width: 34px;
  height: 3px;
  background: var(--tgl-white);
}

.tgl-hero-slider__title {
  margin: 0 0 18px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 3.9vw, 46px);
  line-height: 1.14;
  color: var(--tgl-white);
  text-wrap: pretty;
}
.tgl-hero-slider__text {
  margin: 0 0 32px;
  max-width: 470px;
  font-family: "Roboto", sans-serif;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.9);
}

.tgl-hero-slider__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.tgl-hero-slider__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 17px 34px;
  border-radius: 98px;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.tgl-hero-slider__btn--primary {
  background: var(--tgl-white);
  color: var(--tgl-red);
}
.tgl-hero-slider__btn--primary:hover,
.tgl-hero-slider__btn--primary:focus-visible {
  background: var(--tgl-red);
  color: var(--tgl-white);
}
.tgl-hero-slider__btn--ghost {
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  color: var(--tgl-white);
}
.tgl-hero-slider__btn--ghost:hover,
.tgl-hero-slider__btn--ghost:focus-visible {
  background: var(--tgl-white);
  color: var(--tgl-navy);
  border-color: var(--tgl-white);
}

/* --- controls --- */
.tgl-hero-slider__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  width: 100%;
  max-width: var(--tgl-max-width);
  margin: 0 auto;
  padding: 0 24px 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.tgl-hero-slider__rail {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tgl-hero-slider--no-rail .tgl-hero-slider__controls {
  justify-content: center;
}

/* thin visual line, 44px touch box: the track is painted in the content box only */
.tgl-hero-slider__bar {
  width: 74px;
  height: auto;
  padding: 20px 0;
  border: 0;
  background: rgba(255, 255, 255, 0.32);
  background-clip: content-box;
  overflow: hidden;
  cursor: pointer;
  display: block;
}
.tgl-hero-slider__bar-fill {
  display: block;
  height: 4px;
  background: var(--tgl-white);
  transform: scaleX(0);
  transform-origin: left center;
}
.tgl-hero-slider__bar.is-active .tgl-hero-slider__bar-fill {
  animation: tgl-hero-rail var(--tgl-duration) linear both;
}

@keyframes tgl-hero-rail {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.tgl-hero-slider__count {
  margin-left: 6px;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.tgl-hero-slider__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tgl-hero-slider__icon-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: var(--tgl-white);
  font-family: "Poppins", sans-serif;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: 0.3s;
}
.tgl-hero-slider__icon-btn:hover {
  background: var(--tgl-white);
  color: var(--tgl-navy);
}

.tgl-hero-slider a:focus-visible,
.tgl-hero-slider button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.tgl-hero-slider__live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- responsive --- */
@media (max-width: 1024px) {
  .tgl-hero-slider__inner {
    padding: 126px 24px 148px;
  }
  .tgl-hero-slider__text {
    font-size: 16px;
  }
}

@media (max-width: 760px) {
  .tgl-hero-slider__inner {
    padding: 118px 20px 134px;
  }
  .tgl-hero-slider__image {
    object-position: right center;
  }
  .tgl-hero-slider__content {
    max-width: 100%;
  }
  .tgl-hero-slider__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .tgl-hero-slider__btn {
    width: 100%;
    box-sizing: border-box;
    min-height: 54px;
    padding: 18px 24px;
  }
  .tgl-hero-slider__controls {
    padding: 0 20px 26px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .tgl-hero-slider__rail {
    width: 100%;
    gap: 10px;
  }
  .tgl-hero-slider__bar {
    flex: 1;
    width: auto;
  }
  .tgl-hero-slider__bar-fill {
    height: 6px;
  }
}

@media (max-width: 420px) {
  .tgl-hero-slider__inner {
    padding: 106px 18px 130px;
  }
  .tgl-hero-slider__icon-btn {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tgl-hero-slider__slide {
    transition: none;
  }
  .tgl-hero-slider__slide.is-active .tgl-hero-slider__content {
    animation: none;
  }
  .tgl-hero-slider__bar-fill {
    animation: none !important;
  }
}
