/* Keçidlər — Qalereya — Açıq kart — Desktop 5869:39768, Mobile 5869:39785 */

.aayda-crossing-gallery-page {
  background-color: var(--aayda-colors-surface-disabled);
}

.aayda-crossing-gallery {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 20px 16px 100px;
}

.aayda-crossing-gallery-page .aayda-breadcrumbs {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

/* ML-E D6: the five-level trail (… • tunnel name • Photo gallery) wraps, as the shared breadcrumb
   does, instead of running past a narrow viewport on one line. A trail that fits is unchanged. */
.aayda-crossing-gallery-page .aayda-breadcrumbs__list {
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
}

/* ML-E D6: here the long crumb is the record's own link (its name), one level above "Photo
   gallery", so it may shrink to an ellipsis too when it is too long for a line of its own. */
/* This trail still wraps (its long crumb is an ancestor): its current crumb keeps the sizing it had before the shared
   breadcrumb became a single line (breadcrumbs.css), so it moves to a line of its own rather than shrinking. */
.aayda-crossing-gallery-page .aayda-breadcrumbs__item:last-child {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.aayda-crossing-gallery-page .aayda-breadcrumbs__item {
  min-width: 0;
  max-width: 100%;
}

.aayda-crossing-gallery-page .aayda-breadcrumbs__link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aayda-crossing-gallery__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  min-width: 0;
  margin-top: 38px;
}

.aayda-crossing-gallery__title {
  margin: 0;
  color: var(--aayda-colors-gray-800);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-24);
  font-weight: var(--aayda-typography-weight-medium);
  line-height: var(--aayda-typography-line-height-heading-24);
  letter-spacing: var(--aayda-typography-letter-spacing-24);
}

.aayda-crossing-gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aayda-crossing-gallery__item {
  box-sizing: border-box;
  width: 100%;
  height: 244px;
  overflow: hidden;
  border-radius: var(--aayda-radius-image);
}

