/* Gallery redesign: index + details pages */
.vc-gallery-index-page .container-xxl {
    max-width: 1360px;
}

.vc-gallery-index-configurable {
    --vc-gallery-columns-desktop: 3;
    --vc-gallery-columns-tablet: 2;
    --vc-gallery-columns-mobile: 1;
    --vc-gallery-gap: 24px;
    --vc-gallery-card-radius: 20px;
    --vc-gallery-image-ratio: 4 / 3;
}

.vc-gallery-detail-configurable {
    --vc-gallery-detail-columns-desktop: 3;
    --vc-gallery-detail-columns-tablet: 2;
    --vc-gallery-detail-columns-mobile: 1;
    --vc-gallery-detail-gap: 18px;
    --vc-gallery-detail-card-radius: 16px;
    --vc-gallery-detail-image-ratio: 3 / 2;
}

.vc-gallery-index .vc-gallery-index__toolbar {
    margin-bottom: clamp(24px, 4vw, 44px);
}

.vc-gallery-index .button-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 0;
}

.vc-gallery-index .button-group button {
    margin: 0;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid #d6c9b9;
    background: #f6efe3;
    color: #30261d;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-size: 12px;
    text-transform: uppercase;
    flex: 0 0 auto;
}

.vc-gallery-index .button-group button::before {
    display: none;
}

.vc-gallery-index .button-group button:hover,
.vc-gallery-index .button-group button.active {
    border-color: #1f1a13;
    background: #1f1a13;
    color: #f8f2e7;
}

.vc-gallery-index__body {
    width: 100%;
}

.vc-gallery-grid__inner {
    display: grid;
    grid-template-columns: repeat(var(--vc-gallery-columns-desktop, 3), minmax(0, 1fr));
    gap: var(--vc-gallery-gap, 24px);
}

.vc-gallery-grid__item {
    min-width: 0;
}

.vc-gallery-card {
    height: 100%;
    border-radius: var(--vc-gallery-card-radius, 20px);
    background: #15120f;
    box-shadow: 0 20px 50px rgba(20, 18, 14, 0.2);
    overflow: hidden;
}

.vc-gallery-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.vc-gallery-card__media {
    margin: 0;
    overflow: hidden;
    position: relative;
    aspect-ratio: var(--vc-gallery-image-ratio, 4 / 3);
}

.vc-gallery-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.vc-gallery-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16, 13, 10, 0.05) 0%, rgba(16, 13, 10, 0.55) 100%);
}

.vc-gallery-card__content {
    background: #15120f;
    color: #f6ebda;
    padding: 20px;
}

.vc-gallery-card__eyebrow {
    margin: 0 0 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #d7b98a;
}

.vc-gallery-card h3 {
    margin: 0;
    font-size: clamp(20px, 2.2vw, 30px);
    color: #fff;
    line-height: 1.18;
}

.vc-gallery-card__cta {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e5c897;
}

.vc-gallery-card__cta::after {
    content: '\2192';
    line-height: 1;
}

.vc-gallery-card:hover .vc-gallery-card__media img {
    transform: scale(1.05);
}

.vc-gallery-detail {
    padding: clamp(50px, 6vw, 90px) 0;
}

.vc-gallery-detail .container {
    max-width: 1440px;
}

.vc-gallery-detail__header {
    max-width: 840px;
    margin: 0 auto 36px;
    text-align: center;
}

.vc-gallery-detail__eyebrow {
    margin: 0 0 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8f7550;
    font-weight: 600;
}

.vc-gallery-detail__header h1 {
    margin: 0;
    color: #1c1711;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.1;
}

.vc-gallery-detail__description {
    margin-top: 16px;
    color: #4f4334;
    font-size: 17px;
    line-height: 1.75;
}

.vc-gallery-detail__description p:last-child {
    margin-bottom: 0;
}

.vc-gallery-detail__meta {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vc-gallery-detail__meta span {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #d6c9b8;
    background: #f5ede0;
    color: #4a3e2f;
    font-size: 12px;
    letter-spacing: 0.03em;
}

.vc-gallery-detail__grid {
    display: grid;
    gap: var(--vc-gallery-detail-gap, 18px);
    grid-template-columns: repeat(var(--vc-gallery-detail-columns-desktop, 3), minmax(0, 1fr));
}

.vc-gallery-detail__item {
    grid-column: span 1;
    min-width: 0;
}

.vc-gallery-detail__item:nth-child(8n + 1),
.vc-gallery-detail__item:nth-child(8n + 5) {
    grid-column: span 1;
}

.vc-gallery-detail__link {
    position: relative;
    display: block;
    border-radius: var(--vc-gallery-detail-card-radius, 16px);
    overflow: hidden;
    background: #d8d8d8;
    box-shadow: 0 16px 36px rgba(19, 16, 12, 0.16);
}

.vc-gallery-detail__link img {
    width: 100%;
    aspect-ratio: var(--vc-gallery-detail-image-ratio, 4 / 3);
    object-fit: cover;
    transition: transform 0.45s ease;
}

.vc-gallery-detail__item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(15, 12, 9, 0.05) 30%, rgba(15, 12, 9, 0.8) 100%);
    color: #f8f2e6;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vc-gallery-detail__item-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1510;
    font-size: 13px;
}

.vc-gallery-detail__item-text {
    font-size: 13px;
    line-height: 1.5;
}

.vc-gallery-detail__link:hover img {
    transform: scale(1.05);
}

.vc-gallery-detail__link:hover .vc-gallery-detail__item-overlay {
    opacity: 1;
}

@media (max-width: 1199px) {
    .vc-gallery-grid__inner {
        grid-template-columns: repeat(var(--vc-gallery-columns-tablet, 2), minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .vc-gallery-detail__item,
    .vc-gallery-detail__item:nth-child(8n + 1),
    .vc-gallery-detail__item:nth-child(8n + 5) {
        grid-column: span 1;
    }

    .vc-gallery-detail__grid {
        grid-template-columns: repeat(var(--vc-gallery-detail-columns-tablet, 2), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .vc-gallery-index {
        --vc-gallery-gap: 16px;
    }

    .vc-gallery-index .button-group {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .vc-gallery-index .button-group button {
        white-space: nowrap;
    }

    .vc-gallery-grid__inner {
        grid-template-columns: repeat(var(--vc-gallery-columns-mobile, 1), minmax(0, 1fr));
    }

    .vc-gallery-card {
        border-radius: var(--vc-gallery-card-radius, 14px);
    }

    .vc-gallery-detail {
        padding: 44px 0;
    }

    .vc-gallery-detail__grid {
        gap: var(--vc-gallery-detail-gap, 14px);
    }

    .vc-gallery-detail__item,
    .vc-gallery-detail__item:nth-child(8n + 1),
    .vc-gallery-detail__item:nth-child(8n + 5) {
        grid-column: span 1;
    }

    .vc-gallery-detail__grid {
        grid-template-columns: repeat(var(--vc-gallery-detail-columns-mobile, 1), minmax(0, 1fr));
    }

    .vc-gallery-detail__link {
        border-radius: var(--vc-gallery-detail-card-radius, 12px);
    }

    .vc-gallery-detail__item-overlay {
        opacity: 1;
    }
}
