/* AMATO premium gallery. Scoped to the live Galerie page only. */
body.page-id-109 {
  --ag-bg: #f4f0e8;
  --ag-surface: #eae0cb;
  --ag-ink: #151719;
  --ag-night: #050505;
  --ag-accent: #90745d;
  --ag-accent-deep: #745c49;
  --ag-gold: #c7a265;
  --ag-line: rgba(144, 116, 93, 0.3);
}

body.page-id-109 #primary.amato-page-content {
  background: var(--ag-bg);
  color: var(--ag-ink);
  overflow: clip;
}

body.page-id-109 .amato-editorial-hero {
  position: relative;
  min-height: clamp(430px, 62vh, 680px);
  justify-content: flex-end;
  padding-bottom: clamp(58px, 8vw, 112px);
  isolation: isolate;
  background-color: var(--ag-night);
  background-image: linear-gradient(90deg, rgba(5, 5, 5, 0.72) 0%, rgba(5, 5, 5, 0.44) 58%, rgba(5, 5, 5, 0.25) 100%), url("../../../../uploads/amato-real/photos/amato-exterior-real-02.webp") !important;
  background-blend-mode: normal;
}

body.page-id-109 .amato-editorial-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: transparent;
}

body.page-id-109 .amato-editorial-hero > * {
  position: relative;
  z-index: 1;
}

body.page-id-109 .amato-editorial-hero-title .elementor-heading-title {
  max-width: 780px;
  font-size: clamp(52px, 7vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.025em;
}

body.page-id-109 .amato-editorial-hero-copy {
  max-width: 560px;
}

.amato-gallery-filter {
  position: sticky;
  top: var(--amato-header-height, 78px);
  z-index: 18;
  display: flex;
  justify-content: center;
  gap: clamp(20px, 4vw, 56px);
  min-height: 64px;
  padding: 0 clamp(20px, 4vw, 64px);
  overflow-x: auto;
  border-bottom: 1px solid var(--ag-line);
  background: rgba(244, 240, 232, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.amato-gallery-filter::-webkit-scrollbar { display: none; }

.amato-gallery-filter a {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 64px;
  color: var(--ag-ink);
  font: 500 11px/1.2 "Jost", Arial, sans-serif;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.amato-gallery-filter a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--ag-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.amato-gallery-filter a:hover::after,
.amato-gallery-filter a:focus-visible::after,
.amato-gallery-filter a.is-active::after { transform: scaleX(1); }

.amato-gallery-filter a:focus-visible,
.amato-gallery-item:focus-visible,
.amato-gallery-open-all:focus-visible,
.amato-gallery-lightbox button:focus-visible {
  outline: 2px solid var(--ag-gold);
  outline-offset: 3px;
}

body.page-id-109 .amato-gallery-editorial.e-con {
  display: block;
  width: min(1320px, calc(100% - clamp(40px, 7vw, 120px)));
  max-width: none;
  margin-inline: auto;
  padding: clamp(76px, 9vw, 128px) 0;
  background: transparent;
  border-bottom: 1px solid var(--ag-line);
}

body.page-id-109 .amato-gallery-editorial > .elementor-widget-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 clamp(28px, 4vw, 48px);
}

body.page-id-109 .amato-gallery-editorial > .elementor-widget-heading::after {
  content: attr(data-gallery-count);
  color: var(--ag-accent-deep);
  font: 500 10px/1.2 "Jost", Arial, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.page-id-109 .amato-gallery-editorial > .elementor-widget-heading .elementor-heading-title {
  margin: 0;
  color: var(--ag-ink);
  font: 400 clamp(38px, 5vw, 66px)/1.02 "Marcellus", Georgia, serif;
}

body.page-id-109 .amato-gallery-mosaic.e-con {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(250px, 1fr));
  width: 100%;
  max-width: none;
  height: clamp(560px, 50vw, 720px);
  padding: 0;
  gap: 10px;
}

body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image {
  position: relative;
  grid-column: span 5;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ag-surface);
  cursor: zoom-in;
}

body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:first-child {
  grid-column: 1 / span 7;
  grid-row: 1 / span 2;
}

body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:nth-child(2) {
  grid-column: 8 / span 5;
  grid-row: 1;
}

body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:nth-child(3) {
  grid-column: 8 / span 2;
  grid-row: 2;
}

body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:nth-child(4) {
  grid-column: 10 / span 3;
  grid-row: 2;
}

body.page-id-109 .amato-gallery-editorial.gallery-layout--reverse .amato-gallery-mosaic > .elementor-widget-image:first-child {
  grid-column: 6 / span 7;
}

body.page-id-109 .amato-gallery-editorial.gallery-layout--reverse .amato-gallery-mosaic > .elementor-widget-image:nth-child(2) {
  grid-column: 1 / span 5;
}

body.page-id-109 .amato-gallery-editorial.gallery-layout--reverse .amato-gallery-mosaic > .elementor-widget-image:nth-child(3) {
  grid-column: 1 / span 3;
}

body.page-id-109 .amato-gallery-editorial.gallery-layout--reverse .amato-gallery-mosaic > .elementor-widget-image:nth-child(4) {
  grid-column: 4 / span 2;
}

body.page-id-109 .amato-gallery-mosaic .elementor-widget-container,
body.page-id-109 .amato-gallery-mosaic img {
  width: 100%;
  height: 100%;
}

body.page-id-109 .amato-gallery-mosaic img {
  display: block;
  min-height: 0;
  margin: 0;
  object-fit: cover;
  transition: transform 360ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 180ms ease;
}

body.page-id-109 .amato-gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 54%, rgba(5, 5, 5, 0.58) 100%);
  opacity: 0;
  transition: opacity 180ms ease;
}

