/*
Base styles of the article blocks (image, columns, gallery, buttons, cover…), loaded before style.css.
They come from the old WordPress block styles, renamed and reduced to the blocks and options this site uses.
style.css adjusts most of them to the theme. Every block is described in docs/article-patterns.md.

Background and text colours: an element with a "bg-…" class gets padding (paragraphs, columns), and
links inside a paragraph with a "color-…" class take its colour. The selectors [class*="bg-"] and
[class*="color-"] mean "has any background colour class" and "has any text colour class".
*/

/* Buttons: <div class="buttons"><div class="button outline"><a class="button-link">… */
.button-link {
  color: #fff;
  background-color: #32373c;
  border-radius: 9999px;
  box-shadow: none;
  cursor: pointer;
  display: inline-block;
  font-size: 1.125em;
  padding: calc(0.667em + 2px) calc(1.333em + 2px);
  text-align: center;
  text-decoration: none;
  overflow-wrap: break-word;
  box-sizing: border-box;
}
.button-link:active,
.button-link:focus,
.button-link:hover,
.button-link:visited {
  color: #fff;
}
.outline > .button-link {
  border: 2px solid;
  padding: 0.667em 1.333em;
}
.outline > .button-link:not([class*="color-"]) {
  color: currentColor;
}
.outline > .button-link:not([class*="bg-"]) {
  background-color: transparent;
}
.buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  column-gap: 0.5em;
}
.buttons > .button {
  display: inline-block;
  margin: 0 0 0.5em;
}
.buttons.items-left {
  justify-content: flex-start;
}
.buttons.items-center {
  justify-content: center;
}
.buttons.centered,
.button.centered {
  text-align: center;
}

/* Columns: <div class="columns"><div class="column">… */
.columns {
  display: flex;
  margin-bottom: 1.75em;
  box-sizing: border-box;
  flex-wrap: wrap;
}
@media (min-width: 782px) {
  .columns {
    flex-wrap: nowrap;
  }
}
.columns[class*="bg-"] {
  padding: 1.25em 2.375em;
}
.columns.valign-top {
  align-items: flex-start;
}
.columns.valign-center {
  align-items: center;
}
.columns.valign-bottom {
  align-items: flex-end;
}
.column {
  flex-grow: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}
@media (max-width: 599px) {
  .column {
    flex-basis: 100% !important;
  }
}
@media (min-width: 600px) and (max-width: 781px) {
  .column:not(:only-child) {
    flex-basis: calc(50% - 1em) !important;
    flex-grow: 0;
  }
  .column:nth-child(2n) {
    margin-left: 2em;
  }
}
@media (min-width: 782px) {
  .column {
    flex-basis: 0;
    flex-grow: 1;
  }
  .column[style*="flex-basis"] {
    flex-grow: 0;
  }
  .column:not(:first-child) {
    margin-left: 2em;
  }
}
.column.valign-top {
  align-self: flex-start;
}
.column.valign-center {
  align-self: center;
}
.column.valign-bottom {
  align-self: flex-end;
}
.column.valign-bottom,
.column.valign-center,
.column.valign-top {
  width: 100%;
}

/* Cover (text over a dimmed image): <div class="cover dim"><img class="cover-image"><div class="cover-content">… */
.cover {
  position: relative;
  background-size: cover;
  background-position: 50%;
  min-height: 430px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1em;
  box-sizing: border-box;
}
.cover.parallax {
  background-attachment: fixed;
}
@supports (-webkit-overflow-scrolling: touch) {
  .cover.parallax {
    background-attachment: scroll;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cover.parallax {
    background-attachment: scroll;
  }
}
.cover.dim:not([class*="bg-"]) {
  background-color: #000;
}
.cover.dim::before {
  content: "";
  background-color: inherit;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.5;
}
.cover.dim-60::before {
  opacity: 0.6;
}
.cover.dim-70::before {
  opacity: 0.7;
}
.cover.dim-80::before {
  opacity: 0.8;
}
.cover.dim-90::before {
  opacity: 0.9;
}
.cover.dim-100::before {
  opacity: 1;
}
.cover .cover-content {
  width: 100%;
  z-index: 1;
  color: #fff;
}
.cover h1:not([class*="color-"]),
.cover h2:not([class*="color-"]),
.cover h3:not([class*="color-"]),
.cover h4:not([class*="color-"]),
.cover h5:not([class*="color-"]),
.cover h6:not([class*="color-"]),
.cover p:not([class*="color-"]) {
  color: inherit;
}
.cover img.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  outline: none;
  border: none;
  box-shadow: none;
}
.cover-image {
  z-index: 0;
}

