/* Qalereya — Açıq kart. Desktop 4921:39636, Mobile 5668:26806. */

.aayda-gallery-detail-page {
  background-color: var(--aayda-colors-surface-disabled);
}

.aayda-gallery-detail {
  width: 100%;
  min-width: 0;
  padding: 20px 0 40px;
}

.aayda-gallery-detail__inner {
  display: flex;
  flex-direction: column;
  width: calc(100% - 32px);
  max-width: 370px;
  margin-inline: auto;
}

.aayda-gallery-detail__album {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 38px;
}

.aayda-gallery-detail__album-body {
  display: flex;
  flex-direction: column;
  gap: var(--aayda-numbers-spacing-20);
  width: 100%;
}

.aayda-gallery-detail__heading {
  display: flex;
  flex-direction: column;
  gap: var(--aayda-numbers-spacing-16);
  width: 100%;
}

.aayda-gallery-detail__title {
  margin: 0;
  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);
  color: var(--aayda-colors-text);
}

.aayda-gallery-detail__lead {
  margin: 0;
  width: 100%;
  font-size: var(--aayda-typography-size-14);
  font-weight: var(--aayda-typography-weight-medium);
  line-height: var(--aayda-typography-line-height-14);
  letter-spacing: var(--aayda-typography-letter-spacing-14);
  color: var(--aayda-colors-navy-900);
  white-space: pre-wrap;
}

.aayda-gallery-detail__media {
  display: flex;
  flex-direction: column;
  gap: var(--aayda-numbers-spacing-20);
  width: 100%;
}

.aayda-gallery-detail__photos--desktop {
  display: none;
}

.aayda-gallery-detail__photos--mobile {
  display: flex;
  flex-direction: column;
  gap: var(--aayda-numbers-spacing-20);
  width: 100%;
}

.aayda-gallery-detail__photo,
.aayda-gallery-detail__photo-link {
  display: block;
  width: 370px;
  max-width: 100%;
  height: 244px;
  overflow: hidden;
  border-radius: var(--aayda-radius-image);
}

.aayda-gallery-detail__photo img,
.aayda-gallery-detail__photo-link img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  /* FOTO-9B: scaled to fill the tile and cropped, never stretched — the static page's "fill" bent
     any photo that was not the tile's shape. The road and crossing galleries crop the same way. */
  object-fit: cover;
  object-position: center;
  /* FOTO-8: the frame shows the site's image placeholder tint (the crossing gallery's) while the
     photo downloads; the loaded photo fills the same box and covers it. On the image itself rather
     than the frame, so nothing is tinted where there is no image. */
  background-color: var(--aayda-colors-news-tab-active-fill);
}

/* The related cards reuse the news card; only the album page tints their covers while loading. */
.aayda-gallery-detail-page .aayda-news-page__card-media img {
  background-color: var(--aayda-colors-news-tab-active-fill);
}

.aayda-gallery-detail__photo-link--crop img {
  width: 117.52%;
  max-width: none;
  height: 100%;
  margin-left: -8.08%;
  object-fit: fill;
}

/* The share row and the related albums are shown at every width (FOTO-7, decisions D1 and D2).
 * Below 1416px both take the news article's mobile-first layout — the share row is
 * .aayda-news-detail__share and the section also carries .aayda-news-detail__related, both from
 * news-detail.css — and the album page's own desktop placement stays in the 1416px block below.
 * The section sits as far below the album as the news article's does (its 20px column gap). */
.aayda-gallery-detail__related {
  margin-top: var(--aayda-numbers-spacing-20);
}

