/* Consellis: the single style sheet. The values are those of the deep green palette, IBM Plex Sans
 * and the spacing steps of README.md § Charte. No shadow: the relief comes from the 1 px line.
 */

@layer jetons, base, composants, mise-en-page;

@layer jetons {
  :root {
    --fond: #eef3f1;
    --surface: #ffffff;
    --bordure: #d2ddd9;
    --texte: #1a201e;
    --texte-2: #586662;
    --accent: #0f6e63;
    --accent-presse: #0b574e;
    --accent-pale: #e3f1ee;
    --attention: #9a4d00;
    --attention-fond: #fdefd9;

    --e-2: 0.5rem; /* 8px */
    --e-3: 0.75rem; /* 12px */
    --e-4: 1rem; /* 16px */
    --e-5: 1.5rem; /* 24px */
    --e-6: 2rem; /* 32px */
    --e-7: 3rem; /* 48px */

    --r-controle: 4px;
    --r-cadre: 6px;

    --t-13: 0.8125rem;
    --t-14: 0.875rem;
    --t-15: 0.9375rem;
    --t-17: 1.0625rem;
    --t-22: 1.375rem;
    --t-32: 2rem;

    --d-etat: 150ms;
    --colonne-max: 1040px;
  }
}

@layer base {
  @font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
  }

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

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    margin: 0;
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    font-size: var(--t-15);
    line-height: 1.5;
    background: var(--fond);
    color: var(--texte);
  }

  h1,
  h2,
  h3,
  p,
  ul {
    margin: 0;
  }

  h1,
  h2,
  h3 {
    font-weight: 600;
  }

  h1 {
    font-size: var(--t-32);
    line-height: 1.15;
  }

  h2 {
    font-size: var(--t-22);
    line-height: 1.25;
  }

  h3 {
    font-size: var(--t-17);
    line-height: 1.3;
  }

  a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--d-etat);
  }

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

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  main:focus {
    outline: none;
  }

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

    * {
      transition: none !important;
    }
  }
}

@layer composants {
  .bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding-inline: var(--e-4);
    border-radius: var(--r-controle);
    border: 1px solid transparent;
    font-size: var(--t-15);
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--d-etat), color var(--d-etat);
  }

  .bouton--principal {
    background: var(--accent);
    color: #ffffff;
  }

  .bouton--principal:hover {
    background: var(--accent-presse);
    color: #ffffff;
  }

  .bouton--secondaire {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
  }

  .bouton--secondaire:hover {
    background: var(--accent-pale);
    color: var(--accent-presse);
  }

  .carte {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--r-cadre);
    padding: var(--e-5);
  }

  .carte h3 + p {
    margin-top: var(--e-2);
    color: var(--texte-2);
    font-size: var(--t-14);
  }

  .pile {
    display: flex;
    flex-direction: column;
    gap: var(--e-4);
  }

  .secondaire {
    color: var(--texte-2);
  }

  .adresse {
    font-size: var(--t-17);
    font-weight: 600;
  }

  /* A text still to be written: visible at a glance, never mistaken for the final text. */
  .a-remplir {
    background: var(--attention-fond);
    color: var(--attention);
    border-radius: var(--r-controle);
    padding-inline: 0.2em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

  .evitement {
    position: absolute;
    left: var(--e-4);
    top: -100px;
    padding: var(--e-2) var(--e-4);
    background: var(--surface);
    border-radius: var(--r-controle);
  }

  .evitement:focus {
    top: var(--e-4);
  }
}

@layer mise-en-page {
  .colonne {
    max-width: var(--colonne-max);
    margin-inline: auto;
    padding-inline: 40px;
  }

  .entete {
    background: var(--surface);
    border-bottom: 1px solid var(--bordure);
  }

  .entete-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-4);
    min-height: 64px;
  }

  .marque {
    color: var(--texte);
    font-size: var(--t-17);
    font-weight: 600;
    text-decoration: none;
  }

  .accroche {
    display: flex;
    flex-direction: column;
    gap: var(--e-5);
    padding-block: 96px var(--e-7);
  }

  .accroche h1,
  .chapeau {
    max-width: 720px;
  }

  .chapeau {
    color: var(--texte-2);
    font-size: var(--t-17);
  }

  .section {
    display: flex;
    flex-direction: column;
    gap: var(--e-5);
    padding-block: var(--e-7);
  }

  .grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--e-5);
    padding: 0;
    list-style: none;
  }

  #contact .carte {
    max-width: 640px;
  }

  .pied {
    margin-top: var(--e-7);
    padding-block: var(--e-6);
    border-top: 1px solid var(--bordure);
    color: var(--texte-2);
    font-size: var(--t-13);
  }

  @media (max-width: 1023px) {
    .colonne {
      padding-inline: var(--e-5);
    }

    .grille {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 639px) {
    .colonne {
      padding-inline: var(--e-4);
    }

    h1 {
      font-size: 1.625rem; /* 26px */
    }

    .accroche {
      padding-block: var(--e-7) var(--e-6);
    }

    .accroche .bouton {
      width: 100%;
      min-height: 44px;
    }

    .entete .bouton {
      min-height: 44px;
    }

    .carte {
      padding: var(--e-4);
    }
  }
}
