/* ============================================================
   ARTWORK GALLERY
   Unlike the general photo gallery, pieces are NOT cropped to
   squares — each keeps its real aspect ratio, standardized to a
   fixed height instead. Achieved with plain CSS (fixed height,
   width: auto on the <img>) rather than any JS layout calculation.
   ============================================================ */

.ag-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 24px 100px;
}

.ag-wrap h1 {
    text-align: center;
    margin-bottom: 10px;
}

.ag-intro {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 40px;
    font-size: 17px;
    line-height: 1.6;
    opacity: 0.85;
}

.ag-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.ag-piece {
    display: block;
    background: #FDFCF9;
    padding: 14px 14px 22px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ag-piece:hover {
    transform: rotate(0deg) scale(1.04) translateY(-6px) !important;
    box-shadow: 0 16px 28px rgba(0,0,0,0.24);
    z-index: 2;
    position: relative;
}

.ag-piece img {
    display: block;
    height: 280px;
    width: auto;
}

@media (max-width: 600px) {
    .ag-wrap { padding: 40px 16px 70px; }
    .ag-piece { padding: 10px 10px 16px; }
    .ag-piece img { height: 190px; }
    .ag-grid { gap: 22px; }
}

/* ---- Lightbox modal (same pattern as the general gallery) ---- */

.ag-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ag-modal-overlay.visible {
    display: flex;
}

.ag-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
    max-height: 90vh;
}

.ag-modal-img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.ag-modal-nav {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.ag-modal-arrow {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.ag-modal-arrow:hover {
    background: rgba(255,255,255,0.2);
}

.ag-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}

.ag-modal-close:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .ag-modal-close { top: 14px; right: 18px; font-size: 34px; }
    .ag-modal-arrow { width: 42px; height: 42px; }
}
