/* Fixes for the parts of the WordPress front-end that cannot run statically,
   plus two defects in the theme's own sticky-header CSS. Loaded last.

   The header rules below repeat the original selector
   (`.elementor-2637 .elementor-element.elementor-element-787502b…`) on purpose:
   the rule they override is that specific, and a shorter selector loses to it
   even with !important. 2637 is the header template, 787502b its top section -
   both are the same on every page. */

/* The search overlay and the cart drawer have no backend; keep them closed. */
#search-popup,
.site-search-popup,
.bodoni-cart-panel,
.shopping-cart-panel {
  display: none !important;
}

/* Elementor hides sections until its JS runs; keep content visible even if a
   script fails to load. */
.elementor-invisible {
  visibility: visible !important;
}

/* ------------------------------------------------------------------ header */

/* 1. The stuck header faded the whole element to 85%, so the logo and the menu
      went translucent and the page text read straight through them. The tint
      belongs on the background: same colour, same 85%, but the header's own
      content stays opaque - and `backdrop-filter` finally has an effect, since
      element opacity was compositing the blurred layer over an unblurred page. */
.elementor-2637
  .elementor-element.elementor-element-787502b.sticky-header.elementor-sticky--effects {
  opacity: 1 !important;
  background-color: rgba(0, 0, 0, 0.85) !important;
}

/* 2. The shrink rule pinned the container to a fixed 45px height. Above roughly
      1500px the menu is a single row and fits, but below that it wraps and the
      rows were clipped by the header and overlapped the logo. Letting the
      container grow past the minimum keeps the shrink effect where it works and
      stops the collision where it does not. */
.sticky-header.elementor-sticky--effects > .elementor-container {
  height: auto !important;
}

/* 3. The header is fixed once stuck, so in-page anchors (#domaine, #equipe,
      #TerreVigne, #VigneRaisin in the main menu) landed underneath it. */
html {
  scroll-padding-top: 100px;
}

@media (max-width: 1024px) {
  html {
    scroll-padding-top: 80px;
  }
}

/* ----------------------------------------------------------------- galleries */

/* Global Gallery builds its masonry from JavaScript that talks to
   admin-ajax.php. With no WordPress behind the site the script never finishes,
   so it leaves its spinner up and the container pinned to its initial 150px,
   clipping every thumbnail. The markup and the images are all present, so we
   drop the loader and lay the items out with CSS columns - the same masonry the
   plugin was going to produce. */
.gg_gallery_wrap .gg_loader {
  display: none !important;
}

.gg_gallery_wrap,
.gg_gallery_wrap .gg_container {
  height: auto !important;
  min-height: 0 !important;
  /* the plugin caps the container until its script measures the grid */
  max-height: none !important;
}

.gg_masonry_gallery .gg_container {
  columns: 4;
  column-gap: 14px;
}

.gg_masonry_gallery .gg_img {
  break-inside: avoid;
  display: block !important;
  position: static !important;
  width: 100% !important;
  left: auto !important;
  top: auto !important;
  margin: 0 0 14px !important;
  /* the plugin fades each item in once its script has placed it */
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.gg_masonry_gallery .gg_img img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 1024px) {
  .gg_masonry_gallery .gg_container { columns: 3; }
}
@media (max-width: 767px) {
  .gg_masonry_gallery .gg_container { columns: 2; column-gap: 10px; }
  .gg_masonry_gallery .gg_img { margin-bottom: 10px !important; }
}

/* --------------------------------------------------------------- news page */

/* The News page carried only an Instagram widget whose service is gone; this
   styles the link that replaces it. */
.csl-instagram .elementor-container {
  padding: 90px 15px 110px;
  text-align: center;
}
.csl-instagram__link {
  display: inline-block;
  margin-top: 6px;
  padding: 16px 34px;
  border: 1px solid var(--e-global-color-primary, #c96838);
  color: var(--e-global-color-primary, #c96838);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.csl-instagram__link:hover {
  background: var(--e-global-color-primary, #c96838);
  color: #fff;
}
