/* les règles sont classées dans l'ordre suivant (et dans chaque catégorie de haut en bas) : 
général
page home
page about
page illustrations
page projet
page projet en détail
page 404
media queries*/

/* GENERAL */
:root {
  --palette-brun-0: #f4efeb;
  --palette-brun-1: #cfae89; /*rgba(207, 174, 137, 0.80)*/
  --palette-brun-2: #b38e65; /*rgba(179, 142, 101, 0.80)*/
  --palette-brun-3: #956b4c; /*rgba(149, 107, 76, 0.80)*/
  --palette-brun-4: #744d35; /*rgba(116, 77, 53, 0.80)*/
  --palette-brun-5: #5c3827;
  --palette-brun-6: #46281a;
  --palette-brun-7: #1e0800;
  --palette-brun-8: #9c8a75;
  --palette-gris-1: #c2bbb3;
  --palette-vert-1: #cfd487; /*rgba(207, 212, 135, 0.80)*/
  --palette-vert-2: #9da262;
  --palette-vert-3: #7d8046;
  --palette-vert-4: #242604;
  --palette-bleu-1: #96a5ab; /*rgba(150, 165, 171, 0.80)*/
  --palette-bleu-2: #7fa1b3;
  --palette-rouge-1: #780b18; /*rgba(120, 11, 24, 0.80)*/
  
  --heading-font: "Courier Prime", monospace;
  --body-font: "Courier Prime", monospace;
}
html {
  font-family: "Courier Prime", monospace;
  font-size: calc(12px + 0.390625vw); /* la taille de police change selon largeur viewport */
  line-height: 1.45;
  color: var(--palette-brun-7);
  overscroll-behavior-y: none;
  box-sizing: border-box; /* pour que les choses restent dans les trucs */
  scroll-behavior: smooth;
  scrollbar-color: var(--palette-bleu-1) lightgrey;
}
*, /* astérix = tout, c'est pour s'assurer que tous les éléments sont en box-sizing: border-box */
*:before,
*:after {
  box-sizing: inherit;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex; /* pour que la page remplissent bien l'écran ? je crois ? */
  flex-direction: column;
}
br {
  margin-bottom: 1em;
}
img {
  max-width: 100%;
  border-radius: 0.5rem;
}
footer {
  background-image: url("../assets/5-crop.webp");
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  color: var(--palette-brun-1);
  font-size: 0.7em;
  margin: 0;
  padding: 0.5rem 1rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
footer img {
  margin: 0.5rem;
}
footer .right {
  text-align: right;
}
footer .left {
  align-self: end;
}
footer .mail {
  content: url(../assets/email.webp);
  height: 1.3rem;
}
footer .insta {
  content: url(../assets/insta.webp);
  height: 1.5rem;
  margin-left: 0.8rem;
}
#noai { /* règles concernant le dialog anti ai */
  max-width: 60ch;
  padding: 1.5rem 2rem;
  border: 10px double var(--palette-rouge-1);
}
#noai span {
  font-weight: bold;
  font-size: 1rem;
}
#noai button {
  float: right;
}
#noai::backdrop {
  background-color: black;
  opacity: 40%;
}


a {
  color: inherit; /* sinon c'est le bleu-violet par défault */
  text-decoration: none;
}
a[href^="http"]:not(.insta)::after { /* ajoute une icone qui indique que le lien fait sortir du site sauf si j'ai mis la classe .insta */
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.25em;
  background-size: 100%;
  background-image: url("../assets/external-link.png");
}
button {
  border: none;
  background: none;
  margin: 0;
  padding: 0;
}
button:hover {
  cursor: pointer;
}
nav {
  margin: 1rem;
  text-align: right;
  font-weight: bold;
  line-height: 1.8
}
nav a {
  background-color: var(--palette-brun-1);
  border-radius: 20px;
  padding: 0.1rem 0.5rem 0.1rem;
}
nav a:hover {
  background-color: var(--palette-brun-2);
}
nav .active {
  background: none;
  &:hover {
    background: none;
    cursor: default;
  }
}
main {
  margin: 0 10rem 0;
  padding: 0;
  flex: 1; /* je sais plus mais c'est sûrement utile */
}
h1 {
  margin: 4.5rem 0 1.5rem;
  padding: 0;
  font-family: var(--heading-font);
  font-weight: bold;
  font-size: 3.8rem;
  text-align: center;
  line-height: 1
}

