/* CONTENT */

body:not(.home) {
  padding-top: var(--header-height);
}

/* SECTION CONTENT — artist overrides */

.section-content p,
.section-content .text {
  width: 100%;
}

.section-content p:last-child {
  margin-bottom: 0;
}

/* FEATURED IMAGE */

.featured_image {
  padding: 17% 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

/* CONTENT_SIMPLE */

.content_simple {
  padding: 0 0 56px 0;
}

/* INFOS PRATIQUES */

#section-1 {
  padding-top: 40px;
}

/* GALLERY */

.gallery-page h1 {
  margin-bottom: 0;
}

.gallery-page .title-section {
  padding-bottom: 96px;
}

.gallery-section {
  --thumb-height: 160px;
  --gap: 80px;
  padding-top: 0 !important;
}
.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 1000px;
}
.gallery-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: var(--gap);
}

.gallery-row-2-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

.gallery-row:last-of-type {
  margin-bottom: 0;
}

.gallery-item {
  cursor: pointer;
  flex: 0 0 auto;
  width: fit-content;
}

.gallery-item:focus-visible {
  outline: none;
}

.gallery-thumb {
  overflow: hidden;
  height: var(--thumb-height);
  width: fit-content;
}
.gallery-thumb img {
  height: 100%;
  width: auto;
  display: block;
}

/* Image hors ratio standard → thumbnail carré centré */
.gallery-item.force-square .gallery-thumb {
  width: var(--thumb-height);
}
.gallery-item.force-square .gallery-thumb img {
  width: 100%;
  object-fit: cover;
}
.gallery-caption {
  font-size: 0.875rem;
  margin: 16px 0 2px;
  text-align: center;
  max-width: calc(var(--thumb-height) * var(--thumb-ratio, 1));
  overflow-wrap: break-word;
}

/* LIGHTBOX */

.gallery-lightbox {
  --max-image-width: 80vw;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  background: var(--beige);
  justify-content: center;
  border: none;
  padding: 0;
}
.gallery-lightbox[open] {
  display: flex;
}
.gallery-lightbox::backdrop {
  display: none;
}
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--max-image-width);
  padding-top: 100px;
}

.lightbox-img {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  min-height: 0;
}

.lightbox-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: fill;
  box-shadow: 0px 0px 20px 1px rgba(119, 119, 119, 0.2);
  -moz-box-shadow: 0px 0px 20px 1px rgba(119, 119, 119, 0.2);
  -webkit-box-shadow: 0px 0px 20px 1px rgba(119, 119, 119, 0.2);
}
.lightbox-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  align-self: stretch;
  flex-basis: 120px;
  flex-shrink: 0;
  margin-bottom: 20px;
}
.lightbox-info {
  text-align: center;
  width: 170px;
  flex-shrink: 0;
}
.lightbox-caption {
  font-weight: 500;
  font-size: 0.875rem;
  margin: 0 0 4px;
}
.lightbox-description {
  font-size: 0.75rem;
  margin: 0;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.lightbox-close img {
  width: 20px;
  height: 20px;
}
.lightbox-prev img,
.lightbox-next img {
  width: 15px;
  height: 29px;
}
.lightbox-prev,
.lightbox-next {
  flex-shrink: 0;
}

.lightbox-close {
  position: absolute;
  top: 50px;
  right: 50px;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .lightbox-close {
    --spacing: calc((100vw - var(--max-image-width)) / 2);
    top: var(--spacing);
    left: var(--spacing);
    right: initial;
  }

  .lightbox-bottom {
    justify-content: space-between;
    gap: initial;
  }

  .gallery-row-2-items {
    justify-content: center;
  }

  body:not(.home) {
    padding-top: 109px;
  }

  .content_simple .section-content img {
    object-fit: contain;
    max-width: 100%;
  }

  :root {
    --section-padding-x: 30px;
  }

  body:not(.home) section {
    padding: 25px var(--section-padding-x);
  }
  body:not(.home) .content_simple section {
    padding: 50px var(--section-padding-x);
  }

  .featured_image {
    padding: 30.5% 0;
  }

  .page-title {
    font-size: 40px !important;
    line-height: 32px;
    text-align: center;
    margin-bottom: 70px;
  }

  .section-subtitle {
    max-width: 150px;
    margin-left: 0;
    font-size: 23px;
  }

  .section-content:not(.column) > div {
    flex-direction: column;
  }

  .section-content:not(.column) > div img {
    flex-direction: column;
    margin-bottom: 20px;
  }
}
