/*
 * Les Fondamentaux — palette festive azur : cobalt, turquoise, corail, vert et jaune solaire.
 * Feuille de style associée à la version dynamique.
 *
 * Recommandé dans <head> pour un vrai rendu mobile :
 * <meta name="viewport" content="width=device-width, initial-scale=1">
 */

:root {
  --entete: #2457c5;
  --francais: #e5485d;
  --francais-fonce: #b52e43;
  --francais-tendre: #fff0f2;
  --maths: #087fa3;
  --maths-tendre: #eaf8fc;
  --sciences: #2f9e68;
  --sciences-tendre: #ecf8f1;
  --encre: #18324a;
  --texte: #405465;
  --texte-doux: #687b89;
  --bordure: #d7e3e9;
  --papier: #ffffff;
  --fond: #f7fbfa;
  --rayon: 18px;
  --accent: var(--francais);
  --accent-tendre: var(--francais-tendre);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-y: scroll;
  scroll-behavior: smooth;
  background: var(--fond);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0 0 4.5rem;
  color: var(--texte);
  font-family: Ubuntu, "Liberation Sans", Arial, sans-serif;
  background:
    radial-gradient(
      circle at 8% 10%,
      rgba(229, 72, 93, 0.12),
      transparent 24rem
    ),
    radial-gradient(
      circle at 92% 16%,
      rgba(255, 193, 7, 0.14),
      transparent 22rem
    ),
    radial-gradient(
      circle at 78% 88%,
      rgba(8, 127, 163, 0.10),
      transparent 28rem
    ),
    var(--fond);
  background-repeat: no-repeat;
  animation: fadein 0.35s ease-out;
}

@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

a {
  color: var(--encre);
  text-decoration: none;
  outline: 0;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
.bttn:focus-visible {
  outline: 3px solid rgba(229, 72, 93, 0.38);
  outline-offset: 3px;
}

header {
  position: relative;
  height: 170px;
  margin: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(120deg, #2457c5 0%, #078fb0 50%, #2f9e68 100%);
  overflow: hidden;
}

header::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -150px;
  width: 380px;
  height: 380px;
  border: 55px solid rgba(255, 209, 102, 0.24);
  border-radius: 50%;
}

.nom {
  position: relative;
  z-index: 1;
  max-width: 1680px;
  margin: 0 auto;
  padding: 1.35rem clamp(1rem, 5vw, 4.5rem) 0;
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.nom::after {
  content: "Une vidéothèque pour apprendre et comprendre";
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(0.78rem, 1.4vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.82;
}

.enveloppe {
  position: relative;
  z-index: 2;
  max-width: 1680px;
  margin: -66px auto 0;
  padding: 0 clamp(0.75rem, 4vw, 3.5rem);
}

.retour,
.retour1 {
  position: absolute;
  z-index: 4;
  top: -78px;
  right: clamp(1.1rem, 5vw, 4.5rem);
  float: none;
  margin: 0;
}

.retour .lienext,
.retour1 .lienext {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.retour .lienext:hover,
.retour1 .lienext:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.retour img,
.retour1 img {
  display: block;
}

.sommaire {
  margin: 0 0 1.4rem;
  padding: 1.15rem clamp(0.85rem, 2vw, 1.6rem) 1.35rem;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
}

.sommaire h2 {
  margin: 0 0 1rem;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid var(--bordure);
  color: var(--francais);
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.8;
  text-align: center;
}

.sommaire h2 a {
  display: inline-block;
  margin: 0 0.1rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0.5rem;
  color: var(--texte-doux);
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.sommaire h2 a:hover {
  color: var(--encre);
  background: #fff5cf;
}

.sommaire h2 span {
  color: inherit;
}

.sommaire p {
  position: relative;
  display: block;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.58rem 0.25rem 0.58rem 13.3rem;
  border: 0;
  border-bottom: 1px solid #dce7ec;
  border-radius: 0;
  background: transparent;
  color: var(--texte-doux);
  font-size: 0;
  line-height: 1.35;
}

.sommaire h2 + p {
  border-top: 0;
}

.sommaire p:last-child {
  border-bottom: 0;
}

.sommaire .titre {
  position: absolute;
  top: 50%;
  left: 1rem;
  width: 11.6rem;
  color: var(--encre);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.005em;
  transform: translateY(-50%);
}

.sommaire p a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: calc((100% - 2rem) / 5);
  min-height: 36px;
  margin: 0.2rem 0.5rem 0.2rem 0;
  padding: 0.28rem 0.35rem 0.28rem 0.95rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #42586a;
  font-size: 0.84rem;
  font-variant: small-caps;
  line-height: 1.15;
  text-align: left;
  vertical-align: top;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.sommaire p a::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--francais);
  transform: translateY(-50%);
  opacity: 0.62;
}

.sommaire p a:nth-of-type(5n) {
  margin-right: 0;
}

.sommaire p a:hover {
  color: var(--francais-fonce);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: #f2a4ae;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transform: none;
}

#maths p a:hover {
  color: var(--maths);
  background: transparent;
  text-decoration-color: #74cddd;
}

#maths h2 {
  color: var(--maths);
}

#maths p a::before {
  background: var(--maths);
}