.mail:before {
  content: "";
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  margin-right: 0.5rem;
  background-size: 100%;
  background-image: url("../assets/mail.png");
  vertical-align: middle;
}
.insta:before {
  content: "";
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  margin-right: 0.25em;
  background-size: 100%;
  background-image: url("../assets/instagram.png");
  vertical-align: middle;
}







/* INDEX PAGE ---------------------------------------------------------------------------------------*/
.index-page h1 {
  margin: 0;
}
.index-page h2 {
  margin: 0;
  font-size: 3.8rem;
}
.index-page header {
  text-align: center;
  height: 100%;
  background-image:
    url("../assets/1.2-wide.webp"), 
    url("../assets/1.1 v2.webp");
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position:
    top center,
    bottom center;
  color: var(--palette-vert-4);
}
.index-page .about {
  padding: 11rem 2rem;
}
.about .voir-plus {
  content: url("../assets/bouton5.webp");
  height: 2.5rem;
  width: auto;
  margin-top: 1rem;
}
.about .un {
  content: url("../assets/bouton2.webp");
}
.voir-plus:hover {
  filter: brightness(120%) grayscale(30%);
}

.index-page details {
  margin: 0.5rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 5;
  text-align: right;
}
details summary {
  padding: 0;
  margin: 0.5rem;
  font-weight: bold;
  background-image: url("../assets/feuille.webp");
  background-size: 6rem auto;
  background-repeat: no-repeat;
  background-position: top right;
  height: 3.62rem; /*exactement la hauteur de la feuille*/
  width: 6rem;
  text-align: center;
  vertical-align: middle;
  position: fixed;
  right: 0;
  top: 0;
  &::marker {
    display: none;
    content: "";
  }
  &:hover {
    color: white;
    text-shadow: 2px 2px var(--palette-vert-2);
    filter: brightness(107%)
  }
}
details summary p { /* sans ça je n'arrivais pas à centrer le texte sur la feuille */
  margin: 0;
  padding: 20% 5% 20% 15%;
}
.index-page details:hover {
  cursor: pointer;
}
.index-page nav {
  margin: 0 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-weight: normal;
  border: 10px solid white; /*fallback*/
  border-image: url("../assets/spider.webp");
  border-image-slice: 16.6% 50%;
  border-image-width: 1rem 2.2rem;
  border-image-repeat: stretch;
  border-image-outset: 0 1.15 1.56;
  padding-top: 3.2rem;
}
.index-page nav a {
  display: inline-flex; /* pour que le bg wrap autour du texte */
  align-self: flex-end;
  border-radius: 20px 0 0 20px;
  padding: 0 0.5rem 0;
  line-height: 1.8;
  color: black;
  font-size: 0.8rem;
  background-color: rgba(255, 255, 255, .80);
  &:hover {
    background-color: rgba(150, 165, 171, 0.80)
  }
}

.index-page main {
  background-color: var(--palette-brun-0);
  background-image: url("../assets/2.1 v3.webp");
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: top;
  margin: 0; /*nécessaire car les bg images sont sur les articles*/
  padding: 0; /* idem */
}


