/* ==========================================================================
   1. RESET & VARIABLES GLOBALES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f5f5f5;
  color: #000;
}

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

html {
  scroll-behavior: smooth;
}

/* ==========================================================================
   2. TYPOGRAPHIE
   ========================================================================== */
h1 {
  font-size: 2rem;
  font-weight: 500;
}

h2 {
  font-size: 2.4rem;
  font-weight: 600;
}

h3 {
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 20px;
}

h1, h2, h3 {
  line-height: 1.2;
}

p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.6;
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 95%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px 0;
  flex-wrap: wrap;
  position: relative;
}

.logo img {
  display: block;
  width: 130px;
  height: auto;
}

.logo img:hover {
  color: #D8450F;
}

.main-nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}

.main-nav a {
  text-decoration: none;
  color: #000;
  font-weight: 300;
  transition: 0.3s;
}

.main-nav a:hover {
  text-decoration: underline;
}

.burger {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  color: black;
  cursor: pointer;
  z-index: 1015;
  position: absolute;
  top: 15px;
  right: 20px;
}

.close-menu {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 3rem;
  cursor: pointer;
  z-index: 1016;
  color: #000;
}

.close-menu:hover {
  color: black;
}

/* ==========================================================================
   4. HERO SECTION
   ========================================================================== */
.hero {
  width: 100%;
  height: 50vh;
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
  padding: 20px;
}

/* ==========================================================================
   5. PORTFOLIO
   ========================================================================== */
.containerportfolio {
  width: 90%;
  max-width: 1800px;
  margin: 100px auto;
}

.header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  margin-bottom: 180px;
}

.title {
  font-size: 80px;
  font-weight: 300;
}

.description {
  font-size: 18px;
  line-height: 1.6;
  max-width: 1000px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 90px;
}

.item {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ddd;
  overflow: hidden;
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.item:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

.item a {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   6. PAGE PHOTO PROJET (CARROUSEL) - INCHANGÉ POUR TES AUTRES PAGES
   ========================================================================== */
.container {
  width: 95%;
  max-width: 1800px;
  flex: 1;
  margin: 80px 0 0 auto;
}

.top {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  margin-bottom: 190px;
  margin: 0 50px 190px 0;
  align-items: start;
}

.gallery-wrapper {
  position: relative;
}

.gallery {
  display: flex;
  gap: 80px;
  overflow-x: auto;
  scroll-behavior: smooth;
  bottom: 0;
}

.gallery img {
  height: 380px;
  width: auto;
  object-fit: cover;
  cursor: pointer;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px;
  cursor: pointer;
  font-size: 25px;
}

.arrow.left { left: 0; }
.arrow.right { right: 0; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 35px;
  cursor: pointer;
  z-index: 1016;
  color: #000;
}

.lightbox .close:hover {
  color: black;
}

.lightbox .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox .left { left: 20px; }
.lightbox .right { right: 20px; }

/* ==========================================================================
   7. À PROPOS
   ========================================================================== */
.apropos {
  background: #fff;
}

main.apropos {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  width: 100%;
  max-width: 1800px;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.06);
}

.apropos .bio {
  padding: 90px 0 60px 0;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  position: relative;
}

.bio-img {
  flex: 0 0 30vw;
  position: static;
  right: 0;
  top: 0;
  margin: 0 30px 0 0;
}

.bio-img img {
  width: 100%;
  height: 570px;
  object-fit: cover;
  margin: 0;
  transition: transform 0.3s ease;
}

.bio-text {
  flex: 1;
  max-width: 50%;
  padding: 0;
  margin: 0 0 0 40px;
}

.bio-text p {
  font-size: 20px;
  line-height: 1.8;
}

/* ==========================================================================
   8. FORMATIONS
   ========================================================================== */
.formation {
  padding: 30px 0 200px 0;
  background: #F7F7F7;
}

.formation nav ul {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  list-style-type: none;
  gap: 200px;
  font-weight: 300;
}

.formation button {
  background: none;
  border: none;
  padding: 3px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-transform: uppercase;
}

.formation button:hover {
  text-decoration: underline;
}

.lien { 
  text-decoration: underline;
  color: darkslategray;
  list-style-type: none;
  font-weight: inherit;
}

.lilien { 
  font-size: 16px;
  list-style-type: none;
}

.timeline1, .timeline2, .timeline3 {
  display: flex;
  flex-direction: column;
  gap: 50px;
  max-width: 900px;
  margin: 100px auto 60px auto;
}

.timeline2, .timeline3 {
  display: none;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
}

.timeline-date {
  font-size: 16px;
  color: #333;
}

.timeline-date p {
  margin: 0;
  font-size: 16px;
}

.timeline-content h3 {
  font-size: 16px;
}

.timeline-content p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/* ==========================================================================
   9. CONTACT
   ========================================================================== */
.contact-section {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6rem 4%;
  bottom: 0;
  position: sticky;
}

.contact-section a {
  list-style-type: none;
  text-decoration: underline;
  color: #BA3606;
}

.contact-text {
  flex: 1;
}

.contact-text h4 {
  font-size: 30px;
  font-weight: 300;
  padding: 0 0 30px 0;
}

.contact-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 2px solid grey;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 300;
  font-family: inherit;
  background: transparent;
  margin: 0 0 3px 0;
  transition: border-color 0.25s, color 0.25s;
  color: #000;
}

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

