/* styles.css */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --bg-alt: #e5e7eb;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --shadow: 0 20px 40px -25px rgba(15, 23, 42, 0.45);
  --radius: 18px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

[data-lang] {
  display: none;
}

body.lang-fr [data-lang="fr"],
body.lang-en [data-lang="en"] {
  display: initial;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

ul {
  margin: 0;
  padding-left: 1.4rem;
}

ul.expertise {
  list-style-type: square; /* options: disc | circle | square | none */
  padding-left: 1.5rem;
}

.keyword {
  color: var(--accent);
  font-weight: 600;
}
.expertise li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}


.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  max-width: 720px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-header h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 1.5rem + 1vw, 2.6rem);
}

.section-header p {
  margin: 0;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #f8fafc;
  box-shadow: var(--shadow);
}

.btn.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--accent);
}

.btn.ghost:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn.inline {
  align-self: flex-start;
  margin-top: 1rem;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  border-color: transparent;
}

.btn.inline:hover {
  background: rgba(37, 99, 235, 0.16);
}

.btn.article-link {
  align-self: flex-start;
  margin-top: 1rem;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  border-color: transparent;
}

.btn.article-link:hover {
  background: rgba(37, 99, 235, 0.16);
}

.section-cta {
  text-align: center;
  margin-top: 3rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 244, 246, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  overflow: visible;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  position: relative;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  border: none;
  background: transparent;
  padding: 0.4rem;
  cursor: pointer;
}

.lang-toggle {
  margin-left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.lang-option {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: rgba(37, 99, 235, 0.18);
  outline: none;
}

.lang-option.is-active {
  background: var(--accent);
  color: #f8fafc;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.nav-toggle span {
  width: 1.8rem;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.nav-open span:first-child {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle.nav-open span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.15);
  overflow: hidden;
  pointer-events: none;
  display: none;
}

.scroll-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
  transition: width 0.15s ease;
}

/* Hero */

.hero {
  padding-top: 6rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 -30px 60px -55px rgba(15, 23, 42, 0.65);
}

.hero-grid {
  display: grid;
  gap: 3.5rem;
  align-items: start;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
}

.identity-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}

.centered-title {
  text-align: center;
  margin-top: 1rem;
}

.identity-block .portrait img {
  margin: 0 auto;
}


.hero h1 {
  margin: 0.75rem 0;
  font-size: clamp(2.4rem, 1.6rem + 1.8vw, 3.2rem);
  line-height: 1.2;
}

.hero p {
  color: var(--muted);
  font-size: 1rem;
}

.hero-highlights {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.6rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  align-items: center;
}

.hero-title {
  margin: 0 0 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  line-height: 1.15;
}

