/* =======================================================
   GALLERY SECTION - LIGHT THEME FIX
   ======================================================= */
.cw-gallery-section {
    --cg-bg:           #ffffff; /* White background */
    --cg-surface:      #f8fafc;
    --cg-border:       #e2e8f0;
    --cg-gold:         #3b82f6; /* Theme Blue instead of Gold */
    --cg-gold-dim:     rgba(59, 130, 246, 0.1);
    --cg-gold-glow:    rgba(59, 130, 246, 0.2);
    --cg-white:        #0f172a; /* Dark text for headings */
    --cg-muted:        #64748b; /* Grey text */
    --cg-card-bg:      #ffffff;
    --cg-card-shadow:  rgba(0, 0, 0, 0.05);
    --cg-radius:       16px;
    --cg-font-display: 'Plus Jakarta Sans', sans-serif; /* Theme Font */
    --cg-font-body:    'Inter', sans-serif; /* Theme Font */
    --cg-transition:   0.4s ease;
}

/* Remove Dark Mode Glow & Lines */
.cw-gallery-section::before { display: none; }
.cw-gallery__glow { display: none; }

/* Fix Card Footer for Light Theme */
.cw-gallery__card-footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e2e8f0;
    backdrop-filter: blur(5px);
}
.cw-gallery__counter-num { color: #0f172a; font-weight: 800; }
.cw-gallery__card { border: 1px solid #e2e8f0; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

/* ════════════════════════════════════════════════════════
   1. Section Wrapper
   ════════════════════════════════════════════════════════ */
.cw-gallery-section {
    background: var(--cg-bg);
    padding: 80px 20px 100px;
    overflow: hidden;
    position: relative;
}

/* Subtle top border accent */
.cw-gallery-section::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--cg-gold) 30%,
        var(--cg-gold) 70%,
        transparent
    );
    opacity: 0.4;
}

/* ════════════════════════════════════════════════════════
   2. Section Header
   ════════════════════════════════════════════════════════ */
.cw-gallery__header {
    text-align: center;
    margin-bottom: 56px;
}

.cw-gallery__eyebrow {
    display: inline-block;
    font-family: var(--cg-font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cg-gold);
    margin-bottom: 12px;
}

.cw-gallery__title {
    font-family: var(--cg-font-display);
    font-size: clamp(2rem, 8vw, 3.2rem);
    font-weight: 700;
    color: var(--cg-white);
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0 0 20px;
}

/* Decorative rule */
.cw-gallery__rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cw-gallery__rule-line {
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cg-gold));
}

.cw-gallery__rule-line:last-child {
    background: linear-gradient(90deg, var(--cg-gold), transparent);
}

.cw-gallery__rule-diamond {
    font-size: 8px;
    color: var(--cg-gold);
    line-height: 1;
}

/* ════════════════════════════════════════════════════════
   3. Stage (outer container)
   ════════════════════════════════════════════════════════ */
.cw-gallery__stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* ── Ambient glow ── */
.cw-gallery__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--cg-gold-glow) 0%, transparent 70%);
    pointer-events: none;
    filter: blur(40px);
    opacity: 0.6;
    z-index: 0;
    animation: cg-pulse 4s ease-in-out infinite alternate;
}

@keyframes cg-pulse {
    from { opacity: 0.45; transform: translate(-50%, -50%) scale(0.95); }
    to   { opacity: 0.70; transform: translate(-50%, -50%) scale(1.05); }
}

/* ════════════════════════════════════════════════════════
   4. Card Stack
   ════════════════════════════════════════════════════════ */
.cw-gallery__stack {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 380px;
    perspective: 1000px;
    cursor: pointer;
    z-index: 1;
}

/* ── Single Card ── */
.cw-gallery__card {
    position: absolute;
    inset: 0;
    background: var(--cg-card-bg);
    border-radius: var(--cg-radius);
    border: 1px solid var(--cg-border);
    padding: 10px 10px 56px 10px;
    box-shadow:
        0 2px  4px  var(--cg-card-shadow),
        0 8px  24px var(--cg-card-shadow),
        0 24px 60px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.06);
    transform-origin: bottom center;
    transition:
        transform    var(--cg-transition),
        opacity      0.4s ease,
        box-shadow   0.3s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    will-change: transform;
}

