:root {
    --g-height: 60vh; /* Master height for desktop gallery */
    --g-mob-height: 450px; /* Master height for mobile gallery */
    --max-width: 1300px;
}
  
/* --- NATIVE CSS PINNING --- */
@media (min-width: 1025px) {
    .tc-gallery-wrapper {
        position: relative;
        width: 100%;
        height: 300vh; /* How long the user scrolls to reach the end */
    }
    .tc-gallery-section {
        position: sticky;
        top: 0;
        height: 100vh; /* Native pinning: sticks to the top of the screen */
    }
}
  
.tc-gallery-section {
    width: 100%;
    background-color: #fffbec; /* Cream background to match your Details section */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 100px; 
}
  
.tc-gallery-header {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto 40px auto;
    padding: 0 5vw;
    text-align: center;
    z-index: 5;
    pointer-events: none;
    flex-shrink: 0;
}
.tc-gallery-header .story-overline .text-dark{
 color: #000 !important;
}
  
/* --- DESKTOP TRACK (DYNAMIC WIDTHS, FIXED HEIGHT) --- */
.tc-desktop-track {
    display: flex;
    gap: 20px;
    padding-left: max(24px, calc((100vw - var(--max-width)) / 2 + 20px));
    padding-right: 5vw; 
    width: max-content; 
    height: var(--g-height);
    align-items: center;
    will-change: transform;
    transition: transform 0.1s linear; 
}
  
.tc-gallery-item {
    position: relative;
    height: 100%;
    width: auto; /* THIS IS THE MAGIC: Lets the image decide the width */
    border-radius: 12px; 
    overflow: hidden;
    cursor: zoom-in;
    flex-shrink: 0;
    background: rgba(0,0,0,0.05); 
}
  
.tc-img {
    height: 100%;
    width: auto; /* Maintains original aspect ratio */
    object-fit: cover;
    will-change: transform;
    transition: filter 0.3s ease, opacity 0.5s ease, transform 0.5s ease;
    opacity: 0; 
}

.tc-img.loaded { opacity: 1; }
.tc-gallery-item:hover .tc-img { filter: brightness(1.1); transform: scale(1.03); }
  
/* --- MOBILE SWIPER --- */
.tc-mobile-swiper {
    display: none; 
    width: 100%;
    height: var(--g-mob-height);
    margin-top: 0;
    overflow: visible;
}
  
@media (max-width: 1024px) {
    .tc-gallery-wrapper { height: auto; }
    .tc-gallery-section { height: auto !important; display: block; padding: 80px 0; position: relative; }
    .tc-gallery-header { margin-bottom: 40px; }
    .tc-desktop-track { display: none; }
    .tc-mobile-swiper { display: block; }
  
    .swiper-slide {
        width: auto; /* Allows dynamic widths on mobile too! */
        height: 100%;
        transition: transform 0.3s ease, opacity 0.3s ease;
        opacity: 0.5;
        transform: scale(0.95);
        border-radius: 12px;
        overflow: hidden;
    }
    .swiper-slide-active { opacity: 1; transform: scale(1); z-index: 2; }
}
  
/* --- LIGHTBOX OVERLAY --- */
.tc-lb-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #F9F8F4;
    z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    /* The premium noise filter you requested */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    visibility: hidden;
    overflow: hidden;
    clip-path: circle(0% at 0% 0%);
}
  
.tc-lb-kicker { position: absolute; top: 26px; left: 26px; z-index: 20; pointer-events: none; opacity: 0; }
.tc-lb-close { position: absolute; top: 30px; right: 30px; font-family: var(--secondary-font); color: #000; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; font-size: 12px; cursor: pointer; z-index: 20; display: flex; align-items: center; gap: 8px; opacity: 0; transition: color 0.3s;}
.tc-lb-close:hover { color: var(--accent-primary); }
.tc-lb-close svg { width: 20px; height: 20px; }
.tc-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 60px; height: 60px; display: grid; place-items: center; cursor: pointer; z-index: 20; color: #000; opacity: 0; transition: transform 0.2s ease, color 0.3s; }
.tc-lb-nav:hover { color: var(--accent-primary); }
.tc-lb-nav:active { transform: translateY(-50%) scale(0.9); }
.tc-lb-nav svg { width: 40px; height: 40px; stroke-width: 1; }
.tc-lb-prev { left: 20px; }
.tc-lb-next { right: 20px; }
  
@media(max-width: 768px){
    .tc-lb-nav { width: 40px; height: 40px; top: auto; bottom: 30px; transform: none; }
    .tc-lb-nav:active { transform: scale(0.9); }
}
  
.tc-lb-img-wrap { position: relative; width: 100%; height: 70vh; display: flex; align-items: center; justify-content: center; overflow: hidden; z-index: 10; }
.tc-lb-img { max-width: 90vw; max-height: 100%; object-fit: contain; box-shadow: 0 20px 40px rgba(0,0,0,0.1); opacity: 0; transform: scale(0.95); border-radius: 8px;}
.tc-lb-meta { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; opacity: 0; z-index: 10; }
.tc-lb-share-label { font-family: var(--secondary-font); font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: #666; }
.tc-lb-actions { display: flex; gap: 20px; }
.tc-share-btn { cursor: pointer; color: #000; transition: opacity 0.3s; }
.tc-share-btn:hover { opacity: 0.6; color: var(--accent-primary);}
.tc-share-btn svg { width: 20px; height: 20px; }

/* --- THE "VIEW ALL" END CARD --- */
.tc-gallery-end {
    width: 350px !important; /* Fixed width so it looks like a clean card */
    background: #962E51 !important; /* Matches your premium burgundy */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    border-radius: 12px;
}

.gallery-end-card {
    text-align: center;
    padding: 40px;
    color: #ffffff;
}

.gallery-end-card h3 {
    font-family: var(--primary-font);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.gallery-end-card p {
    font-family: var(--secondary-font);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    margin-bottom: 30px;
}

.gallery-view-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    background: #ffffff;
    color: #962E51;
    text-decoration: none;
    font-family: var(--secondary-font);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.gallery-view-btn:hover {
    transform: translateY(-3px);
    background: #f0f0f0;
}

@media (max-width: 1024px) {
    .tc-gallery-end {
        width: 300px !important; /* Slightly smaller on mobile */
    }
}