:root {
  --text: #222;
  --muted: #666;
  --bg: #f5f5f5;
  --surface: white;
  --border: #ddd;
  --accent: #0062cc;
  --accent-light: #7db9ff;
  --radius: 8px;
}

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

@font-face {
  font-family: "Libre";
  src: url("../assets/fonts/Libre_Caslon_Condensed/LibreCaslonCondensed-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Arimo";
  src: url("../assets/fonts/Arimo/Arimo-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Arimo", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: "Libre", Georgia, serif;
  line-height: 1.2;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Lien d'évitement : caché, visible seulement au clavier */

.skip-link {
  position: absolute;
  top: -100px;
  left: 10px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 10px;
}

/* En-tête */

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Logo : au survol, les lettres réapparaissent une par une */

.logo {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
}

.logo svg {
  display: block;
  width: 130px;
  height: auto;
  fill: currentColor;
}

.logo-letter {
  transform-box: fill-box;
  transform-origin: center;
}

.logo:hover .logo-letter,
.logo:focus-visible .logo-letter {
  animation: lettre-apparait 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Le 1er enfant est le disque : les 13 caractères suivent, décalés de 60 ms chacun */
.logo-letter:nth-child(3) { animation-delay: 0.06s; }
.logo-letter:nth-child(4) { animation-delay: 0.12s; }
.logo-letter:nth-child(5) { animation-delay: 0.18s; }
.logo-letter:nth-child(6) { animation-delay: 0.24s; }
.logo-letter:nth-child(7) { animation-delay: 0.3s; }
.logo-letter:nth-child(8) { animation-delay: 0.36s; }
.logo-letter:nth-child(9) { animation-delay: 0.42s; }
.logo-letter:nth-child(10) { animation-delay: 0.48s; }
.logo-letter:nth-child(11) { animation-delay: 0.54s; }
.logo-letter:nth-child(12) { animation-delay: 0.6s; }
.logo-letter:nth-child(13) { animation-delay: 0.66s; }
.logo-letter:nth-child(14) { animation-delay: 0.72s; }

@keyframes lettre-apparait {
  from {
    opacity: 0;
    transform: scale(0.3);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo:hover .logo-letter,
  .logo:focus-visible .logo-letter {
    animation: none;
  }
}

/* Menu */

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  gap: 8px 24px;
}

nav a {
  text-decoration: none;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

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

nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Contenu principal */

main {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 20px;
}

.intro,
.closing {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
}

.intro h1 {
  margin-bottom: 10px;
}

.closing h2 {
  margin-bottom: 10px;
}

.section-title {
  text-align: center;
  margin-bottom: 20px;
}

/* Cartes d'articles (accueil) */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.cards article {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cards article:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.cards img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.cards h3,
.cards p {
  padding: 10px 15px;
}

.cards h3 {
  font-size: 1.25rem;
}

.cards p {
  flex-grow: 1;
}

.read-more {
  display: inline-block;
  padding: 10px 15px 15px;
  color: var(--text);
  font-weight: 600;
}

.read-more:hover {
  color: var(--accent);
}

/* Pages de lecture (articles, guide, contact, mentions) */

.article-page {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-page h1 {
  margin-bottom: 10px;
}

.article-page h2 {
  margin: 30px 0 10px;
}

.article-page img {
  width: 100%;
  height: auto;
  max-height: 350px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.article-page p {
  margin-bottom: 15px;
}

.article-page .date {
  color: var(--muted);
  font-size: 0.9rem;
}

.article-page ul,
.article-page ol {
  margin: 0 0 15px 20px;
}

.article-page li {
  margin-bottom: 8px;
}

.article-page .read-more {
  padding: 10px 0;
}

/* Guide et tableau */

.guide {
  max-width: 900px;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.95rem;
  line-height: 1.5;
}

caption {
  caption-side: top;
  font-style: italic;
  color: var(--muted);
  padding-bottom: 10px;
  text-align: left;
}

th,
td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--text);
  color: white;
}

tbody th {
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

/* Formulaire de contact */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 20px 0;
}

.contact-form label {
  font-weight: 600;
  margin-top: 10px;
}

.contact-form input:not([type="checkbox"]),
.contact-form textarea {
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-form fieldset {
  margin-top: 10px;
  padding: 10px 15px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-form legend {
  font-weight: 600;
  padding: 0 5px;
}

.choix {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.choix input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.contact-form .choix label {
  font-weight: normal;
  margin-top: 0;
}

.contact-form button {
  align-self: flex-start;
  margin-top: 15px;
  padding: 10px 24px;
  font: inherit;
  font-weight: 600;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.contact-form button:hover {
  background: var(--text);
}

/* Vidéo */

.video {
  max-width: 560px;
  margin: 0 auto;
}

.video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius);
}

/* Pied de page */

footer {
  background: var(--text);
  color: white;
  padding: 25px 20px;
  margin-top: 40px;
  text-align: center;
}

footer ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 20px;
  margin-bottom: 15px;
}

footer p {
  font-size: 0.9rem;
  margin-top: 5px;
}

footer a {
  color: white;
}

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

footer a:focus-visible {
  outline-color: var(--accent-light);
}
