:root {
  --black: #222;
  --white: #fff;
  --main-purple: #944E96;
  --neutral-gray: #eee;
  --gradient: linear-gradient(to right, var(--vert-fonce), var(--violet), var(--rose), var(--rouge), var(--orange), var(--jaune), var(--vert-clair), var(--turquoise));

  --vert-fonce: #2F9F40;
  --violet: #A860A3;
  --rose: #E95296;
  --rouge: #EA563F;
  --orange: #F1833A;
  --jaune: #EFE473;
  --vert-clair: #CADD8F;
  --turquoise: #6BC0B7;

  --gap: 1rem;

  --font-h1: 2.99rem;
  --font-h2: 2.49rem;
  --font-h3: 2.07rem;
  --font-h4: 1.73rem;
  --font-h5: 1.44rem;
  --font-h6: 1.2rem;
  --font-small: 0.83rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/**/

@font-face {
  font-family: "Cabin";
  src: url(/assets/fonts/Cabin.woff2) format("woff2-variations");
  font-style: normal;
}

@font-face {
  font-family: "Cabin";
  src: url(/assets/fonts/Cabin-Italic.woff2) format("woff2-variations");
  font-style: italic;
}

/**/

@layer reset {

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  font-size: clamp(1em, 18px, 1.25em);
}

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

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

textarea:not([rows]) {
  min-height: 10em;
}

:target {
  scroll-margin-block: 5ex;
}
}
/**/

body {
  font-family:
    Cabin,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Helvetica Neue",
    sans-serif;
  font-synthesis: none;
  color: var(--black);
  background-color: var(--white);
  display: grid;
  grid-template-columns:
    [full-start] var(--gap)
    [margin-start] minmax(0, 1fr)
    [wide-start] clamp(0px, 10vi - 30px, 6em)
    [content-start] minmax(auto, 16em) [center]
    minmax(auto, 16em) [content-end]
    clamp(0px, 10vi - 30px, 6em) [wide-end]
    minmax(0, 1fr) [margin-end]
    var(--gap) [full-end];
  margin: 0;
}

h1, .h1 { font-size: var(--font-h1); }
h2, .h2 { font-size: var(--font-h2); }
h3, .h3 { font-size: var(--font-h3); }
h4, .h4 { font-size: var(--font-h4); }
h5, .h5 { font-size: var(--font-h5); }
h6, .h6 { font-size: var(--font-h6); }
small, .small {
  font-size: var(--font-small);
}

:where(h1, h2, h3, h4, h5, h6) {
  margin-block-start: 1.5em;
  margin-block-end: 0.5em;
}

p {
  margin: 0;
}

a {
  color: var(--main-purple);

  &:visited {
    color: color-mix(in srgb, var(--main-purple) 80%, var(--black) 20%);
  }

  &:hover {
    color: color-mix(in srgb, var(--main-purple) 70%, var(--black) 30%);
    text-decoration-thickness: 2px;
  }
}

:focus-visible {
  outline: 2px solid tomato;
  outline-offset: 2px;
}

/**/

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/**/

#skiplink {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.5rem;
  color: var(--white);
  background-color: var(--main-purple);

  &:not(:focus) {
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }
}

