/* ==================================================
   EB - VILLAGE
   Single borgo + archivio borghi
   ================================================== */

/* --------------------------------------------------
   Link contenuto borgo
-------------------------------------------------- */
.single-village .eb-article a,
.single-village .eb-block a,
.single-village .eb-intro a,
.single-village .eb-tabs a {
  color: #1A2B48;
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

.single-village .eb-article a:hover,
.single-village .eb-block a:hover,
.single-village .eb-intro a:hover,
.single-village .eb-tabs a:hover,
.single-village .eb-article a:focus,
.single-village .eb-block a:focus,
.single-village .eb-intro a:focus,
.single-village .eb-tabs a:focus {
  color: #8A1726;
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

.single-village .eb-article a .fa,
.single-village .eb-article a .fab,
.single-village .eb-article a .fas,
.single-village .eb-article a .far {
  color: inherit;
}

/* --------------------------------------------------
   Rendering / preloader
-------------------------------------------------- */
.single-village .eb-block,
.single-village .eb-grid,
.single-village .eb-tabs,
.single-village .eb-card {
  content-visibility: visible !important;
  contain: none !important;
}

.single-village .elementor-section,
.single-village .elementor-container,
.single-village .elementor-widget {
  content-visibility: visible !important;
  contain: none !important;
}

.single-village .st-preloader,
.single-village .loader-wrapper {
  display: none !important;
}

.single-village .main-wrapper,
.single-village .page-wrapper {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.single-village .eb-grid.is-loading {
  min-height: 140px;
}

.single-village .eb-grid.is-loading::before {
  content: "";
  display: block;
  height: 140px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f3f3f3 25%, #e9e9e9 37%, #f3f3f3 63%);
  background-size: 400% 100%;
  animation: ebShimmer 1.1s infinite linear;
}

@keyframes ebShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ==================================================
   Galleria PRO borghi
================================================== */

.eb-pro-gallery-wrap {
  margin: 38px 0 48px;
}

.eb-pro-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eb-pro-gallery-head .eb-sec-title {
  margin: 0;
}

.eb-pro-gallery {
  display: grid;
  grid-template-columns: 1.35fr .8fr .8fr;
  grid-template-rows: 230px 230px;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.eb-pro-gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  background: #f3f3f3;
  box-shadow: none;
}

.eb-pro-gallery__item.is-large {
  grid-row: span 2;
}

.eb-pro-gallery__item.is-hidden-thumb {
  display: none;
}

.eb-pro-gallery__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2,.6,.2,1), filter .4s ease;
}

.eb-pro-gallery__item:hover .eb-pro-gallery__img {
  transform: scale(1.06);
  filter: brightness(1.04) contrast(1.04);
}

.eb-pro-gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.60) 0%,
    rgba(0,0,0,.26) 42%,
    rgba(0,0,0,0) 72%
  );
  opacity: .95;
  pointer-events: none;
  transition: opacity .3s ease;
}

.eb-pro-gallery__item:hover::after {
  opacity: 1;
}

.eb-pro-gallery__overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  padding: 46px 16px 15px;
  color: #fff !important;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0,0,0,.82);
}

.eb-pro-gallery__title {
  display: block;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
  margin-bottom: 5px;
}

.eb-pro-gallery__item.is-large .eb-pro-gallery__title {
  font-size: 19px;
}

.eb-pro-gallery__place,
.eb-pro-gallery__author {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  opacity: .96;
}

.eb-pro-gallery__author {
  margin-top: 4px;
  display: flex;
  opacity: .88;
}

.eb-pro-gallery__all {
  border: 0 !important;
  background: #8A1726 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(138,23,38,.24);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.eb-pro-gallery__all:hover,
.eb-pro-gallery__all:focus {
  background: #6f1020 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(138,23,38,.32);
}

@media (max-width: 900px) {
  .eb-pro-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 260px 180px 180px;
  }

  .eb-pro-gallery__item.is-large {
    grid-column: span 2;
    grid-row: auto;
  }
}