.hero-title .name {
  font-size: clamp(2.6rem, 1.8rem + 2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hero-title .role {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  opacity: 0.85;
}


.portrait img {
  width: clamp(260px, 32vw, 380px);
  border-radius: 16px;
  box-shadow: var(--shadow);
  /* border-radius: 12px; */
  transition: width 0.3s ease;
  background: var(--accent);
  padding: 0px;
  display: inline-block;
}

.hero-card {
  width: 100%;
  background: var(--card);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.hero-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.hero-card ul {
  list-style: square;
  color: var(--muted);
}

.hero-card li {
  margin-bottom: 0.35rem;
}


.motto {
  margin: 2rem 0;
}
.motto h3 {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 0.5rem;
}
.motto blockquote {
  border-left: 4px solid var(--accent);
  background: #eef2ff;
  padding: 0.75rem 1rem;
  margin: 0 0 0.75rem 0;
  font-style: italic;
}
.motto p {
  color: #374151;
}

/* Cards & grids */

.grid {
  display: grid;
  gap: 1.8rem;
}

.case-grid,
.project-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 720px) {
  .case-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .case-grid,
  .project-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card h3 {
  margin: 0;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.case-links {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--accent);
}

.case-links li {
  margin: 0.25rem 0;
}

.case-links a {
  color: var(--accent);
  font-weight: 600;
}

.card-tag {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(17, 24, 39, 0.55);
}

/* CV */

.cv-columns {
  display: grid;
  gap: 2rem;
}

.cv-secondary {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .cv-columns {
    grid-template-columns: minmax(320px, 1.75fr) minmax(260px, 1fr);
    align-items: start;
  }
}

.cv-group {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}


.cv-items {
  display: grid;
  gap: 1rem;
}

.cv-group--wide .cv-items {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.cv-group h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.cv-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: rgba(37, 99, 235, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cv-item-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cv-timeline-item .cv-item-header {
  flex-direction: row-reverse; /* au cas où il s’applique */
}


.cv-item-role {
  margin: 0;
  font-weight: 600;
}

.cv-item p {
  margin: 0;
  color: var(--muted);
}

.cv-summary-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  padding: 0.35rem;
  box-sizing: border-box;
}

.cv-summary-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cv-summary-logo.cv-logo-missing {
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.75);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.4rem;
}

.cv-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cv-group > p {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.cv-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-style: italic;
}

.cv-education {
  display: grid;
  gap: 0.8rem;
  color: var(--muted);
}

/* Timeline */

.timeline {
  display: grid;
  gap: 1.8rem;
}

.timeline-item {
  padding-left: 1.5rem;
  border-left: 2px solid rgba(37, 99, 235, 0.3);
}

.timeline-item h3 {
  margin: 0 0 0.5rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.timeline-gallery {
  margin-top: 1rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.timeline-gallery .media-thumb {
  max-height: 260px;
}

.timeline-gallery .media-thumb img {
  height: 100%;
  object-fit: cover;
}

.media-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.media-inline {
  color: var(--muted);
  font-size: 0.9rem;
}

.articles-grid {
  display: grid;
  gap: 2.5rem;
}

.article-card {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  .article-card {
    grid-template-columns: 1fr;
  }
}

.article-image {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  background: #111827;
  aspect-ratio: 16 / 9;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.article-content h3 {
  margin: 0 0 0.75rem;
}

.article-content p {
  color: var(--muted);
}


/* Training */

.training-grid {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.training-media {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Chess */

/* Chess — 2 colonnes desktop : (1) texte + Mazé | (2) plus belle victoire */
@media (min-width: 960px) {
  .chess-content {
    display: grid !important;                 /* remplace le flex en colonne */
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    align-items: start;
  }

  /* Colonne 1 : texte FIDE + carte GM Mazé */
  .chess-content > .chess-text-block,
  .chess-content > .chess-mentor {
    grid-column: 1;
  }
  .chess-content > .chess-mentor {            /* supprime la marge ajoutée en mobile */
    margin-top: 0;
  }

  /* Colonne 2 : ta plus belle victoire (viewer + texte) */
  .chess-content > .chess-board {
    grid-column: 2;
    grid-row: 1 / span 2;                     /* occupe la hauteur des 2 blocs de gauche */
    margin-top: 0;
  }
}
/* Placement en 2 colonnes sur desktop : dans la colonne de gauche */
@media (min-width: 960px) {
  .chess-content {
    display: grid !important;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
  .chess-content > .chess-text-block,
  .chess-content > .chess-mentor,
  .chess-content > .chess-ratings {
    grid-column: 1;
  }
  .chess-content > .chess-board {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
  }
}



.chess-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.chess-text-block + .chess-text-block {
  margin-top: 1.5rem;
}

.chess-text-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  max-width: 700px;
}

/* pour que le bouton soit centré aussi */
.chess-text-block .btn.inline {
  align-self: center;
}


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

.fide-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.95em;
}

.chess-board {
  /* plus de grid-area: board; */
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  justify-content: center;
  align-items: center;
}

#chess-game {
  min-height: 420px;
}

#chess {
  background-image:
    linear-gradient(45deg, rgba(0,0,0,0.03) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,0.03) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.03) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.03) 75%);
  background-size: 60px 60px;
  background-attachment: fixed;
}

.chess-comments {
  margin: 1.2rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.chess-game-section {
  margin-top: 1.5rem;
}

.chess-game-wrapper {
  display: flex;
  justify-content: center;
}

.chess-gallery {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 1024px) {
  #chess-game {
  max-width: 100%;
  }

  .portrait img{
    width: 80%;
  }
}

/* Kitesurf section */

#kitesurf {
  text-align: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.08), transparent 70%);
}