.site-header {
  grid-column: margin;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-header .top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block-start: 1rem;

  @media screen and (max-width: 480px) {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.logo {
  img {
    max-width: 4rem;
  }
}

.site-header .text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  .name {
    font-size: var(--font-h4);
    font-weight: bold;
    line-height: 1;
  }
}

.site-header nav {
  margin-block-end: 0.5rem;
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 1rem;
}

.site-header nav a {
  font-size: var(--font-small);
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 3%;

  &:hover {
    text-decoration: underline;
  }
}

/**/

.banner,
.swoosh-strip {
  --swoosh-outer-clip: ellipse(500% 500% at -5% -402%);
  --swoosh-inner-clip: ellipse(390% 390% at -25% -290%);
  grid-column: full;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: start;
  justify-content: center;
  padding-block-end: 1.5rem;
  background: var(--gradient);
  /* Second curve: bottom edge of the whole banner */
  clip-path: var(--swoosh-outer-clip);
}

.banner {
  max-height: 400px;
}

.banner picture,
.swoosh-strip-inner {
  display: block;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  /* First curve: bottom edge of the image / inner strip */
  clip-path: var(--swoosh-inner-clip);
}

.banner img {
  display: block;
  width: 100%;
  max-width: 1400px;
  max-height: 100%;
  margin: auto;
}

.swoosh-strip {
  /* Without an image above, the same geometry reads steeper; tune separately. */
  --swoosh-outer-clip: ellipse(340% 340% at -70% -240%);
  --swoosh-inner-clip: ellipse(250% 250% at -90% -140%);
}

.swoosh-strip-inner {
  min-height: 1rem;
  background-color: var(--white);
}

/**/

.toolbox {
  grid-column: margin;
  margin-block: 0.5rem;
  padding: 1rem;
  border-radius: 1rem;

  ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  li {
    --toolbox-item-color: var(--vert-fonce);
    flex: 1 1 calc((100% - 2.25rem) / 4);
    min-width: min(100%, 11rem);
    display: flex;
  }

  li:nth-child(8n + 1) { --toolbox-item-color: var(--vert-fonce); }
  li:nth-child(8n + 2) { --toolbox-item-color: var(--violet); }
  li:nth-child(8n + 3) { --toolbox-item-color: var(--rose); }
  li:nth-child(8n + 4) { --toolbox-item-color: var(--rouge); }
  li:nth-child(8n + 5) { --toolbox-item-color: var(--orange); }
  li:nth-child(8n + 6) { --toolbox-item-color: var(--jaune); }
  li:nth-child(8n + 7) { --toolbox-item-color: var(--vert-clair); }
  li:nth-child(8n + 8) { --toolbox-item-color: var(--turquoise); }

  a {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 0.125rem solid var(--toolbox-item-color);
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    text-align: center;

    &:hover {
      background: color-mix(in srgb, var(--toolbox-item-color) 14%, var(--white) 86%);
      color: var(--black);
    }
  }
}

/**/

:where(body) > .wrapper {
  grid-column: full;
  display: grid;
  grid-template-columns: subgrid;
}

.wrapper img {
  border-radius: 0.5rem;
  border: 0.125rem solid transparent;
  background: var(--gradient) border-box;
}

:where(body:not(.home)) main {
  grid-column: wide;
}

main p {
  margin-block: 1rem;
}

/**/

:where(body) > .swoosh-strip:has(+ footer) {
  margin-block-start: 2rem;
}

:where(body) > footer {
  grid-column: full;
  display: grid;
  grid-template-columns: subgrid;
  margin-block-start: -2rem;
  padding-block: 4rem 2rem;
  background-color: var(--neutral-gray);
}

:where(body) > footer .wrapper {
  grid-column: margin;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: start;
  gap: 1rem;
}

:where(body) > footer .text {
  flex-basis: 100%;
}

:where(body) > footer nav:first-of-type {
  flex: 1;
}

:where(body) > footer nav:last-of-type {
  flex-shrink: 0;
}

:where(body) > footer .text p:first-of-type {
  font-weight: bold;
}

:where(body) > footer nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 1rem;
}

/**/

.home-title {
  grid-column: margin;
  text-wrap: auto;
  margin-block: 1rem;
}

:where(body.home) > .wrapper {
  grid-column: margin;
  margin-block-start: 3rem;
  display: grid;
  grid-template-columns: subgrid;

  @media screen and (min-width: 768px) {
    grid-template-columns: minmax(0, 65ch) minmax(0, 32.5ch);
    justify-content: center;
    gap: 2rem;
  }
}

:where(body.home) main {
  grid-column: wide;
  @media screen and (min-width: 768px) {
    grid-column: 1;
  }
}

:where(body.home) main > h1 {
  margin-block-start: 0;
}

:where(body.home) aside {
  grid-column: wide;
  border-block-start: 1px solid var(--light-gray);
  @media screen and (min-width: 768px) {
    grid-column: 2;
    padding-inline-start: 2rem;
    border-inline-start: 1px solid var(--light-gray);
    border-block-start: none;
  }
}

:where(body.home) aside > h2 {
  @media screen and (min-width: 768px) {
    margin-block-start: 0;
  }
}

:where(body.home) aside p {
  margin-block-start: 1rem;
}


.news-banner-link {
  display: block;
  margin-block-end: 0.75rem;
  text-decoration: none;
}

.news-banner {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.5rem;
}

#news-list {
  list-style: none;
  padding: 0;
}

#news-list .h5 {
  margin-block: 0.5rem 0;
}

#news-list .small {
  margin-block: 0;
  font-style: italic;
}