/* Four real workshop photographs in a restrained, reference-inspired carousel. */
body.home .ct-factory-gallery {
  --ct-gallery-gap: 24px;
  box-sizing: border-box;
  width: min(76vw, 1880px);
  max-width: calc(100% - 40px);
  margin: clamp(64px, 5vw, 96px) auto clamp(72px, 6vw, 112px);
}

body.home .ct-factory-gallery__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.home .ct-factory-gallery__viewport { overflow: hidden; }
body.home .ct-factory-gallery__track {
  display: flex;
  gap: var(--ct-gallery-gap);
  align-items: stretch;
  will-change: transform;
}
body.home .ct-factory-gallery__card {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 calc((100% - 3 * var(--ct-gallery-gap)) / 4);
  aspect-ratio: 1 / 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #e7e9e9;
}
body.home .ct-factory-gallery__card > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .5s ease;
}
body.home .ct-factory-gallery__card:hover > img { transform: scale(1.035); }
body.home .ct-factory-gallery__caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  column-gap: 16px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 10px 20px;
  color: #fff;
  background: rgba(34, 35, 38, .94);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  transition: background-color .25s ease;
}
body.home .ct-factory-gallery__caption > span { min-width: 0; }
body.home .ct-factory-gallery__description {
  grid-column: 1 / -1;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: max-height .3s ease, margin-top .3s ease, opacity .2s ease;
}
body.home .ct-factory-gallery__card:is(:hover, :focus-within) .ct-factory-gallery__caption {
  background: rgba(24, 25, 27, .92);
}
body.home .ct-factory-gallery__card:is(:hover, :focus-within) .ct-factory-gallery__description {
  max-height: 90px;
  margin-top: 9px;
  opacity: 1;
}
body.home .ct-factory-gallery__expand,
body.home .ct-factory-gallery__arrow,
body.home .ct-factory-gallery__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
  font: inherit;
}
body.home .ct-factory-gallery__expand {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #fff;
  background: transparent;
  font-size: 23px;
  line-height: 1;
  transition: transform .2s ease;
}
body.home .ct-factory-gallery__expand:hover { transform: translate(2px, -2px); }
body.home .ct-factory-gallery__controls {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding-top: 34px;
  padding-right: 12%;
}
body.home .ct-factory-gallery__arrow {
  width: 38px;
  height: 38px;
  padding: 0;
  color: #e6232b;
  background: transparent;
  font-size: 29px;
  line-height: 1;
  transition: transform .2s ease, color .2s ease;
}
body.home .ct-factory-gallery__arrow:hover { color: #e6232b; transform: scale(1.14); }
body.home .ct-factory-gallery__arrow:disabled { opacity: .5; cursor: wait; }
body.home .ct-factory-gallery :is(button):focus-visible {
  outline: 2px solid #e6232b;
  outline-offset: 3px;
}
body.home .ct-factory-gallery__dialog {
  width: min(90vw, 1180px);
  max-height: 90vh;
  box-sizing: border-box;
  padding: 16px;
  border: 0;
  background: #fff;
  box-shadow: 0 24px 70px #0005;
}
body.home .ct-factory-gallery__dialog::backdrop { background: #000b; }
body.home .ct-factory-gallery__dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 84px);
  margin-inline: auto;
  object-fit: contain;
}
body.home .ct-factory-gallery__dialog p { margin: 12px 40px 0 0; font-weight: 600; }
body.home .ct-factory-gallery__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: #222326;
  font-size: 26px;
}

@media (max-width: 1200px) {
  body.home .ct-factory-gallery { width: 88vw; }
  body.home .ct-factory-gallery__card { flex-basis: calc((100% - var(--ct-gallery-gap)) / 2); }
}
@media (max-width: 700px) {
  body.home .ct-factory-gallery { --ct-gallery-gap: 16px; width: calc(100% - 40px); margin-block: 52px 72px; }
  body.home .ct-factory-gallery__card { flex-basis: 84%; aspect-ratio: 1 / 1.03; }
  body.home .ct-factory-gallery__caption { min-height: 48px; padding-inline: 15px; font-size: 14px; }
  body.home .ct-factory-gallery__controls { padding-top: 18px; padding-right: 0; }
}
@media (hover: none) {
  body.home .ct-factory-gallery__description {
    max-height: 90px;
    margin-top: 9px;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.home .ct-factory-gallery__card > img,
  body.home .ct-factory-gallery__caption,
  body.home .ct-factory-gallery__description,
  body.home .ct-factory-gallery__expand,
  body.home .ct-factory-gallery__arrow { transition: none; }
}
