/*
    Coded by 141z
    © 141z 2026 — Tous droits réservés
    contact : contact@141z.fr
*/
.portfolio-header {
    padding: 6rem 2rem 2rem;
    text-align: center;
}
.portfolio-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.subtitle { color: var(--c-text-muted); }

.filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 2rem 2rem;
    flex-wrap: wrap;
}
.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition);
}
.filter-btn:hover {
    background: transparent;
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.filter-btn.active {
    background: var(--c-primary);
    color: var(--c-bg-dark);
    border-color: var(--c-primary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 0 2rem 6rem;
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-item {
    background: var(--c-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(0, 250, 121, 0.06);
    transition: transform var(--transition), box-shadow var(--transition);
}
.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 250, 121, 0.08);
}

.item-media { height: 300px; overflow: hidden; }
.item-media model-viewer { width: 100%; height: 100%; }
.item-media img { width: 100%; height: 100%; object-fit: cover; }

.open-detail-btn {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.3s ease;
}
.open-detail-btn:hover {
    background: rgba(0, 250, 121, 0.15);
    border-color: var(--c-primary);
    color: var(--c-primary);
}

.item-media { position: relative; }
.item-info { padding: 1.2rem; }
.item-info h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.item-info p { color: var(--c-text-muted); font-size: 0.9rem; margin-bottom: 0.8rem; }
.item-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.image-gallery {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.gallery-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease;
}
.gallery-track img {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}
.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 15, 0.6);
    color: var(--c-text);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 2;
}
.image-gallery:hover .gallery-prev,
.image-gallery:hover .gallery-next {
    opacity: 1;
}
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(10, 10, 15, 0.85);
}
.gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all var(--transition);
}
.gallery-dot.active {
    background: var(--c-primary);
    transform: scale(1.2);
}

.tag-clickable {
    cursor: pointer;
    transition: all var(--transition);
}
.tag-clickable:hover {
    color: var(--c-primary);
    border-color: var(--c-primary);
}

.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}
.detail-overlay.active {
    opacity: 1;
    pointer-events: all;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
}
.detail-card {
    position: relative;
    width: 720px;
    max-width: 92vw;
    max-height: 90vh;
    background: var(--c-bg-card);
    border: 1px solid rgba(0, 250, 121, 0.1);
    border-radius: 16px;
    overflow: hidden;
    overflow-y: auto;
    transform: scale(0.9) translateY(40px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-overlay.active .detail-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.detail-close:hover {
    background: rgba(0, 250, 121, 0.15);
    color: var(--c-primary);
    transform: rotate(90deg);
}
.detail-media {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    background: #0a0a0f;
}
.detail-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease;
}
.detail-media img.detail-slide-out-left {
    transform: translateX(-60px);
    opacity: 0;
}
.detail-media img.detail-slide-out-right {
    transform: translateX(60px);
    opacity: 0;
}
.detail-media img.detail-slide-in-left {
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-media img.detail-slide-in-right {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInLeft {
    from { transform: translateX(-60px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(60px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.detail-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}
.detail-arrow:hover {
    background: rgba(0, 250, 121, 0.12);
    border-color: var(--c-primary);
    color: var(--c-primary);
}
.detail-prev { left: 1rem; }
.detail-next { right: 1rem; }
.detail-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    z-index: 2;
}
.detail-info {
    padding: 1.8rem 2rem;
}
.detail-info h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.6rem;
}
.detail-info p {
    color: var(--c-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}
.detail-info p:empty { display: none; }
.detail-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .detail-card { max-width: 96vw; border-radius: 12px; }
    .detail-media { height: 300px; }
    .detail-arrow { width: 36px; height: 36px; font-size: 1.3rem; }
    .detail-prev { left: 0.5rem; }
    .detail-next { right: 0.5rem; }
    .detail-info { padding: 1.2rem 1.5rem; }
    .detail-info h2 { font-size: 1.2rem; }
}

.empty-state {
    text-align: center;
    color: var(--c-text-muted);
    padding: 2rem;
    grid-column: 1 / -1;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 2rem 4rem;
}
.pagination-btn,
.pagination-num {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition);
}
.pagination-btn:hover,
.pagination-num:hover {
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.pagination-num.active {
    background: var(--c-primary);
    color: var(--c-bg-dark);
    border-color: var(--c-primary);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .portfolio-header { padding: 5rem 1rem 1.5rem; }
    .portfolio-header h1 { font-size: 1.8rem; }
    .filter-bar { padding: 0 1rem 1.5rem; gap: 0.4rem; }
    .filter-btn { font-size: 0.75rem; padding: 0.35rem 0.8rem; }
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); padding: 0 1rem; gap: 1rem; }
}
@media (max-width: 480px) {
    .portfolio-grid { grid-template-columns: 1fr; }
    .item-media { height: 220px; }
    .item-info { padding: 1rem; }
    .item-info h3 { font-size: 1rem; }
    .item-info p { font-size: 0.85rem; }
}
