.utg-wrapper { width: 100%; max-width: 1400px; margin: 2rem auto; box-sizing: border-box; }
.utg-wrapper *, .utg-wrapper *::before, .utg-wrapper *::after { box-sizing: border-box; }

/* Perfect Centering and Max-Width Constraints */
.utg-wrapper.alignwide {
    max-width: 2800px;
    margin-left: auto !important;
    margin-right: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

.utg-wrapper.utg-width-breakout { 
    width: 100vw !important; 
    max-width: 100vw !important; 
    position: relative !important; 
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important; 
    margin-right: -50vw !important; 
    padding: 0 calc((100vw - 1400px) / 2) !important; 
    box-sizing: border-box !important;
}

/* Fallback for screens smaller than the max-width */
@media (max-width: 1440px) {
    .utg-wrapper.utg-width-breakout {
        padding: 0 20px !important;
    }
}
.utg-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; justify-content: center; }
.utg-filter-btn { background: #f3f4f6; color: #1f2937; border: 1px solid #e5e7eb; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.utg-filter-btn:hover { background: #e5e7eb; }
.utg-filter-btn.active { background: #111827; color: #ffffff; border-color: #111827; }

.utg-stage { position: relative; width: 100%; transition: height 0.35s ease; }
.utg-tile { position: absolute; top: 0; left: 0; cursor: pointer; transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.4s cubic-bezier(0.22, 1, 0.36, 1), height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease; will-change: transform, width, height, opacity; }
.utg-tile.utg-hidden { opacity: 0; pointer-events: none; transform: scale(0.85) !important; }

.utg-tile-inner { width: 100%; height: 100%; position: relative; overflow: hidden; border-radius: var(--utg-radius, 6px); background: #f9fafb; }
.utg-shadow-soft .utg-tile-inner { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.utg-shadow-deep .utg-tile-inner { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22); }
.utg-tile-inner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

.utg-caption-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; color: var(--utg-text); background: var(--utg-overlay); transition: all 0.3s ease; }
.utg-tile-title { margin: 0 0 4px 0; font-size: 16px; font-weight: 600; color: var(--utg-text); line-height: 1.25; }
.utg-tile-desc { margin: 0; font-size: 13px; color: var(--utg-text); line-height: 1.4; opacity: 0.9; }

.utg-hover-zoom-slide .utg-caption-overlay { opacity: 0; transform: translateY(15px); background: linear-gradient(to top, var(--utg-overlay) 0%, rgba(0,0,0,0.1) 80%, transparent 100%); }
.utg-hover-zoom-slide .utg-tile:hover .utg-caption-overlay { opacity: 1; transform: translateY(0); }
.utg-hover-zoom-slide .utg-tile:hover img { transform: scale(1.07); }
.utg-hover-fade-center .utg-caption-overlay { justify-content: center; align-items: center; text-align: center; opacity: 0; }
.utg-hover-fade-center .utg-tile:hover .utg-caption-overlay { opacity: 1; }

.utg-lightbox { position: fixed; inset: 0; z-index: 999999; background: rgba(10, 12, 16, 0.94); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; overflow: hidden; }
.utg-lightbox.active { opacity: 1; pointer-events: auto; }
.utg-lb-content { width: 100%; height: 100%; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }

.utg-lb-scroll-wrapper { max-width: 90vw; max-height: 80vh; display: flex; align-items: center; justify-content: center; overflow: visible; }
.utg-lightbox.is-zoomed .utg-lb-scroll-wrapper { overflow: auto; touch-action: pan-x pan-y; max-width: 100vw; max-height: 100vh; }

.utg-lb-img { max-width: 100%; max-height: 80vh; width: auto; height: auto; border-radius: 4px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); display: block; margin: 0 auto; transition: transform 0.2s ease-out; }
.utg-lightbox[data-zoom-enabled="yes"] .utg-lb-img { cursor: zoom-in; }
.utg-lightbox.is-zoomed .utg-lb-img { cursor: move; transition: none; }
.utg-lightbox.is-zoomed .utg-lb-caption { opacity: 0; }

.utg-lb-caption { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); padding: 8px 16px; border-radius: 4px; color: #fff; font-size: 14px; transition: opacity 0.2s; z-index: 2; pointer-events: none; max-width: 80vw; text-align: center; }

.utg-lb-toolbar { position: absolute; top: 20px; right: 24px; display: flex; gap: 10px; z-index: 3; }
.utg-lb-btn { background: rgba(255,255,255,0.12); color: #fff; border: none; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; text-decoration: none; }
.utg-lb-btn:hover { background: rgba(255,255,255,0.28); color: #fff; }
.utg-lb-btn svg { width: 22px; height: 22px; fill: currentColor; }

.utg-lb-social { position: absolute; bottom: 24px; right: 24px; display: flex; gap: 8px; z-index: 3; }
.utg-lb-social .utg-lb-btn { width: 40px; height: 40px; }
.utg-lb-social .utg-lb-btn svg { width: 18px; height: 18px; }

.utg-lb-prev, .utg-lb-next { position: absolute; background: rgba(255,255,255,0.12); color: #fff; border: none; width: 50px; height: 50px; border-radius: 50%; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; z-index: 2; top: 50%; transform: translateY(-50%); }
.utg-lb-prev:hover, .utg-lb-next:hover { background: rgba(255,255,255,0.28); }
.utg-lb-prev { left: 24px; }
.utg-lb-next { right: 24px; }

@media (max-width: 768px) {
    .utg-lb-img { max-width: 95vw; max-height: 75vh; }
    .utg-lightbox.is-zoomed .utg-lb-img { transform: scale(2) !important; max-width: none; max-height: none; }
    .utg-lb-toolbar { top: 10px; right: 10px; gap: 6px; }
    .utg-lb-btn { width: 36px; height: 36px; }
    .utg-lb-btn svg { width: 18px; height: 18px; }
    .utg-lb-social { bottom: 10px; right: 10px; gap: 6px; }
    .utg-lb-prev { left: 10px; width: 36px; height: 36px; font-size: 18px; }
    .utg-lb-next { right: 10px; width: 36px; height: 36px; font-size: 18px; }
    .utg-lb-caption { bottom: 15px; font-size: 12px; }
}