.afg-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    margin: 0 auto;
}

.afg-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: center;
    font: inherit;
    color: inherit;
}

.afg-image-wrap {
    position: relative;
    display: block;
    overflow: visible;
    aspect-ratio: 945 / 1417;
    border-radius: 8px;
    background: #eee;
}

.afg-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform .2s ease, opacity .2s ease;
}

.afg-item:hover img,
.afg-item:focus-visible img {
    transform: none;
}

.afg-item.is-playing .afg-image-wrap {
    outline: 4px solid currentColor;
    outline-offset: 2px;
}

.afg-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.70);
    color: #fff;
    font-size: 22px;
    opacity: 0;
    transition: opacity .2s ease;
}

.afg-item:hover .afg-play,
.afg-item:focus-visible .afg-play,
.afg-item.is-playing .afg-play {
    opacity: 1;
}

.afg-item.is-playing .afg-play {
    font-size: 0;
}

.afg-item.is-playing .afg-play::after {
    content: "❚❚";
    font-size: 20px;
}

.afg-title {
    display: block;
    margin-top: 7px;
    font-size: .95rem;
    line-height: 1.3;
}

.afg-player {
    margin-top: 24px;
    padding: 16px;
    border-radius: 8px;
    background: #f5f5f5;
}

.afg-audio {
    width: 100%;
    display: none;
}

.afg-player.has-audio .afg-audio {
    display: block;
}

.afg-status {
    display: block;
    margin-top: 8px;
    font-size: .9rem;
}

.afg-player.has-audio .afg-status {
    display: none;
}

.afg-empty {
    padding: 20px;
}

@media (max-width: 800px) {
    .afg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 420px) {
    .afg-grid {
        gap: 8px;
    }
}


/* Audio Fotogalerij 1.3.0 */
.afg-gallery { display: flex; flex-direction: column; }
.afg-player-top { order: 1; margin-top: 1em; margin-bottom: 1.5em; }
.afg-grid { order: 2; display: block; }
.afg-row-box {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 16px;
    margin-bottom: 18px;
    border-radius: 12px;
}
.afg-row-1 { background: #eaf4ff; }
.afg-row-2 { background: #eef9ed; }
.afg-row-3 { background: #fff4df; }
.afg-row-4 { background: #f5ebff; }
.afg-row-5 { background: #ffecef; }
.afg-row-6 { background: #e8f7f5; }
.afg-row-7 { background: #fffbe0; }
.afg-row-8 { background: #eeeaff; }
.afg-row-9 { background: #f8eee5; }
.afg-image-wrap { aspect-ratio: 945 / 1417; }
.afg-item img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 800px) {
    .afg-row-box { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 420px) {
    .afg-row-box { gap: 8px; padding: 8px; }
}

/* Audio Fotogalerij 1.4.0 - categorietitel per rij */
.afg-row-box {
    display: block;
}
.afg-category-title {
    margin: 0 0 14px 0;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 700;
}
.afg-row-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 800px) {
    .afg-row-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}
@media (max-width: 420px) {
    .afg-row-items {
        gap: 8px;
    }
    .afg-category-title {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }
}

/* Audio Fotogalerij 1.4.2 - vaste instructietekst bij player */
.afg-player.has-audio .afg-status { display: block; }
