*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: system-ui, -apple-system, sans-serif; background: #0f0f1a; color: #e2e2f0; min-height: 100vh; }

.gal-header { padding: 50px 20px 30px; text-align: center; background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent); border-bottom: 1px solid rgba(255,255,255,.05); }
.gal-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; color: #fff; margin-bottom: 8px; }
.gal-header .count { font-size: .9rem; color: rgba(255,255,255,.4); }
.gal-container { max-width: 1400px; margin: 0 auto; padding: 28px 20px 50px; }

.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gal-item { position: relative; cursor: pointer; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); transition: transform .2s, border-color .2s; }
.gal-item:hover { transform: translateY(-5px); border-color: #f9731666; }
.gal-item .thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.gal-item .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gal-item:hover .thumb img { transform: scale(1.07); }
.gal-item .info { padding: 14px 16px; }
.gal-item .info h3 { font-size: .92rem; font-weight: 700; color: #fff; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-item .info p { font-size: .78rem; color: rgba(255,255,255,.4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.85); width: 56px; height: 56px; background: rgba(255,255,255,.92); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform .25s, opacity .25s; opacity: .75; pointer-events: none; }
.gal-item:hover .play-btn { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.play-btn svg { width: 22px; height: 22px; margin-left: 4px; }

.duration-badge { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.82); padding: 3px 7px; border-radius: 5px; font-size: .7rem; font-weight: 600; color: #fff; }

.type-badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 5px; font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.type-badge.youtube { background: #ff0000; color: #fff; }
.type-badge.vimeo   { background: #1ab7ea; color: #fff; }
.type-badge.local   { background: #f97316; color: #000; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.96); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal.show { display: flex; }
.modal-inner { width: 100%; max-width: 960px; animation: zoomIn .2s ease; }
@keyframes zoomIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-video { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 10px 10px 0 0; overflow: hidden; }
.modal-video video, .modal-video iframe { width: 100%; height: 100%; border: none; display: block; }
.modal-info { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-top: none; border-radius: 0 0 10px 10px; padding: 18px 22px; }
.modal-info h3 { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 5px; }
.modal-info p  { font-size: .88rem; color: rgba(255,255,255,.5); line-height: 1.6; }
.modal-close { position: fixed; top: 18px; right: 20px; width: 42px; height: 42px; background: rgba(255,255,255,.1); border: none; border-radius: 50%; color: #fff; font-size: 1.4rem; cursor: pointer; transition: background .15s; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: rgba(255,255,255,.2); }

.back-link { display: inline-flex; align-items: center; gap: 7px; margin: 16px 20px; padding: 8px 16px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.7); text-decoration: none; border-radius: 7px; font-size: .85rem; border: 1px solid rgba(255,255,255,.08); transition: all .15s; }
.back-link:hover { background: rgba(255,255,255,.12); color: #fff; }

@media (max-width: 768px) { .gal-grid { grid-template-columns: repeat(2, 1fr); } .gal-item .thumb { width: 180px; min-width: 180px; } }
@media (max-width: 500px) { .gal-grid { grid-template-columns: 1fr; } .gal-item { flex-direction: column; } .gal-item .thumb { width: 100%; min-width: 0; aspect-ratio: 16/9; } }
