.rtx-art-gallery {
  color: #fff;
  background: #080808;
}

.rtx-art-gallery__inner {
  width: min(100%, 1280px);
  margin: 0 auto;
}

.rtx-art-gallery__header {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto 42px;
  text-align: center;
}

.rtx-art-gallery__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .17em;
  line-height: 1.2;
  text-transform: uppercase;
}

.rtx-art-gallery__title {
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: clamp(42px, 5vw, 72px);
  line-height: .95;
  text-transform: uppercase;
}

.rtx-art-gallery__body {
  margin: 0;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255,255,255,.9);
}

.rtx-art-gallery__grid {
  --rtx-art-gallery-gap: 16px;
  --rtx-art-gallery-row: 280px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: var(--rtx-art-gallery-row);
  gap: var(--rtx-art-gallery-gap);
}

.rtx-art-gallery__item {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0 solid transparent;
  background: #111;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}

.rtx-art-gallery__item:nth-child(1) { grid-column: 1 / span 3; grid-row: span 2; }
.rtx-art-gallery__item:nth-child(2) { grid-column: 4 / span 3; grid-row: span 1; }
.rtx-art-gallery__item:nth-child(3) { grid-column: 4 / span 3; grid-row: span 1; }
.rtx-art-gallery__item:nth-child(4) { grid-column: 1 / span 2; }
.rtx-art-gallery__item:nth-child(5) { grid-column: 3 / span 2; }
.rtx-art-gallery__item:nth-child(6) { grid-column: 5 / span 2; }
.rtx-art-gallery__item:nth-child(n+7) { grid-column: span 2; }

.rtx-art-gallery__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1);
  transition: transform .65s cubic-bezier(.22,1,.36,1), filter .45s ease;
}

.rtx-art-gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,.12);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.rtx-art-gallery__expand {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.34);
  background: rgba(0,0,0,.34);
  color: #fff;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: opacity .28s ease, transform .28s ease, background-color .28s ease;
  backdrop-filter: blur(8px);
}

.rtx-art-gallery__expand :is(i, svg) {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 16px;
  line-height: 1;
}

.rtx-art-gallery__item:hover::after,
.rtx-art-gallery__item:focus-visible::after { opacity: 1; }

.rtx-art-gallery__item:hover .rtx-art-gallery__expand,
.rtx-art-gallery__item:focus-visible .rtx-art-gallery__expand {
  opacity: 1;
  transform: none;
}

.rtx-art-gallery__item:focus-visible {
  z-index: 3;
  outline: 2px solid #69B8DF;
  outline-offset: 4px;
}

.rtx-art-gallery .rtx-reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity var(--rtx-reveal-duration, .68s) cubic-bezier(.22,1,.36,1),
    transform var(--rtx-reveal-duration, .68s) cubic-bezier(.22,1,.36,1);
  transition-delay: var(--rtx-reveal-delay, 0ms);
}

.rtx-art-gallery .rtx-reveal[data-rtx-animation="fade"] { transform: none; }
.rtx-art-gallery .rtx-reveal[data-rtx-animation="reveal"] { transform: translate3d(-26px, 0, 0); }
.rtx-art-gallery .rtx-reveal[data-rtx-animation="none"],
.rtx-art-gallery .rtx-reveal.is-visible {
  opacity: 1;
  transform: none;
}

body.elementor-editor-active .rtx-art-gallery .rtx-reveal,
body.elementor-editor-preview .rtx-art-gallery .rtx-reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .rtx-art-gallery .rtx-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rtx-art-gallery__item img,
  .rtx-art-gallery__item::after,
  .rtx-art-gallery__expand { transition: none; }
}

@media (max-width: 1024px) {
  .rtx-art-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rtx-art-gallery__item:nth-child(1) { grid-column: 1; grid-row: span 2; }
  .rtx-art-gallery__item:nth-child(2) { grid-column: 2; grid-row: span 1; }
  .rtx-art-gallery__item:nth-child(3) { grid-column: 2; grid-row: span 1; }
  .rtx-art-gallery__item:nth-child(n+4) { grid-column: span 1; grid-row: span 1; }
}

/* Mobile gallery: one featured work, then a two-column scan. */
@media (max-width: 767px) {
  .rtx-art-gallery__header {
    justify-items: start;
    max-width: none;
    text-align: left;
  }

  .rtx-art-gallery__eyebrow { font-size: 11px; letter-spacing: .16em; }
  .rtx-art-gallery__title {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 !important;
    font-size: clamp(34px, 9.8vw, 46px);
    line-height: 1;
    text-align: left;
    text-wrap: initial;
    overflow-wrap: normal;
    word-break: normal;
  }
  .rtx-art-gallery__body { width: 100%; max-width: none; font-size: 15.5px; line-height: 1.6; }

  .rtx-art-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row dense;
    grid-auto-rows: auto;
    gap: max(8px, var(--rtx-art-gallery-gap, 8px));
  }

  .rtx-art-gallery__item,
  .rtx-art-gallery__item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
    aspect-ratio: 4 / 5;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* A full-width work opens each visual group; pairs below keep scanning fast. */
  .rtx-art-gallery__item:first-child,
  .rtx-art-gallery__item:nth-child(5n + 1),
  .rtx-art-gallery__item:last-child:nth-child(5n + 2),
  .rtx-art-gallery__item:last-child:nth-child(5n + 4) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 11;
  }

  .rtx-art-gallery__item img { transform: none; transition: none; }
  .rtx-art-gallery__item:hover img { transform: none; }

  .rtx-art-gallery__expand {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border-color: rgba(255,255,255,.26);
    background: rgba(5,10,13,.48);
    opacity: 1;
    transform: none;
    backdrop-filter: blur(7px);
  }

  .rtx-art-gallery__expand :is(i, svg) {
    width: 17px;
    height: 17px;
    font-size: 15px;
  }
}

@media (max-width: 340px) {
  .rtx-art-gallery__grid { grid-template-columns: 1fr; }
  .rtx-art-gallery__item,
  .rtx-art-gallery__item:nth-child(n),
  .rtx-art-gallery__item:first-child,
  .rtx-art-gallery__item:nth-child(5n + 1),
  .rtx-art-gallery__item:last-child:nth-child(5n + 2),
  .rtx-art-gallery__item:last-child:nth-child(5n + 4) {
    grid-column: 1;
    aspect-ratio: 4 / 5;
  }
}
