/* =========================================================
   AC GALLERY · ANTONIO CAMBA · 3.1.0
   ========================================================= */

.ac-cg {
    --ac-cg-bg: var(--ac-caliza, #f3f0e8);
    --ac-cg-text: var(--ac-texto, #252522);
    --ac-cg-soft: var(--ac-texto-suave, #6c6a63);
    --ac-cg-accent: #292a27;

    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--ac-cg-bg);
    color: var(--ac-cg-text);
}

.ac-cg-gallery-inner {
    width: min(1180px, 90vw);
    margin: 0 auto;
    padding: 3.5rem 0 4rem;
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
}

.ac-cg-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem;
    align-content: start;
}

.ac-cg-thumb {
    appearance: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    display: block;
    min-width: 0;
}

.ac-cg-thumb span {
    display: block;
    overflow: hidden;
    border: 1px solid transparent;
    transition: transform .16s ease, border-color .16s ease;
}

.ac-cg-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    opacity: 1;
    filter: none;
}

.ac-cg-thumb:hover span,
.ac-cg-thumb:focus-visible span {
    transform: scale(1.025);
}

.ac-cg-thumb.is-active span {
    border-color: rgba(37,37,34,.45);
}

.ac-cg-thumb:focus-visible {
    outline: 1px solid var(--ac-cg-accent);
    outline-offset: 3px;
}

.ac-cg-selected {
    min-width: 0;
}

.ac-cg-work {
    display: none;
    margin: 0;
    padding: 0;
}

.ac-cg-work.is-active {
    display: block;
}

.ac-cg-image {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ac-cg-image img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
}

.ac-cg-caption {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    gap: .8rem;
    margin: .75rem 0 0;
    padding: 0;
}

.ac-cg-caption h2,
.ac-cg-caption p {
    margin: 0;
    padding: 0;
    text-align: left;
}

.ac-cg-caption h2 {
    flex: 0 0 auto;
    color: var(--ac-cg-text);
    font-family: var(--ac-font-sans, "Helvetica Neue", Helvetica, Arial, sans-serif);
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ac-cg-caption p {
    flex: 0 0 auto;
    color: var(--ac-cg-soft);
    font-family: var(--ac-font-sans, "Helvetica Neue", Helvetica, Arial, sans-serif);
    font-size: .68rem;
    line-height: 1.4;
}

.ac-cg-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.ac-cg-arrow {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ac-cg-text);
    font: inherit;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: transform .16s ease;
}

.ac-cg-arrow:hover,
.ac-cg-arrow:focus-visible {
    transform: translateX(2px);
}

.ac-cg-arrow.ac-cg-prev:hover,
.ac-cg-arrow.ac-cg-prev:focus-visible {
    transform: translateX(-2px);
}

.ac-cg-arrow:focus-visible {
    outline: 1px solid var(--ac-cg-accent);
    outline-offset: 4px;
}

@media (max-width: 991px) {
    .ac-cg-gallery-inner {
        width: calc(100% - 4rem);
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 2.2rem;
        padding: 2.8rem 0 3.2rem;
    }

    .ac-cg-thumbnails {
        gap: .7rem;
    }
}

@media (max-width: 767px) {
    .ac-cg-gallery-inner {
        width: calc(100% - 2.5rem);
        display: block;
        padding: 2.3rem 0 2.8rem;
    }

    .ac-cg-thumbnails {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .55rem;
        margin-bottom: 2rem;
    }

    .ac-cg-caption {
        flex-wrap: wrap;
        gap: .3rem .7rem;
    }

    .ac-cg-caption h2 {
        font-size: .65rem;
    }

    .ac-cg-caption p {
        font-size: .62rem;
    }

    .ac-cg-navigation {
        margin-top: .85rem;
    }
}