Label {
  font-weight: 300;
  color: grey;
  font-size: 1rem;
}

Label:hover {
  color: black;
}

.contact-form button {
  padding: 0.9rem 1.2rem;
  border: none;
  background: #000;
  color: #fff;
  font-size: 1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.25s, font-size 0.3s;
}

.contact-form input:hover,
.contact-form textarea:hover {
  border-bottom-color: #BA3606;
}

.contact-form button:hover {
  background: #BA3606;
  color: #fff;
  font-size: 1.2rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-bottom-color: black;
  color: #000;
}

/* ==========================================================================
   10. PAGE PROJET & MODIFICATEURS DE COUBLAGE
   ========================================================================== */
.page-projet {
  display: grid;
  grid-template-columns: 180px 1fr;
  width: 95%;
  max-width: 1800px;
  margin: 60px auto 120px auto;
  gap: 40px;
}

.sidebar {
  position: sticky;
  top: 40px;
  align-self: start;
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
}

.sidebar a {
  font-size: 1rem;
  font-weight: 400;
  color: #000;
  text-decoration: none;
}

.sidebar .top-link {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.sidebar.scrolled .top-link {
  opacity: 1;
}

.sidebar a:hover {
  text-decoration: underline;
  opacity: 1;
}

.content {
  min-width: 0;
}

.intro {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  margin-bottom: 90px;
  align-items: start;
}

.intro-left h1 {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 15px;
}

.intro-left .tags {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.6;
}

.intro-right p {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.6;
}

.full-image,
.full-image-wide {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: cover;
  display: block;
  margin-bottom: 120px;
}

.section-center {
  max-width: 850px;
  margin: 0 auto 90px auto;
  text-align: center;
}

.section-center h2 {
  margin-bottom: 25px;
  line-height: 1.2;
}

.section-center h3 {
  margin-bottom: 20px;
}

.section-center p {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 16px;
}

.section-center .moodboard-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 40px;
  display: block;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
  margin-bottom: 120px;
  width: 100%;
}

.grid-3 img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.page-ferme .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: center;
}

.page-ferme .grid-3 img {
  width: 100%; 
  aspect-ratio: 1 / 1; 
  object-fit: cover;   
  border-radius: 8px; 
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 200px;
  width: 100%;
}

.grid-2 img {
  width: 100%;
  height: auto; 
  display: block;
}

.section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  align-items: center;
  margin-bottom: 150px;
  width: 100%;
}

.section-split img {
  width: 100%;
  max-width: 100%;
  height: 700px;
  object-fit: cover;
  display: block;
}

.section-split-text {
  min-width: 0;
}

.section-split-text h2, 
.section-split-text h3 {
  margin-bottom: 20px;
}

.section-split-text p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.6;
}

.section-split.reverse {
  direction: rtl;
}

.section-split.reverse > * {
  direction: ltr;
}

.menu-section, 
.website-section {
  width: 100%;
  margin-bottom: 120px;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.menu-item {
  position: relative; 
  overflow: hidden;   
  border-radius: 8px; 
}

.menu-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.menu-item:hover img {
  transform: scale(1.04);
}

.menu-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0; 
  transition: opacity 0.3s ease;
  padding: 15px;
  box-sizing: border-box;
}

.menu-item:hover .overlay {
  opacity: 1;
}

.menu-item .overlay span {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 400;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 6px;
}

.website-intro {
  max-width: 850px;
  margin: 30px auto 60px auto;
  text-align: center;
}

.website-intro p {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.6;
}

.website-mockup img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: cover;
  display: block;
}

.portfolio-trigger-container {
  width: 100%;       
  max-width: 100%;   
  margin: 30px 0 60px 0;    
}

.main-cover-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  height: 600px; 
}

.main-cover-thumb img {
  width: 100%;
  height: 100%; 
  object-fit: cover; 
  display: block;
  transition: transform 0.4s ease;
}

.hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hover-overlay span {
  color: #fff;
  font-family: sans-serif;
  font-weight: 500;
  border: 1px solid #fff;
  padding: 10px 20px;
  border-radius: 4px;
}

.main-cover-thumb:hover img {
  transform: scale(1.05);
}

.main-cover-thumb:hover .hover-overlay {
  opacity: 1;
}