.aayda-crossing-gallery__trigger {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.aayda-crossing-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.aayda-crossing-gallery__item:first-child .aayda-crossing-gallery__image--mobile {
  position: absolute;
  top: 0;
  left: -8.08%;
  width: 117.52%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

.aayda-crossing-gallery__image--desktop {
  display: none;
}

.aayda-crossing-gallery__image--mobile {
  display: block;
}

@media (min-width: 768px) and (max-width: 1415px) {
  .aayda-crossing-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--aayda-numbers-spacing-20);
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1416px) {
  .aayda-crossing-gallery {
    width: 1440px;
    max-width: 100%;
    margin: 0 auto;
    padding: 42px 84px 142px;
  }

  .aayda-crossing-gallery-page .aayda-breadcrumbs__list {
    width: fit-content;
    max-width: none;
  }

  .aayda-crossing-gallery__content {
    gap: 41px;
    width: 1272px;
    margin-top: 61px;
  }

  .aayda-crossing-gallery__title {
    font-size: var(--aayda-typography-size-32);
    font-weight: var(--aayda-typography-weight-semi-bold);
    line-height: var(--aayda-typography-line-height-heading-32);
    letter-spacing: var(--aayda-typography-letter-spacing-32);
    white-space: nowrap;
  }

  .aayda-crossing-gallery__grid {
    grid-template-columns: repeat(3, 408px);
    gap: 24px;
    width: 1272px;
  }

  .aayda-crossing-gallery__item {
    width: 408px;
    height: 245px;
  }

  .aayda-crossing-gallery__image--desktop {
    display: block;
  }

  .aayda-crossing-gallery__image--mobile {
    display: none;
  }
}

/* Lightbox — Desktop 4921:39921, Mobile 5662:24357 */

.aayda-gallery-viewer[hidden] {
  display: none;
}

.aayda-gallery-viewer {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000000;
  backdrop-filter: blur(12px);
}

.aayda-gallery-viewer__header {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 72px;
  padding: 32px 13px 0;
}

.aayda-gallery-viewer__title {
  display: none;
}

.aayda-gallery-viewer__close {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.aayda-gallery-viewer__close img {
  display: block;
  width: 15px;
  height: 15px;
}

.aayda-gallery-viewer__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.aayda-gallery-viewer__arrow {
  display: none;
}

.aayda-gallery-viewer__figure {
  box-sizing: border-box;
  position: absolute;
  top: 290px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 237px;
  margin: 0;
  overflow: hidden;
  touch-action: none;
}

.aayda-gallery-viewer__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  border-radius: var(--aayda-radius-image);
}

.aayda-gallery-viewer__image--mobile-offset {
  position: relative;
  left: -8.08%;
  width: 117.52%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

.aayda-gallery-viewer__counter {
  position: absolute;
  z-index: 2;
  top: 42px;
  left: 50%;
  margin: 0;
  color: var(--aayda-colors-base-white, #ffffff);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-14);
  font-weight: var(--aayda-typography-weight-bold);
  line-height: var(--aayda-typography-line-height-14);
  letter-spacing: var(--aayda-typography-letter-spacing-14);
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}

.aayda-gallery-viewer__thumbs {
  display: none;
}

.aayda-gallery-viewer__caption {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 20px 12px;
  overflow: hidden;
  color: var(--aayda-colors-base-white, #ffffff);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-16);
  font-weight: var(--aayda-typography-weight-bold);
  line-height: var(--aayda-typography-line-height-16);
  letter-spacing: var(--aayda-typography-letter-spacing-16);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(22, 22, 22, 0.72);
}

@media (min-width: 1416px) {
  .aayda-gallery-viewer {
    backdrop-filter: blur(20px);
  }

  .aayda-gallery-viewer__header {
    justify-content: space-between;
    width: 100%;
    height: 70px;
    min-height: 70px;
    padding: 10px 32px;
    background: #191919;
  }

  .aayda-gallery-viewer__title {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--aayda-colors-base-white, #ffffff);
    font-family: var(--aayda-typography-font-primary);
    font-size: var(--aayda-typography-size-18);
    font-weight: var(--aayda-typography-weight-medium);
    line-height: var(--aayda-typography-line-height-18);
    letter-spacing: var(--aayda-typography-letter-spacing-18);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .aayda-gallery-viewer__body {
    position: relative;
    flex: 1 1 auto;
    align-items: stretch;
    justify-content: flex-start;
    width: 1440px;
    max-width: 100%;
    /* The design frame is 1440 × 900 and its content stack about 850px tall. Up to 900px of viewport
       height nothing moves; on a taller viewport (a 4K or high-resolution display) the stack moves down
       by half the extra height, so it is centred instead of leaving the black area below it. The arrows
       are positioned from this box, so they move with the image. dvh overrides the vh fallback. */
    margin: max(0px, calc((100vh - 900px) / 2)) auto 0;
    margin: max(0px, calc((100dvh - 900px) / 2)) auto 0;
  }

  .aayda-gallery-viewer__arrow {
    position: absolute;
    z-index: 1;
    display: block;
    width: 56px;
    height: 56px;
  }

  .aayda-gallery-viewer__arrow img {
    display: block;
    width: 56px;
    height: 56px;
    max-width: none;
  }

  .aayda-gallery-viewer__arrow--prev {
    top: 350px;
    left: 84px;
  }

  .aayda-gallery-viewer__arrow--next {
    top: 352px;
    left: 1300px;
  }

  .aayda-gallery-viewer__figure {
    position: static;
    top: auto;
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1056px;
    height: 566px;
    margin: 57px 192px 0;
    border-radius: var(--aayda-radius-image);
  }

  .aayda-gallery-viewer__counter {
    position: static;
    z-index: auto;
    top: auto;
    left: auto;
    width: 100%;
    margin: 24px 0 0;
    font-size: var(--aayda-typography-size-20);
    font-weight: var(--aayda-typography-weight-medium);
    line-height: var(--aayda-typography-line-height-20);
    letter-spacing: var(--aayda-typography-letter-spacing-20);
    transform: none;
  }

  /* Nine thumbnails fill the 1058px strip (4921:39933), packed from the left with 10px gaps; more scroll
     sideways, and the script keeps the current one in view. */
  .aayda-gallery-viewer__thumbs {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    width: 1058px;
    height: 81px;
    margin: 26px 192px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .aayda-gallery-viewer__thumbs::-webkit-scrollbar {
    display: none;
  }

  .aayda-gallery-viewer__thumb {
    box-sizing: border-box;
    flex: 0 0 108px;
    width: 108px;
    height: 81px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: var(--aayda-radius-button);
  }

  .aayda-gallery-viewer__thumb:nth-child(3n + 2) {
    flex-basis: 110px;
    width: 110px;
  }

  .aayda-gallery-viewer__thumb.is-current {
    border-color: var(--aayda-colors-blue-400);
  }

  .aayda-gallery-viewer__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
  }

  .aayda-gallery-viewer__caption {
    display: none;
  }
}
