/*
 Theme Name:   J2R Child
 Theme URI:    https://j2r.com
 Description:  Thème enfant Hello Elementor pour J2R - Electric. Raw. Urban.
 Author:       J2R
 Template:     hello-elementor
 Version:      1.0.0
 Text Domain:  j2r-child
*/

/* Preloader — block reveal effect */
html.is-loading {
    overflow-x: hidden !important;
    overflow-y: scroll !important;
}

body.is-loading {
    overflow: hidden !important;
}

.j2r-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    pointer-events: none;
    overflow: hidden;
}

.j2r-preloader__block {
    position: absolute;
    background: #0F0F0F;
    opacity: 1;
    transition: opacity 0.04s ease;
}

.j2r-preloader__block.is-hidden {
    opacity: 0;
}

/* Selection color — brand red */
::selection {
    background: #FF002E;
    color: #ffffff;
}

/* Prevent horizontal scroll globally, force vertical scrollbar */
html {
    overflow-x: hidden;
    overflow-y: scroll;
}

body {
    overflow-x: hidden;
    /* Override Elementor's body background with a relative URL so it loads
       from any host (LAN, production, localhost) instead of hardcoded localhost */
    background-image: url('../../uploads/2026/02/background-j2r-1.png') !important;
}

/* On touch devices: override body overflow to 'clip' so it does NOT become
   a scroll container. This is critical for position:sticky to work relative
   to the viewport (needed by horizontal scroll section).
   CSS rule: overflow-x:hidden auto-computes overflow-y:auto → scroll container.
   overflow:clip does NOT create a scroll container. */
@media (pointer: coarse) {
    body {
        overflow: clip !important;
    }
}

/* Disable CSS smooth scroll — Lenis handles it */
html,
html.lenis,
html.lenis body {
    scroll-behavior: auto !important;
}

/* Full-width fluid text — JS auto-sizes, CSS just ensures no wrap */
.j2r-fluid-text {
    overflow: visible;
}

.j2r-fluid-text .elementor-heading-title {
    white-space: nowrap;
    line-height: 1 !important;
    display: block;
    background: linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.45)), var(--j2r-grunge) repeat, #ffffff;
    background-blend-mode: normal, multiply;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* --- 3D Logo Container --- */
.logo3d-container {
    width: 650px;
    height: 260px;
    cursor: pointer;
    margin: 0 auto;
}

.logo3d-container canvas {
    display: block;
}

@media (max-width: 768px) {
    .logo3d-container {
        width: 320px;
        height: 140px;
    }
}

/* --- Moto Charge Sequence (scroll-driven) --- */
.j2r-moto-charge {
    position: relative;
}

.j2r-moto-charge__sticky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1000px;
    overflow: hidden;
    z-index: 2;
}

.j2r-moto-charge__img {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    max-height: 1000px;
    max-width: none;
    width: auto;
    object-fit: contain;
    opacity: 0;
}

.j2r-moto-charge__img.is-active {
    opacity: 1;
}

/* Laptop / petit desktop */
@media (max-width: 1440px) {
    .j2r-moto-charge__sticky { height: 850px; }
    .j2r-moto-charge__img { max-height: 850px; }
}

/* Petit laptop */
@media (max-width: 1280px) {
    .j2r-moto-charge__sticky { height: 700px; }
    .j2r-moto-charge__img { max-height: 700px; bottom: -30px; }
}

