/* ==========================================
   CRIHD COMMON STYLES
   ========================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   CONTENEUR ET GRILLE
   ========================================== */

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: var(--container-xl);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
    padding: 0 var(--spacing-lg);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* ==========================================
   NAVIGATION
   ========================================== */

.header {
  background: var(--bg-primary);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) 0;
  min-height: 70px;
}

.navbar-brand .logo {
  text-decoration: none;
  color: var(--text-primary);
}

.logo-text {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
}

.navbar-nav {
  display: none;
}

@media (min-width: 1024px) {
  .navbar-nav {
    display: block;
  }
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--spacing-xl);
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  padding: var(--spacing-sm) 0;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-primary);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  z-index: 100;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  border-bottom: 1px solid #f3f4f6;
}

.dropdown-menu li:last-child {
  border-bottom: none;
}

.dropdown-menu a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

/* ==========================================
   BOUTON HAMBURGER MOBILE
   ========================================== */

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1051;
  position: relative;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
}

@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary, #2c3e50);
  border-radius: 1px;
  transition: all 0.3s ease;
  transform-origin: center;
  display: block;
}

/* Animation du bouton hamburger */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-6px);
}

/* ==========================================
   NAVIGATION MOBILE
   ========================================== */

@media (max-width: 1023px) {
  .navbar-nav {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary, #ffffff);
    z-index: 1030;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 80px 20px 20px;
    margin: 0;
    width: 100%;
    height: 100%;
  }

  .navbar-nav.active {
    transform: translateX(0);
  }

  .nav-menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-item {
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
    margin: 0;
    padding: 0;
  }

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

  .nav-link {
    display: block;
    padding: 1rem;
    font-size: 1rem;
    width: 100%;
    color: var(--text-primary, #2c3e50);
    text-decoration: none;
    margin: 0;
    border: none;
    background: transparent;
  }

  .nav-link:hover {
    color: var(--primary-color, #3b82f6);
  }

  /* Dropdown mobile */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .nav-item.dropdown-open .dropdown-menu {
    max-height: 300px;
    padding: 0.5rem 0;
  }

  .dropdown-menu a {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    display: block;
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
  }

  .dropdown-menu li:last-child a {
    border-bottom: none;
  }

  /* Indicateur dropdown */
  .nav-item.dropdown > .nav-link::after {
    content: '+';
    float: right;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
  }

  .nav-item.dropdown.dropdown-open > .nav-link::after {
    transform: rotate(45deg);
  }
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.language-switch {
  display: none;
}

@media (min-width: 768px) {
  .language-switch {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
  }
}

.lang-current {
  color: var(--text-white);
  background: var(--primary-color);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.lang-divider {
  color: var(--text-light);
}

.lang-option, .lang-current {
  border: none;
  padding: 5px;
  border-radius: 3px;
}

.lang-option {
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.lang-option:hover {
  color: var(--primary-color);
}

/* ==========================================
   CORRECTIONS SPÉCIFIQUES PAGES
   ========================================== */

/* Correction Tailwind pour certaines pages */
.navbar-nav.hidden,
.navbar-nav.invisible,
.mobile-menu-toggle.hidden {
  display: block;
  visibility: visible;
  opacity: 1;
}

@media (max-width: 1023px) {
  .navbar-nav.hidden,
  .navbar-nav.invisible {
    display: block;
    position: fixed;
  }
}

/* Page Direction */
body[data-page="direction"] .mobile-menu-toggle {
  z-index: 1055;
  pointer-events: auto;
}

/* Page Politique avec Tailwind */
body[data-page="politique"] .mobile-menu-toggle {
  z-index: 1055;
  pointer-events: auto;
  display: flex;
}

body[data-page="politique"] .navbar-nav.active {
  transform: translateX(0);
  display: block;
}

/* Page Contact */
body[data-page="contact"] .navbar-nav {
  z-index: 1031;
}

/* ==========================================
   BODY LOCK MENU OUVERT
   ========================================== */

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Éviter les doubles barres de défilement */
@media (max-width: 1023px) {
  body.menu-open,
  html.menu-open {
    overflow-x: hidden;
    overflow-y: hidden;
  }
}

/* ==========================================
   HERO SECTION
   ========================================== */

.breadcrumb-section {
  background: #f8f9fa;
  padding: 12px 0;
}

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

.breadcrumb-text {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.breadcrumb-line {
  width: 60px;
  height: 2px;
  background: #2c3e50;
  margin-left: 16px;
}

.contact-hero {
  padding: 60px 0 40px;
  background: #ffffff;
}

.hero-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 80px;
  align-items: start;
}

.hero-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: #2c3e50;
  margin: 0;
}

.highlight-text {
  color: #c53c3c;
}

.hero-description p {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================
   BOUTONS
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: #c53c3c;
    color: white;
    border: none;
    border-radius: 0;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: #e5e7eb;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-secondary:focus {
  outline: 2px solid #c53c3c;
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
}

.btn-secondary:hover,
.btn-secondary.active {
  background: #c53c3c;
  border-color: #c53c3c;
  color: white;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  text-decoration: none;
  padding: var(--spacing-xs) 0;
}

.btn-link:hover {
  color: var(--primary-color);
}

/* ==========================================
   FORMULAIRES
   ========================================== */

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(197, 60, 60, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ==========================================
   GRILLE DES ARTICLES (Réutilise projects-grid)
   ========================================== */
.card-section{
    padding: 40px 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

/* Vue liste pour les articles */
.card-grid.list-view {
    grid-template-columns: 1fr;
}

.card-grid.list-view .card {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.card-grid.list-view .card-image {
    flex: 0 0 200px;
    height: 150px;
}

.card-grid.list-view .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   CARTES D'ARTICLES (Adaptations des card)
   ========================================== */

.card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #c53c3c;
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 24px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-category {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
}

.card-duration {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-link {
    color: #c53c3c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.card-link:hover {
    color: #a73030;
    transform: translateX(4px);
}

.card-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.card-link:hover i {
    transform: translateX(4px);
}

/* ==========================================
   PAGINATION DES PROJETS
   ========================================== */

.card-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
}

.pagination-btn {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #c53c3c;
    color: #c53c3c;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-number {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    border-radius: 0;
}

.page-number:hover,
.page-number.active {
    background: #c53c3c;
    border-color: #c53c3c;
    color: white;
}

.pagination-dots {
    color: #6b7280;
    font-weight: 500;
    padding: 8px 4px;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
  background: var(--bg-dark);
  color: var(--text-white);
  padding: var(--spacing-5xl) 0 var(--spacing-xl);
}

.footer-content {
  display: grid;
  gap: var(--spacing-4xl);
}

.footer-main {
  display: grid;
  gap: var(--spacing-4xl);
}

@media (min-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr 2fr;
  }
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-white);
  margin-bottom: var(--spacing-md);
}

.footer-description {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: var(--spacing-xl);
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.social-link:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

.footer-links {
  display: grid;
  gap: var(--spacing-xl);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.footer-column {
  display: flex;
  flex-direction: column;
}

.footer-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-white);
  margin-bottom: var(--spacing-lg);
}

.footer-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-link {
  color: var(--text-light);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-white);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.contact-item {
  color: var(--text-light);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.contact-item strong {
  color: var(--text-white);
}

/* ==========================================
   OPTIMISATIONS PERFORMANCE
   ========================================== */

.navbar-nav,
.mobile-menu-toggle,
.mobile-menu-toggle span {
  will-change: transform;
  backface-visibility: hidden;
}

/* Correction pour iOS Safari */
@supports (-webkit-overflow-scrolling: touch) {
  .navbar-nav {
    -webkit-overflow-scrolling: touch;
  }
}

/* ==========================================
   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: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

@media (min-width: 768px) {
  .btn-secondary {
    flex: 1;
    text-align: center;
    min-width: 80px;
  }

  .d-md-none { display: none; }
  .d-md-block { display: block; }
  .d-md-flex { display: flex; }
  .d-md-grid { display: grid; }
}

@media (min-width: 1024px) {
  .d-lg-none { display: none; }
  .d-lg-block { display: block; }
  .d-lg-flex { display: flex; }
  .d-lg-grid { display: grid; }
}

/* ==========================================
   RESPONSIVE TEAM GRID
   ========================================== */

@media (max-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .team-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .member-image {
    height: 250px;
  }

  .filter-buttons {
    flex-direction: column;
    align-items: center;
  }

  .filter-btn {
    min-width: 120px;
  }
}