* {
  box-sizing: border-box;
}
html {
  overflow-x: clip; /* to avoid horizontal scroll */
}
body {
  background-color: white;
  font-family: Helvetica;
  margin: 0;
  font-size: 16px;
}

main {
  padding: 0 16px;
}

.page article {
  padding-bottom: 64px;
}

.center {
  text-align: center;
}

.ct-content-container {
  padding: 0;
  max-width: 1340px;
  margin-left: auto;
  margin-right: auto;
}

.img-lightbox {
  cursor: pointer;
}

.is-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(min(300px, 100vw), 1fr)) !important;
  gap: var(--wp--style--unstable-gallery-gap, 16px);
}

@media screen and (max-width: 600px) {
  .is-layout-grid {
    grid-template-columns: 1fr !important;
  }
}

/******* Extension Lightbox ********/

#panel-lightbox {
  overflow: hidden;
  align-items: center;
  justify-content: center;
  display: flex;
}

#panel-lightbox figure,
#dialog-lightbox figure {
  width: 100%;
  height: 100%;
  margin: 0;
}

#panel-lightbox figure img,
#dialog-lightbox figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
}

#panel-lightbox figcaption,
#dialog-lightbox figcaption {
  position: absolute;
  bottom: 0px;
  width: 100%;
  padding: 20px 10%;
  background-color: rgba(0, 0, 0, 60%);
  text-align: center;
  color: white;
  font-family: "Noto Sans";
  font-style: italic;
}

/******* Extension Panel ********/

.panel {
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.5s ease-in-out,
    visibility 0.5s ease-in-out;
}

.panel.panel-visible {
  visibility: visible;
  opacity: 1;
}

.panel-fullscreen {
  position: fixed;
  z-index: 100;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.panel-dark {
  background-color: rgba(18, 21, 25, 0.98);
}

.panel-close-btn {
  position: absolute;
  top: 30px;
  right: 25px;
  border: none;
  background-color: transparent;
  color: #c0c0c0;
  transition: all 0.25s ease-in-out;
  line-height: 0;
  cursor: pointer;
}
.panel-close-btn:hover {
  transform: rotate(180deg) scale(1.2);
}

.grid-end {
  display: grid;
  justify-items: end;
}

.video-responsive {
  overflow: hidden;
  padding-bottom: 56.25%;
  position: relative;
  height: 0;
}

.video-responsive iframe {
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  position: absolute;
}

.wp-block-gallery {
  margin: 1em;
}

#cmplz-document h3 {
  background-image: unset;
}

@media (max-width: 782px) {
  /* table responsive */
  .wp-block-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(to right, #0000, #0000 20px, #0003) 0 100%/100%
      1px no-repeat;
    margin: 1em 0px;
  }

  .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* si nécessaire */
    table-layout: auto !important; /* ou fixed si beaucoup de colonnes */
  }

  .wp-block-table table th,
  .wp-block-table table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #e5e7eb;
    max-width: 60vw;
    min-width: 40vw;
  }

  /* If flex with 2 or more columns wrap in mobile display, let user inverse order of column (right column before and left after) */
  .flex-wrap-reverse {
    flex-wrap: wrap-reverse !important;
  }

  /* force center image horizontaly in mobile mode even if image is float right or left in desktop */
  .is-layout-flex > .wp-block-column > .wp-block-image > figure,
  .is-layout-flex .wp-block-column > figure.wp-block-image {
    float: unset;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
}

/****** Reveal animation ******/

.tw-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition:
    opacity 1.2s ease-out,
    transform 1.2s ease-out;
  will-change: opacity, transform;
  transition-delay: 0.2s;
}

.tw-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* .tw-reveal.is-visible:nth-child(2) { transition-delay: 0.4s; }
.tw-reveal.is-visible:nth-child(3) { transition-delay: 0.8s; }
.tw-reveal.is-visible:nth-child(4) { transition-delay: 1.2s; }
.tw-reveal.is-visible:nth-child(5) { transition-delay: 1.6s; }
.tw-reveal.is-visible:nth-child(6) { transition-delay: 2s; }
.tw-reveal.is-visible:nth-child(7) { transition-delay: 2.4s; }
.tw-reveal.is-visible:nth-child(8) { transition-delay: 2.8s; }
.tw-reveal.is-visible:nth-child(9) { transition-delay: 3.2s; }
.tw-reveal.is-visible:nth-child(10) { transition-delay: 3.6s; } */

@media screen and (max-width: 900px) and (min-width: 601px) {
  .wp-block-gallery.has-nested-images
    figure.wp-block-image:not(#individual-image) {
    margin: 0;
    width: calc(
      50% - var(--wp--style--unstable-gallery-gap, 16px) / 2
    ) !important;
  }
}
@media screen and (max-width: 600px) {
  .wp-block-gallery {
    margin: 1em 0;
  }
  .wp-block-gallery.has-nested-images
    figure.wp-block-image:not(#individual-image) {
    margin: 0;
    width: 100% !important;
  }
}