#maths .titre {
  color: var(--maths);
}

#autres p a:hover {
  color: var(--sciences);
  background: transparent;
  text-decoration-color: #8fd0ab;
}

#autres h2 {
  color: var(--sciences);
}

#autres p a::before {
  background: var(--sciences);
}

#autres .titre {
  color: var(--sciences);
}

.etoile {
  display: none;
}

.hidden {
  display: none;
}

.unhidden {
  display: block;
}

/* Couleur des panneaux mathématiques. */
:is(
  #30,
  #31,
  #32,
  #33,
  #34,
  #35,
  #36,
  #37,
  #37bis,
  #38,
  #39,
  #40,
  #41,
  #42,
  #43,
  #44,
  #45,
  #46,
  #47,
  #48,
  #49,
  #50,
  #52,
  #53,
  #54,
  #55,
  #56,
  #57,
  #58,
  #110
) {
  --accent: var(--maths);
  --accent-tendre: var(--maths-tendre);
}

/* Couleur des panneaux sciences, technologie et EMC. */
:is(
  #70,
  #70bis,
  #71,
  #72,
  #73,
  #74,
  #75,
  #76,
  #77,
  #78,
  #79,
  #79bis,
  #80,
  #81,
  #82,
  #83,
  #84,
  #85
) {
  --accent: var(--sciences);
  --accent-tendre: var(--sciences-tendre);
}

.conteneur {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(225px, 100%), 1fr));
  gap: 1rem;
  margin: 0 0 1.4rem;
  padding: 1rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.celtit {
  position: relative;
  width: 100%;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 3.5rem 0.75rem 0.2rem;
  border-bottom: 3px solid var(--accent);
}

.celtit h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.close {
  position: absolute;
  top: -0.55rem;
  right: -0.35rem;
  float: none;
  margin: 0;
  font-size: 0;
}

.close .croix {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--bordure);
  border-radius: 50%;
  background: #fff6d9;
  color: var(--texte-doux);
  padding: 0;
  font-size: 0;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.close .croix::before,
.close .croix::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

.close .croix::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close .croix::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close .croix:hover {
  color: #fff;
  background: var(--accent);
  transform: rotate(5deg);
}

.pastille {
  position: relative;
  display: flex;
  width: auto;
  min-width: 0;
  min-height: 128px;
  margin: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  overflow: visible;
}

.pastille::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  bottom: 17px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  opacity: 0.82;
}

.pastille:hover {
  background: linear-gradient(135deg, var(--accent-tendre), #fff 42%);
}

a.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 2.15rem 1rem 2rem;
  border: 0;
  color: var(--encre);
  text-align: center;
}

a.cell:hover,
a.cell:active,
a.cell:focus {
  border: 0;
  color: var(--accent);
}

.intertitre {
  width: 100%;
  margin: 0;
  color: inherit;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
}

.lien {
  position: absolute;
  left: 0.75rem;
  bottom: 0.55rem;
  margin: 0;
}

.lien .lienext {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  transition: background 0.18s ease;
}

.lien .lienext:hover {
  background: var(--accent-tendre);
}

.cycle {
  position: absolute;
  right: 0.8rem;
  bottom: 0.75rem;
  margin: 0;
}

.c2,
.c3 {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  outline: 4px solid #fff;
  cursor: help;
}

