* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

:root {
  --coef: 1.2;
  --s0: 1rem;
  --s-1: calc(var(--s0) / var(--coef));
  --s1: calc(var(--coef) * var(--s0));
  --s2: calc(var(--coef) * var(--s1));
  --s3: calc(var(--coef) * var(--s2));
  --s4: calc(var(--coef) * var(--s3));
  --s5: calc(var(--coef) * var(--s4));

  --bg: white;
  --fg: black;
  --accent: #1e1e1e;
  --gap: 5rem;
  --delay: 1s;
  --easing: cubic-bezier(0.87, 0, 0.13, 1);
  --max-width: 1100px;
  --stroke-width: 2px;

  --border: ridge var(--fg) 0.4rem;

  --article-width: 20vmin;
  --rayon: 26vmin;
}

html,
body {
  scroll-behavior: smooth;
}

body {
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  background-color: var(--bg);
  color: var(--fg);
  margin: 0;
  font-family: serif;
  font-style: normal;
  font-weight: normal;
  transition:
    background-color var(--easing) var(--delay),
    color var(--easing) var(--delay);
  height: 100vh;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--fg);
}

::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
  cursor: grabbing;
}

body ::selection {
  background: var(--fg);
  color: var(--accent) !important;
}

img {
  max-width: 100%;
  max-height: 100%;
}

/* TYPO GENERAL */
html,
body {
  font-size: clamp(1rem, 1rem + 0.6vw, 1.2rem);
  color: var(--fg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--fg);
  font-weight: normal;
  font-style: normal;
}

h2 {
  font-size: var(--s3);
  margin-bottom: 1rem;
}
h3 {
  font-size: var(--s3);
}
h4 {
  font-size: var(--s2);
}
h5 {
  font-size: var(--s1);
}
h6 {
  font-size: var(--s0);
}

a,
a:visited {
  color: var(--fg);
}

a:hover,
a:focus {
  text-decoration: none;
}

p {
  line-height: 1.4;
  font-size: var(--s0);
}

/* HEADER */
header.menu-temp {
  position: absolute;
  font-family: "Redaction_10-Bold-CVB";
  font-weight: normal;
  color: var(--bg);
  font-size: 5rem;
  -webkit-text-stroke: 0.01rem var(--fg);
  text-shadow: 0 0 var(--fg);
  transition:
    all var(--easing) var(--delay),
    text-shadow 0.25s ease;
}

header.menu-temp:hover {
  text-shadow:
    -0.1em 0.2rem 0 #00daaf,
    -0.2em 0.4rem 0 #0a78fe,
    -0.3em 0.6rem 0 #ae00e5,
    -0.4em 0.8rem 0 #ec015c;
  cursor: pointer;
}

header.menu-temp span {
  position: fixed;
  line-height: 0.5;
}

header.menu-temp a {
  color: var(--fg);
  transition: color var(--easing) var(--delay);
  text-decoration: none;
  -webkit-text-stroke: var(--stroke-width) var(--bg);
  margin: 0;
}

/* z-index dans cet ordre pour la version mobile */
header.menu-temp .nos {
  top: 0rem;
  left: 1rem;
  z-index: 1003;
}
header.menu-temp .futurs {
  top: 0rem;
  right: 1rem;
  z-index: 1002;
}
header.menu-temp .point {
  bottom: 0rem;
  left: 1rem;
  z-index: 1001;
}
header.menu-temp .net {
  bottom: 0rem;
  right: 1rem;
  z-index: 1000;
}

nav {
  position: fixed;
  bottom: 0;
  left: 0;

  width: 100%;
  background: transparent;
}

nav ul {
  font-size: var(--s2);
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: 3rem;
  margin: 0 auto;
  border-radius: 1em;
  padding: 1rem 2rem;

  max-width: 100%;
  text-align: center;
}

/* MAIN */
main {
  padding-block: 0;
  overflow-y: auto;
  height: 100%;
  font-size: var(--s0);
  scrollbar-color: var(--fg) var(--bg);
  scrollbar-width: auto;
}

#toggle-popup,
#popup {
  font-family: "Young Serif";
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#toggle-popup {
  cursor: pointer;
  border: var(--border);
  font-size: var(--s5);
  background-color: var(--bg);
  text-align: center;
  height: calc(var(--s5) * 1.5);
  width: calc(var(--s5) * 1.5);
  border-radius: var(--s5);
  transform: translate(-50%, -50%) scale(1);
}

#toggle-popup:focus-visible {
  outline-offset: 0.2rem;
}

#toggle-popup:active {
  transform: translate(-50%, -50%) scale(0.99);
}

#popup {
  top: 25%;
  display: none;

  background-color: var(--bg);
  padding: 2rem;
  border: var(--border);
  width: calc(var(--rayon) * 4);
}

#popup.open {
  display: block;
}

#popup h1 {
  text-transform: uppercase;
  font-size: var(--s5);
  margin-bottom: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  #fond div {
    background: linear-gradient(var(--color) 40%, transparent);
    position: fixed;
    inset: 0;
    z-index: -1;
    transform: translateY(-100%);
    transition:
      transform ease-out calc(var(--delay) / 2),
      background ease-out calc(var(--delay) / 2);
  }
}

ul.articles-list-home {
  list-style: none;
  position: fixed;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: calc(var(--rayon) * 2);
  width: calc(var(--rayon) * 2);
  border-radius: 100%;
  /* border: solid red 3px; */
}

