/* Fichier CSS complet avec améliorations WCAG 2.1 pour Antheos Data */

:root {
  /* Font families */
  --font-primary: 'Work Sans', Helvetica, sans-serif;
  --font-secondary: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-tertiary: 'EB Garamond', Georgia, serif;

  /* Font sizes */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-md: 1.125rem;   /* 18px */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.5rem;     /* 24px */
  --font-size-2xl: 1.875rem;  /* 30px */
  --font-size-3xl: 2.25rem;   /* 36px */

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Font weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Brand colors from logo */
  --brand: #0b4912;      /* Main logo text */
  --main-1: #8ae364;     /* Medium green */
  --accent: #a2f771;     /* Light green */
  --deep-green: #0c340c; /* Hero/section background */
  --dark-accent: #379634;/* For borders/hover */
  --background: #f7f9f9; /* Off-white background */
  --text-color: #163a16; /* For main text */
  --text-strong: #1b5c22;
  --stroke-weak: #a6ef8c;
  --stroke-strong: #7ed957;

  /* Gradients and shadows */
  --gradient-primary: linear-gradient(135deg, #7ed957 0%, #a6ef8c 100%);
  --gradient-hero: linear-gradient(135deg, #042804 0%, #0c4813 100%);
  --shadow-soft: 0 4px 12px rgba(33, 122, 43, 0.08);
  --shadow-strong: 0 8px 24px rgba(33, 122, 43, 0.12);

  /* Nouvelles variables pour l'accessibilité */
  --focus-outline: 3px solid var(--main-1);
  --focus-offset: 2px;
  --announcement-bg-start: var(--main-1);  /* Retour au vert clair */
  --announcement-bg-end: #43d18d;          /* Version légèrement plus foncée */
}

/* Accessibilité - Skip link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 8px 16px;
  background-color: var(--brand);
  color: white;
  z-index: 1000;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
}

/* Amélioration de l'état focus pour tous les éléments interactifs */
*:focus {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

body {
  background-color: var(--background);
  display: flex;
  flex-direction: column;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  min-height: 100vh;
  color: var(--text-color);
  margin: 0;
  padding: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  height: 80px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  flex-shrink: 0;
}

main {
  flex: 1 0 auto;
}

nav {
  display: flex;
  align-items: center;
  margin-left: 0;
  padding-top: 0;
}

nav ul {
  display: flex;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  text-align: center;
  margin: 0;
  width: 100px;
}

nav ul li a {
  display: block;
  padding: 5px 0;
  width: 100%;
  color: var(--brand);
  text-decoration: none;
  font-weight: 400;
  transition: all 0.3s ease;
}

nav ul li a:hover {
  background-color: var(--stroke-weak);
  transform: translateY(-2px);
  text-decoration: none;
}

.is-active > a {
  background-color: var(--background);
  color: var(--brand);
  font-weight: var(--font-weight-bold); /* Augmenté pour l'accessibilité */
  position: relative;
}

.is-active > a:after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background-color: var(--brand);
  border-radius: 0%;
  transition: all 0.3s ease;
}

footer {
  background-color: #163a16;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 50px 60px;
  font-size: 0.95rem;
  position: relative;
  margin-top: 100px;
  flex-shrink: 0;
}

footer::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--stroke-weak);
  opacity: 0.8;
}

/* Footer navigation */
.footer-links {
  display: flex;
  list-style: none;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-left: 0;
  margin-bottom: 0;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--main-1);
  transition: width 0.2s ease;
}

.footer-links a:hover {
  color: #7ed957;
}

.footer-links a:hover::after {
  width: 100%;
}

.copyright {
  display: flex;
  align-items: center;
  letter-spacing: 0.5px;
  opacity: 0.9;
  font-size: 0.9rem;
}

.copyright::before {
  content: '©';
  margin-right: 8px;
  font-size: 1.1rem;
  opacity: 0.8;
}

/* Typography base styles */
h1, h2, h3, h4, h5, h6, #hero-title {
  font-family: var(--font-secondary);
  margin-top: 2.5rem; /* Augmenté pour une meilleure séparation visuelle */
  margin-bottom: 1rem;
  line-height: var(--line-height-tight);
  color: var(--text-strong);
}

h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  padding: 0 0 0.5rem 0;
  border-bottom: 2px solid var(--stroke-weak);
}

h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
  text-align: left;
}

h2::after {
  content: '';
  display: block;
  margin: 0.75rem 0 0 0;
  width: 120px;
  max-width: 80%;
  height: 4px;
  background: linear-gradient(90deg, var(--main-1) 60%, var(--secondary) 100%);
  border-radius: 3px;
}

h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.lire {
  margin-bottom: 30px;
}

/* Paragraph styles */
p {
  line-height: var(--line-height-relaxed);
  margin-bottom: 1.8rem; /* Augmenté pour meilleure séparation */
  max-width: 80ch; /* Limiter la largeur pour améliorer la lisibilité */
}