.illustrations {
  text-align: center;
  padding-top: 5rem;
  margin: 0 6rem;
}
.illustrations a {
  border: 10px solid var(--palette-brun-4); /*fallback*/
  border-radius: 10px;
  margin: 3rem 0;
  padding: 2rem;
  display: grid;
  grid-template-areas: "img title title";
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-image-slice: 6.6%; /*mon image fait 15 x 15 unités*/
  border-image-width: 1.7rem;
  border-image-repeat: repeat;
  &:hover {
    color: var(--palette-brun-3);
  }
}
.illustrations a:first-child {
  border-image-source: url(../assets/border-1.webp);
  &:hover {
    border-image-source: url(../assets/border-1-tilt.webp);
  }
}
.illustrations a:nth-child(2) {
  border-image-source: url(../assets/border-2.webp);
  &:hover {
    border-image-source: url(../assets/border-2-tilt.webp);
  }
}
.illustrations a:nth-child(3) {
  border-image-source: url(../assets/border-3.webp);
  &:hover {
    border-image-source: url(../assets/border-3-tilt.webp);
  }
}
.illustrations a:nth-child(4) {
  border-image-source: url(../assets/border-4.webp);
  &:hover {
    border-image-source: url(../assets/border-4-tilt.webp);
  }
}
.illustrations a:nth-child(5) {
  border-image-source: url(../assets/border-5.webp);
  &:hover {
    border-image-source: url(../assets/border-5-tilt.webp);
  }
}
.illustrations a:nth-child(even) { /* pour alterner les images gauche droite */
  grid-template-areas: "title title img";
  & img {
    justify-self: end;
  }
}
.illustrations img {
  max-height: 50vh;
  grid-area: img; 
  justify-self: start;
}
.illustrations h2 {
  grid-area: title;
  font-size: 2.5rem;
}


.projets {
  padding: 0;
  height: 100%;
  margin: 6rem 5rem;
}
.projets .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  background-image: url("../assets/plank.webp");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 0 2rem;
  margin: 0 2rem;
  &:hover {
    color: var(--palette-brun-0);
  }
}
.projets h2 {
  font-size: 3rem;
}
.projets .voir-plus {
  content: url("../assets/bouton1.webp");
  height: 2.5rem
}
.projets div:not(.head) {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  margin-top: 1rem;
}
.projets a:not(.head) {
  text-align: center;
  padding: 2.5rem;
  margin: 1rem;
  background-position: bottom left, top right;
  background-repeat: no-repeat;
  background-size: 80%;
  border-radius: 20px;
  &:hover {
    background-color: white;
  }
}
.projets a:first-child:not(.head) {
  background-image: url("../assets/corner-3a.webp"), url("../assets/corner-3b.webp");
}
.projets a:nth-child(2) {
  background-image: url("../assets/corner-1a.webp"), url("../assets/corner-1b.webp");
  background-size: 70%;
}
.projets a:nth-child(3) {
  background-image: url("../assets/corner-6a.webp"), url("../assets/corner-6b.webp");
}
.projets img {
  max-height: 36vh;
  max-width: 50vw;
  text-align: center;
}
.projets figcaption {
  font-weight: bold;
  font-size: 1.2rem;
  max-width: 18ch;
  margin: auto;
}


.contact {
  padding: 0;
  height: 100%;
  background-image: url("../assets/4.1 v2 ani.webp"), url("../assets/4.2 v2 ani.webp");
  background-color: var(--palette-gris-1);
  background-size: 100% auto;
  background-position: top center, bottom center;
  background-repeat: no-repeat;
  margin-bottom: -1.5rem; /* légère tricherie qui permet de faire se superposer les background-image de deux div différents */
  padding-bottom: 1.5rem;
  text-align: center;
}
.contact div {
  margin: 5rem 0;
  padding: 7rem 0 4em;
  height: 100%;
}




/* ABOUT PAGE ----------------------------------------------------------------------------------*/
.about-page body {
  color: var(--palette-vert-4);
  background-image:
  url("../assets/1.2.webp"), url("../assets/1.1 v2 foot.webp");
  background-size: 100% auto, 100% auto;
  background-repeat: no-repeat, no-repeat;
  background-position:
    top center, bottom center;
}
.about-page main {
  margin-bottom: 8rem;
}
.about-page .autobio {
  font-size: 0.95rem;
}
.autobio img {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
  max-height: 17.5rem;
}