@media (min-width: 768px) and (max-width: 1415px) {
  .aayda-gallery-detail__inner {
    width: calc(100% - 32px);
    max-width: 100%;
    min-width: 0;
  }

  .aayda-gallery-detail__photos--mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--aayda-numbers-spacing-20);
    width: 100%;
    min-width: 0;
  }

  .aayda-gallery-detail__photo,
  .aayda-gallery-detail__photo-link {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1416px) {
  .aayda-gallery-detail {
    padding: 40px 0 100px;
  }

  .aayda-gallery-detail__inner {
    width: 1272px;
    max-width: none;
    margin-inline: auto;
  }

  /*
   * Figma Frame 1618874227 in 4921:39636: 1272 wide, padding 60 on every side, and the share row
   * (Share/Section) its last child, ending 60 above the card's bottom edge. Figma's 1082 is that
   * padding around its own heading, grid and share row; the card takes its height from the content
   * here, so the row keeps those 60px whatever the title and description run to. A fixed 1082 left
   * 101px under the row without a description and pushed it out of the card under a long title.
   */
  .aayda-gallery-detail__album {
    box-sizing: border-box;
    width: 1272px;
    margin-top: 40px;
    padding: 60px;
    background: var(--aayda-colors-neutral-surface-subtle);
    border-radius: 12px;
  }

  .aayda-gallery-detail__album-body {
    gap: 46px;
    width: 1152px;
  }

  .aayda-gallery-detail__heading {
    width: 628px;
    gap: 1px;
  }

  .aayda-gallery-detail__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);
  }

  .aayda-gallery-detail__lead {
    width: 514px;
    font-weight: var(--aayda-typography-weight-semi-bold);
  }

  .aayda-gallery-detail__media {
    gap: 43px;
    width: 100%;
  }

  .aayda-gallery-detail__photos--mobile {
    display: none;
  }

  /* As tall as its rows: 711px is the design's nine photos (3 × 221 + 2 × 24). A fixed 711 stretched
   * the rows of a shorter album (four photos sat 146px apart, a single row left 490px empty below it)
   * and let a longer one run over the share row. align-content keeps every row 221px and 24px apart. */
  .aayda-gallery-detail__photos--desktop {
    display: grid;
    grid-template-columns: 368px 368px 368px;
    grid-auto-rows: 221px;
    align-content: start;
    column-gap: 24px;
    row-gap: 24px;
    width: 1152px;
    height: auto;
  }

  .aayda-gallery-detail__photo,
  .aayda-gallery-detail__photo-link {
    width: 368px;
    height: 221px;
  }

  .aayda-gallery-detail-page .aayda-gallery-detail__share {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 1152px;
    height: 79px;
    margin: 0;
    padding: 20px 0 16px;
    border-top: 1px solid rgba(210, 216, 234, 0.69);
  }

  .aayda-gallery-detail-page .aayda-news-detail__share-actions {
    flex-direction: row;
    gap: var(--aayda-numbers-spacing-8);
    align-items: center;
    width: auto;
  }

  .aayda-gallery-detail__related {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 1272px;
    margin-top: 68px;
  }

  .aayda-gallery-detail__related .aayda-news-detail__related-header {
    height: 47px;
  }

  .aayda-gallery-detail__related .aayda-news-detail__related-title {
    width: auto;
    font-size: var(--aayda-typography-size-36);
    line-height: var(--aayda-typography-line-height-36);
    letter-spacing: var(--aayda-typography-letter-spacing-36);
    white-space: nowrap;
  }

  .aayda-gallery-detail__related .aayda-news-detail__all--header {
    display: inline-flex;
  }

  .aayda-gallery-detail__all-label-default,
  .aayda-gallery-detail__all-label-hover {
    font-size: var(--aayda-typography-size-20);
    font-weight: var(--aayda-typography-weight-semi-bold);
    line-height: var(--aayda-typography-line-height-20);
    letter-spacing: var(--aayda-typography-letter-spacing-20);
    white-space: nowrap;
  }

  .aayda-gallery-detail__all-label-hover {
    display: none;
  }

  .aayda-gallery-detail-page .aayda-news-detail__all:hover .aayda-gallery-detail__all-label-default,
  .aayda-gallery-detail-page .aayda-news-detail__all:focus-visible .aayda-gallery-detail__all-label-default {
    display: none;
  }

  .aayda-gallery-detail-page .aayda-news-detail__all:hover .aayda-gallery-detail__all-label-hover,
  .aayda-gallery-detail-page .aayda-news-detail__all:focus-visible .aayda-gallery-detail__all-label-hover {
    display: inline;
  }

  .aayda-gallery-detail-page .aayda-news-page__card {
    background: var(--aayda-colors-neutral-surface-subtle);
  }
}

.aayda-inner-page-root.is-gallery-viewer-open,
.aayda-gallery-detail-page.is-gallery-viewer-open {
  overflow: hidden;
}

.aayda-gallery-detail-viewer[hidden] {
  display: none;
}

.aayda-gallery-detail-viewer:not([hidden]) {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--aayda-colors-base-black, #000000);
  backdrop-filter: blur(12px);
  /* A horizontal stroke is the viewer's swipe (gallery-detail.js), not the browser's back/forward
     gesture; vertical panning and pinch-zoom stay the browser's. */
  touch-action: pan-y pinch-zoom;
  overscroll-behavior: contain;
}