/* Converting main_point to use proper heading structure */
.main_point {
  color: var(--brand);
  font-family: var(--font-secondary);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
}

/* Strong and emphasis */
strong, b {
  font-weight: var(--font-weight-bold); /* Augmenté pour meilleur contraste */
}

em, i {
  font-style: italic;
}

/* Lists */
ul {
  list-style-type: square;
  list-style-position: inside;
  margin-bottom: 1.5rem;
}

li {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: var(--line-height-relaxed);
}

/* Blockquote with improved styling */
blockquote {
  border-left: 4px solid var(--main-1);
  color: #444; /* Assombri pour meilleur contraste */
  font-family: var(--font-tertiary);
  font-size: var(--font-size-md);
  font-style: italic;
  line-height: var(--line-height-relaxed);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background-color: #f9f9f9;
  border-radius: 0 8px 8px 0;
}

/* Base link styles */
a {
  transition: color 0.2s ease;
}

/* Navigation links don't get underlines */
header a,
nav a,
footer a,
.button,
.hero-button,
#announcement-bar a,
main a.button,
main a.hero-button {
  text-decoration: none;
}

header a:hover,
nav a:hover,
footer a:hover,
#announcement-bar a:hover {
  text-decoration: none;
}

/* Amélioration du contraste pour le bouton "en ligne" dans la barre d'annonce */
#announcement-bar {
  background: var(--accent);
  color: var(--deep-green);
  font-weight: 600;
  border-radius: 0;
  margin: 0;
  padding: 12px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1em;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

#announcement-bar p {
  text-align: center;
  width: 100%;
  margin: 0;
}

#announcement-bar a {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: var(--brand);
  padding: 6px 16px;
  margin-left: 12px;
  border-radius: 20px;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid var(--main-1);
}

#announcement-bar a:hover {
  background: var(--main-1);
  color: var(--deep-green);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-frame {
  border: 1px solid var(--main-1);
  border-radius: 4px;
  padding: 20px 20px 10px;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  display: inline-block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 10px auto 50px;
  max-width: 100%;
}

.image-frame .illustration_article {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border: none;
  box-shadow: none;
}

.image-frame figcaption {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  margin-top: 20px;
  font-style: italic;
  line-height: 1.4;
}

/* Style pour les illustrations simples, sans cadre */
.illustration-simple {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 50px auto;
}

.illustration-simple .illustration_article {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

details > summary {
  font-family: Georgia, 'Times New Roman', Times, serif;
  color: var(--brand);
  font-weight: 400;
  list-style-type: none;
  margin: 1rem;
}

details > summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 5px;
  transform: rotate(0deg);
  transition: transform 0.2s linear;
}

details[open] > summary::before {
  transform: rotate(90deg);
}

/* Responsive typography */
@media (max-width: 768px) {
  /* Typography responsive rules */
  h1 {
    font-size: var(--font-size-2xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }

  .main_point {
    font-size: var(--font-size-lg);
  }

  p, li {
    font-size: var(--font-size-base);
  }

  blockquote {
    font-size: var(--font-size-base);
    padding: 0.75rem 1rem;
  }

  /* Layout responsive rules */
  header {
    flex-direction: column;
    height: auto;
    padding: 15px;
  }

  #logo {
    margin-bottom: 15px;
    width: 250px;
  }

  nav {
    width: 100%;
  }

  nav ul {
    width: 100%;
    justify-content: center;
  }

  /* Taille minimum des zones tactiles pour mobile */
  nav ul li a,
  .button,
  #announcement-bar a {
    padding: 12px 16px;
    min-height: 44px; /* Recommandation WCAG pour les zones tactiles */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #hero {
    padding: 1.5rem 0;
  }

  #hero-content {
    flex-direction: column;
    padding: 0 1rem;
  }

  #hero-title {
    font-size: var(--font-size-xl);
    max-width: 100%;
    text-align: center;
  }

  #hero-paragraph p {
    text-align: center;
  }

  #hero-image {
    width: 200px;
    margin: 1rem auto;
  }

  #hero-image > img {
    width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin: 40px auto;
  }

  nav {
    margin-left: 10px;
  }

  #content > img {
    width: 100%;
  }

  #hero .button {
    min-height: 44px; /* Recommandation WCAG pour les zones tactiles */
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 0;
  }

  #announcement-bar a {
    min-height: 44px; /* Recommandation WCAG pour les zones tactiles */
    padding: 10px 16px;
  }

  footer {
    flex-direction: column;
    padding: 40px 20px;
    gap: 30px;
    text-align: center;
    margin-top: 70px;
  }

  .footer-links {
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
  }

  .copyright {
    justify-content: center;
  }
}

#logo {
  display: inline-block;
  width: 300px;
  margin: 12px 0 0 16px;
}

#hero {
  background: var(--gradient-hero);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
  box-shadow: var(--shadow-soft);
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, 
    rgba(255, 255, 255, 0.08) 0%, 
    transparent 60%
  );
  pointer-events: none;
}

#hero-content {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
  padding: 0 2rem;
}

