* {
  box-sizing: border-box;
}

.gallery {
  max-width: 1440px;
  margin: 0 auto;
  background: #fff;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  float: left;
  min-width: 100%;
}

.gallery-header {
  width: 100%;
  margin-bottom: 20px;
}

.gallery h3 {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: #2c3e50;
  font-weight: 600;
}

.gallery-header .gallerycomment {
  color: #7f8c8d;
  margin-bottom: 10px;
  font-size: 15px;
}

.gallery-header > p {
  color: #95a5a6;
  font-size: 14px;
  margin: 0;
}

.pagenavigation {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  padding: 15px 0;
  border-top: 1px solid #ecf0f1;
  border-bottom: 1px solid #ecf0f1;
  flex-wrap: wrap;
}

.pagenavigation a {
  color: #3498db;
  text-decoration: none;
  padding: 8px 15px;
  background: #ecf0f1;
  font-weight: 500;
}

.prevpage, .nextpage {
  font-weight: 600;
}

.pagelinks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagelinks a, .pagelinks span {
  padding: 6px 12px;
  min-width: 36px;
  text-align: center;
}

.pagelinks span {
  background: #3498db;
  color: #fff;
  font-weight: 600;
}

/* Isotope Grid */
.gallery-grid {
  margin: 20px 0 0 0;
  width: 100%;
  position: relative;
}

.gallery-grid::after {
  content: '';
  display: block;
  clear: both;
}

/* Grid sizer pour Isotope */
.grid-sizer {
  width: calc(33.333% - 14px);
}

.gutter-sizer {
  width: 20px;
}

.img {
  width: calc(33.333% - 14px);
  margin-bottom: 20px;
  /* NE PAS utiliser float - Isotope gère le positionnement */
}

.img a {
  display: block;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.img img {
  width: 100%;
  height: auto;
  display: block;
}

.img.directory a::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  padding: 8px 12px;
  font-size: 20px;
}

.img > span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: #555;
  text-align: center;
  padding: 0 5px;
}

.galleryclear {
  clear: both;
  height: 0;
  visibility: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .grid-sizer,
  .img {
    width: calc(50% - 10px);
  }
  
  .gallery {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .grid-sizer,
  .img {
    width: 100%;
  }
  
  .gallery {
    padding: 15px;
  }
}

/* Lightbox customization */
.lb-data .lb-caption {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.lb-data .lb-caption em {
  display: block;
  font-size: 13px;
  color: #bbb;
  margin-top: 5px;
}