/**
 * Agence Web Art - Portfolio CSS
 * Version 2.3.0
 */

/* ============================================
   RESET — Isolation du plugin
   ============================================ */
.awa-portfolio-wrapper,
.awa-portfolio-wrapper *,
.awa-portfolio-wrapper *::before,
.awa-portfolio-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   WRAPPER — Pleine largeur viewport
   ============================================ */

body:has(.awa-portfolio-wrapper) {
    overflow-x: hidden;
}

.awa-portfolio-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

/* Override conteneurs Elementor */
.elementor-widget:has(.awa-portfolio-wrapper),
.elementor-widget-wrap:has(.awa-portfolio-wrapper),
.elementor-element:has(.awa-portfolio-wrapper),
.e-con:has(.awa-portfolio-wrapper),
.e-con-inner:has(.awa-portfolio-wrapper) {
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ============================================
   FILTRES
   ============================================ */
.awa-portfolio-filters {
    padding: 30px 5%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
}

.awa-portfolio-filters-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.awa-filter-btn {
    padding: 12px 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    display: inline-block;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

.awa-filter-btn:hover {
    transform: translateY(-1px);
}

/* ============================================
   GALERIE
   ============================================ */
.awa-portfolio-gallery {
    padding: 60px 3%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.awa-portfolio-grid {
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* ============================================
   CARTE
   ============================================ */
.awa-portfolio-card {
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.awa-portfolio-card.awa-hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

/* ============================================
   IMAGE — <img> avec object-fit
   ============================================ */
.awa-portfolio-image {
    width: 100%;
    height: 350px;
    background-color: #e8e8e8;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Curseur loupe sur les images cliquables */
.awa-lightbox-trigger {
    cursor: zoom-in;
}

.awa-portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

/* Zoom au survol */
.awa-portfolio-card:hover .awa-portfolio-img {
    transform: scale(1.05);
}

.awa-portfolio-placeholder {
    font-size: 1.2rem;
    color: #aaa;
    font-weight: 500;
}

/* ============================================
   TAG CATÉGORIE
   ============================================ */
.awa-portfolio-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2;
    letter-spacing: 0.3px;
}

/* ============================================
   INFO (sous l'image)
   ============================================ */
.awa-portfolio-info {
    padding: 30px;
}

.awa-portfolio-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.awa-portfolio-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    margin: 0 0 15px 0;
    font-weight: 400;
}

.awa-portfolio-description {
    line-height: 1.7;
    font-size: 0.95rem;
    font-weight: 400;
    margin: 0;
}

/* ============================================
   MESSAGE VIDE
   ============================================ */
.awa-portfolio-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    border: 2px dashed #ddd;
    border-radius: 12px;
}

.awa-portfolio-empty p {
    font-size: 1.1rem;
    color: #999;
    margin: 0;
}

/* ============================================
   PAGINATION
   ============================================ */
.awa-portfolio-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 20px 0;
    flex-wrap: wrap;
    width: 100%;
}

.awa-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fff;
    font-family: inherit;
}

.awa-page-btn:hover,
.awa-page-btn.active {
    background: #F07400;
    color: #fff;
    border-color: #F07400;
    text-decoration: none;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.awa-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.awa-lightbox.is-open {
    display: flex;
}

.awa-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.93);
    cursor: pointer;
}

.awa-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.awa-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    transition: opacity 0.25s ease;
}

.awa-lightbox-img.is-loading {
    opacity: 0;
}

.awa-lightbox-caption {
    text-align: center;
    padding: 14px 20px 0;
    max-width: 680px;
    width: 100%;
}

.awa-lightbox-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: #fff;
    font-family: inherit;
}

.awa-lightbox-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    font-family: inherit;
}

.awa-lightbox-close,
.awa-lightbox-prev,
.awa-lightbox-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 2;
    line-height: 1;
    font-family: inherit;
}

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

.awa-lightbox-close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 1.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.awa-lightbox-prev,
.awa-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.awa-lightbox-prev { left: 16px; }
.awa-lightbox-next { right: 16px; }

/* Spinner de chargement */
.awa-lightbox-loader {
    display: none;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: awa-spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -20px 0 0 -20px;
    z-index: 3;
}

.awa-lightbox-loader.is-active {
    display: block;
}

@keyframes awa-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .awa-portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .awa-portfolio-image {
        height: 280px;
    }

    .awa-portfolio-filters {
        padding: 20px 3%;
    }

    .awa-filter-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .awa-lightbox-prev { left: 8px; }
    .awa-lightbox-next { right: 8px; }
}

@media (max-width: 576px) {
    .awa-portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .awa-portfolio-image {
        height: 250px;
    }

    .awa-portfolio-gallery {
        padding: 40px 4%;
    }

    .awa-portfolio-info {
        padding: 20px;
    }

    .awa-portfolio-title {
        font-size: 1.2rem;
    }

    .awa-lightbox-prev,
    .awa-lightbox-next {
        width: 38px;
        height: 38px;
        font-size: 1.8rem;
    }
}
