/* ========================================
   CV Khaled BEN KHALIFA - Styles globaux
   Design académique sobre et professionnel
   ======================================== */

:root {
  --color-primary: #1a3a5c;
  --color-secondary: #2c5f8d;
  --color-accent: #0056b3;
  --color-text: #333;
  --color-text-light: #666;
  --color-bg: #f8f9fa;
  --color-white: #ffffff;
  --color-border: #dee2e6;
  --color-hover: #e9ecef;
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: Georgia, 'Times New Roman', serif;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

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

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* En-tête et navigation */
.site-header {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-white);
  text-decoration: none;
  padding: 1rem 1.5rem 1rem 0;
  font-family: var(--font-heading);
}

.nav a:not(.brand) {
  color: var(--color-white);
  text-decoration: none;
  padding: 1rem 1rem;
  display: block;
  transition: var(--transition);
  font-size: 0.95rem;
}

.nav a:not(.brand):hover,
.nav a.active {
  background-color: var(--color-secondary);
}

/* Bouton menu mobile */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 1rem;
  margin-left: auto;
}

/* Container principal */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Typographie */
h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-accent);
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.3rem;
  color: var(--color-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.1rem;
  color: var(--color-text);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Cartes de contenu */
.card {
  background-color: var(--color-white);
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

/* Listes de définition (dl) */
.grid-dl {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0.75rem 1.5rem;
  margin: 1rem 0;
}

.grid-dl dt {
  font-weight: 600;
  color: var(--color-primary);
}

.grid-dl dd {
  color: var(--color-text);
}

/* Listes */
ul, ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

ul.list-clean {
  list-style: none;
  margin-left: 0;
}

ul.list-clean li {
  padding-left: 1.5rem;
  position: relative;
}

ul.list-clean li:before {
  content: "▪";
  color: var(--color-accent);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Tableaux */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-white);
  box-shadow: var(--shadow);
  border-radius: 4px;
  overflow: hidden;
}

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

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

tbody tr:hover {
  background-color: var(--color-hover);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Badges et labels */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  background-color: var(--color-accent);
  color: var(--color-white);
  margin-right: 0.5rem;
}

.badge-secondary {
  background-color: var(--color-secondary);
}

/* Section de publication */
.publication-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

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

.publication-year {
  font-weight: 600;
  color: var(--color-accent);
  margin-right: 0.5rem;
}

/* Liens */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

/* Source link */
.source {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-top: 1rem;
  font-style: italic;
}

/* Pied de page */
.footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.footer p {
  margin: 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav {
    position: relative;
  }

  .nav a:not(.brand) {
    display: none;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .nav.active a:not(.brand) {
    display: block;
  }

  .grid-dl {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .grid-dl dt {
    font-weight: 700;
    margin-top: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.625rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0 0.75rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .card {
    padding: 1rem;
  }
}

/* Utilitaires */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

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

.text-primary {
  color: var(--color-primary);
}

.text-accent {
  color: var(--color-accent);
}

/* Animation de chargement */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease;
}