.CV {
  padding: 0;
  margin: 1rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  list-style-type: none;
}
.CV li {
  background-size: auto 100%;
  background-repeat: no-repeat;
  margin: 1rem;
  padding: 1rem 1.6rem;
  font-weight: bold;
  color: var(--palette-bleu-2);
  max-width: 27ch;
  align-content: center;
  & a {
    color: inherit;
    text-decoration: underline dashed;
    &:hover {
      text-decoration: none;
      background-color: var(--palette-bleu-2);
      border-radius: 6px;
      color: white;
      padding: 0.3rem 0.3rem 0;
      margin: -0.3rem; /* truc pour que le padding ne fasse pas bouger le texte */
    }
  }
  &:first-child {
    background-image: url("../assets/cv-grad.webp")
  }
  &:nth-child(2) {
    background-image: url("../assets/cv-livre.webp")
  }
  &:nth-child(3) {
    background-image: url("../assets/cv-work.webp")
  }
}

.ami {
  border: 6px dashed var(--palette-brun-3); /*fallback*/
  border-radius: 20px;
  border-image: url("../assets/border-6.webp");
  border-image-slice: 16.6%;
  border-image-repeat: round;
  border-image-width: 1.5rem;
  padding: 2rem 2.5rem;
  margin: 1rem 0 0 1rem;
  color: var(--palette-brun-5);
  max-width: 60ch;
  float: right;
  & h3 {
    margin: 0 0 0.5rem;
    color: var(--palette-brun-3);
    font-size: 1.6rem;
  }
  & br {
    margin-bottom: 0.4rem;
  }
}
.ami ul {
  margin-bottom: 0;
  list-style: "\2764";
}
.ami li {
  padding-left: 1rem;
  margin-bottom: 1rem;
  &::marker {
    color: var(--palette-rouge-1);
    margin-right: 20px;
  }
}
.about-page .mail:before {
  background-image: url("../assets/mail-dark.png");
  margin-right: 0.5rem;
}
.about-page .insta:before {
  background-image: url("../assets/instagram-dark.png");
}







/* ILLUSTRATIONS PAGE -------------------------------------------------------------------------*/
.illustrations-page button img {
  max-height: 80vh;
  box-shadow: 5px 5px 8px var(--palette-gris-1);
  cursor: zoom-in;
}
.illustrations-page footer img {
  box-shadow: none;
}
.illustrations-page main {
  margin: 0 0.5rem 2rem;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 2rem;
}
.illustrations-page header {
  margin-bottom: 2.5rem;
}
.categories header {
  margin-bottom: 1rem;
}
.illustrations-page .head {
  background-image: url("../assets/2.1 v3-crop.webp");
  background-position: top center;
  background-repeat: no-repeat;
  background-size: 100% auto;
  padding-top: 3rem;
}
.illustrations-page nav {
  background-color: var(--palette-brun-8);
  padding: 0.5rem 0.5rem 0;
  margin: 0;
  & a {
    background: none;
    &:hover {
      background-color: var(--palette-brun-1)
    }
  }
  & .active {
    color: var(--palette-brun-0);
    &:hover {
      background: none;
    }
  }
}
.illustrations-page hr {
  border: none;
  max-height: 2rem;
  max-width: 75vw;
  margin-top: 3rem;
  }
.interpretation hr {
  content: url("../assets/sep-9.webp");
}
.BD hr {
  content: url("../assets/sep-3.webp");
}
.technique hr {
  content: url("../assets/sep-1.webp");
}
.mascotte hr {
  content: url("../assets/sep-2.webp");
}
.plus hr {
  content: url("../assets/sep-8.webp");
}
.illustrations-page h1 {
  margin: auto;
  padding: 2rem;
  max-width: 20ch;
}
.illustrations-page .info {
  margin: auto;
  padding: 0.5rem 1rem;
  max-width: 60vw;
  text-align: center;
  background-color: rgba(207, 174, 137, 0.70);
  border-radius: 30px;
}
.illustrations-page {
  background-color: var(--palette-brun-0);
}
.illustrations-page .illustrations { /*concerne la page catégories*/
  padding-top: 0
}
.illustrations-page button {
  border: none;
  background: none;
  margin: 0;
  padding: 0;
}


