/* ============================================================
   GT Auto Gallery – Slideshow Player v4
   ============================================================ */

:root {
    --gtag-accent: #d4620a;
    --gtag-bg:     #0f0f0f;
    --gtag-ctrl:   #1a1a1a;
    --gtag-text:   #ddd;
    --gtag-radius: 10px;
}

/* ── Container ─────────────────────────────────────────────── */
.gtag-player {
    width: 100%;
    margin: 28px 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--gtag-bg);
    border-radius: var(--gtag-radius);
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(0,0,0,.5);
    user-select: none;
}

/* ── Main stage ─────────────────────────────────────────────── */
.gtag-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

@media (max-width: 600px) and (orientation: portrait) {
    .gtag-player {
        border-radius: 0;
        margin-left: calc(-50vw + 50%);  /* déborde des marges du contenu */
        width: 100vw;
    }
    .gtag-stage {
        aspect-ratio: unset;
        height: 72vw;      /* hauteur généreuse, letterbox noir si photo pas au bon ratio */
        max-height: 70vh;
    }
    .gtag-stage img {
        object-fit: contain;   /* letterbox : on voit toute la photo */
        background: #000;
    }
}

.gtag-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .5s ease;
}
.gtag-slide.is-active { opacity: 1; z-index: 2; }

.gtag-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ── Zoom layer ─────────────────────────────────────────────── */
.gtag-zoom-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    display: none;
}
.gtag-zoom-layer.is-active { display: block; }

.gtag-zoom-layer img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transform-origin: 0 0;
    cursor: grab;
    pointer-events: auto;
    -webkit-user-drag: none;
    will-change: transform;
}
.gtag-zoom-layer img.dragging { cursor: grabbing; }

/* ── Progress bar ───────────────────────────────────────────── */
.gtag-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--gtag-accent);
    z-index: 9;
    transition: width linear;
}

/* ── Counter badge (haut droite) ────────────────────────────── */
.gtag-count-badge {
    position: absolute;
    top: 12px; right: 14px;
    background: rgba(0,0,0,.52);
    color: #fff;
    font-size: .72rem;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 8;
    backdrop-filter: blur(6px);
    letter-spacing: .04em;
}

/* ── Zoom controls (haut gauche) ────────────────────────────── */
.gtag-zoom-controls {
    position: absolute;
    top: 10px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
    opacity: 1; /* toujours visible */
    touch-action: manipulation;
}

.gtag-zoom-controls button {
    background: rgba(0,0,0,.52);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    line-height: 1;
    transition: background .2s, border-color .2s, transform .15s;
}
.gtag-zoom-controls button:hover {
    background: rgba(212, 98, 10, .75);
    border-color: var(--gtag-accent);
    transform: scale(1.1);
}
.gtag-zoom-controls button:active { transform: scale(.9); }

.gtag-zoom-level {
    background: rgba(0,0,0,.52);
    color: rgba(255,255,255,.8);
    font-size: .68rem;
    padding: 3px 5px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(4px);
    pointer-events: none;
    min-width: 36px;
    letter-spacing: .03em;
}

/* ── Controls bar ───────────────────────────────────────────── */
.gtag-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--gtag-ctrl);
}

/* Transport buttons (prev / play-pause / next) */
.gtag-btn-transport {
    background: none;
    border: none;
    color: var(--gtag-text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    font-size: 1rem;
    transition: color .2s;
    padding: 0;
    touch-action: manipulation;
}
.gtag-btn-transport svg {
    width: 22px; height: 22px;
    display: block;
}
.gtag-btn-play svg { width: 30px; height: 30px; }

/* Cercle hover propre */
.gtag-btn-transport::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: transparent;
    transition: background .2s;
}
.gtag-btn-transport:hover { color: #fff; }
.gtag-btn-transport:hover::before  { background: rgba(212,98,10,.22); }
.gtag-btn-transport:active::before { background: rgba(212,98,10,.42); }
.gtag-btn-transport:active { transform: scale(.9); }

/* Separator */
.gtag-sep {
    width: 1px; height: 24px;
    background: rgba(255,255,255,.1);
    flex-shrink: 0;
}

/* ── Thumbnail strip ────────────────────────────────────────── */
.gtag-thumbnails {
    display: flex;
    gap: 6px;
    flex: 1;
    padding: 2px 0;
    overflow: hidden;  /* plus de scroll — la fenêtre glissante gère tout */
}

.gtag-thumb {
    flex: 1;               /* remplit l'espace dispo équitablement */
    min-width: 0;          /* évite le dépassement */
    max-width: 90px;       /* plafond pour pas être trop large si peu d'images */
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: .38;
    border: 2px solid transparent;
    transition: opacity .25s, border-color .25s, transform .2s;
}

@media (max-width: 600px) {
    .gtag-thumb {
        height: 40px;
    }
}
.gtag-thumb:hover   { opacity: .75; transform: scale(1.06); }
.gtag-thumb.is-active {
    opacity: 1;
    border-color: var(--gtag-accent);
    transform: scale(1.05);
}
.gtag-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

@media (max-width: 480px) {
    .gtag-thumb { width: 56px; height: 40px; }
}
