/* ==========================================================================
   Analitik Muhasebe — Gallery block + lightbox
   Native "gallery" block presentation. Uses the existing Analitik design tokens.
   ========================================================================== */

.theme-nova-default .am-gallery {
    margin: 0;
}

.theme-nova-default .am-gallery-empty {
    margin: 0;
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: var(--theme-muted);
    background: var(--theme-surface-muted, #f4f5f7);
    border: 1px dashed var(--theme-border-strong, #d4d4d4);
    border-radius: var(--theme-radius-sm);
    font-size: 0.95rem;
}

.theme-nova-default .am-gallery-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.theme-nova-default .am-gallery-cell {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.theme-nova-default .am-gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-sm);
    background: var(--theme-surface);
    cursor: zoom-in;
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.theme-nova-default .am-gallery-item:hover {
    border-color: var(--theme-accent);
    box-shadow: 0 4px 14px rgba(6, 24, 46, 0.1);
    transform: translateY(-2px);
}

.theme-nova-default .am-gallery-item:focus-visible {
    outline: none;
    box-shadow: var(--theme-focus, 0 0 0 3px rgba(177, 138, 71, 0.4));
}

.theme-nova-default .am-gallery-img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--theme-surface-muted, #f4f5f7);
}

.theme-nova-default .am-gallery-caption {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--theme-muted);
}

@media (min-width: 560px) {
    .theme-nova-default .am-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .theme-nova-default .am-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.15rem;
    }
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.theme-nova-default .am-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgba(4, 15, 27, 0.92);
}

.theme-nova-default .am-lightbox[hidden] {
    display: none;
}

.theme-nova-default .am-lightbox-stage {
    position: relative;
    max-width: min(1100px, 100%);
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-nova-default .am-lightbox-img {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--theme-radius-sm);
    background: #fff;
}

.theme-nova-default .am-lightbox-caption {
    margin: 0.9rem 0 0;
    max-width: 60ch;
    text-align: center;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
    line-height: 1.55;
}

.theme-nova-default .am-lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: background 0.16s ease;
}

.theme-nova-default .am-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.26);
}

.theme-nova-default .am-lightbox-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.theme-nova-default .am-lightbox-prev { left: -0.5rem; }
.theme-nova-default .am-lightbox-next { right: -0.5rem; }

.theme-nova-default .am-lightbox-close {
    position: absolute;
    top: clamp(0.75rem, 3vw, 1.5rem);
    right: clamp(0.75rem, 3vw, 1.5rem);
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}

.theme-nova-default .am-lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
.theme-nova-default .am-lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.theme-nova-default .am-lightbox-counter {
    position: absolute;
    top: clamp(0.75rem, 3vw, 1.5rem);
    left: clamp(0.75rem, 3vw, 1.5rem);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

@media (max-width: 559px) {
    .theme-nova-default .am-lightbox-prev { left: 0; }
    .theme-nova-default .am-lightbox-next { right: 0; }
    .theme-nova-default .am-lightbox-btn { width: 2.5rem; height: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .theme-nova-default .am-gallery-item { transition: none; }
}
