@media (min-width: 72rem) {
  :root {
    --grid: repeat(10, 1fr);
  }
}
[role="tabpanel"].is-hidden {
  display: none;
}
.project {
  --header-height: calc(
    2 * 1.025em + 2px + 2 * var(--space--sides)
  );
}
.project--header {
  position: fixed;
  z-index: 2;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space--sides);
  background: var(--color--invert);
}
.project--title {
  display: flex;
  flex-wrap: wrap;
  margin-block-end: 2px;
}
.project--name::after {
  content: "\00a0–\00a0";
}
.project--ville {
  display: block;
}
[role="tablist"] button:first-child {
  margin-inline-end: 1em;
}
#gallery-number-slides {
  display: none;
}
@media (min-width: 48rem) {
  .project {
    --header-height: calc(1.025em + 2 * var(--space--sides));
  }
  .project--header {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space--gutter);
  }
  .project--header [role="tablist"] {
    grid-column: 1 / span 5;
    grid-row: 1;
  }
  .project--title {
    grid-column: 6 / span 7;
    margin-block-end: 0;
  }
}
@media (min-width: 72rem) {
  .project {
    --header-height: calc(1.025em + 2 * var(--space--sides));
  }
  .project--header {
    grid-template-columns: repeat(10, 1fr);
  }
  .project--header [role="tablist"] {
    grid-column: 1 / span 3;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space--gutter);
  }
  #tab-infos {
    grid-column: span 2;
  }
  .project--title {
    grid-column: 4 / span 5;
    /*  display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space--gutter); */
  }
  /*  .project--name {
    grid-column: span 3;
  }
  .project--name::after {
    content: unset;
  }
  .project--ville {
    grid-column: span 2;
  } */
}
/* Galerie */
.gallery {
  --space-before: 0;
  padding-inline: var(--space--sides);
  margin-block-start: var(--space-before);
}
.gallery .is-vertical-small img {
  max-width: 50%;
}
.gallery figure {
  height: fit-content;
}
.gallery a {
  text-decoration: none;
  position: relative;
  display: block;
}
.gallery figcaption {
  position: absolute;
  bottom: 0.25rem;
  left: 0.25rem;
  right: 0.25rem;
  color: var(--color--invert);
}
.is-caption-dark figcaption {
  color: var(--color--text);
}

.embla__viewport {
  overflow: hidden;
}
.embla__container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  touch-action: pan-y pinch-zoom;
  height: calc(
    100dvh - var(--header-height) - var(--nav-height)
  );
}
.embla__slide {
  flex: 0 0 fit-content;
  min-width: 0;
  padding-top: var(--gallery--spacing);
}

@media (min-width: 48rem) and (orientation: landscape) {
  .gallery {
    --space-before: 2rem;
    padding-inline: 0;
    --img-height: min(
      30rem,
      calc(
        100dvh - var(--header-height) - var(--nav-height) -
          var(--space-before)
      )
    );
  }
  .embla__container {
    flex-direction: row;
    height: auto;
  }
  .embla__slide {
    padding-top: 0;
    margin-right: var(--gallery--spacing);
  }
  .gallery figure {
    width: fit-content;
    height: 100%;
  }
  .gallery .is-vertical-small img {
    max-width: unset;
  }
  .gallery img {
    width: auto;
    height: var(--img-height);
    max-width: none;
  }
  .gallery .is-horizontal-small img {
    height: calc(var(--img-height) / 2);
  }
  #gallery-number-slides {
    display: block;
    position: fixed;
    z-index: 2;
    right: var(--space--sides);
    bottom: var(--space--sides);
    width: calc(
      (
          100dvw - 2 * var(--space--sides) - 11 *
            var(--space--gutter)
        ) /
        12 * 2 + var(--space--gutter)
    );
  }
}
@media (min-width: 72rem) and (orientation: landscape) {
  #gallery-number-slides {
    width: calc(
      (
          100dvw - 2 * var(--space--sides) - 9 *
            var(--space--gutter)
        ) /
        10
    );
  }
}

/* Infos */
#tabpanel-infos {
  padding-block-start: var(--space-below-header);
  padding-inline: var(--space--sides);
}
.technical > div {
  display: grid;
  grid-template-columns: var(--grid);
  gap: var(--space--gutter);
  break-inside: avoid-column;
}
.technical > [data-field="materiaux"],
.technical > [data-field="fichier"],
.technical > [data-field="photographes"] {
  margin-block-start: 1rem;
}
.technical dt {
  grid-column: span 2;
}
.technical dd {
  grid-column: span 4;
}
.entry--text {
  margin-block: 3rem calc(3rem + var(--header-height));
}
.project .entry--text p,
.project .entry--text ul {
  margin-block-end: 0;
}