@media (max-width: 768px) {
  .eb-pro-gallery-wrap {
    margin: 30px 0 40px;
  }

  .eb-pro-gallery-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .eb-pro-gallery {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    max-width: none;
    margin: 0;
    -webkit-overflow-scrolling: touch;
  }

  .eb-pro-gallery::-webkit-scrollbar {
    height: 4px;
  }

  .eb-pro-gallery::-webkit-scrollbar-thumb {
    background: rgba(138,23,38,.35);
    border-radius: 999px;
  }

  .eb-pro-gallery__item,
  .eb-pro-gallery__item.is-large {
    flex: 0 0 82%;
    height: 260px;
    scroll-snap-align: start;
  }

  .eb-pro-gallery__item.is-hidden-thumb {
    display: none;
  }

  .eb-pro-gallery__title,
  .eb-pro-gallery__item.is-large .eb-pro-gallery__title {
    font-size: 16px;
  }

  .eb-pro-gallery__place,
  .eb-pro-gallery__author {
    font-size: 12px;
  }
}

/* Overlay più visibile */
.eb-pro-gallery__overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.35) 40%,
    rgba(0, 0, 0, 0.05) 100%
  );
  padding: 14px;
}

/* Titolo foto */
.eb-pro-gallery__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.92); /* meno sparato */
  line-height: 1.3;
}

/* Nome borgo */
.eb-pro-gallery__place {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.65); /* grigino elegante */
}

/* Lightbox caption */
.eb-pro-lightbox__caption {
  text-align: center;
  margin-top: 10px;
}

.eb-pro-lightbox__caption-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.eb-pro-lightbox__caption-author {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}

/* ==================================================
   Lightbox PRO borghi
================================================== */

.eb-pro-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10,10,10,.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
}

.eb-pro-lightbox[hidden] {
  display: none !important;
}

.eb-pro-lightbox__stage {
  max-width: 92vw;
  max-height: 86vh;
  text-align: center;
}