.image-pop { /* règles concernant le dialog modal des illu */
  margin: auto;
  padding: 0;
  max-height: 95vh;
  max-width: 95vw;
  border: none;
  background: none;
}
.image-pop button {
  position: absolute;
  right: 0;
  top: 0;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  line-height: 1;
  margin: 0.5rem;
  padding: 0.2rem 0.3rem 0.25rem;
  border-radius: 40px;
  background-color: rgba(0, 0, 0, 0.30)
}
.image-pop div {
  display: grid;
  grid-template-areas: "img p";
  gap: 1rem;
}
.image-pop img {
  grid-area: img;
  max-height: 90vh;
  border-color: var(--palette-brun-1);
}
.image-pop p {
  grid-area: p;
  align-self: end;
  max-width: 33ch;
  font-size: 0.6rem;
  line-height: 1.2;
  color: white;
}
.image-pop p a {
  color: white;
  text-decoration: underline dotted;
  &:hover {
    text-decoration: none;
    color: var(--palette-bleu-2)
  }
}
.image-pop time {
  font-size: 0.5rem;
  font-style: italic;
  display: block;
  margin-top: 0.7rem;
}
.image-pop span {
  font-weight: bold;
  font-size: 0.7rem;
  display: block;
  margin-bottom: 0.7rem;
}
.image-pop::backdrop {
  background-color: black;
  opacity: 85%;
}







/* PROJETS PAGE ---------------------------------------------------------------------------------*/
.projets-page {
  background-color: var(--palette-brun-0)
}
.projets-page h1 {
  background-image: url("../assets/plank.webp");
  background-size: 100% 100%;
  margin: 3rem 5rem 1rem;
  padding: 1rem;
}
.projets-page header {
  margin-bottom: 3rem;
}
.projets-page img {
  max-height: 40vh;
  float: left;
  margin-right: 1rem;
}
.projets-page article {
  margin-bottom: 2.5rem;
  border-radius: 0.8rem;
  padding: 3.3rem 4rem;
  display: flow-root; /* pour éviter que l'image sorte de l'article */
  height: 100%;
  background-position: bottom left, top right;
  background-repeat: no-repeat;
  background-size: 40%;
}
.projets-page a:first-child article {
  background-image: url("../assets/corner-3a.webp"), url("../assets/corner-3b.webp");
}
.projets-page a:nth-child(2) article {
  background-image: url("../assets/corner-1a.webp"), url("../assets/corner-1b.webp");
  background-size: 28%;
}
.projets-page a:nth-child(3) article {
  background-image: url("../assets/corner-6a.webp"), url("../assets/corner-6b.webp");
}
.projets-page a:nth-child(4) article {
  background-image: url("../assets/corner-2a.webp"), url("../assets/corner-2b.webp");
}
.projets-page a:nth-child(5) article {
  background-image: url("../assets/corner-4a.webp"), url("../assets/corner-4b.webp");
}
.projets-page a:nth-child(6) article {
  background-image: url("../assets/corner-5a.webp"), url("../assets/corner-5b.webp");
}
.projets-page a:nth-child(7) article {
  background-image: url("../assets/corner-7a.webp"), url("../assets/corner-7b.webp");
} /* quand on aura plus de 7 articles, reprend les corners du début */

.projets-page h2 {
  margin: 0 0 1rem;
}
.projets-page time {
  float: right;
  padding-top: 0.3rem;
  padding-left: 1.5rem;
  font-style: italic;
  font-size: 0.8rem;
}
.projets-page article:hover {
  background-color: white;
}




/* PAGE PROJETS EN DÉTAIL -----------------------------------------------------------------*/
.projets-page-detail {
  background-color: var(--palette-brun-0);
  background-image: url("../assets/geol.webp");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top center;
}
.projets-page-detail main {
  margin: 3rem 7rem 1rem;
}
.principal {
  float: left;
  max-height: 90vh;
  max-width: 40vw;
  margin: 0.5rem 1.5rem 1.5rem 0;
}
.projets-page-detail h1 {
  margin: 0 0 1rem;
  padding: 0;
  text-align: left;
  font-size: 3.3rem;
  line-height: 1;
}
.projets-page-detail time {
  font-style: italic;
  font-weight: bold;
}
.projets-page-detail aside {
  float: right;
  padding: 0.8rem 1rem 0;
  margin: 0 0 0.8rem 0.8rem;
  border: 6px solid var(--palette-brun-1);
  background-color: rgba(207, 174, 137, 0.50);
  border-radius: 20px;
  max-width: 35%;
  font-size: 0.9rem;
  font-weight: bold;
  & ul {
    margin: 0.3rem 0 0.5rem;
  }
}
.projets-page-detail main a {
  text-decoration: underline;
  font-weight: normal;
  &:hover {
    text-decoration: none;
    color: white;
  }
}
.projets-page-detail .galerie {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
}
.projets-page-detail .galerie img:not(.image-pop img) {
  max-height: 60vh
}







