/* Wig Gallery — Front-end Themes */

/* ── Shared ──────────────────────────────────────────── */
.wig-gallery { margin: 20px 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.wig-gallery-title { font-size: 20px; font-weight: 600; margin: 0 0 16px; color: #1f2937; }
.wig-gallery-error, .wig-gallery-empty { color: #6b7280; font-style: italic; }

/* Modal */
.wig-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.wig-modal-content { width: 100%; max-width: 900px; background: #000; border-radius: 12px; overflow: hidden; position: relative; }
.wig-modal-close { position: absolute; top: 10px; right: 14px; color: #fff; font-size: 28px; cursor: pointer; z-index: 10; background: none; border: none; line-height: 1; }
.wig-modal-body { width: 100%; }
.wig-modal-body iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }

/* ── Grid Theme ──────────────────────────────────────── */
.wig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.wig-grid-item { cursor: pointer; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: box-shadow 150ms, transform 150ms; }
.wig-grid-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(-2px); }
.wig-grid-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #1e1e1e; }
.wig-grid-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 300ms; }
.wig-grid-item:hover .wig-grid-thumb img { transform: scale(1.05); }
.wig-grid-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #666; }
.wig-grid-duration { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.75); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.wig-grid-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 200ms; background: rgba(0,0,0,0.3); }
.wig-grid-item:hover .wig-grid-play { opacity: 1; }
.wig-grid-play .dashicons { font-size: 40px; width: 40px; height: 40px; color: #fff; }
.wig-grid-title { margin: 0; padding: 10px 12px; font-size: 13px; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── List Theme ──────────────────────────────────────── */
.wig-list-item { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer; transition: background 100ms; }
.wig-list-item:hover { background: #fafafa; }
.wig-list-thumb { width: 120px; flex-shrink: 0; border-radius: 6px; overflow: hidden; }
.wig-list-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.wig-list-info { flex: 1; min-width: 0; }
.wig-list-info strong { display: block; font-size: 14px; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wig-list-dur { font-size: 12px; color: #9ca3af; }
.wig-list-play { background: none; border: 1px solid #e5e7eb; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 100ms; }
.wig-list-play:hover { background: #ea580c; border-color: #ea580c; }
.wig-list-play:hover .dashicons { color: #fff; }

/* ── Carousel Theme ──────────────────────────────────── */
.wig-carousel { position: relative; overflow: hidden; }
.wig-carousel-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 4px 0; }
.wig-carousel-track::-webkit-scrollbar { display: none; }
.wig-carousel-slide { flex: 0 0 280px; scroll-snap-align: start; cursor: pointer; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: box-shadow 150ms; }
.wig-carousel-slide:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.wig-carousel-slide img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.wig-carousel-slide p { margin: 0; padding: 8px 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wig-carousel-prev, .wig-carousel-next { position: absolute; top: 50%; transform: translateY(-70%); background: rgba(255,255,255,0.9); border: 1px solid #e5e7eb; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; }
.wig-carousel-prev { left: 8px; }
.wig-carousel-next { right: 8px; }
.wig-carousel-prev:hover, .wig-carousel-next:hover { background: #ea580c; color: #fff; border-color: #ea580c; }

/* ── oEmbed wrap ──────────────────────────────────────── */
.wig-oembed-wrap { margin: 12px 0; }
.wig-oembed-wrap iframe { max-width: 100%; border-radius: 8px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .wig-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .wig-list-thumb { width: 80px; }
    .wig-carousel-slide { flex: 0 0 240px; }
}