.eb-pro-lightbox__img {
  max-width: min(1200px, 92vw);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

.eb-pro-lightbox__caption {
  margin-top: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.eb-pro-lightbox__close,
.eb-pro-lightbox__nav {
  position: fixed;
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.eb-pro-lightbox__close:hover,
.eb-pro-lightbox__nav:hover {
  background: rgba(255,255,255,.26);
  transform: scale(1.04);
}

.eb-pro-lightbox__close {
  top: 22px;
  right: 22px;
}

.eb-pro-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.eb-pro-lightbox__nav:hover {
  transform: translateY(-50%) scale(1.04);
}

.eb-pro-lightbox__nav.is-left {
  left: 22px;
}

.eb-pro-lightbox__nav.is-right {
  right: 22px;
}

.eb-pro-lightbox-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .eb-pro-lightbox {
    padding: 20px;
  }

  .eb-pro-lightbox__img {
    max-width: 94vw;
    max-height: 74vh;
    border-radius: 14px;
  }

  .eb-pro-lightbox__close,
  .eb-pro-lightbox__nav {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }

  .eb-pro-lightbox__nav.is-left {
    left: 10px;
  }

  .eb-pro-lightbox__nav.is-right {
    right: 10px;
  }
}

.eb-pro-lightbox__caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #e8e8e8;
  text-align: center;
}

.eb-pro-lightbox__caption-title {
  font-size: 13px;
  font-weight: 700;
}

.eb-pro-lightbox__caption-author {
  font-size: 11px;
  color: #bdbdbd;
  font-weight: 500;
}

/* --------------------------------------------------
   Hero principale borgo
-------------------------------------------------- */
body.single-village .eb-hero.has-img {
  position: relative !important;
  overflow: hidden !important;
  height: 450px !important;
  min-height: 450px !important;
}

body.single-village .eb-hero.has-img > picture,
body.single-village .eb-hero.has-img > img.eb-hero__img,
body.single-village .eb-hero.has-img > img.eb-hero-lcp,
body.single-village .eb-hero.has-img > img.eb-hero-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

body.single-village .eb-hero.has-img > picture > img,
body.single-village .eb-hero.has-img > img.eb-hero__img,
body.single-village .eb-hero.has-img > img.eb-hero-lcp,
body.single-village .eb-hero.has-img > img.eb-hero-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

body.single-village .eb-hero,
body.single-village .eb-hero * {
  animation: none !important;
  transition: none !important;
  filter: none !important;
}

@media (max-width: 768px) {
  body.single-village .eb-hero.has-img {
    height: 300px !important;
    min-height: 300px !important;
  }
}

/* --------------------------------------------------
   Share pagina borgo
-------------------------------------------------- */
.single-village .eb-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.single-village .eb-share__toggle {
  background: #8A1726 !important;
  color: #fff !important;
  border: 1px solid #8A1726 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  line-height: 1.2 !important;
}

.single-village .eb-share__toggle[aria-expanded="true"],
.single-village .eb-share__toggle:hover,
.single-village .eb-share__toggle:focus {
  background: #8A1726 !important;
  border-color: #8A1726 !important;
  color: #fff !important;
  filter: brightness(0.95);
}

.single-village .eb-share__toggle *,
.single-village .eb-share__toggle:hover *,
.single-village .eb-share__toggle[aria-expanded="true"] * {
  color: #fff !important;
  fill: #fff !important;
}

.single-village .eb-share__menu a {
  background: #fff !important;
  color: #8A1726 !important;
  border: 1px solid rgba(138, 23, 38, .35) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
}

.single-village .eb-share__menu a:hover,
.single-village .eb-share__menu a:focus {
  background: #8A1726 !important;
  color: #fff !important;
  border-color: #8A1726 !important;
}

.single-village .eb-share__menu a:hover *,
.single-village .eb-share__menu a:focus * {
  color: #fff !important;
  fill: #fff !important;
}

/* --------------------------------------------------
   Layout sezioni borgo
-------------------------------------------------- */
.single-village,
.single-village .site-content,
.single-village #main {
  background: #f6f6f6;
}

.single-village .eb-village-section {
  margin-top: 56px;
  padding: 34px 22px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
}

.single-village .eb-village-section + .eb-village-section {
  margin-top: 26px;
}

.single-village .eb-village-section--alt {
  background: #fff !important;
}

.single-village .eb-village-section--events {
  border-top-color: rgba(138, 23, 38, .25);
}

.single-village .eb-village-section__head {
  margin-bottom: 18px;
}

.single-village .eb-village-section__title {
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 10px;
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

.single-village .eb-village-section__title::after,
.single-village .eb-sec-title::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  background: #8A1726;
  margin-top: 10px;
}

.single-village .eb-village-section__intro {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(0, 0, 0, .68);
  max-width: 820px;
}

.single-village .eb-village-section .eb-grid {
  margin-top: 18px;
}

/* --------------------------------------------------
   Testi, tab e contenuti borgo
-------------------------------------------------- */
body.single-village.eb-editorial-body .eb-intro,
body.single-village.eb-editorial-body .eb-intro p,
body.single-village.eb-editorial-body .eb-article,
body.single-village.eb-editorial-body .eb-article p,
body.single-village.eb-editorial-body .eb-tabs,
body.single-village.eb-editorial-body .eb-tabs p,
body.single-village.eb-editorial-body .eb-tabs li,
body.single-village.eb-editorial-body .eb-tabs-content,
body.single-village.eb-editorial-body .eb-tabs-content p,
body.single-village.eb-editorial-body .eb-tabs-content li,
body.single-village.eb-editorial-body .eb-village-section p,
body.single-village.eb-editorial-body .eb-village-section li {
  color: #232323 !important;
  -webkit-text-fill-color: #232323 !important;
}