/* YouTube, Vimeo or Issuu player: <figure class="embed ratio-16-9"><div class="embed-frame"><iframe>… */
.cover .embed {
  min-width: 320px;
  min-height: 240px;
}
.embed {
  margin: 0 0 1em;
}
.embed figcaption {
  margin-top: 0.5em;
  margin-bottom: 1em;
}
.embed iframe {
  max-width: 100%;
}
.embed-frame {
  position: relative;
}
/* With a "ratio-…" class, the player keeps its proportions at every width. */
.embed[class*="ratio-"] .embed-frame::before {
  content: "";
  display: block;
  padding-top: 50%;
}
.embed[class*="ratio-"] iframe {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 100%;
  width: 100%;
}
.embed.ratio-16-9 .embed-frame::before {
  padding-top: 56.25%;
}
.embed.ratio-4-3 .embed-frame::before {
  padding-top: 75%;
}
.embed.ratio-1-1 .embed-frame::before {
  padding-top: 100%;
}
.embed.ratio-9-16 .embed-frame::before {
  padding-top: 177.77%;
}

/* Gallery: <figure class="gallery cols-3 cropped"><ul class="gallery-grid"><li class="gallery-item">… */
.gallery-grid,
.gallery {
  display: flex;
  flex-wrap: wrap;
  list-style-type: none;
  padding: 0;
  margin: 0;
}
.gallery-grid .gallery-item,
.gallery .gallery-item {
  margin: 0 1em 1em 0;
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  justify-content: center;
  position: relative;
  align-self: flex-start;
  width: calc(50% - 1em);
}
.gallery-grid .gallery-item:nth-of-type(2n),
.gallery .gallery-item:nth-of-type(2n) {
  margin-right: 0;
}
.gallery-grid .gallery-item figure,
.gallery .gallery-item figure {
  margin: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.gallery-grid .gallery-item img,
.gallery .gallery-item img,
.gallery .gallery-item video {
  display: block;
  max-width: 100%;
  height: auto;
  width: auto;
}
.gallery-grid .gallery-item figcaption,
.gallery .gallery-item figcaption {
  position: absolute;
  bottom: 0;
  width: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 3em 0.77em 0.7em;
  color: #fff;
  text-align: center;
  font-size: 0.8em;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3) 70%, transparent);
  box-sizing: border-box;
  margin: 0;
}
.gallery-grid .gallery-item figcaption img,
.gallery .gallery-item figcaption img {
  display: inline;
}
.gallery-grid figcaption,
.gallery figcaption {
  flex-grow: 1;
}
.gallery-grid.cropped .gallery-item,
.gallery.cropped .gallery-item {
  align-self: inherit;
}
.gallery-grid.cropped .gallery-item a,
.gallery-grid.cropped .gallery-item img,
.gallery.cropped .gallery-item a,
.gallery.cropped .gallery-item img,
.gallery.cropped .gallery-item video {
  width: 100%;
  height: 100%;
  flex: 1;
  object-fit: cover;
}
@media (min-width: 600px) {
  .gallery-grid.cols-3 .gallery-item,
  .gallery.cols-3 .gallery-item {
    width: calc(33.33333% - 0.66667em);
    margin-right: 1em;
  }
  .gallery-grid.cols-4 .gallery-item,
  .gallery.cols-4 .gallery-item {
    width: calc(25% - 0.75em);
    margin-right: 1em;
  }
  .gallery-grid.cols-5 .gallery-item,
  .gallery.cols-5 .gallery-item {
    width: calc(20% - 0.8em);
    margin-right: 1em;
  }
  .gallery-grid.cols-6 .gallery-item,
  .gallery.cols-6 .gallery-item {
    width: calc(16.66667% - 0.83333em);
    margin-right: 1em;
  }
  .gallery-grid.cols-2 .gallery-item:nth-of-type(2n),
  .gallery-grid.cols-3 .gallery-item:nth-of-type(3n),
  .gallery-grid.cols-4 .gallery-item:nth-of-type(4n),
  .gallery-grid.cols-5 .gallery-item:nth-of-type(5n),
  .gallery-grid.cols-6 .gallery-item:nth-of-type(6n),
  .gallery.cols-2 .gallery-item:nth-of-type(2n),
  .gallery.cols-3 .gallery-item:nth-of-type(3n),
  .gallery.cols-4 .gallery-item:nth-of-type(4n),
  .gallery.cols-5 .gallery-item:nth-of-type(5n),
  .gallery.cols-6 .gallery-item:nth-of-type(6n) {
    margin-right: 0;
  }
}
.gallery-grid .gallery-item:last-child,
.gallery .gallery-item:last-child {
  margin-right: 0;
}
.gallery-grid.centered .gallery-item figure,
.gallery.centered .gallery-item figure {
  justify-content: center;
}

