/* Portfolio grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    padding: 40px 0;
}

/* Portfolio item */
.portfolio-item {
    text-align: center;
}

.portfolio-item img {
    width: 80%;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.portfolio-item img:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.portfolio-item img.portret {
    width: 40%;
}

/* Teksten binnen portfolio items */
.portfolio-item h2 {
    margin-top: 15px;
    text-align: right;
    padding-right: 10%;
    color: red;
}

.portfolio-item p {
    text-align: right;
    padding-right: 10%;
    color: blue;
}

/* Lightbox overlay */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 9999;
}

.lightbox.active {
    visibility: visible;
    opacity: 1;
}

/* Wrapper zodat caption onder de afbeelding staat */
.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

/* Afbeelding */
.lightbox-content img {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-content img.visible {
    opacity: 1;
}

/* Caption ONDER de afbeelding + kader */
.lightbox-caption {
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    color: white;
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
    max-width: 80%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-caption.visible {
    opacity: 1;
}

/* Spinner */
.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    border: 6px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10000;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navigatie pijlen */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    color: white;
    cursor: pointer;
    user-select: none;
    padding: 20px;
    transition: opacity 0.2s;
    z-index: 10001;
}

.lightbox-arrow:hover {
    opacity: 0.7;
}

.lightbox-arrow.left {
    left: 20px;
}

.lightbox-arrow.right {
    right: 20px;
}

/* Sluiten met X */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    user-select: none;
    z-index: 10001;
}