body.single-village.eb-editorial-body .eb-village-section h2,
body.single-village.eb-editorial-body .eb-village-section h3,
body.single-village.eb-editorial-body .eb-sec-title,
body.single-village.eb-editorial-body .eb-village-section__title {
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

body.single-village .eb-tabs-nav .eb-tab-btn {
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 11px 16px !important;
  min-height: 40px !important;
  border-radius: 10px !important;
  line-height: 1.2 !important;
}

body.single-village.eb-editorial-body .eb-tabs-nav > .eb-tab-btn:not(.is-active) {
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

body.single-village.eb-editorial-body .eb-tabs-nav > .eb-tab-btn.is-active {
  background: #8A1726 !important;
  border-color: #8A1726 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* --------------------------------------------------
   Card e badge nelle sezioni borgo
-------------------------------------------------- */
.single-village .eb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.single-village .eb-card a,
.single-village .eb-card a:hover,
.single-village .eb-card a:focus {
  text-decoration: none !important;
}

body.single-village.eb-editorial-body .eb-card h3,
body.single-village.eb-editorial-body .eb-card h3 a,
body.single-village.eb-editorial-body .eb-card .eb-card-title,
body.single-village.eb-editorial-body .eb-card__title,
body.single-village.eb-editorial-body .eb-card__title a {
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

body.single-village.eb-editorial-body .eb-card p,
body.single-village.eb-editorial-body .eb-card .eb-meta,
body.single-village.eb-editorial-body .eb-card .eb-card-excerpt,
body.single-village.eb-editorial-body .eb-card small,
body.single-village.eb-editorial-body .eb-card span {
  color: #555 !important;
  -webkit-text-fill-color: #555 !important;
}

.single-village .eb-badge-cat {
  display: inline-flex;
  align-items: center;
  background: #8A1726 !important;
  color: #fff !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  line-height: 1.2;
  text-decoration: none !important;
}

.single-village .eb-badge-cat *,
.single-village .eb-badge-cat:hover,
.single-village .eb-badge-cat:focus {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-decoration: none !important;
}

.single-village .eb-village-section--news .eb-card {
  position: relative;
}

.single-village .eb-village-section--news .eb-card .eb-thumb {
  display: block;
  position: relative;
  z-index: 1;
  border-radius: 12px;
  overflow: hidden;
}

.single-village .eb-village-section--news .eb-card > .eb-badge-cat {
  position: relative;
  z-index: 3;
  margin-top: -38px;
  margin-left: 12px;
  margin-bottom: 10px;
}

/* --------------------------------------------------
   Badge categorie/tag borgo
-------------------------------------------------- */
body.single-village .eb-cat-badges {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  overflow: visible !important;
  padding: 4px 0 12px !important;
}

body.single-village .eb-cat-badge,
body.single-village .eb-cat-badge:hover,
body.single-village .eb-cat-badge:focus,
body.single-village .eb-cat-badge:visited,
body.single-village .eb-badges a,
body.single-village .eb-tags a {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 22px !important;
  padding: 7px 11px !important;
  border-radius: 6px !important;
  line-height: 1.15 !important;
  background: #8A1726 !important;
  border: 1px solid #8A1726 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  overflow: visible !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

body.single-village .eb-cat-badge:hover,
body.single-village .eb-cat-badge:focus,
body.single-village .eb-badges a:hover,
body.single-village .eb-tags a:hover {
  background: #6f1020 !important;
  border-color: #6f1020 !important;
}

/* --------------------------------------------------
   Archivio borghi: filtri leggibili
-------------------------------------------------- */
body.post-type-archive-village .eb-filter,
body.post-type-archive-village .eb-filter *,
body.post-type-archive-village .eb-archive-filter,
body.post-type-archive-village .eb-archive-filter *,
body.post-type-archive-village .nice-select,
body.post-type-archive-village .nice-select *,
body.post-type-archive-village select,
body.post-type-archive-village option,
body.post-type-archive-village .dropdown-menu,
body.post-type-archive-village .dropdown-menu *,
body.post-type-archive-village .filter-option,
body.post-type-archive-village .filter-option-inner,
body.post-type-archive-village .filter-option-inner-inner,
body.tax-village-category .eb-filter *,
body.tax-village-connection .eb-filter *,
body[class*="village"] .eb-filter *,
body[class*="borghi"] .eb-filter *,
body[class*="village"] select,
body[class*="village"] option,
body[class*="borghi"] select,
body[class*="borghi"] option,
body[class*="village"] .dropdown-menu *,
body[class*="borghi"] .dropdown-menu *,
body[class*="village"] .nice-select *,
body[class*="borghi"] .nice-select * {
  color: #232323 !important;
  -webkit-text-fill-color: #232323 !important;
}

body.post-type-archive-village .dropdown-menu .active,
body.post-type-archive-village .dropdown-menu .selected,
body.post-type-archive-village .nice-select .option.selected,
body[class*="village"] .dropdown-menu .active,
body[class*="borghi"] .dropdown-menu .active,
body[class*="village"] .dropdown-menu .selected,
body[class*="borghi"] .dropdown-menu .selected {
  background: #8A1726 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}


/* ==================================================
   Galleria borghi - pulsante "Tutte le foto" dentro la foto
   stile località / Traveler
================================================== */

/* Nasconde eventuale bottone rimasto nella testata */
.eb-pro-gallery-head > .eb-pro-gallery__all {
  display: none !important;
}

/* Bottone dentro la prima foto */
.eb-pro-gallery__item .eb-pro-gallery__all-inside {
  position: absolute !important;
  right: 16px !important;
  bottom: 16px !important;
  z-index: 30 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.48) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 13px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  padding: 10px 15px !important;
  cursor: pointer !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.28) !important;
  backdrop-filter: blur(10px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(140%) !important;
  text-shadow: none !important;
}

.eb-pro-gallery__item .eb-pro-gallery__all-inside:hover,
.eb-pro-gallery__item .eb-pro-gallery__all-inside:focus {
  background: rgba(0,0,0,.58) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.eb-pro-gallery__all-icon {
  font-size: 15px !important;
  line-height: 1 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* Evita sovrapposizione tra nome borgo e pulsante */
.eb-pro-gallery__item.is-large .eb-pro-gallery__overlay {
  right: 145px !important;
}

/* Mobile: una sola foto grande, come Traveler/località */
@media (max-width: 768px) {
  .eb-pro-gallery-head {
    display: block !important;
    margin-bottom: 14px !important;
  }

  .eb-pro-gallery {
    display: block !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 18px !important;
  }

  .eb-pro-gallery__item {
    display: none !important;
  }

  .eb-pro-gallery__item.is-large,
  .eb-pro-gallery__item:first-child {
    display: block !important;
    width: 100% !important;
    height: 220px !important;
    min-height: 220px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  .eb-pro-gallery__item.is-large .eb-pro-gallery__img,
  .eb-pro-gallery__item:first-child .eb-pro-gallery__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .eb-pro-gallery__item .eb-pro-gallery__all-inside {
    right: 12px !important;
    bottom: 12px !important;
    font-size: 12px !important;
    padding: 9px 13px !important;
  }

  .eb-pro-gallery__item.is-large .eb-pro-gallery__overlay {
    left: 14px !important;
    right: 120px !important;
    bottom: 14px !important;
  }
}

/* ==================================================
   Galleria PRO - layout dinamico pulito
================================================== */

/* 1 immagine */
.eb-pro-gallery:has(> .eb-pro-gallery__item:first-child:last-child) {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

.eb-pro-gallery:has(> .eb-pro-gallery__item:first-child:last-child) .eb-pro-gallery__item {
  height: 520px !important;
}

/* 2 immagini */
.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(2):last-child) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: 420px !important;
}

.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(2):last-child) .eb-pro-gallery__item,
.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(2):last-child) .eb-pro-gallery__item.is-large {
  height: 420px !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* 3 immagini */
.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(3):last-child) {
  display: grid !important;
  grid-template-columns: 2fr 1fr !important;
  grid-template-rows: repeat(2, 220px) !important;
}

.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(3):last-child) .eb-pro-gallery__item.is-large {
  height: 454px !important;
  grid-row: 1 / span 2 !important;
}

.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(3):last-child) .eb-pro-gallery__item:not(.is-large) {
  height: 220px !important;
}

/* 4 immagini */
.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4):last-child) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, 260px) !important;
}

