/* --- LAYOUT --- */
.tg-wrap { width: 100%; max-width: 100%; margin: 0 auto; padding: 20px 0; box-sizing: border-box; overflow: visible; font-family: inherit; }
.tg-wrap * { box-sizing: border-box; }
.tg-container { position: relative; min-height: 100px; }

/* FILTERS */
.tg-filters { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.tg-filter-btn { background: #f1f1f1; border: none; padding: 10px 20px; border-radius: 30px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; color: #555; font-family: inherit; }
.tg-filter-btn:hover, .tg-filter-btn.active { background: #111; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* GRID */
.tg-grid-wrapper { display: grid; gap: 20px; width: 100%; transition: opacity 0.3s ease; grid-template-columns: repeat(var(--tg-cols-mob, 1), 1fr); }
.tg-grid-wrapper.loading { opacity: 0.2; pointer-events: none; }

/* TABLET (2 cols) */
@media (min-width: 500px) and (max-width: 1024px) {
    .tg-grid-wrapper { grid-template-columns: repeat(2, 1fr); }
}

/* DESKTOP (4 cols default or user setting) */
@media (min-width: 1025px) { 
    .tg-grid-wrapper { grid-template-columns: repeat(var(--tg-cols-desk, 4), 1fr); gap: 30px; } 
}

@media (max-width: 767px) { .tg-grid-wrapper .tg-card:nth-child(n+5) { display: none; } .tg-grid-wrapper.tg-mob-revealed .tg-card:nth-child(n+5) { display: block; } }

/* CARD */
.tg-card { position: relative; display: block; width: 100%; min-width: 0; perspective: 1500px; text-decoration: none; outline: none; -webkit-tap-highlight-color: transparent; touch-action: pan-y; cursor: pointer; transform: translateZ(0); }
.tg-card__figure { position: relative; width: 100%; height: 100%; margin: 0; transform-style: preserve-3d; will-change: transform; pointer-events: none; border-radius: 12px; overflow: hidden; background: #000; }
.tg-card__image { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(0.8); transition: filter 0.3s ease, opacity 0.3s ease; position: absolute; top: 0; left: 0; z-index: 2; }
.tg-main-vid-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; background: #000; }
.tg-main-video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s ease; }
.tg-main-video.loaded { opacity: 1; }
.tg-hover-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: 0; transition: opacity 0.4s ease; }
.tg-card.video-playing .tg-video { opacity: 1; z-index: 3; }
.tg-card.video-playing .tg-card__image { opacity: 0; }
.tg-card.is-active .tg-card__image { filter: brightness(0.4); box-shadow: 0 20px 50px rgba(0,0,0,0.4); }
.tg-card__deco { position: absolute; top: 20px; left: 20px; right: 20px; bottom: 20px; border: 1px solid rgba(255, 255, 255, 0.4); pointer-events: none; transform: translateZ(40px); border-radius: 8px; z-index: 4; }

/* CAPTION */
.tg-card__caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 30px; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 5px; transform: translateZ(60px) translateY(45px); transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); z-index: 5; }
.tg-card:hover .tg-card__caption, .tg-card.is-active .tg-card__caption { transform: translateZ(80px) translateY(0px); }
.tg-card__title { margin: 0; font-size: 1.3rem; text-transform: uppercase; font-weight: 800; line-height: 1.2; color: var(--tg-col-title, #fff); text-shadow: 0 2px 10px rgba(0,0,0,0.9); font-family: inherit; }
.tg-card__desc { margin: 0; font-size: 0.8rem; opacity: 1; letter-spacing: 1.5px; font-weight: 500; color: var(--tg-col-loc, #ccc); text-shadow: 0 1px 5px rgba(0,0,0,0.9); font-family: inherit; }
.tg-btn { margin-top: 10px; padding: 10px 24px; white-space: nowrap; background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); color: var(--tg-col-btn-text, #000); text-shadow: 0 0 1px rgba(255, 255, 255, 0.3); border-radius: 50px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; pointer-events: auto; opacity: 0; transition: opacity 0.4s ease 0.1s; cursor: pointer; font-family: inherit; }
.tg-card:hover .tg-btn, .tg-card.is-active .tg-btn { opacity: 1; }
.tg-btn:hover { background: rgba(255, 255, 255, 0.9); }

/* --- LOAD MORE --- */
.tg-load-more-wrap { text-align: center; margin-top: 40px; display: flex; align-items: center; justify-content: center; gap: 15px; min-height: 40px; }
.tg-load-btn { background: transparent; border: 2px solid #333; color: #333; padding: 12px 30px; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: 0.3s; font-size: 14px; font-family: inherit; display: inline-block; }
.tg-load-btn:hover { background: #333; color: #fff; }

/* LOADERS */
.tg-loader, .tg-center-loader, .tg-vid-loader { 
    display: none; width: 30px; height: 30px; 
    border: 4px solid rgba(0,0,0,0.1); border-radius: 50%; 
    border-top-color: #ffffff; 
    animation: tg-spin 1s linear infinite, tg-colors 2s ease-in-out infinite alternate;
}
.tg-center-loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50px; height: 50px; z-index: 20; border-width: 5px; }
.tg-vid-loader { display: block; border-top-color: #fff; animation: tg-spin 1s linear infinite; }

.tg-load-more-wrap.is-loading .tg-load-btn { display: none !important; }
.tg-load-more-wrap.is-loading .tg-loader { display: inline-block !important; }

@keyframes tg-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes tg-colors {
    0% { border-top-color: #ffffff; border-right-color: #ffffff; }
    25% { border-top-color: #ff0000; border-right-color: #ff0000; }
    50% { border-top-color: #000000; border-right-color: #000000; }
    75% { border-top-color: #0000ff; border-right-color: #0000ff; }
    100% { border-top-color: #ffffff; border-right-color: #ffffff; }
}