/* --- Newsletter Toast Notification --- */
.j2r-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    padding: 14px 24px;
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.j2r-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.j2r-toast.is-success {
    color: #00ff8b;
    border: 1px solid #00ff8b;
    box-shadow: 0 0 20px rgba(0, 255, 139, 0.4), 0 0 60px rgba(0, 255, 139, 0.15);
}
.j2r-toast.is-error {
    color: #ff002e;
    border: 1px solid #ff002e;
    box-shadow: 0 0 20px rgba(255, 0, 46, 0.4), 0 0 60px rgba(255, 0, 46, 0.15);
}
.j2r-toast.is-warning {
    color: #ff8c00;
    border: 1px solid #ff8c00;
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.4), 0 0 60px rgba(255, 140, 0, 0.15);
}
@media (max-width: 768px) {
    .j2r-toast {
        top: 70px;
        right: 12px;
        left: 12px;
        padding: 10px 16px;
        font-size: 12px;
    }
    .j2r-toast.is-success {
        background: rgba(0, 255, 139, 0.12);
    }
    .j2r-toast.is-error {
        background: rgba(255, 0, 46, 0.12);
    }
    .j2r-toast.is-warning {
        background: rgba(255, 140, 0, 0.12);
    }
}

/* --- Red Corner Accents (newsletter section) --- */
.j2r-corners {
    position: relative;
}

.j2r-corners .elementor-widget-html,
.j2r-corners .elementor-widget-html .elementor-widget-container {
    position: static !important;
}

.j2r-corner-tl,
.j2r-corner-br {
    position: absolute;
    width: 70px;
    height: 40px;
    pointer-events: none;
    z-index: 2;
    transition: top 0.4s ease, left 0.4s ease, bottom 0.4s ease, right 0.4s ease;
}

.j2r-corner-tl {
    top: 0;
    left: 0;
    border-top: 2px solid #FF002E;
    border-left: 2px solid #FF002E;
}

.j2r-corner-br {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid #FF002E;
    border-right: 2px solid #FF002E;
}

.j2r-corners:hover .j2r-corner-tl {
    top: 30px !important;
    left: 30px !important;
}

.j2r-corners:hover .j2r-corner-br {
    bottom: 30px !important;
    right: 30px !important;
}

/* --- Fixed progressive blur at bottom of viewport --- */
.j2r-blur-gradient {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    width: 100dvw;
    height: 160px;
    pointer-events: none;
    z-index: 990;
    overflow: hidden;
}

/* Mobile: extend below viewport to cover Safari/Chrome toolbar gap */
@media (max-width: 767px) {
    .j2r-blur-gradient {
        bottom: -20px;
        height: 180px;
    }
}

.j2r-blur-gradient > div {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* --- Text Reveal (blur + slide-up, word by word) --- */
.j2r-word {
    display: inline-block;
    max-width: 100%;
    opacity: 0;
    filter: blur(8px);
    transform: translateY(12px);
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
}

.j2r-text-reveal.is-visible .j2r-word {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .j2r-word {
        opacity: 1;
        filter: none;
        transform: none;
        transition: none;
    }
}

/* --- Fix MDW Horizontal Scroll on tablet/mobile --- */
.mdw-horizontal-scroll {
    --min-height: 100vh !important;
}

/* Horizontal scroll on touch devices — CSS variable driven by JS,
   !important transform blocks MDW inline styles from conflicting */
@media (pointer: coarse) {
    .mdw-horizontal-scroll {
        overflow: clip !important;
    }
    .mdw-horizontal-scroll > .e-con,
    .mdw-horizontal-scroll > .e-container {
        position: sticky !important;
        top: 0 !important;
        left: auto !important;
        will-change: transform;
        transform: translateX(var(--j2r-tx, 0)) !important;
    }
}

/* --- Autoscroll responsive --- */
@media (max-width: 767px) {
    .j2r-autoscroll__slide {
        width: 46vw !important;
    }
}



/* --- Wheelie icon animation (reusable on any button) --- */
.j2r-btn-wheelie .elementor-button-icon {
    transform-origin: 17% 74%;          /* rear wheel center */
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
}

.j2r-btn-wheelie .elementor-button-icon svg {
    width: 1.35em;                      /* ~5px bigger than btn text */
    height: auto;
}

.j2r-btn-wheelie .elementor-button:hover .elementor-button-icon {
    transform: rotate(-32deg);
}
