/* =========================
   MAIN LAYOUT & TYPOGRAPHY
   ========================= */

/* ----- Base body styles ----- */
body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  background-color: #f5f5f5;
  color: #222;
  overflow: hidden;
}

/* ----- Headings ----- */
h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.5rem;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: #222;
}
h3 {
  font-family: 'Roboto', sans-serif;
  margin-bottom: 5px;
  color: #222;
}

/* ----- Paragraphs ----- */
p {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  margin-bottom: 20px;
}

/* =========================
   HEADER
   ========================= */
header {
  padding: 15px 30px;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  font-size: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 20px;
}
header h1 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.4rem;
  margin: 0;
  text-transform: uppercase;
}
header p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
}

/* =========================
   LAYOUT CONTAINER & SIDEBAR
   ========================= */
.container {
  display: flex;
  height: auto;
  overflow: hidden;
}
.sidebar {
  width: 200px;
  background: linear-gradient(to bottom, #fdfdfd, #ffffff);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ----- Sidebar menu links ----- */
.menu-link {
  position: relative;
  margin: 15px 0;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  color: #000;
}
.menu-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background-color: #000;
  transition: width 0.3s ease;
}
.menu-link:hover::after {
  width: 100%;
}

/* =========================
   MAIN CONTENT AREA
   ========================= */
.content {
  flex-grow: 1;
  background-color: #fff;
  position: relative;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: hidden;
  height: auto;
  z-index: 1;
}

/* =========================
   FADE LAYER FOR TRANSITIONS
   ========================= */
.fade-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.5s ease;
}

/* =========================
   CONTENT BLOCKS (SECTIONS)
   ========================= */
.content-block {
  position: absolute;
  padding: 20px 80px;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease, visibility 0s linear 0.1s;
  overflow: hidden;
}
.content-block.active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  overflow-y: auto;
}

/* =========================
   REEL SECTION
   ========================= */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 1000px;      /* Limite la largeur sur les grands écrans */
  margin: 0 0 30px 0;
  aspect-ratio: 16/9;    /* Garde le ratio */
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0.5rem;
  object-fit: cover;
  background: #000;
  max-width: 93%;
  max-height: 80%;
}

/* =========================
   CV SECTION: TABS & PANELS
   ========================= */
/* ----- Tab menus ----- */
.cv-menu,
.exp-submenu {
  position: sticky;
  display: flex;
  gap: 1rem;
  justify-content: left;
  flex-wrap: wrap;
  border-bottom: 1px solid #eee;
  align-items: flex-end;
  min-height: 2.5rem;
  background: #fff;
  box-shadow: none;
}
.cv-tab,
.exp-tab {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  background: none;
  border: none;
  padding: 0 0 8px 0;
  font-size: 1.1rem;
  cursor: pointer;
  outline: none;
  transition: color 0.2s, background-color 0.2s;
  box-shadow: none;
  color: #222;
  border-radius: 20px;
}
.cv-tab.active,
.exp-tab.active {
  background: none;
  color: #000;
}
.cv-tab:not(.active),
.exp-tab:not(.active) {
  color: #888;
  background: none;
}
.cv-underline,
.exp-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: #000;
  transition: left 0.3s cubic-bezier(.4,0,.2,1), width 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 1;
  pointer-events: none;
}

/* ----- CV/Experience content wrapper ----- */
.cv-content {
  flex: 1 1 0;
  height: calc(100vh - 60px); /* Adjust height to fit the viewport */
  padding: 1rem;
  position: relative;
  width: 85%;
  scrollbar-width: none;
  overflow-y:auto;
  height: auto;
}

