.scrapbook {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 60px 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.polaroid {
    background: white;
    padding: 15px 15px 50px 15px;   /* thicker bottom border - the classic Polaroid look */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    width: 250px;
    transition: transform 0.3s ease;
}

.polaroid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.polaroid figcaption {
    text-align: center;
    margin-top: 10px;
    font-family: "Lucida Console", "Courier New", monospace;   /* handwritten-feel font, optional */
    font-size: 14px;
    color: #333;
}

/* Individual rotation per photo - manually set, same approach as your offset gallery */
.polaroid:nth-child(1) {
    transform: rotate(-6deg);
}

.polaroid:nth-child(2) {
    transform: rotate(4deg) translateY(20px);
}

.polaroid:nth-child(3) {
    transform: rotate(-3deg) translateY(-15px);
}

.polaroid:nth-child(4) {
    transform: rotate(7deg);
}

.polaroid:nth-child(5) {
    transform: rotate(-8deg) translateY(10px);
}

.polaroid:nth-child(6) {
    transform: rotate(2deg) translateY(12px);
}

.polaroid:nth-child(8) {
    transform: rotate(-10deg) translateY(5px);
}


/* Optional: straighten and lift on hover, like picking up the photo */
.polaroid:hover {
    transform: rotate(0deg) scale(1.05);
    z-index: 10;
}


/* ============================
   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: 600px) {
    .scrapbook {
        padding: 30px 20px;
        gap: 30px;
    }

    .polaroid {
        width: 200px;
    }

    .polaroid img {
        height: 180px;
    }

    .polaroid:nth-child(1) { transform: rotate(-3deg); }
    .polaroid:nth-child(2) { transform: rotate(2deg) translateY(10px); }
    .polaroid:nth-child(3) { transform: rotate(-2deg) translateY(-8px); }
    .polaroid:nth-child(4) { transform: rotate(3deg); }
    .polaroid:nth-child(5) { transform: rotate(-4deg) translateY(5px); }
}