:root {
  /* Couleurs de fond */
  --bg-alt: #f6f4f0;
  --bg-contour: #d4cfc7;
  --bg-main: #fbfaf8;
  --bg-white: #ffffff;
  --bg-grey: #efe9e9;

  /* Couleurs de texte */
  --text-dark: #2c2c2c;
  --text-muted: #8c8c8c;

  /* Couleurs d'accentuation */
  --accent: #0077b6;
  --accent-hover: #005f8e;
  --highlight: #f6f4f0;
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-alt);
}

main {
  background: var(--bg-main);
  padding: 3.5rem 1.25rem 1.25rem 1.25rem;
}

.footer {
  text-align: center;
  background: var(--bg-alt);
  color: #666;
  padding: 1rem;
  font-size: 0.9rem;
  display: flex;
}

.footer-name,
.footer-tech {
  flex: 1;
}

/* === TOP BAR === */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 1000;
  border-bottom: 1px solid var(--bg-contour);
}

.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-center h1 {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--text-dark);
  margin: 0;
}

.nav-left {
  flex: 1;
}

.nav-right {
  flex: 1;
  justify-content: right;
}

.nav-right a {
  position: relative;
  color: var(--text-dark);
  text-decoration: none;
  padding: 5px 10px;
  transition: color 0.3s ease;
  display: inline-block;
}

.nav-right a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background-color: var(--text-dark);
  transition: width 0.3s ease;
}

.nav-right a:hover::after {
  width: 80%;
}

.nav-left img {
  width: 35px;
}

/* === Affichage mobile === */

.burger {
  display: none;
  font-size: 2em;
  cursor: pointer;
  color: var(--text-dark);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background-color: var(--bg-white);
  position: absolute;
  top: 60px;
  right: 20px;
  padding: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.mobile-menu a {
  padding: 10px;
  text-decoration: none;
  color: var(--text-dark);
}

/* === SECTION PRESENTATION === */
.presentation {
  max-width: 950px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.presentation h1 {
  color: var(--text-dark);
  font-weight: normal;
  font-size: 1.3rem;
}

.presentation p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-dark);
}

.presentation .btn-presentation {
  padding: 0.8rem 1.6rem;
  font-size: 1.15rem;
  border-radius: 8px;
  background-color: var(--accent);
  color: var(--bg-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  margin-block: 1.5rem;
  font-weight: 600;

  cursor: pointer;
  text-decoration: none;
}

.presentation .btn-presentation:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  background-color: var(--accent-hover);
}


.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* === SECTION CV === */
/* En-tête */
.cv-header {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.cv-contact {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--bg-white);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  box-sizing: border-box;
}

.cv-contact div {
  margin: 4px 8px;
}

.cv-download {
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  background: var(--accent);
  color: var(--bg-white);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid rgba(44, 44, 44, 0.1);
}

.cv-download svg {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  fill: var(--bg-white);
}

.cv-download:hover {
  background: var(--accent-hover);
}

/* Grid principale */
.cv-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  margin: 20px 0 0 0;
}

/* Cartes */
.cv-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.cv-card h3 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 18px;
  border-bottom: 2px solid var(--bg-white);
}

/* Blocs */
.cv-block {
  margin-bottom: 30px;
}

.cv-block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cv-block-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  max-width: 75%;
  overflow-wrap: break-word;
}

.cv-period {
  font-size: 13px;
  color: #666;
  background: #f7f7f7;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  margin-left: auto;
}

.cv-subtitle {
  font-size: 14px;
  color: #777;
  margin: 4px 0 8px 0;
}

/* Liste */
.cv-block ul {
  margin: 0;
  padding-left: 18px;
}

.cv-block li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.4;
}

/* === SECTION PROJETS === */

.projects-section {
  background-color: var(--bg-main);
  display: grid;
  gap: 1.5em;
}