/* ----- CV/Experience panels (hidden by default) ----- */
.cv-section,
.exp-panel {
  display: none;
  opacity: 0;
  animation: none;
  transition: opacity 0.4s;
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  background: #fff;
  overflow-y: auto;
}
.cv-section.active,
.exp-panel.active {
  display: block;
  animation: fadeInCV 0.5s;
  opacity: 1;
  position: relative;
}
@keyframes fadeInCV {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================
   PROFILE STYLES
   ========================= */
.profil-flex {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 0.2rem;
}
.profil-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  filter: grayscale(1) brightness(1);
}
@media (max-width: 700px) {
  .profil-flex {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .profil-photo {
    width: 80px;
    height: 80px;
  }
}

/* =========================
   CV: FORMATION, COMPETENCES, INTERETS
   ========================= */
.cv-section {
  max-width: 85%;
  min-width: 0;
}
.cv-section h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  margin-top: 0;
  margin-bottom: 1.2rem;
  letter-spacing: 0.01em;
  border-left: 3px solid #222;
  padding-left: 0.7em;
  background: none;
}
.cv-section h4 {
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  margin-top: 0.3rem;
  background: none;
  border-left: 3px solid #222;
  padding-left: 0.7em;
}
.formation-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.formation-list li {
  margin-bottom: 1.7em;
  padding-bottom: 0.7em;
  border-left: 2px solid #e0e0e0;
  padding-left: 1.1em;
  background: none;
}
.formation-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}
.formation-ecole {
  color: #555;
  font-size: 0.98em;
  margin-right: 0.7em;
}
.formation-annee {
  color: #aaa;
  font-weight: 600;
  font-size: 0.97em;
  margin-left: 0.5em;
}
.formation-sousliste {
  margin: 0.5em 0 0.5em 1.2em;
  padding: 0;
  list-style: disc;
  color: #666;
  font-size: 0.97em;
}
.formation-sousliste li {
  margin-bottom: 0.2em;
  padding-left: 0.2em;
  border: none;
}
#competences.cv-section p {
  margin-bottom: 0.7em;
  color: #333;
  font-size: 1em;
  background: none;
}
#competences.cv-section strong {
  color: #222;
  font-weight: 700;
  font-size: 1.04em;
}
#interets.cv-section p {
  margin-bottom: 0.5em;
  color: #444;
  font-size: 1em;
  background: none;
}
#interets.cv-section strong {
  color: #222;
  font-weight: 600;
  font-size: 1.01em;
}

/* =========================
   EXPERIENCE TIMELINE & CARDS
   ========================= */
.exp-timeline {
  display: flex;
  flex-direction:column;
  flex-wrap:wrap;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0;
}
.exp-card {
  display: flex;
  gap: 2rem;
  position: relative;
  padding: 1rem;
  background: #fff;
  border-radius: 4px;
  transform: translateX(0);
  transition: all 0.3s ease;
  margin-left: 0;
  width: fit-content;
}
.exp-year {
  flex: 0 0 80px;
  padding: 0.3rem 1rem;
  background: #000;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  border-radius: 3px;
  align-self: flex-start;
}
.exp-content {
  flex: 1;
}
.exp-content h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #222;
}
.exp-content p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #444;
  margin: 0;
}

/* =========================
   PROD SECTION: TABLE
   ========================= */
#prod.content-block {
  position: relative;
  max-height: 80vh;
  max-width: 85%;
  overflow-y: auto; /* Ensure vertical scroll is always available */
  padding-right: 40px; /* Add a little blank on the right */
  padding-bottom: 20vh;
  scrollbar-width: none;
  /* You can adjust 40px as needed for your design */
}

/* Make the Prods section title sticky */
#prod.content-block > h2 {
  position: sticky;
  top: -2.5vh;
  z-index: 6;
  padding-top: 2vh;
  padding-bottom: 2vh;
  width: 120%;
  background: #fff;
  margin-top: 0;
}

/* Make the first row of the table (thead) sticky */
#prod .prod-table thead {
  position: sticky;
  top: 0vh; /* Adjust so it appears just below the sticky h2 */
  z-index: 7;
  background: #fff;
  box-shadow: none;
  margin-top: 0px;
}