body.page-id-109 .amato-gallery-item::after {
  content: attr(data-amato-caption);
  position: absolute;
  right: 20px;
  bottom: 18px;
  left: 20px;
  z-index: 2;
  overflow: hidden;
  color: var(--ag-bg);
  font: 400 13px/1.45 "Jost", Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

body.page-id-109 .amato-gallery-item:hover::before,
body.page-id-109 .amato-gallery-item:hover::after,
body.page-id-109 .amato-gallery-item:focus-visible::before,
body.page-id-109 .amato-gallery-item:focus-visible::after { opacity: 1; }

body.page-id-109 .amato-gallery-item:hover::after,
body.page-id-109 .amato-gallery-item:focus-visible::after { transform: translateY(0); }

body.page-id-109 .amato-gallery-item:hover img { transform: scale(1.025); }

.amato-gallery-open-all {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid var(--ag-ink);
  border-radius: 0;
  background: var(--ag-bg);
  color: var(--ag-ink);
  font: 500 11px/1 "Jost", Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.amato-gallery-open-all:hover { background: var(--ag-ink); color: var(--ag-bg); }
.amato-gallery-open-all svg { width: 17px; height: 17px; }

.amato-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(5, 5, 5, 0.985);
  color: var(--ag-bg);
  opacity: 0;
}

.amato-gallery-lightbox.is-open {
  display: grid;
  animation: amato-gallery-in 180ms ease forwards;
}

@keyframes amato-gallery-in { to { opacity: 1; } }

html.amato-gallery-lock,
html.amato-gallery-lock body { overflow: hidden !important; }

.amato-gallery-lightbox__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.amato-gallery-lightbox__title {
  margin: 0;
  font: 400 clamp(18px, 2vw, 25px)/1.2 "Marcellus", Georgia, serif;
}

.amato-gallery-lightbox__count {
  color: rgba(255, 255, 255, 0.72);
  font: 500 11px/1 "Jost", Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.amato-gallery-lightbox button {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  background: transparent;
  color: var(--ag-bg);
  cursor: pointer;
}

.amato-gallery-lightbox__close {
  justify-self: end;
  width: 48px;
  height: 48px;
  font: 300 30px/1 "Jost", Arial, sans-serif;
}

.amato-gallery-lightbox__stage {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 68px;
  align-items: center;
  min-height: 0;
  padding: clamp(16px, 3vw, 38px);
  gap: clamp(10px, 2vw, 28px);
}

.amato-gallery-lightbox__figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  min-width: 0;
  height: 100%;
  margin: 0;
}

.amato-gallery-lightbox__image {
  display: block;
  max-width: 100%;
  width: auto;
  height: 100%;
  max-height: calc(100vh - 236px);
  object-fit: contain;
}

.amato-gallery-lightbox__caption {
  min-height: 34px;
  padding-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font: 400 13px/1.5 "Jost", Arial, sans-serif;
  text-align: center;
}

.amato-gallery-lightbox__prev,
.amato-gallery-lightbox__next {
  width: 56px;
  height: 56px;
  font: 300 30px/1 "Jost", Arial, sans-serif;
  transition: border-color 180ms ease, background 180ms ease;
}

.amato-gallery-lightbox__prev:hover,
.amato-gallery-lightbox__next:hover,
.amato-gallery-lightbox__close:hover {
  border-color: var(--ag-gold);
  background: rgba(255, 255, 255, 0.08);
}

.amato-gallery-lightbox__thumbs {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 82px;
  padding: 10px clamp(18px, 3vw, 44px) 16px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  scrollbar-width: thin;
}

.amato-gallery-lightbox__thumb {
  flex: 0 0 66px;
  width: 66px;
  height: 54px;
  padding: 0;
  overflow: hidden;
  opacity: 0.5;
}

.amato-gallery-lightbox__thumb.is-current {
  border-color: var(--ag-gold);
  opacity: 1;
}

.amato-gallery-lightbox__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 900px) {
  body.page-id-109 .amato-gallery-mosaic.e-con {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 430px 260px;
    height: auto;
  }

  body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:first-child,
  body.page-id-109 .amato-gallery-editorial.gallery-layout--reverse .amato-gallery-mosaic > .elementor-widget-image:first-child {
    grid-column: 1 / span 2;
    grid-row: 1;
  }

  body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:nth-child(n+2),
  body.page-id-109 .amato-gallery-editorial.gallery-layout--reverse .amato-gallery-mosaic > .elementor-widget-image:nth-child(n+2) {
    grid-column: auto;
    grid-row: 2;
  }

  body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:nth-child(4) { display: none; }
  .amato-gallery-lightbox__stage { grid-template-columns: 54px minmax(0, 1fr) 54px; }
  .amato-gallery-lightbox__prev,
  .amato-gallery-lightbox__next { width: 48px; height: 48px; }
}