.aayda-gallery-detail-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-detail-viewer__title {
  display: none;
}

.aayda-gallery-detail-viewer__close {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.aayda-gallery-detail-viewer__close img {
  display: block;
  width: 15px;
  height: 15px;
}

.aayda-gallery-detail-viewer__close-end {
  position: absolute;
  top: 20px;
  left: 282px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.aayda-gallery-detail-viewer__close-end img {
  display: block;
  width: 16px;
  height: 16px;
}

.aayda-gallery-detail-viewer__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.aayda-gallery-detail-viewer__arrow {
  display: none;
}

.aayda-gallery-detail-viewer__figure {
  box-sizing: border-box;
  position: absolute;
  top: 290px;
  left: 0;
  display: block;
  width: 100%;
  height: 237px;
  margin: 0;
  overflow: hidden;
}

.aayda-gallery-detail-viewer__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  /* FOTO-9B: the whole photo, undistorted, letterboxed on the viewer's dark backdrop. */
  object-fit: contain;
  object-position: center;
}

.aayda-gallery-detail-viewer__counter {
  position: absolute;
  z-index: 2;
  top: 42px;
  left: 178px;
  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;
}

.aayda-gallery-detail-viewer__counter-desktop {
  display: none;
}

.aayda-gallery-detail-viewer__thumbs {
  display: none;
}

.aayda-gallery-detail-viewer__caption {
  box-sizing: border-box;
  position: absolute;
  bottom: 0;
  left: 0;
  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-detail-viewer:not([hidden]) {
    backdrop-filter: blur(20px);
  }

  .aayda-gallery-detail-viewer__header {
    justify-content: space-between;
    width: 100%;
    height: 70px;
    min-height: 70px;
    padding: 10px 32px;
    background: #191919;
  }

  .aayda-gallery-detail-viewer__title {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--aayda-colors-base-white, #ffffff);
    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-detail-viewer__close-end {
    display: none;
  }

  .aayda-gallery-detail-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-detail-viewer__arrow {
    position: absolute;
    z-index: 1;
    display: block;
    width: 56px;
    height: 56px;
  }

  .aayda-gallery-detail-viewer__arrow img {
    display: block;
    width: 56px;
    height: 56px;
    max-width: none;
  }

  .aayda-gallery-detail-viewer__arrow--prev {
    top: 350px;
    left: 84px;
  }

  .aayda-gallery-detail-viewer__arrow--next {
    top: 352px;
    left: 1300px;
  }

  .aayda-gallery-detail-viewer__figure {
    position: static;
    top: auto;
    left: auto;
    width: 1056px;
    height: 566px;
    margin: 57px 192px 0;
    overflow: hidden;
    border-radius: var(--aayda-radius-image);
  }

  .aayda-gallery-detail-viewer__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .aayda-gallery-detail-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);
    text-align: center;
    transform: none;
  }

  .aayda-gallery-detail-viewer__counter-desktop {
    display: inline;
  }

  .aayda-gallery-detail-viewer__counter-mobile {
    display: 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-detail-viewer__thumbs {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    /* 1058px, but never past the viewer's right edge: the row starts at 192px plus the photo's inset, so a
       portrait or square photo would otherwise push it off-screen between 1416px and about 1700px. The
       body is the viewer's full width up to 1440px, and the strip has no padding or border. */
    width: min(1058px, calc(100% - 192px - var(--aayda-gallery-thumbs-inset, 0px)));
    height: 81px;
    margin: 26px 192px 0;
    /* The first thumbnail starts on the shown photo's left edge: the figure's own 192px, plus how far
       the photo, drawn whole and centred, sits in from the frame (--aayda-gallery-thumbs-inset, measured
       by the page script; 0 until then). */
    margin-left: calc(192px + var(--aayda-gallery-thumbs-inset, 0px));
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .aayda-gallery-detail-viewer__thumbs::-webkit-scrollbar {
    display: none;
  }

  .aayda-gallery-detail-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-detail-viewer__thumb:nth-child(3n + 2) {
    flex-basis: 110px;
    width: 110px;
  }

  .aayda-gallery-detail-viewer__thumb.is-current {
    border-color: var(--aayda-colors-blue-400);
  }

  .aayda-gallery-detail-viewer__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    /* FOTO-9B: every thumbnail the same size, cropped rather than stretched. */
    object-fit: cover;
  }

  .aayda-gallery-detail-viewer__caption {
    display: none;
  }
}