/* Mosaic ("masonry"): <figure class="gallery masonry cols-3 spaced"><ul class="gallery-grid"><li class="gallery-item">…
   Each image keeps its proportions and the images of a column follow one another, whatever their heights.
   2 columns on phones, cols-2 to cols-6 from 600px. "spaced": rounded corners and a space between the images;
   without it, square corners and the images touch each other. */
.gallery.masonry {
  display: block;
}
.gallery.masonry .gallery-grid {
  display: block;
  columns: 2;
  column-gap: 0;
}
.gallery.masonry .gallery-grid > .gallery-item {
  display: block;
  width: auto;
  margin: 0;
  break-inside: avoid;
  overflow: hidden;
}
.gallery.masonry .gallery-item figure {
  display: block;
  height: auto;
}
.gallery.masonry .gallery-item a,
.gallery.masonry .gallery-item img,
.gallery.masonry .gallery-item video {
  display: block;
  width: 100%;
  height: auto;
}
.gallery.masonry.spaced .gallery-grid {
  column-gap: 0.5rem;
}
.gallery.masonry.spaced .gallery-grid > .gallery-item {
  margin-bottom: 0.5rem;
  /* The same corners as an Image's "rounded" (style.css). */
  border-radius: 16px;
}
/* Spaced and as wide as the screen: a margin on the sides as wide as the space between the images. */
.gallery.masonry.spaced.width-full {
  padding: 0 0.5rem;
  box-sizing: border-box;
}
@media (min-width: 600px) {
  .gallery.masonry.cols-3 .gallery-grid {
    columns: 3;
  }
  .gallery.masonry.cols-4 .gallery-grid {
    columns: 4;
  }
  .gallery.masonry.cols-5 .gallery-grid {
    columns: 5;
  }
  .gallery.masonry.cols-6 .gallery-grid {
    columns: 6;
  }
  .gallery.masonry.spaced .gallery-grid {
    column-gap: 1rem;
  }
  .gallery.masonry.spaced .gallery-grid > .gallery-item {
    margin-bottom: 1rem;
  }
  .gallery.masonry.spaced.width-full {
    padding: 0 1rem;
  }
}

/* Group: <div class="group"><div class="group-inner">… */
.group {
  box-sizing: border-box;
}

/* Image: <figure class="image">… (older pages: <div class="image"><figure class="centered">…) */
.image {
  margin: 0 0 1em;
}
.image img {
  max-width: 100%;
}
.image:not(.circle) img {
  border-radius: inherit;
}
.image.centered {
  text-align: center;
}
.image.width-full img,
.image.width-wide img {
  width: 100%;
}
.image .centered {
  display: table;
  margin-left: auto;
  margin-right: auto;
}
.image .centered > figcaption {
  display: table-caption;
  caption-side: bottom;
}
.image figcaption {
  margin-top: 0.5em;
  margin-bottom: 1em;
}
.image.circle img {
  border-radius: 9999px;
}
.image figure {
  margin: 0;
}

/* Paragraph with a background or text colour (see the note at the top). */
p[class*="bg-"] {
  padding: 1.25em 2.375em;
}
p[class*="color-"] a {
  color: inherit;
}

/* Separator: <hr class="separator"> (thick line) or <hr class="separator dots"> */
.separator {
  border-top: 1px solid;
  border-bottom: 1px solid;
}
.separator.dots {
  background: none !important;
  border: none;
  /* The text's colour (white), not the grey browsers give to <hr>. */
  color: inherit;
  text-align: center;
  line-height: 1;
  height: auto;
}
.separator.dots::before {
  content: "···";
  color: currentColor;
  font-size: 1.5em;
  letter-spacing: 2em;
  padding-left: 2em;
  font-family: serif;
}

/* Social network icons: <ul class="social-links logos-only"><li class="social-link social-instagram">… */
.social-links {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  padding-right: 0;
  text-indent: 0;
  margin-left: 0;
}
.social-links .social-link a,
.social-links .social-link a:hover {
  text-decoration: none;
  border-bottom: 0;
  box-shadow: none;
}
.social-links .social-link {
  margin: 4px 8px 4px 0;
}
.social-links .social-link a {
  padding: 0.25em;
}
.social-links .social-link svg {
  width: 1em;
  height: 1em;
}
.social-links {
  font-size: 24px;
}
.social-links.centered {
  justify-content: center;
  display: flex;
}
.social-link {
  display: block;
  border-radius: 9999px;
  transition: transform 0.1s ease;
  height: auto;
}
@media (prefers-reduced-motion: reduce) {
  .social-link {
    transition-duration: 0s;
    transition-delay: 0s;
  }
}
.social-link a {
  display: block;
  line-height: 0;
  transition: transform 0.1s ease;
}
.social-link:hover {
  transform: scale(1.1);
}
.social-links .social-link .social-link-anchor,
.social-links .social-link .social-link-anchor:active,
.social-links .social-link .social-link-anchor:hover,
.social-links .social-link .social-link-anchor:visited,
.social-links .social-link .social-link-anchor svg {
  color: currentColor;
  fill: currentColor;
}
.social-links:not(.logos-only) .social-link {
  background-color: #f0f0f0;
  color: #444;
}
.social-links:not(.logos-only) .social-deviantart {
  background-color: #02e49b;
  color: #fff;
}
.social-links:not(.logos-only) .social-dribbble {
  background-color: #e94c89;
  color: #fff;
}
.social-links:not(.logos-only) .social-etsy {
  background-color: #f45800;
  color: #fff;
}
.social-links:not(.logos-only) .social-facebook {
  background-color: #1778f2;
  color: #fff;
}
.social-links:not(.logos-only) .social-instagram {
  background-color: #f00075;
  color: #fff;
}
.social-links.logos-only .social-link {
  background: none;
  padding: 4px;
}
.social-links.logos-only .social-deviantart {
  color: #02e49b;
}
.social-links.logos-only .social-dribbble {
  color: #e94c89;
}
.social-links.logos-only .social-etsy {
  color: #f45800;
}
.social-links.logos-only .social-facebook {
  color: #1778f2;
}
.social-links.logos-only .social-instagram {
  color: #f00075;
}