@media (max-width: 600px) {
  body.page-id-109 .amato-editorial-hero {
    min-height: 490px;
    padding-bottom: 56px;
  }

  body.page-id-109 .amato-editorial-hero-title .elementor-heading-title {
    font-size: clamp(48px, 15vw, 66px);
  }

  .amato-gallery-filter {
    top: var(--amato-header-height-mobile, 68px);
    justify-content: flex-start;
    gap: 30px;
    min-height: 58px;
    padding-inline: 20px;
  }

  .amato-gallery-filter a { min-height: 58px; }

  body.page-id-109 .amato-gallery-editorial.e-con {
    width: calc(100% - 32px);
    padding: 66px 0;
  }

  body.page-id-109 .amato-gallery-editorial > .elementor-widget-heading {
    margin-bottom: 24px;
  }

  body.page-id-109 .amato-gallery-editorial > .elementor-widget-heading::after {
    content: attr(data-gallery-count-short);
  }

  body.page-id-109 .amato-gallery-mosaic.e-con {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 360px 165px;
    gap: 6px;
  }

  body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:nth-child(3) { display: block; }
  body.page-id-109 .amato-gallery-mosaic > .elementor-widget-image:nth-child(4) { display: none; }
  body.page-id-109 .amato-gallery-item::before,
  body.page-id-109 .amato-gallery-item::after { display: none; }

  .amato-gallery-open-all {
    right: 12px;
    bottom: 12px;
    min-height: 44px;
    padding: 0 13px;
    font-size: 10px;
  }

  .amato-gallery-lightbox__top {
    grid-template-columns: 1fr auto;
    min-height: 66px;
    padding: 9px 14px;
  }

  .amato-gallery-lightbox__count {
    grid-column: 1;
    grid-row: 2;
    margin-top: 5px;
  }

  .amato-gallery-lightbox__close {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
  }

  .amato-gallery-lightbox__stage {
    display: flex;
    padding: 12px 12px 72px;
  }

  .amato-gallery-lightbox__figure { width: 100%; }
  .amato-gallery-lightbox__image { max-height: calc(100vh - 232px); }
  .amato-gallery-lightbox__caption { padding: 12px 22px 0; font-size: 12px; }

  .amato-gallery-lightbox__prev,
  .amato-gallery-lightbox__next {
    position: absolute;
    bottom: 12px;
    width: 50px;
    height: 50px;
  }

  .amato-gallery-lightbox__prev { left: calc(50% - 58px); }
  .amato-gallery-lightbox__next { right: calc(50% - 58px); }
  .amato-gallery-lightbox__thumbs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.page-id-109 .amato-gallery-mosaic img,
  .amato-gallery-filter a::after { transition: none; }
  .amato-gallery-lightbox.is-open { animation: none; opacity: 1; }
}