#kitesurf .container.narrow {
  max-width: 720px;
  margin: 0 auto;
}

.kitesurf-header p {
  margin-top: 0.75rem;
}

.kitesurf-years {
  font-weight: 500;
}

.kitesurf-centered {
  margin-top: 3rem;
}

.kitesurf-centered h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.kitesurf-centered ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

.kitesurf-centered ul li {
  margin-bottom: 0.35rem;
}



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

.environment-column {
  display: grid;
  gap: 1.5rem;
}

.environment-column .media-thumb {
  margin: 0;
}
.environment-grid {
  display: grid;
  gap: 2rem;
}

.environment-gallery .media img {
  max-width: 600px;       /* limite la largeur */
  width: 100%;
  height: auto;           /* conserve le ratio naturel */
  aspect-ratio: 16 / 9;   /* format paysage */
  object-fit: cover;      /* recadre proprement */
  margin: 0 auto;         /* centre l’image */
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (min-width: 960px) {

  .environment-column {
    display: grid;
    gap: 1.5rem;
  }
}

/* Footer */

.site-footer {
  background: #111827;
  color: #f8fafc;
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.footer-note {
  margin: 0.2rem 0 0;
  color: rgba(248, 250, 252, 0.7);
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(248, 250, 252, 0.85);
}

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

/* Reveal animation */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.chess-content {
  grid-template-columns: 1fr;
}

/* ===== FOND ANIMÉ POUR LA SECTION ÉCHECS ===== */

#chess {
  position: relative;
  overflow: hidden;
}

#chess .container {
  position: relative;
  z-index: 1; /* contenu au-dessus des pièces */
}

.chess-bg-shapes {
  position: absolute;
  inset: -10%;        /* déborde un peu pour remplir la section */
  pointer-events: none;
  z-index: 0;         /* derrière le contenu, mais AU-DESSUS du fond de la section */
}

/* Formes de base */
.chess-bg-shape {
  position: absolute;
  width: clamp(220px, 32vw, 420px);
  opacity: 0.18;
  will-change: transform;
}

/* Positions de départ */
.chess-bg-shape-1 {
  top: -5%;
  left: -8%;
}

.chess-bg-shape-2 {
  bottom: -15%;
  right: -5%;
}

/* Respect du "réduire les animations" */
@media (prefers-reduced-motion: reduce) {
  .chess-bg-shape {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Responsive */

@media (max-width: 1024px) {
  .hero-grid{
    grid-template-columns: 1fr;
  }

  .hero-side {
    align-items: flex-start;
  }
}

@media (max-width: 840px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 1.5rem;
    background: rgba(248, 250, 252, 0.97);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav.nav-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .lang-toggle {
    margin-left: 0;
    margin-top: 0.8rem;
    order: 3;
    align-self: flex-start;
  }

  .portrait img{
    width: 95%;
  }

  .scroll-progress {
    display: block;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 3.5rem 0;
  }

  .hero {
    padding-top: 4.5rem;
  }

  .hero-card {
    padding: 1.6rem;
  }

  .card {
    padding: 1.6rem;
  }

  .cv-group {
    padding: 1.6rem;
  }

  .articles-panel {
    padding: 2rem;
  }

  .footer {
    padding: 2rem 0;
  }
}

/* ====== CV Timeline (v2) ====== */

@media (min-width: 960px) {
  .cv-timelines {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    align-items: start;
  }
}

@media (max-width: 959.98px) {
  .cv-timelines {
    display: flex;
    flex-direction: column;
  }
}

.cv-timeline {
  background: transparent;
}

.cv-timeline h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}


/* Logo déjà à droite : on garde. Juste un petit garde-fou mobile */
@media (max-width: 720px) {
  .cv-timeline-item {
    padding: 1.2rem 1.2rem 1.1rem 2.4rem; /* padding équilibré : plus de marge inutile à droite */  }
}


/* Carte d'expérience */
.cv-timeline-item {
  position: relative;
  margin-bottom: 1.6rem; /* espace entre les cartes */
}

/* Carte : layout interne (texte + logo à droite) */
.cv-timeline-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.cv-timeline-item .cv-timeline-text {
  flex: 1; /* le texte prend toute la largeur restante */
}

.cv-timeline-item .cv-logo {
  order: 2; /* s’assure que le logo est à droite */
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;  /* garde un carré, pas de bords très arrondis */
  overflow: hidden;
}

/* Logo : image bien contenue dans un carré */
.cv-timeline-item .cv-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* carré + pas de déformation */
  border-radius: 0;    /* pas d’arrondi de l’image elle-même */
}

