/* Portfolio Solweigh - Styles CSS - Version Masonry */

/* Conteneur principal */
.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Filtres */
.portfolio-filters {
    text-align: center;
    margin-bottom: 30px;
}

.filter-btn {
    display: inline-block;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 10px 20px;
    margin: 0 5px 10px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
}

.filter-btn:hover,
.filter-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Grille du portfolio - LAYOUT MASONRY */
.portfolio-grid {
    columns: 3;
    column-gap: 12px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .portfolio-grid {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        columns: 1;
    }
}

/* Éléments du portfolio - NOUVELLE STRUCTURE */
.portfolio-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    break-inside: avoid;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: inline-block;
    width: 100%;
}

.portfolio-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.portfolio-item.hidden {
    display: none;
}

/* Image - HAUTEUR VARIABLE */
.portfolio-item-image {
    position: relative;
    display: block;
}

.portfolio-item-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-item-image img {
    transform: scale(1.02);
}

.portfolio-image-link {
    display: block;
    cursor: pointer;
}

/* Contenu sous l'image */
.portfolio-item-content {
    padding: 15px;
}

.portfolio-item-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #333;
    line-height: 1.3;
}

.portfolio-item-excerpt {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin: 0 0 15px;
}

/* Liens du portfolio */
.portfolio-item-link {
    margin-top: 15px;
}

.portfolio-item-link .portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    color: #333;
    padding: 8px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e0e0e0;
}

.portfolio-link:hover {
    background: #333;
    color: #fff;
    border-color: #333;
    text-decoration: none;
}

.portfolio-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Lightbox */
.portfolio-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.portfolio-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    max-height: 100%;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10000;
}

.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
    margin-left: -60px;
}

.lightbox-next {
    margin-right: -60px;
}

.lightbox-body {
    position: relative;
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Animation d'apparition */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.portfolio-item {
    animation: fadeIn 0.6s ease;
}

/* États de chargement */
.portfolio-item.loading {
    opacity: 0.5;
}

.portfolio-grid.loading::after {
    content: 'Chargement...';
    display: block;
    text-align: center;
    padding: 40px;
    color: #666;
    column-span: all;
    margin: 20px 0;
}

/* Responsive - Ajustements pour mobiles */
@media (max-width: 768px) {
    .portfolio-container {
        padding: 15px;
    }
    
    .portfolio-grid {
        column-gap: 8px;
    }
    
    .portfolio-item {
        margin-bottom: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
        margin: 0 3px 8px;
    }
    
    .portfolio-item-content {
        padding: 12px;
    }
    
    .portfolio-item-title {
        font-size: 16px;
    }
    
    .portfolio-item-excerpt {
        font-size: 13px;
    }
    
    .lightbox-prev {
        margin-left: -25px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-next {
        margin-right: -25px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close {
        top: -30px;
        right: -10px;
    }
}

@media (max-width: 480px) {
    .portfolio-filters {
        margin-bottom: 20px;
    }
    
    .filter-btn {
        display: block;
        width: 100%;
        max-width: 200px;
        margin: 0 auto 8px;
    }
    
    .portfolio-item-content {
        padding: 10px;
    }
    
    .portfolio-item-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
}

/* Support pour CSS Columns sur navigateurs plus anciens */
@supports not (columns: 3) {
    .portfolio-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .portfolio-item {
        flex: 0 0 calc(33.333% - 8px);
    }
    
    @media (max-width: 1024px) {
        .portfolio-item {
            flex: 0 0 calc(50% - 6px);
        }
    }
    
    @media (max-width: 768px) {
        .portfolio-item {
            flex: 0 0 100%;
        }
    }
}
