/* Variables CSS - Charte graphique So Accessible */
:root {
  --primary-color: #DC0276;
  --primary-hover: #b8015f;
  --text-color: #333333;
  --text-secondary: #6b7280;
  --bg-color: #FEFEFE;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 0.5rem;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  font-size: 1.25rem;
}

/* Accessibilité - Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: top 0.2s ease;
  white-space: nowrap;
  border: 2px solid var(--primary-color);
  z-index: 10000;
  transform: translateY(-20px);
  opacity: 0;
}

.skip-link:focus {
  top: 0;
  background: var(--primary-color);
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
  transform: translateY(0);
  opacity: 1;
}

/* Classes utilitaires */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logo-img {
  height: 50px;
  width: auto;
  transition: opacity 0.2s;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
  transition: color 0.2s;
}

.logo:hover .logo-img,
.logo:focus .logo-img {
  opacity: 0.8;
}

.logo:hover .logo-text,
.logo:focus .logo-text {
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a:focus {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Main content */
.main-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-weight: bold;
}

.hero p,
.lead {
  font-size: 1.43rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Search box */
.search-box {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

#search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(220, 2, 118, 0.1);
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: none;
}

#search-results.active {
  display: block;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s;
  text-align: left;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus-within {
  background-color: var(--bg-secondary);
  border-left: 3px solid var(--primary-color);
  padding-left: calc(1rem - 3px);
}

.search-result-item a {
  text-decoration: none;
  color: var(--text-color);
  display: block;
  text-align: left;
}

.search-result-item h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: left;
}

.search-result-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  text-align: left;
}

.search-result-item .category-badge {
  display: inline-block;
  margin-top: 0.25rem;
}

/* Categories */
.categories-section {
  margin: 4rem 0;
}

.categories-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-color);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.category-card:hover,
.category-card:focus {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.category-card h2,
.category-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

h2, h3, h4, h5, h6 {
  color: var(--primary-color);
}

.category-card p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Articles and Links Grid */
.recent-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 4rem 0;
}

/* Articles */
.recent-articles {
  min-width: 0;
}

.recent-articles h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
}

.articles-list {
  display: grid;
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.article-card h2,
.article-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.article-card h2 a,
.article-card h3 a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.article-card h2 a:hover,
.article-card h2 a:focus,
.article-card h3 a:hover,
.article-card h3 a:focus {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.article-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.article-card-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 1rem;
  color: var(--text-secondary);
}

.category-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Recent Links Section */
.recent-links {
  min-width: 0;
}

.recent-links h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
}

.links-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.links-list-vertical {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.links-list li,
.links-list-vertical li {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.links-list li:hover,
.links-list-vertical li:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.link-item {
  padding: 1.5rem;
}

.link-item a {
  display: block;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.2s;
  margin-bottom: 0.75rem;
}

.link-item a:hover,
.link-item a:focus {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.link-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.link-description-small {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.link-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

/* Responsive: 1 colonne sur mobile */
@media (max-width: 768px) {
  .links-list {
    grid-template-columns: 1fr;
  }
}

/* Referentials List */
.referentials-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.referentials-list li {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.referentials-list li:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.referential-item {
  padding: 1rem 1.5rem;
}

.referentials-list a {
  display: block;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.2s;
  margin-bottom: 0.5rem;
}

.referentials-list a:hover,
.referentials-list a:focus {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.referential-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

/* Responsive: 1 colonne sur mobile */
@media (max-width: 768px) {
  .referentials-list {
    grid-template-columns: 1fr;
  }
}

/* Breadcrumb */
.breadcrumb {
  margin: 2rem 0;
}

.breadcrumb ol {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
  font-size: 1rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus {
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Article page */
.article {
  max-width: 800px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 3rem;
}

.article-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
  color: var(--primary-color);
  font-weight: bold;
}

.article-description {
  font-size: 1.43rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.article-external-link {
  font-size: 1.125rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--radius);
}

.article-external-link a {
  color: var(--primary-color);
  text-decoration: none;
  word-break: break-all;
}

.article-external-link a:hover,
.article-external-link a:focus {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 1rem;
  color: var(--text-secondary);
}

.article-category a {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  text-decoration: none;
  font-weight: 600;
}

/* Article content */
.article-content {
  line-height: 1.8;
  font-size: 1.25rem;
}

.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: #000;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-content h2 {
  font-size: 2rem;
  margin: 2.5rem 0 1rem;
}

.article-content h3 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.article-content a:hover,
.article-content a:focus {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

.article-content pre {
  background: var(--text-color);
  color: #f3f4f6;
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article-content blockquote {
  background-color: antiquewhite;
  padding: 1rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--primary-color);
}

.article-content blockquote p {
  margin: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 2rem 0;
  transition: transform 0.3s ease;
}

.article-content img:hover {
  transform: scale(1.02);
}

.article-content hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 3rem 0;
}

/* Article footer */
.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Article navigation */
.article-navigation {
  margin-top: 3rem;
  text-align: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid var(--primary-color);
  font-size: 1.125rem;
}

.btn-secondary {
  background: var(--primary-color);
  color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: white;
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Category section */
.category-section {
  margin: 4rem 0;
  scroll-margin-top: 100px;
}

.category-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-color);
  color: var(--primary-color);
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
}

.footer-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.footer-link:hover,
.footer-link:focus {
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.125rem;
  }

  .article-header h1 {
    font-size: 2rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .logo-text {
    font-size: 1.125rem;
  }

  .nav-menu {
    gap: 1rem;
  }

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

  .recent-content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  #search-input {
    font-size: 1rem;
  }
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .breadcrumb,
  .article-navigation,
  .search-box {
    display: none;
  }

  .article-content a::after {
    content: ' (' attr(href) ')';
  }
}

/* Focus visible pour meilleure accessibilité */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Surlignage recherche accessible */
.search-highlight,
mark {
  background-color: #d81b60;
  color: #ffffff;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Abréviation */
abbr {
  text-decoration: none;
  border-bottom: 1px dotted var(--text-secondary);
  cursor: help;
}