/* 404 ERROR PAGE -------------------------------------------------------------------------*/
.error body {
  background-color: var(--palette-brun-0);
}
.error img {
  max-height: 55vh;
  margin: 1rem;
}
.error p {
  text-align: left;
}
.error main {
  margin-top: 3rem;
  margin-bottom: 3rem;
  text-align: center;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.error h1 {
  margin-top: 2rem;
  text-align: left
}



/* MEDIA QUERIES ----------------------------------------------------------------------------------------------------------*/

@media screen and (max-width: 1300px) { /* ------- 1300 ------------------------ */
  main {
    margin: 0 7rem 0;
  }
  .index-page .about {
    padding: 10rem 2rem 13rem;
  }
  .projets-page-detail main {
    margin: 3rem 6rem 1rem;
  }
  .projets-page-detail h1 {
    font-size: 3.1rem;
  }
}


@media screen and (max-width: 1000px) { /* ---------------------1000-------------------*/
  main {
    margin: 0 5rem 0;
  }
  .index-page .about {
    padding: 9rem 2rem 10rem;
  }
  .projets-page time {
    float: none;
    padding: 0;
  }
  .projets-page-detail main {
    margin: 2rem 3.5rem 1rem;
  }
  .error main {
    display: block;
    & h1 {
      text-align: center;
    }
    & p {
      text-align: center;
    }
  }
}


@media screen and (max-width: 850px) { /*------------------------850-------------------*/
  main {
    margin: 0 3rem 0;
  }
  h1 {
    margin-top: 2rem;
  }
  .about-page body {
    background-position: top center, bottom 2rem center /* pour éviter que le footer mange le bg du bas */
  }
  .index-page h2 {
    font-size: 3.6rem
  }
  .index-page h1 {
    font-size: 3rem;
  }
  .illustrations h2 {
    font-size: 1.8rem;
  }
  .illustrations {
    padding-top: 1.5rem;
  }
  .illustrations, .projets {
    margin: 0 1.5rem;
  }
  .index-page .about {
    padding: 7rem 2rem 8rem;
  }
  .index-page .projets .head {
    margin: 0 1rem;
    & h2 {
      font-size: 3rem;
    }
  }
  .projets-page img {
    max-height: auto;
    max-width: 35vw;
  }
  .projets-page-detail main {
    margin: 3rem 3rem 1rem;
    display: flex;
    flex-direction: column;
  }
  .projets-page-detail h1 {
    font-size: 2.8rem;
    order: 1;
  }
  .projets-page-detail main time {
    order: 2;
    margin-bottom: 0.5rem;
  }
  .projets-page-detail .principal {
    order: 3;
    align-self: center;
    margin: 0 0 1rem;
    max-width: 100%;
    z-index: 5;
  }
  .projets-page-detail p, .projets-page-detail div {
    order: 4;
  }
  .projets-page-detail aside {
    float: none;
    max-width: none;
    margin: 0.8rem 2rem;
  }
}



@media screen and (max-width: 500px) { /*-----------------------------500-----------------*/
  main, .projets-page-detail main {
    margin: 0 1.5rem 0;
  }
  h1, .projets-page-detail h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 2.8rem;
  }
  nav {
    font-size: 0.9rem;
  }
  p {
    margin: 0;
  }
  footer {
    display: grid;
    grid-template-areas: "p1 bt" "p2 bt";
    gap: 0.3rem 1rem;
    line-height: 1.1;
    padding-top: 1rem;
  }
  footer .left {
    grid-area: p2;
  }
  footer .right {
    grid-area: p1;
    text-align: left;
  }
  footer button {
    grid-area: bt;
  }
  
  .index-page h2 {
    font-size: 2.8rem
  }
  .index-page header {
    background-image:
      url("../assets/1.2-natel.webp"), url("../assets/1.1-natel-ani crop.webp");
    background-size: 100% auto, 100% auto;
    background-repeat: no-repeat, no-repeat;
    background-position:
      top center,
      bottom center;
  }
  .index-page .about {
    padding: 11rem 2rem 10rem;
  }
  .index-page main {
    background-image: url("../assets/2.1 v3 natel.webp");
  }
  .about-page .ami ul {
    padding-left: 1.5rem;
  }
  .illustrations {
    padding-top: 3rem;
  }
  .illustrations h2 {
    font-size: 1.5rem;
  }
  .illustrations a {
    display: block;
    border-image-width: 1.3rem;
    padding: 1rem;
    margin: 2rem 1rem;
  }
  .illustrations img {
    max-height: 40vh;
  }
  .projets h2 {
    font-size: 2.5rem;
    justify-self: center;
  }
  .index-page .head {
    display: block;
    text-align: center;
    padding: 1rem 1rem 2rem;
    margin: 0 0.5rem;
  }
  .projets .voir-plus {
    margin: 0 auto;
  }
  .index-page .contact div {
    margin: 1rem 0;
    padding: 8rem 0;
  }
  .contact {
     background-image:
      url("../assets/4.1 v2 ani natel.webp"),
      url("../assets/4.2 v2 ani natel.webp");
  }
  .about-page body {
    background-image:
      url("../assets/1.2-natel.webp"),
      url("../assets/1.1-natel-ani.webp");
    background-size: 100% auto, 100% auto;
    background-repeat: no-repeat, no-repeat;
    background-position:
      top center,
      bottom center;
  }
  .autobio img {
    float: none;
    display: block;
    margin: 0 auto 2rem;
  }
  .autobio p {
    text-align: justify;
  }
  .about-page h2, .about-page h1 {
    line-height: 1.1
  }
  .about-page h1 {
    margin-top: 3rem
  }
  .projets-page img {
    float: none;
    display: block;
    margin: 0 auto 0.5rem;
    max-width: 100%;
  }
  .projets-page h2 {
    margin: 0;
  }
  .projets-page h1 {
    margin: 2rem 2rem 0;
  }
  .projets-page-detail aside {
    margin: 0.8rem auto;
  }
  .illustrations-page .head {
    background-image: url("../assets/2.1 v3 natel-crop.webp");
    padding-top: 2rem;
    & h1 {
      max-width: 15ch;
      font-size: 2.8rem;
    }
  }
  .categories header {
    margin-bottom: 0;
  }
}