#hero-image {
  position: relative;
}

#hero-image > img {
  width: 250px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

#hero-paragraph {
  box-sizing: border-box;
  display: inline-block;
  flex: 1;
}

#hero-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: var(--blanc);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

#hero-paragraph p {
  color: rgba(255, 255, 255, 0.95);
  font-size: var(--font-size-md);
  margin-bottom: 1rem;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

#hero-paragraph p:nth-child(2) {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#content {
  margin: 60px auto;
  max-width: 800px;
  padding: 0 20px;
  min-height: 60vh; /* Hauteur minimale pour le contenu */
}

#content > img {
  margin: 40px auto; /* Augmenté pour meilleure séparation */
  max-width: 100%;
  height: auto;
  display: block; /* Centrage auto */
}

#projects {
  margin: 100px auto;
  max-width: 900px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin: 50px auto;
}

.project-square {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  text-align: left;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--stroke-weak);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.project-square:hover {
  border-color: var(--main-1);
  box-shadow: var(--shadow-strong);
}

.project-square::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.project-square:hover::before {
  opacity: 1;
}

.project-square h3 {
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: var(--font-weight-medium);
  margin: 0 0 18px 0;
  position: relative;
}

.project-square p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 100%;
  margin: 0;
}

/* Formulaires - pour la page contact si nécessaire */
input,
textarea,
select,
button {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  padding: 12px;
  border: 2px solid #ccc;
  border-radius: 6px;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  margin-bottom: 16px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: var(--font-weight-medium);
  color: var(--brand);
}

::placeholder {
  color: #888; /* Assombri pour meilleur contraste */
  opacity: 1;
}

/* Pour les images cliquables */
img[role="button"],
a > img {
  transition: transform 0.3s ease;
}

img[role="button"]:focus,
a:focus > img {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--main-1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin: 40px auto;
  }

  .project-square {
    padding: 32px 24px;
    box-shadow: 0 4px 15px rgba(134, 230, 89, 0.04);
    border: 1px solid rgba(134, 230, 89, 0.18);
  }

  .project-square h3 {
    font-size: 1.2rem;
    margin-bottom: 14px;
  }

  #projects {
    margin: 50px auto;
  }
}

/* Index des articles */
.articles-index {
  margin: 30px auto 60px;
}

.articles-index h1 {
  font-size: 2rem;
  margin-bottom: 30px;
  text-align: left;
  border-bottom: none;
  color: var(--brand);
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.article-link {
  display: block;
  padding: 20px 25px;
  background-color: white;
  border-radius: 8px;
  border: 1px solid rgba(134, 230, 89, 0.3);
  transition: all 0.2s ease-in-out;
  text-decoration: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  position: relative;
}

.article-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background-color: var(--main-1);
  border-radius: 8px 0 0 8px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.article-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-color: rgba(134, 230, 89, 0.5);
}

.article-link:hover::before {
  opacity: 1;
}

.article-title {
  font-family: var(--font-secondary);
  font-size: 1.2rem;
  color: var(--brand);
  font-weight: var(--font-weight-medium);
  display: block;
  margin-bottom: 12px;
}

.article-summary {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
  margin: 0;
  max-width: 100%;
}

@media (max-width: 768px) {
  .articles-index {
    margin: 20px auto 40px;
  }

  .articles-index h1 {
    font-size: 1.7rem;
    margin-bottom: 20px;
    text-align: left;
  }

  .article-link {
    padding: 16px 20px;
  }

  .article-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .article-summary {
    font-size: 0.9rem;
    line-height: 1.4;
  }
}

.back-to-top {
  display: inline-block;
  margin: 40px 0 20px;
  padding: 12px 24px;
  background-color: var(--stroke-weak);
  color: var(--brand);
  border-radius: 30px;
  text-decoration: none !important;
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  text-align: center;
  border: 1px solid rgba(0, 80, 0, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.back-to-top:hover {
  background-color: var(--main-1);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .back-to-top {
    display: block;
    margin: 30px auto 10px;
    max-width: 200px;
    text-align: center;
  }
}

.button--dark {
  background: var(--brand);
  color: #fff;
  border: none;
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  padding: 16px 32px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  letter-spacing: 0.5px;
  transition: background 0.3s, color 0.3s;
  position: relative;
  overflow: hidden;
}

.button--dark:hover {
  background: var(--main-1);
  color: var(--deep-green);
}

.button--dark::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: scale(0.5);
}

.button--dark:hover::after {
  opacity: 1;
  transform: scale(1);
}

.button--light {
  background-color: var(--main-1);
  color: var(--brand);
  border: 2px solid var(--brand);
}

.button--light:hover {
  background-color: var(--brand);
  color: #fff;
}

.service-icon {
  font-size: 2rem;
  color: var(--brand);
  margin-bottom: 1.5rem;
  transition: color 0.3s;
}

.project-square:hover .service-icon {
  color: var(--main-1);
}

.highlight {
  color: var(--highlight);
  font-weight: bold;
}
