.offset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 24px;
    row-gap: 80px;              /* extra vertical room to accommodate the offsets without overlap */
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px;
}

.offset-grid-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.offset-grid-item figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

/* Row 1 (items 1-3): high, low, high */
.offset-grid-item:nth-child(6n+1) { transform: translateY(-30px); }
.offset-grid-item:nth-child(6n+2) { transform: translateY(30px); }
.offset-grid-item:nth-child(6n+3) { transform: translateY(-30px); }

/* Row 2 (items 4-6): low, high, low - reversed */
.offset-grid-item:nth-child(6n+4) { transform: translateY(-30px); }
.offset-grid-item:nth-child(6n+5) { transform: translateY(30px); }
.offset-grid-item:nth-child(6n+6) { transform: translateY(-30px); }

/* ============================
   LIGHTBOX (dialog)
   ============================ */

dialog {
    padding: 0;
    border: none;
    background: transparent;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    justify-content: center;
    align-items: center;
}

dialog[open] {
    display: flex;
}

dialog img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.9);
}

/* ============================
   RESPONSIVENESS
   ============================ */
@media (max-width: 700px) {
    .offset-grid {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 60px;
    }
}

@media (max-width: 500px) {
    .offset-grid {
        grid-template-columns: 1fr;
        row-gap: 20px;
    }

    .offset-grid-item {
        transform: none !important;   /* remove offsets entirely on single-column mobile */
    }
}