.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4):last-child) .eb-pro-gallery__item,
.eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4):last-child) .eb-pro-gallery__item.is-large {
  height: 260px !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* Desktop: se sono 4 o meno, il bottone non serve */
@media (min-width: 769px) {
  .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(1):last-child) .eb-pro-gallery__all-inside,
  .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(2):last-child) .eb-pro-gallery__all-inside,
  .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(3):last-child) .eb-pro-gallery__all-inside,
  .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4):last-child) .eb-pro-gallery__all-inside {
    display: none !important;
  }
}

/* Mobile: solo prima immagine, larga piena */
@media (max-width: 768px) {
  .eb-pro-gallery {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .eb-pro-gallery__item {
    display: none !important;
  }

  .eb-pro-gallery__item:first-child,
  .eb-pro-gallery__item.is-large {
    display: block !important;
    width: 100% !important;
    height: 260px !important;
    border-radius: 18px !important;
  }

  .eb-pro-gallery__item:first-child .eb-pro-gallery__img,
  .eb-pro-gallery__item.is-large .eb-pro-gallery__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .eb-pro-gallery__item .eb-pro-gallery__all-inside {
    display: inline-flex !important;
    right: 12px !important;
    bottom: 12px !important;
  }

  .eb-pro-gallery__item.is-large .eb-pro-gallery__overlay,
  .eb-pro-gallery__item:first-child .eb-pro-gallery__overlay {
    left: 14px !important;
    right: 125px !important;
    bottom: 14px !important;
  }
}

/* ==================================================
   FIX FINALE MOBILE GALLERIA PRO BORGHI
================================================== */
@media only screen and (max-width: 768px) {

  body.single-village .eb-pro-gallery {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
  }

body.single-village .eb-pro-gallery > .eb-pro-gallery__item {
  display: block !important;
}

body.single-village .eb-pro-gallery > .eb-pro-gallery__item:not(:first-child) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
  body.single-village .eb-pro-gallery > .eb-pro-gallery__item:first-child {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 260px !important;
    min-height: 260px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  body.single-village .eb-pro-gallery > .eb-pro-gallery__item:first-child .eb-pro-gallery__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  body.single-village .eb-pro-gallery > .eb-pro-gallery__item:first-child .eb-pro-gallery__all-inside {
    display: inline-flex !important;
    position: absolute !important;
    right: 12px !important;
    bottom: 12px !important;
    z-index: 50 !important;
  }

  body.single-village .eb-pro-gallery > .eb-pro-gallery__item:first-child .eb-pro-gallery__overlay {
    left: 14px !important;
    right: 125px !important;
    bottom: 14px !important;
  }
}

body.single-village .eb-pro-gallery__all-inside {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* FIX MOBILE DEFINITIVO: anche con 4 immagini mostra solo la prima */
@media only screen and (max-width: 768px) {

  body.single-village .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4)) {
    display: block !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body.single-village .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4)) > .eb-pro-gallery__item {
    display: none !important;
  }

  body.single-village .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4)) > .eb-pro-gallery__item:first-child {
    display: block !important;
    width: 100% !important;
    height: 260px !important;
    min-height: 260px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    position: relative !important;
  }

  body.single-village .eb-pro-gallery:has(> .eb-pro-gallery__item:nth-child(4)) > .eb-pro-gallery__item:first-child .eb-pro-gallery__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}