.c2 {
  background: #2f9e68;
}
.c3 {
  background: #ffb703;
}

.c2 span,
.c3 span {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  width: max-content;
  height: auto;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border: 0;
  border-radius: 7px;
  background: var(--encre);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  transform: translateX(-50%) translateY(4px);
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.c2 span::after,
.c3 span::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -5px;
  border-top: 5px solid var(--encre);
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
}

.c2:hover span,
.c3:hover span {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bttn {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease;
}

.bttn:hover {
  background: var(--accent-tendre);
}

.bttn:active {
  transform: translateY(1px);
  opacity: 0.75;
}

.btcp,
.btcode {
  position: absolute;
  top: 0.55rem;
}

.btcp {
  left: 0.65rem;
}

.btcode {
  right: 0.65rem;
}

.msg-temporaire-clipboard {
  position: fixed;
  left: 50%;
  top: 1rem;
  z-index: 9999;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--encre);
  color: #fff;
  font-size: 0.88rem;
  transform: translateX(-50%);
}

.collophon {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 20;
  width: max-content;
  max-width: none;
  margin: 0;
  padding: 0.4rem 0.8rem;
  border-radius: 0 0 10px 10px;
  background: rgba(24, 50, 74, 0.95);
  color: #fff;
  font-size: 0.78rem;
  opacity: 1;
  transform: rotate(-90deg) translateY(100%);
  transform-origin: left bottom;
}

.collophon a {
  color: #fff !important;
}

.collophon a:hover {
  color: #ffd166 !important;
}

.maj {
  position: static;
  margin: 0.6rem auto 0;
  padding: 0 1rem;
  color: #718391;
  font-size: 0.75rem;
  text-align: center;
}

@media (max-width: 1180px) {
  .sommaire p a {
    width: calc((100% - 1.5rem) / 4);
    margin-right: 0.5rem;
  }

  .sommaire p a:nth-of-type(4n) {
    margin-right: 0;
  }

  .sommaire p a:nth-of-type(5n):not(:nth-of-type(4n)) {
    margin-right: 0.5rem;
  }
}

@media (max-width: 920px) {
  .sommaire p {
    padding-left: 11.2rem;
  }

  .sommaire .titre {
    width: 9.6rem;
  }

  .sommaire p a {
    width: calc((100% - 1rem) / 3);
    margin-right: 0.5rem;
  }

  .sommaire p a:nth-of-type(3n) {
    margin-right: 0;
  }

  .sommaire p a:nth-of-type(4n):not(:nth-of-type(3n)),
  .sommaire p a:nth-of-type(5n):not(:nth-of-type(3n)) {
    margin-right: 0.5rem;
  }
}

@media (max-width: 760px) {
  header {
    height: 145px;
  }

  .nom {
    padding-top: 1rem;
  }

  .enveloppe {
    margin-top: -52px;
    padding-inline: 0.65rem;
  }

  .retour,
  .retour1 {
    top: -80px;
    right: 1rem;
  }

  .sommaire {
    padding: 0.8rem 0.7rem 1rem;
    border-radius: 14px;
  }

  .sommaire h2 {
    line-height: 1.55;
  }

  .sommaire p {
    min-height: 0;
    padding: 0.7rem;
  }

  .sommaire .titre {
    position: static;
    display: block;
    width: auto;
    margin: 0 0 0.3rem;
    transform: none;
  }

  .sommaire p a {
    width: calc((100% - 0.4rem) / 2);
    min-height: 34px;
    margin: 0.18rem 0.4rem 0.18rem 0;
    font-size: 0.86rem;
  }

  .sommaire p a:nth-of-type(2n) {
    margin-right: 0;
  }

  .sommaire p a:nth-of-type(3n):not(:nth-of-type(2n)),
  .sommaire p a:nth-of-type(4n):not(:nth-of-type(2n)),
  .sommaire p a:nth-of-type(5n):not(:nth-of-type(2n)) {
    margin-right: 0.4rem;
  }

  .conteneur {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 14px;
  }

  .pastille {
    min-height: 104px;
  }

  .celtit {
    padding-left: 0.15rem;
  }

  .collophon {
    display: none;
  }
}

@media (max-width: 480px) {
  .sommaire p a {
    width: 100%;
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
