/* ================================================================
   Elementor Autumn Leaf Gallery – Styles
   ================================================================ */

/* ── Wrapper ── */
.ealg-gallery-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    /* hint GPU layer */
    will-change: contents;
}

.ealg-gallery-wrapper canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    border-radius: inherit;
}

/* ── Loading overlay ── */
.ealg-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(18, 9, 10, 0.92);
    backdrop-filter: blur(6px);
    z-index: 10;
    transition: opacity 0.55s ease;
    border-radius: inherit;
}

.ealg-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(232, 93, 4, 0.25);
    border-top-color: #E85D04;
    animation: ealg-spin 0.9s linear infinite;
}

@keyframes ealg-spin {
    to { transform: rotate(360deg); }
}

.ealg-loading-text {
    color: #FAA307;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.ealg-error {
    color: #ff8c69;
    font-family: monospace;
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.6;
    padding: 0 20px;
}

/* ── Editor placeholder ── */
.ealg-editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 200px;
    background: #1a0d06;
    border-radius: 4px;
    color: #FAA307;
    font-family: Georgia, serif;
}
.ealg-editor-placeholder p {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.06em;
}
.ealg-editor-placeholder small {
    color: rgba(250,163,7,0.5);
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════ */
.ealg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.ealg-lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 6, 3, 0.88);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.ealg-lb-panel {
    position: relative;
    z-index: 1;
    background: #1c0e07;
    border: 1px solid rgba(232, 93, 4, 0.22);
    border-radius: 8px;
    max-width: 92vw;
    max-height: 92vh;
    width: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(250,163,7,0.08),
        0 24px 80px rgba(0, 0, 0, 0.75);
    transform: scale(0.88) translateY(24px);
    opacity: 0;
    transition:
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.38s ease;
}

/* Open state */
.ealg-lb-open .ealg-lb-overlay { opacity: 1; }
.ealg-lb-open .ealg-lb-panel   { transform: scale(1) translateY(0); opacity: 1; }

.ealg-lb-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(232, 93, 4, 0.15);
    border: 1px solid rgba(232, 93, 4, 0.35);
    color: #FAA307;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.ealg-lb-close:hover {
    background: rgba(232, 93, 4, 0.4);
    transform: rotate(90deg);
}

.ealg-lb-img-wrap {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(92vh - 72px);
}

.ealg-lb-img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 72px);
    object-fit: contain;
    border-radius: 4px 4px 0 0;
}

.ealg-lb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(0,0,0,0.35);
    border-top: 1px solid rgba(232, 93, 4, 0.12);
}

.ealg-lb-title {
    color: #FAA307;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

.ealg-lb-dl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(232, 93, 4, 0.15);
    border: 1px solid rgba(232, 93, 4, 0.4);
    border-radius: 4px;
    color: #FAA307;
    font-size: 0.8rem;
    font-family: Georgia, serif;
    letter-spacing: 0.05em;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.ealg-lb-dl:hover {
    background: rgba(232, 93, 4, 0.3);
    border-color: rgba(232, 93, 4, 0.7);
    color: #FFBA08;
}
.ealg-lb-dl svg {
    flex-shrink: 0;
}

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
    .ealg-lb-panel {
        max-width: 98vw;
        max-height: 96vh;
        border-radius: 6px;
    }
    .ealg-lb-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 12px;
    }
    .ealg-lb-title {
        max-width: 90vw;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .ealg-lb-panel,
    .ealg-lb-overlay { transition: none; }
}
