/**
 * My Custom Lightbox - Styles
 * Version: 1.2.0
 */

/* 1. Основен контейнер на лайтбокса (затъмнения фон) */
#custom-lightbox {
    display: none; /* ЗАДЪЛЖИТЕЛНО: Скрит по подразбиране */
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);

    /* Тези Flexbox правила ще се използват от JS за перфектно центриране */
    align-items: center;
    justify-content: center;
}

/* 2. Самата картинка в лайтбокса */
#custom-lightbox .lightbox-content {
    display: none; /* Скрита, докато се зареди, за да се избегне "премигване" */
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

/* 3. Прелоудър (въртящото се кръгче) */
.lightbox-loader {
    display: none; /* Скрит по подразбиране */
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #555;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute; /* Позиционира се в центъра на екрана */
    top: 50%;
    left: 50%;
    margin-top: -30px;
    margin-left: -30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* 4. Бутони за навигация и затваряне */
#custom-lightbox .close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

#custom-lightbox .close-btn:hover {
    color: #bbb;
}

#custom-lightbox .prev-arrow,
#custom-lightbox .next-arrow {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.4s;
    user-select: none;
    z-index: 10;
}

#custom-lightbox .next-arrow { right: 5px; }
#custom-lightbox .prev-arrow { left: 5px; }

#custom-lightbox .prev-arrow:hover,
#custom-lightbox .next-arrow:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* 5. Брояч (напр. 3 / 10) */
#custom-lightbox .counter {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #f1f1f1;
    font-size: 16px;
    padding: 8px 12px;
}

/* 6. Помощен стил за курсора върху снимките в поста */
.entry-content figure.wp-block-image img {
    cursor: pointer;
}