/* Galleria: griglia uniforme + lightbox come inbarcaconmapi.it */

section.gallery1 .container-fluid {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

section.gallery1 .row.mbr-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 100%;
  justify-items: center;
}

section.gallery1 .row.mbr-gallery > .item {
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 0;
  flex: none;
}

section.gallery1 .item-wrapper {
  position: relative;
  width: 100%;
  height: auto !important;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0 !important;
}

section.gallery1 .item-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease, filter 0.35s ease;
}

section.gallery1 .item-wrapper:hover img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

@media (max-width: 767px) {
  section.gallery1 .item-wrapper:hover img {
    transform: none;
    filter: none;
  }
}

@media (min-width: 768px) {
  section.gallery1 .row.mbr-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 992px) {
  section.gallery1 .row.mbr-gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

section.gallery1 .modal.mbr-slider {
  display: none !important;
}

/* Home: Lido Burrone, Cala Rossa, Cala del Pozzo, Cala Azzurra */
section.news08 .item-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 400px;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
}

section.news08 .item-img img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.35s ease, filter 0.35s ease;
}

section.gallery1 .item-wrapper,
section.news08 .item-img {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  section.news08 .item-img:hover img {
    transform: scale(1.08);
    filter: brightness(1.05);
  }
}

@media (max-width: 767px), (hover: none) {
  section.gallery1 .item-wrapper:hover img,
  section.news08 .item-img:hover img {
    transform: none;
    filter: none;
  }
}

@media (min-width: 1025px) {
  #blog-5-upMgRiNp4l .item-img:hover img {
    transform: none;
    filter: none;
  }
}

html.lightbox-open,
body.lightbox-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.lightbox-open {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

body.lightbox-open .whatsapp-widget {
  visibility: hidden;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 2147483000;
  background: #0d6e86;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  justify-content: safe center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

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

.photo-lightbox.is-open {
  display: flex !important;
}

.photo-lightbox.is-open.is-arming {
  pointer-events: none;
}

.photo-lightbox .photo-lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: min(100%, 960px, calc((100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 80 / 81));
  max-width: min(100%, 960px);
  min-height: 0;
  overflow: hidden;
  border-radius: 2rem;
  border: 2px solid #ffffff;
  background: #0d6e86;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  aspect-ratio: 80 / 81;
  height: auto;
  max-height: calc(100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.photo-lightbox .lightbox-img {
  display: block;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #0d6e86;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lightbox-img.is-changing {
  opacity: 0;
  transform: scale(0.97);
}

.photo-lightbox .photo-lightbox-meta {
  width: 100%;
  max-width: min(100%, 960px);
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  padding: 0 4px;
}

.lightbox-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

.photo-lightbox .photo-lightbox-counter {
  flex: 0 0 auto;
  text-align: center;
  min-width: 4.5rem;
  font-size: 0.85rem;
  color: #ffffff;
  letter-spacing: 2px;
  white-space: nowrap;
}

.lightbox-nav {
  position: static;
  transform: none;
  width: 48px;
  height: 48px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  color: #0d6e86;
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding-bottom: 4px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-nav:hover,
.lightbox-nav:focus {
  background: #eff0ec;
  border-color: #ffffff;
  box-shadow: none;
  color: #0a5a6e;
  outline: none;
}

.lightbox-nav:active {
  transform: scale(0.94);
}

.lightbox-nav:focus-visible,
.lightbox-close-bottom:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 4px;
}

.lightbox-close-bottom {
  width: auto;
  max-width: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  min-height: 44px;
  background: #ffffff;
  color: #0d6e86;
  border: 2px solid #ffffff;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lightbox-close-bottom span {
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
}

.lightbox-close-bottom:hover,
.lightbox-close-bottom:focus {
  background: #eff0ec;
  color: #0a5a6e;
}

.lightbox-close-bottom:active {
  transform: scale(0.97);
}

@media (min-width: 1025px) {
  .photo-lightbox .photo-lightbox-inner {
    width: min(100%, 1008px, calc((100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 84 / 81));
    max-width: min(100%, 1008px);
    aspect-ratio: 84 / 81;
  }

  .photo-lightbox .photo-lightbox-meta {
    max-width: min(100%, 1008px);
  }
}

@media (max-width: 1024px) {
  .photo-lightbox {
    justify-content: flex-start;
    padding:
      max(12px, env(safe-area-inset-top))
      max(4px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(4px, env(safe-area-inset-left));
  }

  .photo-lightbox .photo-lightbox-meta {
    margin-top: 14px;
  }
}

@media (max-width: 768px) {
  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
  }

  .lightbox-nav-row {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .lightbox-nav {
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
  }

  .lightbox-nav-row {
    gap: 18px;
  }
}