/* Texte : Job sur la 1ère ligne, entreprise + dates sur la 2e, contenu en dessous */

.cv-timeline-role {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #111827;
}

.cv-timeline-company {
  margin: 0.3rem 0 0.35rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.cv-timeline-period {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cv-timeline-text p,
.cv-timeline-text ul,
.cv-timeline-text div {
  margin: 0.15rem 0;
  line-height: 1.6;
  color: var(--muted);
  font-size: 0.9rem;
}

.cv-timeline-text ul li::before {
  content: "→ ";
  color: var(--accent);
  font-weight: 600;
}


/* === Timeline alignment fix (2025-11-12) === */
.cv-timeline-list {
  --timeline-x: 18px;             /* position of the vertical line from the list's left edge */
  --dot-size: 18px;               /* diameter of the dot */
  --gutter: 18px;                 /* horizontal gap between the dot and the card */
  position: relative;
  padding-left: calc(var(--timeline-x) + (var(--dot-size) / 2) + var(--gutter));
}

.cv-timeline-list::before {
  content: "";
  position: absolute;
  left: var(--timeline-x);
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(200, 200, 200, 0.5);
}

.cv-timeline-item::before {
  content: "";
  position: absolute;
  top: 1.6rem; /* vertically centers the dot on the card header */
  left: calc(-1 * (var(--dot-size) + var(--gutter))); /* anchors dot on the vertical line */
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg-alt);
  z-index: 2;
}

/* === Placement précis des 3 timelines (2 colonnes desktop) === */

/* Mobile/tablette : 1 colonne (comportement inchangé) */
@media (max-width: 959.98px) {
  .cv-timelines {
    display: block; /* empêche un héritage flex/grid précédent */
  }
}

/* Desktop : 2 colonnes, avec Education sous Teaching */
@media (min-width: 960px) {
  .cv-timelines {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }

  /* 1) Expériences produit & data → colonne 1, rangée 1 */
  .cv-timelines .cv-timeline:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  /* 2) Expériences d’enseignement → colonne 2, rangée 1 */
  .cv-timelines .cv-timeline:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  /* 3) Études supérieures → colonne 2, rangée 2 (juste en dessous de l’enseignement) */
  .cv-timelines .cv-timeline:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }
}

/* === Timeline card layout: grid to avoid squeezing header === */
.cv-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;            /* header prend l'espace, logo à droite */
  grid-template-areas:
    "header logo"
    "body   body";
  align-items: start;
  column-gap: 1.5rem;
  row-gap: 0.6rem;
  position: relative;                          /* pour le chevron absolu */
  padding-bottom: 2.6rem;                      /* espace pour le chevron */
}

/* Le 1er bloc .cv-timeline-text = header (toujours visible) */
.cv-timeline-item > .cv-timeline-text:first-of-type {
  grid-area: header;
  flex: initial;                               /* neutralise d'anciennes règles */
  width: auto;
}

/* Logo à droite */
.cv-timeline-item > .cv-logo {
  grid-area: logo;
  justify-self: end;
  width: 60px;
  height: 60px;
}

/* Corps repliable occupe toute la largeur (2 colonnes) */
.cv-timeline-item > .cv-body {
  grid-area: body;
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}

.cv-timeline-item.is-open > .cv-body {
  max-height: 2000px;
}

/* Variables pour contrôler facilement la taille/position */
:root {
  --cv-toggle-size: 36px;     /* diamètre du bouton */
  --cv-toggle-stroke: 2px;    /* épaisseur de bordure */
  --cv-toggle-inside: calc(var(--cv-toggle-size) / 2); /* moitié du bouton */
}

