/* ==========================================
   SLIDE ENHANCE — STRATUL 2
   Tranziții cinematografice între slide-uri:
   - Parallax zoom pe bg-img în timpul cortinei
   - Linie cupru care fulgeră la seam
   - Titlu cu reveal vertical mask
   - Contor slide (01 / 06)
   Hookuri: detectează tranziția prin clasele animating-in/out
   adăugate de JS_SiteMobila.js (nu-l modificăm).
   ========================================== */

/* ---------- 1. Parallax/zoom pe .bg-img în timpul tranziției ---------- */
/* SWIPE-UP: cortina slide-ului curent se deschide, bg-img-ul lui zoom-out */
body.swipe-up .slide.animating-out .bg-img {
    animation: sl-bgZoomOut 0.95s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}
/* SWIPE-UP: slide-ul revelat (static în spate) — bg-img relaxează spre 1.0 */
body.swipe-up .slide.animating-in .bg-img {
    animation: sl-bgZoomReveal 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
/* SWIPE-DOWN: slide-ul nou care se închide peste curentul */
body.swipe-down .slide.animating-in .bg-img {
    animation: sl-bgZoomReveal 0.95s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes sl-bgZoomOut {
    from { transform: scale(1.0); }
    to   { transform: scale(1.12); }
}
@keyframes sl-bgZoomReveal {
    from { transform: scale(1.1); }
    to   { transform: scale(1.0); }
}

/* ---------- 2. Linie accent cupru — fulgeră la seam ---------- */
/* Position absolute în .slider-wrapper ca să folosească același sistem
   de coordonate ca .split-card-wrapper (evită bug-ul iOS 100vh vs visual viewport
   care punea linia mai sus decât seam-ul cardului când bara URL era vizibilă). */
.transition-accent {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    margin-top: -0.5px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(192, 133, 82, 0.0) 8%,
        rgba(192, 133, 82, 0.95) 50%,
        rgba(192, 133, 82, 0.0) 92%,
        transparent 100%);
    z-index: 200;
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(192, 133, 82, 0.55);
    transition: opacity 0.4s ease;
}
.transition-accent.is-flashing {
    animation: sl-accentFlash 0.9s cubic-bezier(0.77, 0, 0.175, 1);
}
@keyframes sl-accentFlash {
    0%   { transform: scaleX(0); opacity: 0; }
    35%  { transform: scaleX(1); opacity: 1; }
    70%  { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}

/* ---------- 3. Titlu pe card — reveal cu mask vertical ---------- */
.project-title {
    overflow: hidden;
    display: block;
    line-height: 1.15; /* extra spațiu vertical ca să nu taie descenders */
}
.project-title-inner {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.75s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: transform;
}
.slide.active .project-title-inner {
    transform: translateY(0);
}
.slide.animating-in .project-title-inner {
    transform: translateY(0);
    transition-delay: 0.4s;
}
.slide.animating-out .project-title-inner {
    transform: translateY(-110%);
    transition-delay: 0s;
    transition-duration: 0.5s;
}

/* Detaliile cardului (ex. „Custom Made · Premium") apar cu un mic decalaj */
.project-details {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.slide.active .project-details,
.slide.animating-in .project-details {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.55s;
}
.slide.animating-out .project-details {
    opacity: 0;
    transform: translateY(-3px);
    transition-delay: 0s;
    transition-duration: 0.3s;
}

/* ---------- 4. Contor slide (01 / 06) ---------- */
.slide-counter {
    position: fixed;
    bottom: 32px;
    left: 28px;
    z-index: 500;
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    font-feature-settings: 'tnum';
    transition: opacity 0.4s ease;
}
.slide-counter-current {
    display: inline-block;
    min-width: 1.5em;
    transition: transform 0.35s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease;
}
.slide-counter.is-changing .slide-counter-current {
    transform: translateY(-6px);
    opacity: 0;
}
.slide-counter-sep,
.slide-counter-total {
    opacity: 0.55;
}

body.menu-open .slide-counter,
body.menu-open .transition-accent {
    opacity: 0;
}

@media (max-width: 480px) {
    .slide-counter {
        bottom: 28px;
        left: 22px;
        font-size: 0.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .transition-accent { display: none; }
    .project-title-inner,
    .project-details {
        transition: none;
        transform: none;
        opacity: 1;
    }
    body.swipe-up .slide.animating-out .bg-img,
    body.swipe-up .slide.animating-in .bg-img,
    body.swipe-down .slide.animating-in .bg-img { animation: none; }
}