/* Space: <div class="spacer spacer-32" aria-hidden="true"></div> (heights are in style.css) */
.spacer {
  clear: both;
}

/* Video file: <figure class="video"><video>… */
.video {
  margin: 0 0 1em;
}
.video video {
  width: 100%;
}
.video [poster] {
  object-fit: cover;
}
.video.centered {
  text-align: center;
}
.video figcaption {
  margin-top: 0.5em;
  margin-bottom: 1em;
}

/* Text: background colour from the old default palette, sizes and alignment. */
.bg-dark-gray {
  background-color: #313131;
}
.text-small {
  font-size: 0.8125em;
}
.text-large {
  font-size: 2.25em;
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* Gallery of posts (like an Instagram profile):
   <ul class="posts cols-3"><li class="post"><div class="post-images"><a data-lightbox><img></a>…</div><div class="post-text">…</div></li></ul>
   Each post shows its first image (square, or 4:5 with "portrait") and how many images it has.
   Posts touch each other; "spaced" puts a space between them.
   A click opens the viewer (src/assets/lightbox.js) on the post, with its description. */
.posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  margin: 0 auto;
  padding: 0;
}
.posts .post {
  position: relative;
  margin: 0;
  overflow: hidden;
}
.posts .post-images {
  position: relative;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
}
.posts.portrait .post-images {
  aspect-ratio: 4 / 5;
}
.posts .post-images > a {
  display: none;
}
.posts .post-images > a:first-child {
  display: block;
  width: 100%;
  height: 100%;
}
.posts .post-images picture,
.posts .post-images img,
.posts .post-images video {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  transition: transform 0.4s ease-out;
}
.posts .post:hover .post-images img,
.posts .post:hover .post-images video {
  transform: scale(1.04);
}
/* How many images the post has (up to 9, then "9+"); "médias" when it has videos too, "Vidéo" for a video alone. */
.posts .post-images:has(> a)::after {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 1rem;
  background: rgba(9, 22, 42, 0.75);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.4;
  pointer-events: none;
  content: '1 image';
}
.posts .post-images:has(> a:nth-child(2))::after {
  content: '2 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(3))::after {
  content: '3 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(4))::after {
  content: '4 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(5))::after {
  content: '5 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(6))::after {
  content: '6 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(7))::after {
  content: '7 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(8))::after {
  content: '8 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(9))::after {
  content: '9 ' var(--post-media, 'images');
}
.posts .post-images:has(> a:nth-child(10))::after {
  content: '9+ ' var(--post-media, 'images');
}
.posts .post-images:has(> a > video) {
  --post-media: 'médias';
}
.posts .post-images:has(> a:only-child > video)::after {
  content: 'Vidéo';
}
/* The description is only shown in the viewer (lightbox.js reads it from here), not over the image. */
.posts .post-text {
  display: none;
}
.posts.spaced {
  gap: 0.5rem;
}
/* "Coins arrondis" (with the space between the posts): the same corners as an Image's (style.css, .image.rounded). */
.posts.spaced.rounded .post {
  border-radius: 16px;
}
@media (min-width: 600px) {
  .posts.spaced {
    gap: 1rem;
  }
  .posts.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .posts.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Coordonnées: an e-mail address and a phone number, one per line, protected from the robots that collect addresses
   (data-contact, shown by site.js; see lib/contact.js). The same link can be in a text. */
.contact-details {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.contact-details li {
  margin: 0.25rem 0;
}
.contact-details .contact-label {
  margin-right: 0.5em;
  opacity: 0.75;
}
.contact-link {
  overflow-wrap: anywhere;
}
