﻿@layer components {
  body.home .wp-site-blocks .clx-home-main .alignwide.chinalux-gallery-block,
  .editor-styles-wrapper .alignwide.chinalux-gallery-block {
    --clx-home-frame: min(calc(100vw - 76px), 1688px);
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: var(--clx-home-frame) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: var(--clx-home-frame) !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block > .clx-home-gallery-header,
  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block > .clx-home-gallery,
  .editor-styles-wrapper .chinalux-gallery-block > .clx-home-gallery-header,
  .editor-styles-wrapper .chinalux-gallery-block > .clx-home-gallery {
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .clx-home-gallery-header,
  .editor-styles-wrapper .chinalux-gallery-block .clx-home-gallery-header {
    align-items: center !important;
    display: grid !important;
    gap: clamp(18px, 2vw, 32px) !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    margin-block: clamp(48px, 4.8vw, 78px) clamp(24px, 2.4vw, 38px) !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-heading,
  .editor-styles-wrapper .chinalux-gallery-heading {
    min-width: 0;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block h2,
  .editor-styles-wrapper .chinalux-gallery-block h2 {
    color: var(--wp--preset--color--navy-950, #020b2f);
    font-size: clamp(2.2rem, 2.45vw, 3rem) !important;
    line-height: 1.08 !important;
    margin: 0 !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-intro,
  .editor-styles-wrapper .chinalux-gallery-intro {
    color: var(--wp--preset--color--navy-700, rgba(3, 11, 47, .72));
    font-size: clamp(1rem, 1vw, 1.15rem);
    line-height: 1.5;
    margin: 10px 0 0;
    max-width: 720px;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-controls,
  .editor-styles-wrapper .chinalux-gallery-controls {
    align-items: center !important;
    display: flex !important;
    gap: 14px !important;
    justify-self: end !important;
    margin: 0 !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-control,
  .editor-styles-wrapper .chinalux-gallery-control {
    align-items: center !important;
    aspect-ratio: 1;
    background: #fff !important;
    border: 1px solid rgba(3, 11, 47, .11) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 20px rgba(12, 34, 58, .075) !important;
    color: transparent !important;
    cursor: pointer;
    display: inline-flex !important;
    flex: 0 0 54px !important;
    font-size: 0 !important;
    font-weight: 900 !important;
    height: 54px !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    user-select: none;
    width: 54px !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-control::before,
  .editor-styles-wrapper .chinalux-gallery-control::before {
    color: var(--wp--preset--color--chinalux-red, #ed0000);
    content: "\2039";
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-1px);
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-next::before,
  .editor-styles-wrapper .chinalux-gallery-next::before {
    content: "\203A";
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-control:hover,
  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-control:focus-visible,
  .editor-styles-wrapper .chinalux-gallery-control:hover,
  .editor-styles-wrapper .chinalux-gallery-control:focus-visible {
    border-color: rgba(0, 164, 220, .28) !important;
    box-shadow: 0 14px 30px rgba(12, 34, 58, .12) !important;
    outline: 2px solid transparent;
    transform: translateY(-1px);
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-track,
  .editor-styles-wrapper .chinalux-gallery-track {
    --clx-gallery-gap: clamp(24px, 2.2vw, 40px);
    align-items: stretch;
    box-sizing: border-box;
    display: flex !important;
    gap: var(--clx-gallery-gap) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    padding: 0 0 8px !important;
    scroll-behavior: smooth;
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
    width: 100% !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-track::-webkit-scrollbar,
  .editor-styles-wrapper .chinalux-gallery-track::-webkit-scrollbar {
    display: none;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item,
  .editor-styles-wrapper .chinalux-gallery-item {
    flex: 0 0 calc((100% - (var(--clx-gallery-gap) * 3)) * .72 / 4.46) !important;
    margin: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    scroll-snap-align: start;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item:nth-child(4n+2),
  .editor-styles-wrapper .chinalux-gallery-item:nth-child(4n+2) {
    flex-basis: calc((100% - (var(--clx-gallery-gap) * 3)) * .92 / 4.46) !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item:nth-child(4n+3),
  .editor-styles-wrapper .chinalux-gallery-item:nth-child(4n+3) {
    flex-basis: calc((100% - (var(--clx-gallery-gap) * 3)) * 1.5 / 4.46) !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item:nth-child(4n),
  .editor-styles-wrapper .chinalux-gallery-item:nth-child(4n) {
    background-image: none !important;
    flex-basis: calc((100% - (var(--clx-gallery-gap) * 3)) * 1.32 / 4.46) !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item-button,
  .editor-styles-wrapper .chinalux-gallery-item-button {
    appearance: none;
    background: transparent !important;
    border: 0 !important;
    border-radius: 8px;
    box-shadow: none !important;
    cursor: zoom-in;
    display: block;
    margin: 0;
    padding: 0 !important;
    width: 100%;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item-button:disabled,
  .editor-styles-wrapper .chinalux-gallery-item-button:disabled {
    cursor: default;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item-button:focus-visible,
  .editor-styles-wrapper .chinalux-gallery-item-button:focus-visible {
    outline: 3px solid var(--wp--preset--color--chinalux-blue, #009fda);
    outline-offset: 4px;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item img,
  .editor-styles-wrapper .chinalux-gallery-item img {
    aspect-ratio: 16 / 9 !important;
    border-radius: 8px !important;
    display: block;
    height: 100% !important;
    min-height: clamp(190px, 12vw, 245px) !important;
    object-fit: cover !important;
    opacity: 1 !important;
    width: 100% !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-caption,
  .editor-styles-wrapper .chinalux-gallery-caption {
    color: var(--wp--preset--color--navy-700, rgba(3, 11, 47, .72));
    font-size: .9rem;
    margin-top: 10px;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-empty,
  .editor-styles-wrapper .chinalux-gallery-empty {
    background: rgba(255, 255, 255, .92);
    border: 1px dashed rgba(3, 11, 47, .18);
    border-radius: 12px;
    color: var(--wp--preset--color--navy-700, rgba(3, 11, 47, .72));
    padding: 28px;
  }

  @media (max-width: 1023px) {
    body.home .wp-site-blocks .clx-home-main .alignwide.chinalux-gallery-block,
    .editor-styles-wrapper .alignwide.chinalux-gallery-block {
      --clx-home-frame: min(calc(100vw - 40px), 1688px);
    }

    body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item,
    body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item:nth-child(n),
    .editor-styles-wrapper .chinalux-gallery-item,
    .editor-styles-wrapper .chinalux-gallery-item:nth-child(n) {
      flex-basis: calc((100% - var(--clx-gallery-gap)) / 2) !important;
    }
  }

  @media (max-width: 767px) {
    body.home .wp-site-blocks .clx-home-main .alignwide.chinalux-gallery-block,
    .editor-styles-wrapper .alignwide.chinalux-gallery-block {
      --clx-home-frame: min(calc(100vw - 28px), 1688px);
    }

    body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .clx-home-gallery-header,
    .editor-styles-wrapper .chinalux-gallery-block .clx-home-gallery-header {
      grid-template-columns: 1fr auto !important;
      margin-block-start: 42px !important;
    }

    body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item,
    body.home .wp-site-blocks .clx-home-main .chinalux-gallery-item:nth-child(n),
    .editor-styles-wrapper .chinalux-gallery-item,
    .editor-styles-wrapper .chinalux-gallery-item:nth-child(n) {
      flex-basis: min(84vw, 560px) !important;
    }
  }
}

.chinalux-gallery-lightbox-open {
  overflow: hidden;
}

.chinalux-gallery-lightbox {
  align-items: center;
  background: rgba(2, 11, 47, .86);
  display: none;
  inset: 0;
  justify-content: center;
  padding: clamp(22px, 4vw, 64px);
  position: fixed;
  z-index: 99999;
}

.chinalux-gallery-lightbox.is-open {
  display: flex;
}

.chinalux-gallery-lightbox__figure {
  margin: 0;
  max-height: min(78vh, 900px);
  max-width: min(86vw, 1320px);
}

.chinalux-gallery-lightbox__image {
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
  display: block;
  max-height: 78vh;
  max-width: 100%;
  object-fit: contain;
}

.chinalux-gallery-lightbox__caption {
  color: #fff;
  font-size: 1rem;
  margin-top: 14px;
  text-align: center;
}

.chinalux-gallery-lightbox__close,
.chinalux-gallery-lightbox__nav {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: #020b2f;
  cursor: pointer;
  display: inline-flex;
  font-size: 34px;
  font-weight: 800;
  height: 56px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  width: 56px;
}

.chinalux-gallery-lightbox__close {
  right: clamp(18px, 3vw, 42px);
  top: clamp(18px, 3vw, 42px);
}

.chinalux-gallery-lightbox__prev {
  left: clamp(18px, 3vw, 42px);
}

.chinalux-gallery-lightbox__next {
  right: clamp(18px, 3vw, 42px);
}

.chinalux-gallery-lightbox__close:focus-visible,
.chinalux-gallery-lightbox__nav:focus-visible {
  outline: 3px solid #00a4dc;
  outline-offset: 4px;
}

@media (max-width: 767px) {
  .chinalux-gallery-lightbox__nav {
    bottom: 24px;
    top: auto;
  }
}

/* Uniform gallery media ratio: thumbnails crop, lightbox contains. */
body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-track,
.editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-track {
  align-items: stretch !important;
  display: flex !important;
  grid-template-columns: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item,
body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item:nth-child(n),
.editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item,
.editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item:nth-child(n) {
  aspect-ratio: 16 / 9 !important;
  background-image: none !important;
  border-radius: 8px !important;
  flex: 0 0 clamp(210px, 21vw, 300px) !important;
  margin: 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item-button,
.editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item-button {
  aspect-ratio: 16 / 9 !important;
  border-radius: inherit;
  display: block !important;
  height: 100% !important;
  overflow: hidden;
}

body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item img,
body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item:nth-child(n) img,
.editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item img,
.editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item:nth-child(n) img {
  aspect-ratio: 16 / 9 !important;
  border-radius: inherit !important;
  display: block !important;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
  opacity: 1 !important;
  width: 100% !important;
}

.chinalux-gallery-lightbox__figure {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chinalux-gallery-lightbox__image {
  height: auto;
  max-height: 78vh;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
  width: auto;
}

@media (max-width: 1023px) {
  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-track,
  .editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-track {
    --clx-gallery-card-size: calc(50% - 20px) !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item,
  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item:nth-child(n),
  .editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item,
  .editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item:nth-child(n) {
    flex-basis: calc((100% - var(--clx-gallery-gap, clamp(24px, 2.2vw, 40px))) / 2) !important;
  }
}

@media (max-width: 767px) {
  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-track,
  .editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-track {
    --clx-gallery-card-size: min(84vw, 560px) !important;
  }

  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item,
  body.home .wp-site-blocks .clx-home-main .chinalux-gallery-block .chinalux-gallery-item:nth-child(n),
  .editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item,
  .editor-styles-wrapper .chinalux-gallery-block .chinalux-gallery-item:nth-child(n) {
    flex-basis: min(84vw, 560px) !important;
  }
}
