/* ===================================================
   IYL - Client Gallery · Public CSS
   =================================================== */

.iyl-gallery-wrap {
    box-sizing: border-box;
    width: 100%;
}

.iyl-gallery-wrap *,
.iyl-gallery-wrap *::before,
.iyl-gallery-wrap *::after {
    box-sizing: border-box;
}

.iyl-gallery-title {
    font-family: var(--e-global-typography-primary-font-family, inherit);
    font-weight: var(--e-global-typography-primary-font-weight, 700);
    color: var(--e-global-color-primary, #1a1a2e);
    margin: 0 0 .5em;
    line-height: 1.2;
}

.iyl-gallery-subtitle {
    font-family: var(--e-global-typography-secondary-font-family, inherit);
    font-weight: var(--e-global-typography-secondary-font-weight, 400);
    color: var(--e-global-color-secondary, #555);
    margin: 0 0 1.5em;
    line-height: 1.6;
}

.iyl-gallery-grid {
    width: 100%;
}

/* Base grid override injected via element style */

/* Masonry Layout */
.iyl-gallery-masonry {
    display: block !important;
    column-count: var(--iyl-cols);
    column-gap: var(--iyl-gap);
}
.iyl-gallery-masonry .iyl-gallery-item {
    break-inside: avoid;
    margin-bottom: var(--iyl-gap);
    display: inline-block; /* Helps with break-inside in some browsers */
    width: 100%;
}

/* Justified Layout */
.iyl-gallery-justified {
    display: flex !important;
    flex-wrap: wrap;
    gap: var(--iyl-gap);
}
.iyl-gallery-justified .iyl-gallery-item {
    flex-grow: 1;
    height: var(--iyl-jh);
}
.iyl-gallery-justified .iyl-gallery-item img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
}

.iyl-gallery-item {
    overflow: hidden;
}

.iyl-gallery-item a {
    display: block;
    overflow: hidden;
}

.iyl-gallery-item img {
    transition: transform .35s ease, opacity .3s ease;
}

.iyl-gallery-item:hover img {
    transform: scale(1.04);
    opacity: .92;
}

.iyl-lb-trigger {
    cursor: zoom-in;
}

.iyl-gallery-empty {
    color: #999;
    font-style: italic;
    padding: 20px 0;
}

/* ===================== LIGHTBOX ===================== */
#iyl-lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    backdrop-filter: blur(4px);
}

#iyl-lb-overlay.iyl-lb-visible { opacity: 1; }

#iyl-lb-img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 60px rgba(0,0,0,.6);
    transition: transform .3s ease, opacity .3s ease;
    transform: scale(.96);
    opacity: 0;
}

#iyl-lb-overlay.iyl-lb-visible #iyl-lb-img {
    transform: scale(1);
    opacity: 1;
}

.iyl-lb-close {
    position: fixed;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.iyl-lb-close:hover { background: rgba(255,255,255,.25); }

.iyl-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 1000000;
}
.iyl-lb-nav:hover { background: rgba(255,255,255,.25); }
.iyl-lb-nav--prev { left: 20px; }
.iyl-lb-nav--next { right: 20px; }

.iyl-lb-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: 13px;
    font-family: sans-serif;
    letter-spacing: .05em;
}
