/* Portfolio — elenco e scheda lavoro */

.portfolio-page {
    padding: 3rem 0 4rem;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: .45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--primary-light, #40916c);
    color: var(--primary-dark, #1b4332);
    text-decoration: none;
    font-size: .9rem;
    transition: all .2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(45deg, var(--primary-dark, #1b4332), var(--primary-light, #40916c));
    color: #fff;
    border-color: transparent;
}

.portfolio-item--link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.portfolio-grid--page {
    margin-top: 0;
}

.portfolio-year {
    display: inline-block;
    margin-left: .5rem;
    font-size: .8rem;
    color: var(--gray-medium, #6c757d);
}

.portfolio-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-medium, #6c757d);
}

.portfolio-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .4;
}

/* Scheda */
.portfolio-scheda {
    padding: 2rem 0 4rem;
}

.portfolio-breadcrumb {
    font-size: .9rem;
    margin-bottom: 1.5rem;
    color: var(--gray-medium, #6c757d);
}

.portfolio-breadcrumb a {
    color: var(--primary-dark, #1b4332);
}

.scheda-header {
    margin-bottom: 2rem;
}

.scheda-header h1 {
    margin: .5rem 0;
    color: var(--primary-dark, #1b4332);
}

.scheda-meta {
    color: var(--gray-medium, #6c757d);
    margin: 0;
}

.scheda-anno {
    margin-left: 1rem;
    font-weight: 600;
}

.scheda-description {
    margin: 2rem 0;
    line-height: 1.7;
    max-width: 800px;
}

.scheda-footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.portfolio-placeholder--large {
    height: 320px;
    border-radius: 12px;
}

/* Carousel */
.portfolio-carousel {
    position: relative;
    max-width: 900px;
    margin: 0 auto 2rem;
}

.carousel-track-wrap {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,.12));
    background: #111;
}

.carousel-track {
    position: relative;
    min-height: 280px;
}

.carousel-slide {
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-image-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    position: relative;
}

.carousel-image-btn img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #111;
    display: block;
}

.zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: .4rem .6rem;
    border-radius: 6px;
    font-size: .85rem;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: var(--primary-dark, #1b4332);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.carousel-prev { left: -12px; }
.carousel-next { right: -12px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-top: 1rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    padding: 0;
}

.carousel-dot.active {
    background: var(--primary-dark, #1b4332);
}

/* Lightbox */
.portfolio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-lightbox[hidden] {
    display: none !important;
}

.lightbox-image {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: .9rem;
}

@media (max-width: 768px) {
    .carousel-prev { left: 4px; }
    .carousel-next { right: 4px; }
    .carousel-btn { width: 36px; height: 36px; }
}