/* Carte résumé */
.summary-card {
  margin-top: 1rem;
  padding: 0 1rem;
  border-radius: 10px;
  background-color: var(--bg-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.summary-card h1 {
  text-align: center;
}

.summary-card p {
  text-align: center;
  font-size: 1rem;
  color: #444;
  margin-bottom: 1rem;
}

/* Tableau */
.summary-card table {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0rem;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.summary-card th,
.summary-card td {
  padding: 0.6rem 1rem;
  text-align: left;
  word-break: break-word;
  white-space: normal;
}

.summary-card thead {
  background-color: var(--bg-alt);
  font-weight: 600;
}

.summary-card tbody tr:nth-child(even) {
  background-color: #f9f8f6;
}

.summary-card tbody tr:hover {
  background-color: #f0ede9;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.project-card {
  scroll-margin-top: 80px;
  background-color: var(--bg-white);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.details {
  display: none;
  margin-top: 1rem;
  overflow: hidden;
  transition: max-height 1s ease;
  max-height: 0;
}


.project-card[data-expanded="true"] .details {
  display: block;
}

.project-card[data-expanded="true"] .summary {
  display: none;
}

.project-card h2 {
  margin-top: 0rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.summary-card h2 { font-size: 1.6rem; }

.project-card p {
  margin: 1rem 0;
  font-weight: 400;
  color: #444444;
}

.project-card li {
  margin: 1rem 0;
  font-weight: 400;
  color: #444444;
}

.tags span {
  background-color: #d4cfc7;
  color: #3e3a36;
  padding: 0.4rem 0.8rem;
  margin: 0.2rem;
  border-radius: 15px;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
}

.metrics {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.metrics li {
  margin-bottom: 0.3rem;
}

.links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 5px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  font-family: inherit;
  border: 1px solid #d4cfc7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  background-color: var(--bg-alt);
  color: var(--text-dark);
}

.btn:hover {
  background-color: #eceae6;
}

.github-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.chevron-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.project-card[data-expanded="true"] .toggle-details .chevron-icon {
  transform: rotate(180deg);
}

.project-layout {
  display: flex;
  flex-direction: row;
  gap: 2rem;
}

.project-content {
  flex: 2;
}

.project-images {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.project-images img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

/* Masquer les images supplémentaires par défaut */
.project-card[data-expanded="false"] .extra-images {
  display: none;
}

/* Afficher les images supplémentaires quand la card est développée */
.project-card[data-expanded="true"] .extra-images {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


/* === SECTION INTERESTS === */

.interests {
  padding: 0.5rem 2rem;
  text-align: center;
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.interest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 300px;
  text-decoration: none;
  background-color: #f9f9f9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.interest-card:hover {
  transform: translateY(-5px);
}

.interest-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.interest-card h2 {
  padding: 1rem;
  font-size: 1.2rem;
  color: #333;
}

/* 🧱 Structure générale */
.block {
  display: flex;
  flex-wrap: wrap;
  margin: 2rem 0;
  gap: 2rem;
}

/* 🟦 Bloc 1 : Texte gauche / Image droite */
.block.text-left {
  flex-direction: row;
}

/* 🟥 Bloc 2 : Texte droite / Image gauche */
.block.text-right {
  flex-direction: row-reverse;
}

/* 🟨 Bloc 3 : Paragraphe seul */
.block.full-text {
  flex-direction: column;
}
.block.full-text p {
  width: 100%;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* 🟩 Bloc 4 : Galerie seule */
.block.gallery {
  justify-content: center;
  gap: 1rem;
}

/* 🖋️ Texte */
.block-text {
  flex: 1;
  min-width: 250px;
  display: flex;
  align-items: center;
}
.block-text p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* 🖼️ Images */
.block-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  max-width: 100%;
}

.block-images img,
.block.gallery img {
  height: 220px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .block.text-left,
  .block.text-right {
    flex-direction: column;
    align-items: center;
  }

  .block-text {
    text-align: center;
  }

  .block-images {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .block-images img,
  .block.gallery img {
    height: auto;
    max-width: 45%;
  }
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
  .footer {
    flex-direction: column;
  }

  .nav-right {
    display: none;
  }

  .nav-left {
    flex: None;
  }

  .burger {
    display: block;
  }

  .presentation { 
    text-align: justify;
  }

  .cv-grid {
    display: flex;
    flex-direction: column;
  }

  .cv-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .cv-download {
    justify-content: center;
  }

  /* Masque la dernière colonne (thead et tbody) */
  .summary-table th:last-child,
  .summary-table td:last-child {
    display: none;
  }

  .summary-card th,
  .summary-card td {
    padding: 0.5rem 0.8rem;
  }

  .summary-card h2 { 
    font-size: 1.4rem; 
  }

  .project-layout {
    display: flex;
    flex-direction: column;
  }

  .project-images {
    order: 1;
  }

  .project-content {
    order: 2;
  }

  .project-images img {
    max-width: 100%;
    height: auto;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .project-card p {
    text-align: justify;
  }

  .project-card li {
    text-align: justify;
  }
}