.afwd-fag-wrap {
    margin: 1.5rem 0;
}

.afwd-fag-title {
    margin: 0 0 1rem;
}

.afwd-fag-grid {
    display: grid;
    gap: 12px;
}

.afwd-fag-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.afwd-fag-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.afwd-fag-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.afwd-fag-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 900px) {

    .afwd-fag-cols-4,
    .afwd-fag-cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {

    .afwd-fag-cols-3,
    .afwd-fag-cols-4,
    .afwd-fag-cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.afwd-fag-item {
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.afwd-fag-item img {
    width: 100%;
    height: auto;
    display: block;
    transform: scale(1);
    transition: transform .2s ease;
}

.afwd-fag-item:hover img {
    transform: scale(1.04);
}

.afwd-fag-error {
    padding: 12px 14px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 10px;
}

/* Lightbox */
.afwd-fag-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .78);
    z-index: 99999;
}

.afwd-fag-lightbox.is-open {
    display: flex;
}

.afwd-fag-figure {
    max-width: min(1100px, 96vw);
    max-height: 88vh;
    margin: 0;
    position: relative;
}

.afwd-fag-full {
    max-width: 100%;
    max-height: 88vh;
    display: block;
    border-radius: 12px;
}

.afwd-fag-caption {
    margin-top: 10px;
    color: #fff;
    font-size: 14px;
    opacity: .9;
}

.afwd-fag-close {
    position: fixed;
    top: 14px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    font-size: 30px;
    line-height: 44px;
    cursor: pointer;
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.afwd-fag-close:hover {
    background: rgba(255, 255, 255, .2);
}