/* Estilos del widget Image Lightbox — aislados en este archivo */
.bn-image-widget {
    position: relative;
    border-radius: 1rem; /* rounded-2xl aproximado */
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    display: block;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.bn-image-widget .bn-image-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bn-image-widget:hover .bn-image-thumb,
.bn-image-widget:focus-within .bn-image-thumb {
    transform: scale(1.05);
}

.bn-image-widget .bn-image-badge {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: var(--bn-radius-pill);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    pointer-events: none;
    color: var(--bn-color-surface-dark);
}

.bn-image-widget .bn-zoom-icon { width: 20px; height: 20px; stroke-width: 1.8; }

.bn-image-widget .bn-image-redirect-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    color: #1a1a1a;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.bn-image-widget .bn-image-redirect-btn:hover {
    background: var(--bn-color-accent, #006D94);
    color: #fff;
    transform: scale(1.1) rotate(12deg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.bn-image-widget .bn-image-redirect-btn svg {
    width: 18px;
    height: 18px;
}

/* Lightbox overlay */
.bn-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.78);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: var(--bn-z-modal);
    padding: 48px 24px;
}
.bn-lightbox.is-open { opacity: 1; pointer-events: auto; }

.bn-lightbox-inner {
    max-width: min(1200px, 95vw);
    width: auto;
    max-height: calc(100vh - 120px);
    transform: scale(0.98);
    opacity: 0;
    transition: transform 350ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 250ms ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.bn-lightbox-inner.is-visible { transform: scale(1); opacity: 1; }

.bn-image-caption-overlay {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    max-width: calc(100% - 5rem); /* espacio para el badge de zoom a la derecha */
    background: rgba(0,0,0,0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 6px 14px;
    border-radius: 10px;
    color: #fff;
    pointer-events: none;
    z-index: 5;
    transition: background 0.3s ease;
}

.bn-image-caption-overlay p {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    opacity: 0.95;
}

.bn-lightbox-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

/* Spinner */
.bn-lightbox-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.14);
    border-top-color: var(--bn-color-white);
    animation: bn-spin 1s linear infinite;
    display: none;
    z-index: 15;
}

@keyframes bn-spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

.bn-lightbox-frame { 
    overflow: hidden; 
    border-radius: 12px; 
    width: 100%;
    display: flex;
    justify-content: center;
}

.bn-lightbox-img { transition: transform 350ms cubic-bezier(0.2,0.9,0.2,1); }

/* Zoom state */
.bn-lightbox-inner.is-zoomed .bn-lightbox-img { 
    transform: scale(2); 
    cursor: move;
}
.bn-lightbox-inner:not(.is-zoomed) .bn-lightbox-img { 
    cursor: zoom-in; 
}

/* Accessibility: Focus state for the image */
.bn-lightbox-img:focus-visible {
    outline: 3px solid var(--bn-color-accent, #3b82f6);
    outline-offset: 4px;
}
.bn-lightbox-img:focus { outline: none; }

.bn-lightbox-toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 10px;
    z-index: 30;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.2, 1) 0.1s;
}

.bn-lightbox-inner.is-visible .bn-lightbox-toolbar {
    opacity: 1;
    transform: translateY(0);
}

.bn-lightbox-btn {
    background: rgba(255,255,255,0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #1a1a1a;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.bn-lightbox-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.bn-lightbox-btn:active {
    transform: translateY(0);
}

.bn-lightbox-btn svg {
    width: 20px;
    height: 20px;
}

.bn-lightbox-btn.bn-lightbox-close {
    font-size: 24px;
    line-height: 1;
}

.bn-lightbox-zoom-btn.is-active {
    background: var(--bn-color-accent, #3b82f6);
    color: #fff;
}

.bn-lightbox-caption {
    color: rgba(255,255,255,0.95);
    text-align: center;
    padding: 16px 20px 0;
    font-size: 15px;
    font-weight: 400;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
    width: 100%;
    max-width: 800px;
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bn-lightbox-inner.is-visible .bn-lightbox-caption {
    opacity: 1;
}

.bn-lightbox-extra {
    margin-top: 20px;
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
    display: none;
}

.bn-lightbox-inner.is-visible .bn-lightbox-extra {
    opacity: 1;
}

.bn-lightbox-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--bn-color-accent, #006D94);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bn-lightbox-link:hover {
    background: var(--bn-color-accent-hover, #005a7a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    color: #fff;
}

.bn-lightbox-link svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .bn-image-widget .bn-image-badge { bottom: 10px; right: 10px; width:36px; height:36px; }
    .bn-lightbox { padding: 12px; }
    .bn-lightbox-inner { max-height: calc(100vh - 40px); }
    .bn-lightbox-img { max-height: calc(100vh - 40px); }
    .bn-lightbox-toolbar { top: 8px; right: 8px; gap: 8px; }
    .bn-lightbox-btn { width: 44px; height: 44px; }
    .bn-lightbox-btn.bn-lightbox-close { font-size: 28px; }
}
