.cwp-gallery {
    max-width: 1500px;
    margin: auto;
    padding: 40px 20px;
}

/* Navigation header */
.section--navigation .container--filters {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.cwp-gallery__header {
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cwp-gallery__header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cwp-gallery__advanced-btn {
    color: var(--color-text);
    text-decoration: underline;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
}

.cwp-gallery__advanced {
    width: 100%;
    padding: 0 16px;
    margin: 0 auto;
}

.cwp-gallery__filters {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cwp-gallery__filter {
    width: 100%;
}

.cwp-gallery__filter-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.cwp-gallery__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tags */
.cwp-tag {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
}

.cwp-tag:hover {
    border-color: #000;
}

.cwp-tag.is-active {
    border-color: #000;
    background: #000;
    color: #fff;
}

/* Actions */
.cwp-gallery__actions {
    width: 100%;
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.cwp-gallery__reset {
    border: none;
    background: transparent;
    text-decoration: underline;
    cursor: pointer;
    opacity: .8;
}

/* Search */
.cwp-gallery__search {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    min-width: 400px;
}

/* Grid */
.cwp-gallery__grid {
    display: grid;
    gap: 10px;
    grid-auto-flow: dense;
    grid-template-columns: repeat(3, 1fr);
}

/* Item */
.cwp-gallery__item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 36 / 24;
    cursor: zoom-in;
}
.cwp-gallery__item .cwp-gallery__media{
      width: 100%;
    height: 100%;
}
/* Image */
.cwp-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Overlay Hover ✨ */
.cwp-gallery__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px;

    background: linear-gradient(
        to top,
        rgba(0,0,0,0.55) 0%,
        rgba(0,0,0,0.15) 35%,
        rgba(0,0,0,0) 60%
    );

    opacity: 0;
    transition: opacity .25s ease;
}

.cwp-gallery__item:hover .cwp-gallery__overlay {
    opacity: 1;
}

/* Title */
.cwp-gallery__title {
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
    padding: 4px 8px;
    transform: translateY(6px);
    transition: transform .25s ease;
}

.cwp-gallery__item:hover .cwp-gallery__title {
    transform: translateY(0);
}

/* Link Button */
.cwp-gallery__link {
    align-self: flex-end;

    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;

    background: rgba(255,255,255,0.9);
    color: #000;
    text-decoration: none;
    font-weight: 500;

    opacity: 0;
    transform: translateY(4px);

    transition: all .25s ease;
}

.cwp-gallery__item:hover .cwp-gallery__link {
    opacity: 1;
    transform: translateY(0);
}

.cwp-gallery__link:hover {
    background: var(--color-bold);
    color:var(--color-white);
    text-decoration: none;
}

/* Tile sizes */
.cwp-tile--sm { grid-column: span 1; grid-row: span 1; }
.cwp-tile--lg { grid-column: span 2; grid-row: span 2; }

/* Sentinel */
.cwp-gallery__sentinel {
    height: 1px;
}

/* Load more */
.cwp-gallery__more {
    margin: 40px auto 0;
    display: block;
    padding: 12px 22px;
    border-radius: 999px;
    border: none;
    background: black;
    color: white;
    cursor: pointer;
    display: none;
}

/* Skeleton */
.cwp-skeleton {
    position: relative;
    overflow: hidden;
    background: #e9e9e9;
}

.cwp-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,.55) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: cwpShimmer 1.1s infinite;
}

@keyframes cwpShimmer {
    to { transform: translateX(100%); }
}


.cwp-gallery__empty{
  max-width: 680px;
  margin: 28px auto 0;
  padding: 18px 18px;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}
.cwp-gallery__empty-title{
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}
.cwp-gallery__empty-text{
  font-size: 14px;
  opacity: .75;
  margin-bottom: 14px;
}
.cwp-gallery__empty-reset{
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: #000;
  color: #fff;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
    .cwp-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cwp-gallery__header {
        flex-direction: column;
        gap: 16px;
    }

    .cwp-gallery__header-left {
        width: 100%;
    }

    .cwp-gallery__search {
        width: 100%;
        min-width: auto;
    }

    .cwp-gallery__header-right {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        padding: 0 8px;
    }
}

@media (max-width: 520px) {
    .cwp-gallery__grid {
        grid-template-columns: 1fr;
    }

    .cwp-tile--lg {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Mobile / touch → pas de hover */
@media (hover: none) {
    .cwp-gallery__overlay {
        opacity: 1;
    }

    .cwp-gallery__link {
        opacity: 1;
        transform: none;
    }

    .cwp-gallery__item img {
        transform: none !important;
    }
}