/* Hover lift on top card */
.cw-gallery__stack:not(.is-animating) .cw-gallery__card:last-child:hover {
    box-shadow:
        0 4px  8px  var(--cg-card-shadow),
        0 16px 40px var(--cg-card-shadow),
        0 32px 80px rgba(0,0,0,0.5),
        0 0 0 1px var(--cg-gold-dim),
        inset 0 1px 0 rgba(255,255,255,0.08);
    transform: translateY(-6px) scale(1.012) rotate(0deg) !important;
}

/* ── Photo Area ── */
.cw-gallery__card-img {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: calc(var(--cg-radius) - 4px);
    overflow: hidden;
    background: #0a0a0f;
}

.cw-gallery__card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
    transition: transform 0.6s ease, filter 0.3s ease;
    filter: brightness(0.92) contrast(1.05);
}

.cw-gallery__stack:not(.is-animating) .cw-gallery__card:last-child:hover img {
    transform: scale(1.04);
    filter: brightness(0.98) contrast(1.05);
}

/* ── Film Grain Overlay ── */
.cw-gallery__grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    mix-blend-mode: overlay;
}

/* ── Card Footer Bar ── */
.cw-gallery__card-footer {
    position: absolute;
    inset: auto 0 0 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: linear-gradient(
        0deg,
        rgba(10,10,14,0.95) 0%,
        rgba(10,10,14,0.6) 60%,
        transparent 100%
    );
    border-radius: 0 0 var(--cg-radius) var(--cg-radius);
}

/* Counter */
.cw-gallery__counter {
    font-family: var(--cg-font-body);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--cg-muted);
    letter-spacing: 0.04em;
}

.cw-gallery__counter-num {
    color: var(--cg-white);
    font-weight: 600;
}

.cw-gallery__counter-sep {
    opacity: 0.4;
    margin: 0 1px;
}

/* Card Actions (hint + zoom) */
.cw-gallery__card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hint label */
.cw-gallery__hint {
    font-family: var(--cg-font-body);
    font-size: 12px;
    font-weight: 400;
    color: var(--cg-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.cw-gallery__hint svg {
    stroke: var(--cg-gold);
    flex-shrink: 0;
}

/* Zoom Button */
.cw-gallery__zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cg-gold-dim);
    border: 1px solid rgba(201,168,76,0.3);
    color: var(--cg-gold);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    position: relative;
    z-index: 10;
}

.cw-gallery__zoom:hover,
.cw-gallery__zoom:focus-visible {
    background: var(--cg-gold);
    border-color: var(--cg-gold);
    color: #0d0d0f;
    transform: scale(1.12);
    outline: none;
}

/* ── Edge Sheen ── */
.cw-gallery__sheen {
    position: absolute;
    inset: 0;
    border-radius: var(--cg-radius);
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.05) 0%,
        transparent 50%,
        rgba(0,0,0,0.15) 100%
    );
    pointer-events: none;
}

/* ════════════════════════════════════════════════════════
   5. Swipe-out Animation
   ════════════════════════════════════════════════════════ */
.cw-gallery__card.is-leaving {
    transform: translateX(130%) rotate(22deg) scale(0.88) !important;
    opacity: 0 !important;
    pointer-events: none;
    transition:
        transform 0.44s cubic-bezier(0.55, 0, 0.85, 0.1),
        opacity   0.36s ease;
}

/* ════════════════════════════════════════════════════════
   6. Progress Dots
   ════════════════════════════════════════════════════════ */
.cw-gallery__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
}

.cw-gallery__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, width 0.3s;
    outline: none;
}

.cw-gallery__dot.is-active {
    background: var(--cg-gold);
    width: 22px;
    border-radius: 3px;
    transform: none;
}

.cw-gallery__dot:hover:not(.is-active) {
    background: rgba(201,168,76,0.45);
    transform: scale(1.3);
}

/* ════════════════════════════════════════════════════════
   7. Responsive
   ════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .cw-gallery__stack {
        max-width: 260px;
        height: 330px;
    }

    .cw-gallery-section {
        padding: 60px 16px 80px;
    }
}

@media (min-width: 768px) {
    .cw-gallery__stack {
        max-width: 340px;
        height: 440px;
    }
}