/* La carte doit laisser déborder le bouton */
.cv-timeline-item {
  position: relative;
  overflow: visible;                         /* autorise le débordement */
  padding-bottom: calc(var(--cv-toggle-inside) + 0.1rem); /* place pour la moitié haute + un petit espace */
}

/* Bouton circulaire chevauchant le bas de la carte */
.cv-toggle {
  position: absolute;
  left: 50%;
  bottom: 0;                                 /* accroché au bord bas de la carte */
  transform: translate(-50%, 50%);           /* décale vers le bas = moitié hors de l'encart */
  width: var(--cv-toggle-size);
  height: var(--cv-toggle-size);
  border-radius: 50%;
  border: var(--cv-toggle-stroke) solid rgba(37, 99, 235, 0.5);
  background-color: #fff;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.cv-toggle:hover {
  background-color: rgba(37, 99, 235, 0.08);
  border-color: var(--accent);
}

@keyframes cvToggleHintPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.25);
    background-color: #fff;
  }
  50% {
    box-shadow: 0 0 12px 4px rgba(37, 99, 235, 0.35);
    background-color: rgba(37, 99, 235, 0.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.25);
    background-color: #fff;
  }
}

.cv-toggle--hint {
  border-color: var(--accent);
  animation: cvToggleHintPulse 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cv-toggle--hint {
    animation: none;
  }
}

/* Chevron SVG */
.cv-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

/* Ouvert = chevron retourné */
.cv-timeline-item.is-open .cv-toggle svg {
  transform: rotate(180deg);
}

/* Corps repliable (inchangé) */
.cv-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.cv-timeline-item.is-open .cv-body {
  max-height: 2000px;
}

/* Mobile : un chouïa plus d’air si besoin */
@media (max-width: 720px) {
  .cv-timeline-item {
    padding-bottom: calc(var(--cv-toggle-inside) + 0.8rem);
  }
}


/* Sécurité: ces éléments restent bien visibles et sur largeur normale */
.cv-timeline-role,
.cv-timeline-period,
.cv-timeline-company { display: block; }

/* Mobile: même grille, mais logo un peu plus petit et plus d'espace bas */
@media (max-width: 720px) {
  .cv-timeline-item { column-gap: 1rem; padding-bottom: calc(var(--cv-toggle-inside) + 0.8rem); }
  .cv-timeline-item > .cv-logo { width: 52px; height: 52px; }
}

/* --- Patch langue pour les en-têtes de carte (titre / période) --- */

/* Neutralise toute règle précédente qui forcerait l'affichage */
.cv-timeline-role,
.cv-timeline-period,
.cv-timeline-company { display: unset; }

/* Par défaut, cache les variantes localisées de ces champs */
.cv-timeline-role[data-lang],
.cv-timeline-period[data-lang],
.cv-timeline-company[data-lang] { display: none !important; }

/* Affiche UNIQUEMENT la langue active */
body.lang-fr .cv-timeline-role[data-lang="fr"],
body.lang-fr .cv-timeline-period[data-lang="fr"],
body.lang-fr .cv-timeline-company[data-lang="fr"],
body.lang-en .cv-timeline-role[data-lang="en"],
body.lang-en .cv-timeline-period[data-lang="en"],
body.lang-en .cv-timeline-company[data-lang="en"] { display: block !important; }
/* Flip card (écologie - format paysage) */
.flip-card {
  background-color: transparent;
  width: 480px;          /* largeur augmentée */
  height: 300px;         /* hauteur réduite */
  perspective: 1000px;   /* profondeur pour effet 3D */
  margin: 2rem auto;     /* centrage */
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 18px;
  overflow: hidden;
}

.flip-card-front img,
.flip-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}

.flip-card-back {
  transform: rotateY(180deg);
}
@media (max-width: 640px) {
  .environment-grid {
    grid-template-columns: 1fr;   /* 1 colonne fluide */
  }

  .flip-card {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;        /* garde un format paysage sans fixer en px */
    margin: 1.5rem auto;
  }

  .flip-card-inner,
  .flip-card-front,
  .flip-card-back {
    height: 100%;
  }

  .flip-card-front img,
  .flip-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