.prod-table {
  width: 100%;
  max-width: 1100px;
  min-width: 900px; /* Ensure table is wide enough to scroll if needed */
  table-layout: auto;
  margin-left: 0;
  margin-right: 0;
  display: table;
  border-collapse: collapse;
  background: #fff;
  overflow-y: auto;
}
.prod-table th,
.prod-table td {
  padding: 6px 28px 6px 0px;
  font-size: 1rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  position: relative;
  overflow: visible;
  overflow-y: auto;
  z-index: 1;
  background: transparent;
  height: 30px !important;
  min-height: 40px;
  max-height: 70px;
}
.prod-table th:first-child,
.prod-table td:first-child {
  padding-left: 24px;
}
.prod-table th:last-child,
.prod-table td:last-child {
  padding-right: 100px;
  text-align: center;
  width: 0px;
}
.prod-table td:last-child {
  text-align: center;
}
.prod-table tr {
  transition: background 0.3s ease;
  position: relative;
}
.prod-table tr.prod-row {
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
  z-index: 1;
  border-radius: 1rem;
  overflow: auto;
}
.prod-table tr.prod-row.hovered {
  transform: scale(1.005);
  z-index: 2;
  color: #fdfdfd;
}
.prod-table tr.prod-row.hovered td,
.prod-table tr.prod-row.hovered th {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45), 0 1px 0 #222;
}
.prod-table tr.prod-row.hovered .cell-text {
  position: relative;
  z-index: 5;
  color: #ffffff;
}
.prod-table tr.prod-row.hovered .cell-text::before {
  content: "";
  position: absolute;
  left: -0.4em;
  right: -0.4em;
  top: 50%;
  transform: translateY(-50%);
  height: 1.6em;
  background: rgb(0, 0, 0);
  z-index: -1;
  pointer-events: none;
  display: block;
}
th.sortable {
  position: relative;
  cursor: pointer;
  background: none;
  user-select: none;
  font-weight: 700;
}
.th-label {
  display: inline-block;
  position: relative;
  padding-bottom: 3px;
}
.th-underline {
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: #000;
  transition: width 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 1;
  pointer-events: none;
}
th.sortable.active .th-underline {
  width: 100%;
}
#prod .prod-table thead {
  position: sticky;
  top: -30px;
  z-index: 5;
  background: #fff;
  box-shadow: none;
  margin-top: 0px;
}
#prod.content-block::-webkit-scrollbar {
  width: 10px;
  background: #f0f0f0;
  border-radius: 8px;
}
#prod.content-block::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 8px;
  border: 2px solid #f0f0f0;
}
#prod.content-block::-webkit-scrollbar-thumb:hover {
  background: #888;
}
.prod-table tbody tr:nth-child(even) {
  background: #f5f5f5;
}
.prod-table tbody tr:nth-child(odd) {
  background: #fff;
}

/* =========================
   EXPERIENCE: ADVANCED LAYOUTS
   ========================= */
/* Expériences postprod : colonnes scrollables */
.exp-columns-scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  height: 300px;
}
.exp-column {
  min-width: 500px;
  max-width: 500px;
  flex: 2 2 320px;
  padding: 1.2rem 1.5rem;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background: none;
  border-left: 1px solid #ddd;
  flex-wrap: wrap;
}
.exp-column:first-child {
  border-left: none;
}
.exp-item {
  margin-bottom: 0.7em;
  font-size: 1rem;
  color: #444;
}
.exp-item strong {
  color: #222;
  font-size: 1.05em;
}
/* Expériences postprod linéaires */
.exp-list {
  display: flex;
  flex-direction: row;
  flex-wrap:nowrap;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.exp-list li {
  flex: 0 0 auto;
  width: 600px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #444;
  border-left: 3px solid #eee;
  padding: 0.5rem 1rem;
  background: #fff;
}
.exp-list li strong {
  font-size: 1rem;
  color: #222;
}
.exp-sticky-title {
  position: sticky;
  top: 60px;
  background: #fff;
  z-index: 2;
  padding: 0.5em 0 0.5em 0.2em;
  margin: 0 0 1em 0;
  font-size: 1.2em;
  font-weight: 700;
  border-bottom: 1px solid #eee;
}
.exp-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}
.exp-column {
  flex: 1 1 calc(50% - 1rem);
  min-width: 300px;
}
.exp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.exp-list li {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #444;
  border-left: 3px solid #eee;
  padding: 0.5rem 1rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.exp-list li strong {
  font-size: 1rem;
  color: #222;
}

/* =========================
   RESPONSIVE & UTILITIES
   ========================= */

/* Tablets (≤1024px): stack sidebar, reduce paddings, font sizes, make scrollable */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    height: auto;
  }
  .sidebar {
    flex-direction: row;
    width: 100%;
    height: auto;
    justify-content: center;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    border-right: none;
  }
  .content-block {
    padding: 6px 2px;
  }
  .cv-content {
    padding: 0.3rem 0.2vw;
    width: 100%;
    overflow-y: auto;
    max-height: 90vh;
  }
  .prod-table {
    max-width: 100%;
    width: 100%;
    font-size: 0.90rem;
  }
  .prod-table th,
  .prod-table td {
    padding: 3px 4px 3px 0px;
    font-size: 0.90rem;
  }
  .cv-section {
    max-width: 100vw;
    padding: 0.5rem 0.2rem 0.5rem 0.2rem;
  }
}