.articles-list-home li {
  perspective: 1000px;

  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  height: auto;
  width: var(--article-width);
  margin: calc(var(--article-width) * -1) calc(var(--article-width) / -2);

  /* rotation définie dans les templates Jinja pour le dynamisme */
  /* translateY à changer en translate s'il y a 6 volets */
  transform: rotate(var(--rotation)) translate(calc(var(--rayon) * -1))
    rotate(calc(var(--rotation) * -1));

  aspect-ratio: 1 / 2;
  color: var(--fg);
  display: flex;
  flex-direction: column-reverse;
  justify-content: end;
}

.articles-list-home li ::selection {
  background: var(--fg-volet);
  color: var(--bg-volet) !important;
}

/* Styles de hover définis dans le HTML pour que ce soit dynamique */

/* ----- FENÊTRE ----- */
.fenetre {
  position: relative;
  width: 100%;
  height: 100%;
}

.recto,
.recto .volet-devant,
.recto .volet-derriere,
.verso {
  border-radius: 60rem 60rem 1rem 1rem;
}

.recto,
.verso {
  position: absolute;
  inset: 0;
  border: var(--border);
}

/* RECTO */
.recto {
  transition: transform ease var(--delay);
  transform: rotateY(0deg);
  transform-style: preserve-3d;
  transform-origin: center left;
  z-index: 10;
  box-shadow: 0 0 1em var(--accent);
}

.volet-devant {
  display: none;
}

.blason {
  flex: 1 1 auto;
  height: 90%;
  padding: 3rem 1rem 1rem 1rem;
}

.blason img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: center;
}

.title {
  font-family: "Young Serif";
  text-align: center;
  transition: color ease var(--delay);
  margin-bottom: 0;
  font-size: var(--s0);
  font-weight: 700;
  text-transform: uppercase;
  border: var(--border);
  border-top: none;
  padding: 0.5rem;
  z-index: 1;
  background-color: var(--bg);
}

.volet-derriere time {
  font-family: "Young Serif";
  font-size: var(--s3);
  text-align: center;

  width: 100%;
}

@media screen and (hover: none) {
  .volet-derriere time {
    position: absolute;
    bottom: calc(var(--s4) * -2.2);
  }
}

@media screen and (hover: hover) and (pointer: fine) {
  li:hover,
  li:focus-within {
    z-index: 10;
  }

  li:hover .fenetre .recto,
  li:focus-within .fenetre .recto {
    transform: rotateY(-160deg);
    transform-origin: center left;
  }

  .recto .volet-devant,
  .recto .volet-derriere {
    display: block;
    background-color: var(--bg);
    position: absolute;
    inset: 0;
    display: flex;
    flex-flow: column nowrap;
    -moz-backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .recto .volet-derriere {
    background-color: var(--bg-volet);
    transform: rotateY(180deg);
  }

  .volet-derriere time {
    font-size: var(--s4);
    color: var(--fg-volet);
    margin: auto;
  }
}

/* VERSO */
.verso {
  display: flex;
  flex-flow: column nowrap;
  color: var(--fg-volet);
  background-color: var(--bg-volet);
  padding: 1rem;
  gap: 1rem;
  justify-content: space-between;
}

.preview {
  height: 14rem;
}

.preview img {
  --radius: 9rem;
  border-radius: var(--radius) var(--radius) 0rem 0rem;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.content {
  margin-top: auto;
  overflow: auto;
}

#en-construction {
  cursor: not-allowed;
  margin-top: 1rem;
  font-size: var(--s0);
}

a {
  text-decoration: none;
}

a:hover,
a:focus,
a:active {
  border-color: transparent;
}

header a {
  border: none;
}

.stretched-link::after {
  content: " ";
  position: absolute;
  inset: 0;
  z-index: 20;
}

@media (max-width: 900px) {
  :root {
    --coef: 1.25;
  }

  header.menu-temp {
    display: flex;
    flex-direction: row;
    gap: 0;
    justify-content: center;
    width: 100%;
  }

  header.menu-temp span.lien-home {
    position: relative !important;
    top: initial !important;
    right: initial !important;
    bottom: initial !important;
    left: initial !important;
    font-size: 5rem;
  }

  main {
    padding-block: 4rem 1rem;
  }

  #intro {
    margin-inline: 1rem;
  }
}

@media (max-width: 1100px), (max-height: 1000px), (hover: none) {
  :root {
    --stroke-width: 1px;
    --article-width: 20vmin;
    --rayon: 26vmin;
  }

  header.menu-temp a {
    font-size: 3.5rem;
  }

  #toggle-popup {
    top: initial;
    left: initial;
    margin-inline: auto;
    bottom: 1rem;
    transform: translate(0) scale(1);
  }

  #toggle-popup:active {
    transform: translate(0) scale(0.99);
  }

  #popup {
    position: fixed;
    transform: translate(0);
    max-width: calc(100% - 2rem);
    margin: 2rem 1rem;
    inset: 0 0 4rem 0;
    padding: 4rem 1rem;
  }

  ul.articles-list-home {
    list-style: none;

    display: flex;
    flex-flow: row wrap;
    justify-content: start;

    gap: var(--gap);
    padding: 1rem;

    position: relative;
    top: initial;
    left: initial;
    transform: translate(0);
    height: auto;
    width: auto;
    border-radius: 0;
  }

  ul.articles-list-home li {
    position: relative;
    transform: rotate(0) translate(0);
    top: initial;
    left: initial;
    height: auto;
    width: 100%;
    min-width: 260px;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 500px) {
  header.menu-temp a {
    font-size: 2.5rem;
  }
}
