/* ================================================================
   Chancery Depth Gallery v2.0.0
   Horizontal carousel with video support
   Wise Digital Marketing © 2026
================================================================ */

:root {
    --chdg-berry: #A62461;
    --chdg-teal: #7ABFB8;
}

/* Gallery wrapper */
.chdg-gallery {
    width: 100%;
    overflow: hidden;
    padding: 20px 0 40px;
}

/* ── Category Tabs ─────────────────────────────── */
.chdg-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    padding: 0 16px;
}

.chdg-tab {
    padding: 10px 22px;
    border-radius: 30px;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.chdg-tab:hover:not(.active) {
    border-color: var(--chdg-berry);
    color: var(--chdg-berry);
}

.chdg-tab.active {
    background: var(--chdg-berry);
    border-color: var(--chdg-berry);
    color: #fff;
}

/* ── Carousel ─────────────────────────────────── */
.chdg-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 20px 60px;
}

.chdg-track {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Cards ────────────────────────────────────── */
.chdg-card {
    position: absolute;
    width: 280px;
    height: 340px;
    border-radius: 16px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.2);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.chdg-card img,
.chdg-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chdg-card .chdg-embed {
    width: 100%;
    height: 100%;
    position: relative;
}

.chdg-card .chdg-embed img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chdg-card .chdg-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.chdg-vimeo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
}

/* Card positions */
.chdg-card[data-pos="-2"] {
    transform: translateX(calc(var(--gap, 200px) * -1.7)) scale(var(--far-scale, 0.7));
    opacity: 0.5;
    z-index: 1;
}

.chdg-card[data-pos="-1"] {
    transform: translateX(calc(var(--gap, 200px) * -1)) scale(var(--side-scale, 0.85));
    opacity: 0.8;
    z-index: 2;
}

.chdg-card[data-pos="0"] {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 5;
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.3);
}

.chdg-card[data-pos="1"] {
    transform: translateX(var(--gap, 200px)) scale(var(--side-scale, 0.85));
    opacity: 0.8;
    z-index: 2;
}

.chdg-card[data-pos="2"] {
    transform: translateX(calc(var(--gap, 200px) * 1.7)) scale(var(--far-scale, 0.7));
    opacity: 0.5;
    z-index: 1;
}

/* Hidden cards */
.chdg-card.chdg-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(0) scale(0.5);
}

/* ── Play Button ──────────────────────────────── */
.chdg-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: opacity 0.3s ease;
}

.chdg-card:hover .chdg-play,
.chdg-card.playing .chdg-play {
    opacity: 0;
    pointer-events: none;
}

.chdg-play-btn {
    width: var(--play-size, 56px);
    height: var(--play-size, 56px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chdg-play[data-style="filled"] .chdg-play-btn {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.chdg-play[data-style="filled"] .chdg-play-btn svg {
    width: 35%;
    height: 35%;
    margin-left: 8%;
    fill: var(--play-color, #A62461);
}

.chdg-play[data-style="outline"] .chdg-play-btn {
    background: transparent;
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.chdg-play[data-style="outline"] .chdg-play-btn svg {
    width: 35%;
    height: 35%;
    margin-left: 8%;
    fill: #fff;
}

.chdg-play[data-style="minimal"] .chdg-play-btn {
    background: transparent;
    width: 80px;
    height: 80px;
}

.chdg-play[data-style="minimal"] .chdg-play-btn svg {
    width: 50%;
    height: 50%;
    fill: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.chdg-play-btn:hover {
    transform: scale(1.1);
}

/* ── Video Badge ──────────────────────────────── */
.chdg-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--chdg-berry), var(--chdg-teal));
    color: #fff;
    font-family: 'Raleway', sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 10;
}

/* ── CTA Button ───────────────────────────────── */
.chdg-cta {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    z-index: 10;
    transition: all 0.3s ease;
}

.chdg-cta:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transform: translateX(-50%) translateY(-2px);
}

.chdg-cta svg {
    width: 18px;
    height: 18px;
    fill: var(--chdg-berry);
    flex-shrink: 0;
}

/* ── Navigation Arrows ────────────────────────── */
.chdg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
}

.chdg-nav:hover {
    border-color: var(--chdg-berry);
}

.chdg-nav svg {
    width: 20px;
    height: 20px;
    stroke: #333;
    stroke-width: 2;
    fill: none;
}

.chdg-nav.prev {
    left: 10px;
}

.chdg-nav.next {
    right: 10px;
}

/* ── Lightbox ─────────────────────────────────── */
.chdg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chdg-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.chdg-lightbox-inner {
    max-width: 90%;
    max-height: 85%;
    border-radius: 12px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.chdg-lightbox.open .chdg-lightbox-inner {
    transform: scale(1);
}

.chdg-lightbox-inner img,
.chdg-lightbox-inner video,
.chdg-lightbox-inner iframe {
    display: block;
    max-width: 100%;
    max-height: 85vh;
}

.chdg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chdg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chdg-lightbox-close svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    stroke-width: 2;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
    .chdg-carousel {
        padding: 20px 40px;
    }
    
    .chdg-card {
        width: 240px;
        height: 300px;
    }
    
    .chdg-card[data-pos="-2"],
    .chdg-card[data-pos="2"] {
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 600px) {
    .chdg-tabs {
        gap: 6px;
        padding: 0 12px;
    }
    
    .chdg-tab {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .chdg-carousel {
        padding: 10px 50px;
        min-height: 320px;
    }
    
    .chdg-track {
        height: 300px;
    }
    
    .chdg-card {
        width: 200px;
        height: 260px;
    }
    
    .chdg-nav {
        width: 36px;
        height: 36px;
    }
    
    .chdg-nav svg {
        width: 16px;
        height: 16px;
    }
    
    .chdg-cta {
        padding: 10px 18px;
        font-size: 12px;
        bottom: 14px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .chdg-card,
    .chdg-play,
    .chdg-cta,
    .chdg-nav,
    .chdg-tab,
    .chdg-lightbox,
    .chdg-lightbox-inner {
        transition: none;
    }
}
