@charset "UTF-8";

/* =========================================================
   AlegsaOnline.com — Galería pública accesible
   ========================================================= */

.agp-gallery {
    width: min(100%, var(--ao-reading-width));
    margin: 28px 0 32px;
    color: var(--ao-text);
}

.agp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.agp-title {
    margin: 0;
    color: var(--ao-heading);
    font-family: var(--ao-font-serif);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.agp-count {
    flex: 0 0 auto;
    color: var(--ao-text-soft);
    font-size: 0.85rem;
}

.agp-main {
    overflow: hidden;
    background: var(--ao-surface);
    border: 1px solid var(--ao-border);
    border-radius: var(--ao-radius-md);
}

.agp-main-open {
    width: 100%;
    display: block;
    color: #ffffff;
    background: #101827;
    text-decoration: none;
}

.agp-main-media {
    width: 100%;
    aspect-ratio: var(--agp-ratio, 16 / 9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #101827;
}

.agp-main-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.agp-main-info {
    padding: 12px 14px 14px;
}

.agp-main-caption {
    color: var(--ao-text);
    line-height: 1.55;
}

.agp-main-caption:empty {
    display: none;
}

.agp-main-credit {
    margin-top: 6px;
    color: var(--ao-text-faint);
    font-size: 0.81rem;
    line-height: 1.4;
}

.agp-main-credit:empty {
    display: none;
}

.agp-main-credit a {
    color: var(--ao-text-soft);
}

.agp-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 9px;
    margin-top: 10px;
}

.agp-thumb {
    position: relative;
    aspect-ratio: 1.22 / 1;
    display: block;
    min-width: 0;
    overflow: hidden;
    background: var(--ao-surface-soft);
    border: 2px solid transparent;
    border-radius: 10px;
    text-decoration: none;
}

.agp-thumb[aria-current="true"] {
    border-color: var(--ao-primary);
}

.agp-thumb:hover,
.agp-thumb:focus-visible {
    border-color: var(--ao-primary-border);
    transform: translateY(-1px);
}

.agp-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.agp-empty {
    margin: 18px 0;
    padding: 14px;
    color: var(--ao-text-soft);
    background: var(--ao-surface-soft);
    border: 1px solid var(--ao-border);
    border-radius: var(--ao-radius-md);
}

/* =========================================================
   Lightbox
   ========================================================= */

.agp-lightbox {
    position: fixed;
    z-index: 30000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.agp-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 18, 0.94);
    opacity: 0;
    transition: opacity var(--ao-transition);
}

.agp-lightbox__dialog {
    position: relative;
    width: min(1280px, 100%);
    height: min(94vh, 980px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    color: #ffffff;
    background: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 14px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
    opacity: 0;
    transform: scale(0.985);
    transition:
        opacity var(--ao-transition),
        transform var(--ao-transition);
}

.agp-lightbox.is-open .agp-lightbox__backdrop {
    opacity: 1;
}

.agp-lightbox.is-open .agp-lightbox__dialog {
    opacity: 1;
    transform: scale(1);
}

.agp-lightbox__header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 10px 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.agp-lightbox__title {
    min-width: 0;
    margin: 0;
    color: #ffffff;
    font-size: 0.93rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.agp-lightbox__count {
    color: #bdc7d6;
    font-size: 0.82rem;
    white-space: nowrap;
}

.agp-lightbox__header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.agp-lightbox__button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.agp-lightbox__button:hover,
.agp-lightbox__button:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.agp-lightbox__body {
    position: relative;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px 62px;
}

.agp-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.agp-lightbox__previous,
.agp-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.agp-lightbox__previous {
    left: 9px;
}

.agp-lightbox__next {
    right: 9px;
}

.agp-lightbox__footer {
    min-height: 62px;
    padding: 11px 16px 14px;
    color: #dce3ed;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    text-align: center;
}

.agp-lightbox__caption {
    line-height: 1.45;
}

.agp-lightbox__credit {
    margin-top: 4px;
    color: #9caabd;
    font-size: 0.79rem;
}

.agp-lightbox__credit a {
    color: #c8d8ef;
}

@media (max-width: 680px) {
    .agp-gallery {
        margin: 22px 0 28px;
    }

    .agp-head {
        align-items: flex-start;
    }

    .agp-main-media {
        aspect-ratio: var(--agp-ratio-mobile, var(--agp-ratio, 4 / 3));
        min-height: 220px;
        max-height: 55vh;
    }

    .agp-thumbs {
        display: flex;
        overflow-x: auto;
        padding: 2px 1px 6px;
        scroll-snap-type: x mandatory;
    }

    .agp-thumb {
        min-width: 86px;
        flex: 0 0 86px;
        scroll-snap-align: start;
    }

    .agp-lightbox {
        padding: 4px;
    }

    .agp-lightbox__dialog {
        width: 100%;
        height: 98vh;
        border-radius: 10px;
    }

    .agp-lightbox__body {
        padding: 8px;
    }

    .agp-lightbox__previous,
    .agp-lightbox__next {
        top: auto;
        bottom: 9px;
        transform: none;
    }

    .agp-lightbox__previous {
        left: 9px;
    }

    .agp-lightbox__next {
        right: 9px;
    }

    .agp-lightbox__footer {
        min-height: 106px;
        padding-bottom: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agp-lightbox__backdrop,
    .agp-lightbox__dialog {
        transition: none;
    }
}

@media print {
    .agp-thumbs,
    .agp-lightbox {
        display: none !important;
    }

    .agp-main {
        border: 0;
    }
}
