/* ---------------------------------------------------------
   GLOBAL RESET + PREVENT HORIZONTAL SCROLL
--------------------------------------------------------- */
html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: Inter, system-ui, sans-serif;
    background: #ffffff;
    color: #111;
}


/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
.header {
    text-align: center;
    padding: 40px 20px 20px;
    border-bottom: solid;
}

.header h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 600;
}

.header p {
    margin-top: 6px;
    font-size: 1rem;
    opacity: 0.65;
}


/* ---------------------------------------------------------
   SEARCH BAR
--------------------------------------------------------- */
.search-bar {
    margin-top: 18px;
    width: 92%;
    max-width: 420px;
    padding: 12px 16px;

    border-radius: 12px;
    border: 1px solid #ddd;
    background: #fafafa;

    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-bar:focus {
    border-color: #000;
    background: #fff;
    outline: none;
}


/* ---------------------------------------------------------
   MASONRY GRID (GAPLESS, Pinterest Style)
--------------------------------------------------------- */
.masonry {
    padding: 0;
    margin: 0;
    column-gap: 0;
}

.masonry-item {
    width: 100%;
    margin: 0;
    break-inside: avoid;
    position: relative;
    overflow: hidden;
}


/* ---------------------------------------------------------
   BLUR-UP IMAGE LOADING
--------------------------------------------------------- */
.masonry-item img {
    width: 100%;
    display: block;
    cursor: zoom-in;

    /* Blur tiny placeholder */
    filter: blur(15px);
    transform: scale(1.05);
    opacity: 0;

    transition:
        opacity 0.5s ease,
        filter 0.6s ease,
        transform 0.6s ease;
}

.masonry-item img.loaded {
    filter: blur(0px);
    transform: scale(1);
    opacity: 1;
}


/* ---------------------------------------------------------
   ACTION BUTTONS (Download + Share)
--------------------------------------------------------- */
.actions {
    position: absolute;
    bottom: 10px;
    right: 10px;

    display: flex;
    gap: 6px;

    opacity: 0;
    transition: 0.25s ease;
}

.masonry-item:hover .actions {
    opacity: 1;
}

.action-btn {
    padding: 6px 10px;

    font-size: 12px;
    border-radius: 6px;
    border: none;

    background: rgba(0, 0, 0, 0.65);
    color: #fff;

    cursor: pointer;
    user-select: none;

    transition: background 0.2s ease;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}


/* ---------------------------------------------------------
   RESPONSIVE MASONRY COLUMNS
--------------------------------------------------------- */
@media (min-width: 480px) {
    .masonry {
        column-count: 2;
    }
}

@media (min-width: 780px) {
    .masonry {
        column-count: 3;
    }
}

@media (min-width: 1200px) {
    .masonry {
        column-count: 4;
    }
}


/* ---------------------------------------------------------
   LIGHTBOX VIEWER
--------------------------------------------------------- */
.lightbox {
    display: none;
    position: fixed;

    inset: 0;
    background: rgba(0, 0, 0, 0.88);

    justify-content: center;
    align-items: center;

    z-index: 9999;
}

.lightbox-img {
    max-width: 94%;
    max-height: 94%;
    border-radius: 6px;
}

.close {
    position: absolute;
    top: 25px;
    right: 35px;

    font-size: 38px;
    color: #fff;
    cursor: pointer;
    user-select: none;
}


/* ---------------------------------------------------------
   FOOTER
--------------------------------------------------------- */
.footer {
    text-align: center;
    border-top: solid;
    padding: 28px;
    font-size: 0.9rem;
    color: #888;
}