/* =========================================
   1. TRUST PAGE HEADER
   ========================================= */
.trust-header {
    padding: 24px 16px;
    background: var(--bg-dark);
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trust-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
    font-style: italic;
    letter-spacing: 0.5px;
}

.trust-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    margin-bottom: 0;
}

/* =========================================
   2. STORIES / FILTERS NAVIGATION
   ========================================= */
.stories-container {
    padding: 16px 0 24px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-dark);
    scrollbar-width: none; /* Hide scrollbar Firefox */
    min-height: 110px; /* Prevent layout shift during load */
}

.stories-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.stories-wrapper {
    display: inline-flex;
    padding: 0 16px;
    gap: 20px;
    align-items: flex-start;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.2s ease;
    width: 72px; /* Fixed width for alignment */
}

.story-item:hover {
    opacity: 0.8;
}

.story-item.active {
    opacity: 1;
    transform: scale(1.05);
}

.story-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px; /* Space between border and image */
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-item.active .story-ring {
    border-color: var(--accent-gold);
}

.story-thumb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #222;
    display: block;
}

.story-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* =========================================
   3. MASONRY GRID LAYOUT
   ========================================= */
.trust-grid {
    padding: 16px;
    column-count: 2; /* Mobile default */
    column-gap: 12px;
    width: 100%;
}

@media (min-width: 768px) {
    .trust-grid {
        column-count: 3;
        padding: 24px;
        column-gap: 20px;
    }
}

@media (min-width: 1024px) {
    .trust-grid {
        column-count: 4;
    }
}

.trust-item {
    break-inside: avoid; /* Prevent items from splitting across columns */
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    position: relative;
    cursor: zoom-in;
    transform: translateZ(0); /* Hardware accel */
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: opacity 0.3s ease;
}

.trust-media {
    width: 100%;
    height: auto;
    display: block;
    background: #1a1a1a;
}

/* =========================================
   4. LOADING SHIMMER / SKELETON EFFECT
   ========================================= */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: #111;
    background: linear-gradient(90deg, #111 25%, #222 50%, #111 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
    margin-bottom: 12px;
    break-inside: avoid;
    width: 100%;
}

/* =========================================
   5. FULLSCREEN LIGHTBOX (RESPONSIVE FIX)
   ========================================= */
.trust-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.trust-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* Wrapper to hold media and prevent it from touching edges */
.lightbox-media-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px; /* Top/Bottom padding ensures space for buttons */
}

/* Strict constraints on media size */
.lightbox-content {
    max-width: 100%;
    max-height: 85vh; /* Never taller than 85% of screen height */
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Buttons */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10005;
    transition: background 0.2s;
    line-height: 1;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10005;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Hide navigation buttons on very small mobile if desired, or make them smaller */
@media (max-width: 480px) {
    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        background: transparent; /* Cleaner look on mobile */
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    
    .lightbox-media-container {
        padding: 60px 10px; /* More top padding for close button on mobile */
    }
}