/* LING SHUI GALLERY - PUBLIC STYLES */

/* YEAR FILTER BUTTONS */
.lsg-year-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.lsg-year-btn {
    background: transparent;
    border: 2px solid #cc0000;
    color: #cc0000;
    padding: 5px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s, color 0.2s;
}

.lsg-year-btn:hover,
.lsg-year-btn.lsg-year-active {
    background: #cc0000;
    color: #ffffff;
}

/* MASONRY GRID */
.lsg-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 160px;
    gap: 8px;
    width: 100%;
}

/* SPAN CLASSES FOR VISUAL VARIETY */
/* Default: 1 col x 1 row */
.lsg-item { grid-column: span 1; grid-row: span 1; }

/* Wider items */
.lsg-span-2 { grid-column: span 2; grid-row: span 1; }
.lsg-span-4 { grid-column: span 2; grid-row: span 2; }
.lsg-span-6 { grid-column: span 2; grid-row: span 1; }

/* Taller items */
.lsg-span-3 { grid-column: span 1; grid-row: span 2; }
.lsg-span-7 { grid-column: span 1; grid-row: span 2; }

/* Large feature items */
.lsg-span-5 { grid-column: span 2; grid-row: span 2; }

/* GALLERY ITEMS */
.lsg-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 3px;
    background: #111;
}

.lsg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.lsg-item:hover img {
    transform: scale(1.04);
    opacity: 0.75;
}

/* CAPTION OVERLAY */
.lsg-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.72));
    padding: 20px 10px 8px 10px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lsg-item:hover .lsg-item-overlay,
.lsg-item:focus .lsg-item-overlay {
    opacity: 1;
}

.lsg-item-caption {
    color: #ffffff;
    font-size: 0.78em;
    line-height: 1.3;
    display: block;
}

/* HIDDEN ITEMS (filtered out) */
.lsg-item.lsg-filtered-out {
    display: none;
}

/* LIGHTBOX */
.lsg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lsg-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    cursor: pointer;
}

.lsg-lightbox-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
    max-height: 92vh;
}

.lsg-lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 88vw;
    max-height: 78vh;
}

.lsg-lb-img-wrap img {
    max-width: 88vw;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    border-radius: 2px;
}

.lsg-lb-caption {
    color: #ffffff;
    font-size: 0.9em;
    margin-top: 12px;
    text-align: center;
    max-width: 80vw;
    line-height: 1.4;
    min-height: 1.4em;
}

/* LIGHTBOX BUTTONS */
.lsg-lb-close,
.lsg-lb-prev,
.lsg-lb-next {
    position: fixed;
    background: rgba(180,0,0,0.75);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s;
    z-index: 2;
    line-height: 1;
}

.lsg-lb-close:hover,
.lsg-lb-prev:hover,
.lsg-lb-next:hover {
    background: rgba(180,0,0,1);
}

.lsg-lb-close {
    top: 16px;
    right: 20px;
    font-size: 2em;
    padding: 2px 12px 6px 12px;
}

.lsg-lb-prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6em;
    padding: 10px 14px;
}

.lsg-lb-next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6em;
    padding: 10px 14px;
}

/* EMPTY MESSAGE */
.lsg-empty {
    font-style: italic;
    color: #666;
}

/* TABLET: 2 columns */
@media screen and (max-width: 768px) {
    .lsg-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 140px;
    }

    /* Prevent any item spanning more than 2 cols on tablet */
    .lsg-span-2,
    .lsg-span-4,
    .lsg-span-5,
    .lsg-span-6 {
        grid-column: span 2;
    }
}

/* MOBILE: 1 column */
@media screen and (max-width: 480px) {
    .lsg-masonry {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 120px;
    }

    /* All items single col on small phones */
    .lsg-span-2,
    .lsg-span-3,
    .lsg-span-4,
    .lsg-span-5,
    .lsg-span-6,
    .lsg-span-7 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .lsg-lb-prev { left: 4px; }
    .lsg-lb-next { right: 4px; }

    .lsg-lb-close {
        top: 8px;
        right: 8px;
    }
}

/* END PUBLIC STYLES */
