/* 1. The Grid Container */
/* Use responsive column width instead of fixed column-count for better scaling on wide screens */
.pinterest-grid {
    column-width: 200px; /* ideal item width; browser decides column count */
    column-gap: 15px;
    padding: 15px;
    /* max-width: 1400px;  */
    box-sizing: border-box;
    margin: 0 auto;
}


/* grid items remain inline-block so they flow into columns */
.grid-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease-in-out, transform 0.15s ease;
    cursor: pointer;    
    position: relative;
    vertical-align: top;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.45s forwards;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    page-break-inside: avoid;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    height: auto;   
}


.grid-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.grid-item img,
.grid-item video,
.grid-item iframe {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* 3. Video Icon Overlay */
.grid-item[data-type="video"]::before,
.grid-item[data-type="iframe"]::before {
    content: '▶'; /* Simple play icon */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    pointer-events: none; /* Allows clicking 'through' the icon */
    z-index: 10;
    opacity: 0.8;
}

/* modal visibility toggled by class .open */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
}
.modal-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 1100px;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}


#modal-content-container {
    position: relative;
    max-width: 90vw;
    max-height: 100vh;
    margin: auto;
}

/* Add navigation buttons styling */
.modal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    width: 100%;
}

.modal-nav button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
}

.modal-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-content-container img,
.modal-content-container video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}
/* reveal animation */
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.grid-item img,
.grid-item video,
.grid-item iframe {
    width: 100%;
    height: auto;
    display: block;
}

/* 5. Responsive Design */
@media (max-width: 1200px) {
    .pinterest-grid {
        column-width: 200px;
    }
}

@media (max-width: 992px) {
    .pinterest-grid {
        column-width: 180px;
    }
}

@media (max-width: 768px) {
    .pinterest-grid {
        column-width: 180px;
    }
}

@media (max-width: 576px) {
    .pinterest-grid {
        column-width: 100px;
    }
}