/* toutes les règles basé sur l'aspect ratio servent à l'affichage des popup modal de la section illustration. 
les images sont divisées en 3 catégories (wide, square et portrait) selon leur aspect ratio (>2, 1/1, <1), nommées dans la class du dialog.
dès que la règle s'applique, la légende passe sous l'image et non plus à côté */
@media (max-aspect-ratio: 1.75) {
  .wide div {
    grid-template-areas: "img" "p";
    justify-items: center;
  }
  .wide p {
    max-width: 100%;
    margin: 0;
  }
}
@media (max-aspect-ratio: 1) {
  .image-pop:not(.portrait, .square) div {
    grid-template-areas: "img" "p";
    justify-items: center;
  }
  .image-pop:not(.portrait, .square) p {
    max-width: 100%;
    margin: 0;
  }
}
@media (max-aspect-ratio: 0.8) {
  .square div {
    grid-template-areas: "img" "p";
    justify-items: center;
  }
  .square p {
    max-width: 100%;
    margin: 0;
  }
}
@media (max-aspect-ratio: 0.6) {
  .portrait div {
    grid-template-areas: "img" "p";
    justify-items: center;
  }
  .portrait p {
    max-width: 100%;
    margin: 0;
  }
}




@media (hover: none) { /* règles spéciales pour les appareils sans souris ex touchscreen */
  .projets-page article {
    border: none;
    background-color: white;
  }
  .projets div a {
    background-color: white;
  }
}