.video-container {
  position: relative;
  width: 100%;           
  max-width: 100%;       
  margin: 40px auto;     
  height: 0;
  padding-bottom: 56.25%; 
  border-radius: 12px;   
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* PROTECTION SPÉCIFIQUE DES ANIMATIQUES (Force l'écrasement de la section 6) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 17, 20, 0.95) !important; 
  display: none; 
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox:target {
  display: flex;
}

/* Utilisation du double sélecteur ultra-spécifique pour cibler tes animatiques */
.lightbox .lightbox-img {
  width: auto !important;
  height: auto !important;
  max-width: 60% !important;  
  max-height: 75vh !important; 
  object-fit: contain !important;
  margin: auto !important;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.arrow {
  position: absolute;
  color: #ffffff;
  font-size: 40px;
  text-decoration: none;
  top: 50%;
  transform: translateY(-50%);
  padding: 20px;
  transition: color 0.2s;
}

.arrow:hover { color: #BA3606; } 
.prev { left: 4%; }  
.next { right: 4%; } 

.close-btn {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 35px;
  text-decoration: none;
}

.close-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; 
  cursor: default;
}

/* ==========================================================================
   11. UTILITAIRES / MISC
   ========================================================================== */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* ==========================================================================
   12. RESPONSIVE GLOBAL (TOUTES LES MEDIA QUERIES REGROUPÉES)
   ========================================================================== */

/* ======= TABLETTES LARGE (max-width: 1100px) ======= */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
  }
}

/* ======= TABLETTES (max-width: 1024px) ======= */
@media (max-width: 1024px) {
  .header {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 80px;
  }
  
  .top {
    grid-template-columns: 1fr;
    margin: 0 20px 80px 0;
  }

  .intro { gap: 40px; }
  .grid-3 { gap: 15px; }
  .section-split { gap: 50px; }
}

/* ======= TABLETTES STANDARD (max-width: 850px) ======= */
@media (max-width: 850px) {
  .contact-section {
    flex-direction: column;
    padding: 4rem 5%;
    gap: 2rem;
  }
}

/* ======= MOBILES & TABLETTES PORTRAIT (max-width: 768px) ======= */
@media (max-width: 768px) {
  /* Typographies de base sur mobile */
  h2 { font-size: 1.8rem; }
  h3 { font-size: 1.5rem; }

  /* Ajustement forcé de la Lightbox Animatique sur mobile */
  .lightbox .lightbox-img { 
    max-width: 85% !important; 
    max-height: 70vh !important;
  }
  .prev { left: 15px; }
  .next { right: 15px; }
  .close-btn { right: 25px; top: 25px; }
  .arrow { font-size: 30px; }

  /* Ajustement manquant : Image de couverture principale */
  .main-cover-thumb {
    height: 350px; /* Réduit la hauteur immense pour que ce soit beau sur mobile */
  }

  .site-header { padding: 15px 20px; }
  .logo img { width: 110px; }
  
  .burger {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
  }
  .close-menu {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
  }
  
  .main-nav ul {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 100px 20px;
    gap: 20px;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1010;
    overflow-y: auto;
  }
  .main-nav ul.show {
    display: flex;
    padding-left: 30px;
  }
  .main-nav li {
    text-align: left;
    padding: 0 0 20px 0;
  }
  .main-nav li a { font-size: 1.8em; }

  .hero {
    height: 30vh;
    min-height: 250px;
    margin-bottom: 10px;
  }

  .apropos .bio {
    flex-direction: column;
    padding: 50px 5%;
  }
  .bio-img {
    flex: 1;
    width: 100%;
    margin: 0 0 30px 0;
  }
  .bio-img img {
    width: 100%;
    height: auto;
    max-height: 400px;
  }
  .bio-text {
    max-width: 100%;
    margin: 0;
    text-align: center;
  }

  .formation nav ul {
    flex-direction: column;
    gap: 25px;
    align-items: center;
  }
  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .portfolio-section {
    flex-direction: column;
    padding: 0px;
  }
  .filters {
    flex-direction: row;
    gap: 0px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  .filters button {
    margin-left: 10px;
    margin-top: 20px;
    white-space: nowrap;
    border-radius: 50px;
    padding: 7px 20px;
    background: white;
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
  }
  .filters button.active {
    background-color: #BA3606;
    color: #fff;
  }

  /* Page Projet & Sidebar Mobile */
  .page-projet {
    grid-template-columns: 1fr;
    width: 90%;
    margin-top: 20px;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 10px 0; /* Ajout d'un léger padding pour respirer */
    border-bottom: 1px solid rgba(0,0,0,0.08); /* Ligne subtile séparatrice */
  }
  .sidebar .top-link { opacity: 1; }
  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 50px;
  }
  .intro-left h1 { font-size: 2.5rem; }
  
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 60px;
  }
  
  .page-ferme .grid-3 {
    grid-template-columns: 1fr; 
    max-width: 300px;         
    margin: 0 auto;           
  }

  .section-split {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 60px;
    direction: ltr;
  }
  .section-split img { height: 300px; }
  .full-image,
  .full-image-wide { margin-bottom: 60px; }
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .menu-section,
  .website-section { margin-bottom: 60px; }
}

/* ======= PETITS MOBILES (max-width: 600px) ======= */
@media (max-width: 600px) {
  .title { font-size: 45px; }
  .grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .grid-item h3 { font-size: 0.9rem; }
  .gallery img { height: 250px; }
}

/* ======= TRÈS PETITS MOBILES (max-width: 480px) ======= */
@media (max-width: 480px) {
  .logo img { width: 90px; }
  .main-nav ul {
    padding: 80px 15px;
    gap: 15px;
  }
  .main-nav li a { font-size: 1.5rem; }

  .burger,
  .close-menu {
    top: 15px;
    right: 15px;
  }
}