.jtoz-projects {
  margin: 0 0 200px;
  padding-block: clamp(72px, 9vw, 130px);
  padding-inline: clamp(32px, 8vw, 120px);
  color: #f2f2f2;
  background: #383838;
}

.jtoz-projects__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.jtoz-projects__heading {
  margin: 0 0 clamp(48px, 6vw, 78px);
  padding: 0;
  color: #f2f2f2;
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-align: left;
}

.jtoz-projects__slash {
  color: #ffba12;
  font-weight: 400;
}

.jtoz-projects__grid {
  display: flex;
  width: 100%;
  height: clamp(520px, 54vw, 720px);
  min-height: 520px;
  overflow: hidden;
  background: #242424;
}

.jtoz-project {
  position: relative;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  outline: 0;
  cursor: pointer;
  transition: flex-grow 620ms ease;
}

.jtoz-project.is-active {
  flex-grow: 3;
  cursor: default;
}

.jtoz-projects__grid--1 .jtoz-project {
  flex-grow: 1;
}

.jtoz-project__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) brightness(0.68);
  transition: filter 620ms ease;
}

.jtoz-project.is-active .jtoz-project__image {
  filter: none;
}

.jtoz-project__image--placeholder {
  background: linear-gradient(145deg, #474747, #242424);
}

.jtoz-project__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 186, 18, 0.74);
  transition: background-color 620ms ease, opacity 620ms ease;
}

.jtoz-project.is-active .jtoz-project__overlay {
  background: linear-gradient(0deg, rgba(15, 15, 15, 0.82) 0%, rgba(15, 15, 15, 0.08) 70%);
}

.jtoz-project__caption {
  position: absolute;
  z-index: 1;
  right: clamp(22px, 3vw, 46px);
  bottom: clamp(28px, 4vw, 58px);
  left: clamp(22px, 3vw, 46px);
  min-width: 250px;
  color: #fff;
}

.jtoz-project:not(.is-active) .jtoz-project__caption {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.jtoz-project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jtoz-project__title {
  margin: 0;
  color: #fff;
  font-size: clamp(23px, 2.4vw, 38px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: left;
}

@media (min-width: 769px) {
  .jtoz-project:not(.is-active) .jtoz-project__caption {
    right: 16px;
    left: 16px;
    width: auto;
    max-width: calc(100% - 32px);
    min-width: 0;
    box-sizing: border-box;
  }

  .jtoz-project:not(.is-active) .jtoz-project__title {
    max-width: 100%;
    font-size: clamp(20px, 1.65vw, 25px);
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
  }

  .jtoz-project:not(.is-active) .jtoz-project__meta {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

.jtoz-project__details {
  max-width: 680px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 260ms ease 180ms, transform 260ms ease 180ms, visibility 0s linear 620ms, max-height 620ms ease;
}

.jtoz-project.is-active .jtoz-project__details {
  max-height: 230px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 300ms ease 240ms, transform 300ms ease 240ms, max-height 620ms ease;
}

.jtoz-project__description {
  margin: 20px 0 18px;
  color: #e0e0e0;
  font-size: 15px;
  line-height: 1.8;
}

.jtoz-project__link,
.jtoz-projects__all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 16px;
  padding: 9px 0 7px;
  color: #fff;
  border-bottom: 1px solid #ffba12;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.jtoz-project__link:hover,
.jtoz-project__link:focus-visible,
.jtoz-projects__all:hover,
.jtoz-projects__all:focus-visible {
  color: #ffba12;
  border-color: #fff;
  text-decoration: none;
}

.jtoz-project:focus-visible {
  box-shadow: inset 0 0 0 2px #ffba12;
}

.jtoz-project__link:focus-visible,
.jtoz-projects__all:focus-visible {
  outline: 2px solid #ffba12;
  outline-offset: 4px;
}

.jtoz-projects__indicators {
  display: none;
}

.jtoz-projects__all-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 34px;
}

.jtoz-projects__all {
  color: #e8e8e8;
}

@media (max-width: 768px) {
  .jtoz-projects {
    padding-block: 72px;
    padding-inline: 24px;
  }

  .jtoz-projects__heading {
    margin-bottom: 46px;
    font-size: clamp(28px, 8.5vw, 38px);
  }

  .jtoz-projects__grid {
    height: clamp(500px, 142vw, 620px);
    min-height: 500px;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    background: transparent;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .jtoz-projects__grid::-webkit-scrollbar {
    display: none;
  }

  .jtoz-project,
  .jtoz-project.is-active,
  .jtoz-projects__grid--1 .jtoz-project {
    min-width: 100%;
    flex: 0 0 100%;
    scroll-snap-align: start;
    cursor: default;
    transition: none;
  }

  .jtoz-project__overlay,
  .jtoz-project.is-active .jtoz-project__overlay {
    background: linear-gradient(0deg, rgba(15, 15, 15, 0.84) 0%, rgba(15, 15, 15, 0.08) 72%);
    transition: none;
  }

  .jtoz-project__image,
  .jtoz-project.is-active .jtoz-project__image {
    filter: none;
    transition: none;
  }

  .jtoz-project__caption {
    right: 25px;
    bottom: 30px;
    left: 25px;
    min-width: 0;
  }

  .jtoz-project__title {
    font-size: clamp(25px, 8vw, 34px);
  }

  .jtoz-project__details,
  .jtoz-project.is-active .jtoz-project__details {
    max-height: 260px;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .jtoz-project__description {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.75;
  }

  .jtoz-projects__indicators {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 22px;
  }

  .jtoz-projects__indicator {
    width: 32px;
    height: 20px;
    margin: 0;
    padding: 9px 0;
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .jtoz-projects__indicator::before {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.32);
    content: "";
  }

  .jtoz-projects__indicator.is-active::before {
    background: #ffba12;
  }

  .jtoz-projects__all-wrap {
    margin-top: 24px;
  }

  .jtoz-projects__all {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jtoz-project,
  .jtoz-project__image,
  .jtoz-project__overlay,
  .jtoz-project__details {
    transition-duration: 0.01ms;
  }

  .jtoz-projects__grid {
    scroll-behavior: auto;
  }
}
