/* Shared lightbox styles for index.php and portofolio.php */

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    padding: 28px;
    background:
        radial-gradient(circle at top, rgba(20, 184, 166, 0.18), transparent 30%),
        rgba(2, 6, 23, 0.94);
    animation: fadeIn 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    color: #f8fafc;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    z-index: 10000;
}

.lightbox-close {
    top: 28px;
    right: 32px;
    font-size: 30px;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 26px;
}

.lightbox-nav.prev {
    left: 32px;
}

.lightbox-nav.next {
    right: 32px;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(20, 184, 166, 0.22);
    border-color: rgba(94, 234, 212, 0.45);
    transform: translateY(-50%) scale(1.04);
}

.lightbox-close:hover {
    transform: scale(1.04);
}

.lightbox-content {
    width: min(100%, 1040px);
    max-height: calc(100vh - 24px);
    animation: zoomIn 0.3s ease;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 18px;
}

@keyframes zoomIn {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.76) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.lightbox-frame .lightbox-counter {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
}

.lightbox-content img {
    max-width: 100%;
    max-height: min(66vh, calc(100vh - 320px));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(8, 47, 73, 0.3);
}

.lightbox-caption {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 22px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    color: #e2e8f0;
    max-height: min(34vh, 320px);
    overflow: hidden;
}

.lightbox-caption-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.lightbox-caption h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    min-width: 0;
    word-break: break-word;
}

.lightbox-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.16);
    color: #99f6e4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    justify-self: end;
}

.lightbox-caption-body {
    min-height: 0;
    overflow-y: auto;
    display: grid;
    gap: 8px;
    padding-right: 4px;
}

.lightbox-caption p {
    margin: 0;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.6;
}

.lightbox-hint {
    font-size: 12px;
    color: #94a3b8;
}

.lightbox-whatsapp-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
    padding: 12px 18px;
    min-height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #25d366 0%, #1fa855 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(37, 211, 102, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.lightbox-whatsapp-cta-mobile {
    display: none;
}

.lightbox-whatsapp-icon {
    width: 18px;
    height: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lightbox-whatsapp-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.lightbox-whatsapp-text-mobile {
    display: none;
}

.lightbox-whatsapp-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(37, 211, 102, 0.34);
    filter: brightness(1.03);
}

.lightbox-whatsapp-cta:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .lightbox-modal {
        padding: 16px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 46px;
        height: 46px;
        font-size: 26px;
    }

    .lightbox-nav {
        width: 36px;
        height: 36px;
        top: auto;
        bottom: 108px;
        transform: none;
        font-size: 20px;
        opacity: 0.76;
        background: rgba(15, 23, 42, 0.46);
    }

    .lightbox-nav.prev {
        left: 16px;
    }

    .lightbox-nav.next {
        right: 16px;
    }

    .lightbox-nav:hover {
        transform: scale(1.04);
    }

    .lightbox-content {
        width: 100%;
        gap: 8px;
        max-height: calc(100vh - 18px);
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .lightbox-frame {
        padding: 8px;
        border-radius: 18px;
        border-color: rgba(255, 255, 255, 0.12);
    }

    .lightbox-content img {
        max-height: min(90vh, calc(100vh - 94px));
        border-radius: 14px;
    }

    .lightbox-caption {
        padding: 2px 2px 0;
        max-height: none;
        min-height: 0;
        gap: 3px;
        grid-template-rows: auto auto;
        background: transparent;
        border: 0;
        backdrop-filter: none;
        border-radius: 0;
        color: #e2e8f0;
        overflow: visible;
    }

    .lightbox-caption-top {
        align-items: flex-start;
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .lightbox-caption h3 {
        font-size: 15px;
        font-weight: 600;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #f8fafc;
    }

    .lightbox-counter {
        min-width: 0;
        padding: 5px 9px;
        font-size: 10px;
        letter-spacing: 0.03em;
        background: rgba(15, 23, 42, 0.54);
        color: #d1fae5;
        border: 1px solid rgba(167, 243, 208, 0.28);
    }

    .lightbox-frame .lightbox-counter {
        top: 10px;
        right: 10px;
    }

    .lightbox-caption-body {
        overflow: hidden;
        gap: 0;
        padding-right: 0;
        min-height: 0;
    }

    .lightbox-caption p {
        font-size: 12px;
        line-height: 1.4;
        color: rgba(226, 232, 240, 0.78);
    }

    .lightbox-hint {
        display: none;
    }

    .lightbox-whatsapp-cta {
        display: none;
    }

    .lightbox-whatsapp-text-full {
        display: none;
    }

    .lightbox-whatsapp-text-mobile {
        display: none;
    }

    .lightbox-whatsapp-icon {
        width: 24px;
        height: 24px;
    }

    .lightbox-whatsapp-cta-mobile {
        position: absolute;
        right: 16px;
        bottom: 16px;
        z-index: 4;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        color: #ffffff;
        background: linear-gradient(135deg, rgba(37, 211, 102, 0.96) 0%, rgba(31, 168, 85, 0.94) 100%);
        border: 1px solid rgba(255, 255, 255, 0.24);
        backdrop-filter: blur(7px);
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), 0 7px 18px rgba(37, 211, 102, 0.2);
        text-decoration: none;
        transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    }

    .lightbox-whatsapp-cta-mobile:hover {
        transform: scale(1.04);
        filter: brightness(1.03);
    }

    .lightbox-whatsapp-cta-mobile:active {
        transform: scale(0.96);
    }

    .lightbox-whatsapp-cta-mobile .lightbox-whatsapp-icon {
        width: 23px;
        height: 23px;
    }
}
