/* Replaces AMP sidebar / carousel / lightbox behaviour for Mobirise legacy pages */

/* Match index/contact: no browser gutter; nav aligns with webalyse .container */
html {
  scrollbar-gutter: stable;
}

html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

section.menu,
section.menu1,
section[class*="header"] {
  max-width: none;
}

/* Same content column as css/webalyse.css (.container --max: 1140px) */
section.menu .menu-container,
section.menu1 .menu-container,
section.menu .menu-container.container,
section.menu1 .menu-container.container {
  width: min(100% - 2rem, 1140px) !important;
  max-width: 1140px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

section.menu .navbar-logo,
section.menu1 .navbar-logo {
  margin-left: 0 !important;
}

#sidebar.legacy-sidebar,
.legacy-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 100%);
  height: 100%;
  max-height: 100vh;
  overflow: auto;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  background-color: #ffffff !important; /* beat Mobirise #sidebar { background: transparent } */
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
  display: block; /* override leftover amp-sidebar { display: none } on desktop */
}

#sidebar.legacy-sidebar .builder-sidebar,
.legacy-sidebar .builder-sidebar {
  background-color: #ffffff !important;
  min-height: 100%;
}

.legacy-sidebar.is-open {
  transform: translateX(0);
}

.legacy-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1090;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.legacy-sidebar-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.legacy-sidebar-open {
  overflow: hidden;
}

img.legacy-img {
  max-width: 100%;
  height: auto;
  display: block;
}

.navbar-logo img.legacy-img,
.navbar-logo a img {
  width: 84px;
  height: 56px;
  object-fit: contain;
}

.legacy-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.legacy-carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.45s ease;
}

.legacy-carousel-track > .carousel-img {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  position: relative;
}

.legacy-carousel-track > .carousel-img > img.legacy-img {
  width: 100%;
  height: auto;
  min-height: 280px;
  object-fit: cover;
}

#scrollToTopButton {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#scrollToTopButton.is-visible {
  opacity: 0.55;
  visibility: visible;
}

.legacy-tabs .tabContent {
  display: none;
}

.legacy-tabs .tabContent.is-active {
  display: block;
}

.legacy-tabs .tabButton {
  cursor: pointer;
}

.legacy-tabs .tabButton.is-active {
  font-weight: 700;
}

.legacy-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.legacy-lightbox.is-open {
  display: flex;
}

.legacy-lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 90vh;
  object-fit: contain;
}

.legacy-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* Match "Tell us how we can help" (header1, 150px) spacing on Get in touch */
section.contacts1#contact-email,
section.contacts1 {
  padding-top: 150px !important;
  padding-bottom: 150px !important;
}

/* Where we are based: grey → colour on hover (Mobirise features12) */
.features12 .card-img img,
.features12 .card-img .legacy-img {
  filter: grayscale(1) !important;
  transition: filter 0.35s ease !important;
}

.features12 .card:hover .card-img img,
.features12 .card:hover .card-img .legacy-img,
.features12 .card-wrapper:hover .card-img img,
.features12 .card-wrapper:hover .card-img .legacy-img {
  filter: grayscale(0) !important;
}

/* Keep photos visible: AMP stacked amp-img above ::before; plain <img> sat underneath opaque navy */
.features12 .card-wrapper .card-img::before {
  opacity: 0.35 !important;
}

.features12 .card:hover .card-img::before,
.features12 .card-wrapper:hover .card-img::before {
  opacity: 0.15 !important;
}
