/* ---------------------- RESET ---------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: linear-gradient(270deg, #FAF7F0, #E0E0E0);
  color: #fff;
  line-height: 1.6;
}

/* ---------------------- HEADER ---------------------- */
header {
  text-align: center;
  padding: 40px 20px 20px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #09261C;
}

header h2 {
  font-size: 1.2rem;
  font-weight: 400;
  color: #0B4D39;
}
.portfolio {
  column-count: 4;       
  column-gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;

  will-change: transform;
}

.portfolio .item {
  display: inline-block;
  width: 100%;
  margin: 0 0 15px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
  vertical-align: top;

  min-height: 140px;
}

.portfolio > * {
  display: inline-block;
  width: 100%;
  margin: 0 0 15px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
  vertical-align: top;
  min-height: 140px;
}
.portfolio img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 15px;
  cursor: pointer;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);


  opacity: 0;
  animation: fadeImg 0.45s ease forwards;
  transition: filter 0.25s ease, opacity 0.2s ease;
  will-change: opacity, filter;
}

@keyframes fadeImg {
  to {
    opacity: 1;
  }
}


.img-placeholder {

  background-color: #f0f0f0;

  transition: filter 0.35s ease, opacity 0.25s ease;
}


.portfolio[data-debug="true"] img {
  opacity: 1 !important;
}

.lb {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.lb.active {
  opacity: 1;
  visibility: visible;
}

.lb-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

@keyframes fadeIn {
  from { opacity:0; transform:scale(0.95); }
  to { opacity:1; transform:scale(1); }
}

/* Flèches */
.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  padding: 10px 15px;
  user-select: none;
  transition: transform 0.2s ease, color 0.2s ease;
}
.lb-prev:hover, .lb-next:hover {
  transform: translateY(-50%) scale(1.2);
  color: #c86a8d;
}
.lb-prev { left: 20px; }
.lb-next { right: 20px; }


.lb-close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, color 0.2s ease;
}
.lb-close:hover {
  transform: scale(1.2);
  color: #c86a8d;
}

#popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#popup .popup-content {
  background: #fff;
  color: #000;
  padding: 25px 35px;
  border-radius: 12px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

#popup button {
  margin-top: 15px;
  padding: 10px 25px;
  background: #c86a8d;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease;
}
#popup button:hover {
  background: #a64a70;
}
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: linear-gradient(270deg, #A3CFC0, #E099B1, #A3CFC0);
  background-size: 400% 400%;
  animation: gradientMove 12s ease infinite;
  border-radius: 12px;
  margin: 20px;
  flex-wrap: nowrap;
  gap: 10px;
  position: relative; 
}

/* Title centré */
.main-header .title {
  text-align: center;
  flex-grow: 1;
  min-width: 150px;
  width: 100%;
  padding: 0 80px; 
}

.main-header .title h1 {
  margin: 0;
  color: #09261C;
  font-size: 1.6rem;
}
.main-header .title h2 {
  margin: 0;
  color: #0B4D39;
  font-size: 0.95rem;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Retour */
.btn-return {
  background-color: #c86a8d;
  color: #000;
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-return:hover {
  background-color: #a64a70;
}

/* Instagram */
.insta-icon {
  height: 58px;
  width: 58px;
  border-radius: 6px;
  transition: transform 0.2s ease;
  display: inline-block;
}
.insta-icon:hover {
  transform: scale(1.1);
}

/* ---------------------- MEDIA QUERIES ---------------------- */

/* Large tablette */
@media(max-width:1024px){
  .portfolio { column-count: 3; }
  .portfolio .item,
  .portfolio > * { min-height: 130px; }
}

/* Tablette / petit écran */
@media(max-width:768px){
  .portfolio { column-count: 2; }
  .portfolio .item,
  .portfolio > * { min-height: 120px; }
}

@media(max-width:480px){
  .main-header {
    flex-direction: column; 
    align-items: center;
    gap: 15px;
  }

  .main-header .title {
    order: 1;
    width: 100%;
    text-align: center;
    padding: 0;
  }

  .header-content-mobile {
    order: 2;
    display: flex;
    flex-direction: row; /* Force la ligne */
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap; 
  }


  .btn-return, .btn-nav, .insta-icon {
    height: 35px; 
    font-size: 0.8rem;
  }
  
  .insta-icon {
    width: 35px;
  }


  .header-left, .header-right {
    display: contents; 
  }
}

@media(max-width:600px){
  .lb-prev, .lb-next { font-size: 2.2rem; }
  .lb-close { font-size: 2.5rem; }
}

@keyframes gradientMove {
  0% {background-position: 0% 50%;}
  50% {background-position: 100% 50%;}
  100% {background-position: 0% 50%;}
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px; 
  flex: 1; 
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1; 
}


.main-header .title {
  flex: 2; 
  padding: 0 10px;
  white-space: nowrap;
}


.btn-nav {
  background-color: transparent;
  color: #09261C; /* Vert foncé comme le titre */
  border: 2px solid #09261C;
  padding: 8px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-nav:hover {
  background-color: #09261C;
  color: #fff;
}