@media (min-width: 48rem) {
  .technical {
    columns: 2;
    gap: var(--space--gutter);
  }
}
@media (min-width: 72rem) {
  .project--info {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space--gutter);
  }
  .technical {
    columns: unset;
    grid-column: span 3;
  }
  .technical > div {
    grid-template-columns: repeat(3, 1fr);
  }
  .technical dt {
    grid-column: 1;
  }
  .technical dd {
    grid-column: span 2;
  }
  .plans {
    grid-column: 4 / span 5;
  }
  .entry--text > * {
    grid-column: span 5;
  }
  .entry--text {
    margin-bottom: calc(1rem + var(--header-height));
  }
}
@media (min-width: 90rem) {
  .project--info {
    grid-template-columns: repeat(10, 1fr);
  }
  .plans {
    grid-column: 5 / span 6;
  }
}

/* Plans */

.project--info .plans {
  margin-block-start: var(--space--section);

  position: relative;
  display: grid;
  gap: var(--space--gutter);
  --img-ratio: 1;
}
.project--info .plans::after {
  grid-row: 1;
  content: "";
  display: block;
  aspect-ratio: 1;
}
.project--info .plans ul {
  list-style: none;
  margin: 0;
  padding: 0;
  height: fit-content;
}
.project--info .plans li {
  grid-column: 3 / span 3;
}
.project--info .plans .caption {
  text-decoration: none;
  display: block;
  width: 100%;
  color: var(--color--disabled);
  cursor: pointer;
}
.project--info .plans .caption.active {
  color: var(--color--text);
}

.project--info .plans a {
  --offset: 0;
  position: absolute;
  left: var(--offset);
  width: calc(100% - var(--offset));
  aspect-ratio: var(--img-ratio);
  top: 0;
  /* background: #f1f1f1; */
  display: none;
}
.project--info .plans img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.project--info .plans .caption.active + a {
  display: block;
}
@media (min-width: 48rem) {
  .project--info .plans {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--space--gutter);
  }
  .project--info .plans::after {
    content: "";
    display: block;
    grid-column: 1 / span 8;
    grid-row: 1;
    aspect-ratio: 1;
  }
  .project--info .plans a {
    left: 0;
    --offset: calc(
      (100% - 11 * var(--space--gutter)) / 12 * 4 + 4 *
        var(--space--gutter)
    );
  }
  .project--info .plans ul {
    margin-left: 0;
    grid-row: 1;
    grid-column: 9 / span 4;
    list-style: none;
    margin: 0;
    padding: 0;
    height: fit-content;
  }
}
@media (min-width: 72rem) {
  .project--info .plans ul {
    display: block;
    grid-column: 1;
  }
  .project--info .plans {
    grid-template-columns: repeat(4, 1fr);
    padding-block: 0;
    margin-block-start: 0;
  }
  /* Zone after pour placeholder img */
  .project--info .plans::after {
    content: "";
    display: block;
    grid-column: span 3;
    aspect-ratio: 1;
  }
  .project--info .plans a {
    /* --offset: calc(
      (100% - 3 * var(--space--gutter)) / 4 * 2 + 2 *
        var(--space--gutter)
    ); */
    --offset: calc(
      (100% - 3 * var(--space--gutter)) / 4 +
        var(--space--gutter)
    );
    left: var(--offset);
    object-position: 0 0;
    top: 0;
    bottom: unset;
  }
}
@media (min-width: 90rem) {
  .project--info .plans {
    grid-template-columns: repeat(6, 1fr);
  }
  .project--info .plans ul {
    grid-column: span 2;
  }
  .project--info .plans::after {
    grid-column: span 4;
    max-width: 24rem;
  }
  .project--info .plans a {
    max-width: 24rem;
    --offset: calc(
      (100% - 5 * var(--space--gutter)) / 6 * 2 + 2 *
        var(--space--gutter)
    );
  }
}

/* Lightbox */
.sl-wrapper .sl-close {
  font-family: "body", sans-serif;
  font-weight: 400;
  font-size: 1rem;
}
.sl-navigation button {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sl-wrapper .sl-image .sl-caption.pos-outside {
  background: none;
  color: var(--color--text);
  padding: 0.25rem 0 0;
}
.sl-wrapper .sl-counter {
  top: unset;
  left: unset;
  right: var(--space--sides);
  bottom: 1rem;
}