/* Mobiles (≤700px): single column, minimal paddings, font sizes, scrollable blocks/tables */
@media (max-width: 700px) {
  header {
    flex-direction: column;
    padding: 6px 2vw;
    font-size: 0.85rem;
  }
  .header-content {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
  .sidebar {
    flex-direction: row;
    width: 100%;
    min-width: 0;
    padding: 2px 0;
    font-size: 0.90rem;
  }
  .menu-link {
    margin: 0 4px;
    font-size: 0.90rem;
  }
  .content-block {
    position: relative;
    padding: 2px 0.5vw;
    width: 100%;
    min-width: 0;
    overflow-y: auto;
    max-height: 90vh;
  }
  .cv-content {
    padding: 0.2rem 0.2vw;
    width: 100%;
    overflow-y: auto;
    max-height: 90vh;
  }
  .cv-section,
  .cv-section.active,
  .exp-panel,
  .exp-panel.active {
    position: static;
    width: 100%;
    min-width: 0;
    padding: 0.2rem 0.1rem;
    box-sizing: border-box;
  }
  .cv-section h3 {
    font-size: 0.93rem;
    padding-left: 0.2em;
  }
  .exp-content {
    min-height: 0;
  }
  .profil-flex {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .profil-photo {
    width: 48px;
    height: 48px;
  }
  /* Table: horizontal scroll for overflow, smaller font */
  .prod-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    font-size: 0.80rem;
  }
  .prod-table thead, .prod-table tbody, .prod-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  .prod-table th,
  .prod-table td {
    padding: 2px 2px 2px 0px;
    font-size: 0.80rem;
    white-space: normal;
  }
  .prod-table th:last-child,
  .prod-table td:last-child {
    padding-right: 4px;
  }
  .prod-table th:first-child,
  .prod-table td:first-child {
    padding-left: 4px;
  }
  .prod-table {
    font-size: 0.80rem;
  }
  /* Timeline cards: stack vertically */
  .exp-card {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.4rem;
  }
  .exp-year {
    align-self: flex-start;
    margin-bottom: 0.2rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
  }
  .exp-timeline {
    padding: 0.5rem 0.1rem;
    gap: 0.7rem;
  }
  .cv-section {
    padding: 0.3rem 0.1rem 0.3rem 0.1rem;
  }
  .formation-list li {
    padding-left: 0.2em;
    font-size: 0.90em;
  }
  .formation-sousliste {
    margin-left: 0.3em;
    font-size: 0.88em;
  }
}

/* Small Mobiles (≤480px): tightest paddings, smallest font, scrollable */
@media (max-width: 480px) {
  header h1 {
    font-size: 0.95rem;
  }
  .content-block {
    padding: 2px 0.2vw;
    max-height: 95vh;
    overflow-y: auto;
  }
  .cv-content {
    padding: 0.05rem 0.05vw;
    max-height: 95vh;
    overflow-y: auto;
  }
  .cv-section,
  .cv-section.active,
  .exp-panel,
  .exp-panel.active {
    padding: 0.1rem 0.05rem;
  }
  .cv-section h3 {
    font-size: 0.85rem;
    padding-left: 0.1em;
  }
  .profil-photo {
    width: 36px;
    height: 36px;
  }
  .prod-table th,
  .prod-table td {
    font-size: 0.70rem;
    padding: 1px 1px 1px 0px;
  }
  .exp-timeline {
    padding: 0.2rem 0.05rem;
    gap: 0.4rem;
  }
  .exp-card {
    padding: 0.2rem;
  }
  .formation-list li {
    font-size: 0.85em;
    padding-left: 0.1em;
  }
}

/* Large screens (≥2000px): unchanged */
@media (min-width: 2000px) {
  .prod-table th,
  .prod-table td {
    font-size: 0.95rem;
    padding-right: 12px;
  }
}

/* =========================
   SPECIAL CASES & OVERRIDES
   ========================= */
#experiences.content-block.active {
  overflow-y: auto;
  height: 100vh;
}
#experiences.cv-section.active {
  overflow-y: auto;
  height: 68vh;
  scrollbar-width:none;
}