/**
 * Torn Divider Module - Styles
 */

/* ================================================
   CONTAINER
   ================================================ */

.cj-torn {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ================================================
   TAILLES - DIAGONAL
   ================================================ */

.cj-torn--diagonal.cj-torn--small {
    height: 40px;
}

.cj-torn--diagonal.cj-torn--medium {
    height: 60px;
}

.cj-torn--diagonal.cj-torn--large {
    height: 90px;
}

/* ================================================
   TAILLES - HORIZONTAL (barres fines)
   ================================================ */

.cj-torn--horizontal.cj-torn--small {
    height: 2px;
}

.cj-torn--horizontal.cj-torn--medium {
    height: 3px;
}

.cj-torn--horizontal.cj-torn--large {
    height: 4px;
}

/* ================================================
   TAILLES - GRADIENT
   ================================================ */

.cj-torn--gradient.cj-torn--small {
    height: 40px;
}

.cj-torn--gradient.cj-torn--medium {
    height: 60px;
}

.cj-torn--gradient.cj-torn--large {
    height: 90px;
}

/* ================================================
   TAILLES - DOTTED (pointillé)
   ================================================ */

.cj-torn--dotted.cj-torn--small {
    height: 2px;
}

.cj-torn--dotted.cj-torn--medium {
    height: 3px;
}

.cj-torn--dotted.cj-torn--large {
    height: 4px;
}

/* ================================================
   LAYERS
   ================================================ */

.cj-torn__layer {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

/* ================================================
   VARIANTE DIAGONAL
   ================================================ */

/* Direction : descend vers la droite */
.cj-torn--diagonal.cj-torn--down-right .cj-torn__layer--back {
    clip-path: polygon(0 0, 100% 40%, 100% 100%, 0 100%);
}

.cj-torn--diagonal.cj-torn--down-right .cj-torn__layer--front {
    clip-path: polygon(0 10%, 100% 50%, 100% 58%, 0 18%);
}

/* Direction : descend vers la gauche */
.cj-torn--diagonal.cj-torn--down-left .cj-torn__layer--back {
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
}

.cj-torn--diagonal.cj-torn--down-left .cj-torn__layer--front {
    clip-path: polygon(0 50%, 100% 10%, 100% 18%, 0 58%);
}

/* ================================================
   VARIANTE HORIZONTAL
   ================================================ */

.cj-torn--horizontal .cj-torn__layer--back {
    display: none;
}

.cj-torn--horizontal .cj-torn__layer--front {
    clip-path: none;
}

/* ================================================
   VARIANTE GRADIENT (fondu)
   ================================================ */

.cj-torn--gradient .cj-torn__layer--back {
    display: none;
}

.cj-torn--gradient .cj-torn__layer--front {
    clip-path: none;
}

/* ================================================
   VARIANTE DOTTED (pointillé)
   ================================================ */

.cj-torn--dotted .cj-torn__layer--back {
    display: none;
}

.cj-torn--dotted .cj-torn__layer--front {
    clip-path: none;
    background: transparent !important;
}

/* ================================================
   STYLES DE COULEURS
   ================================================ */

/* --- ORANGE (accent principal) --- */

/* Orange sur clair */
.cj-torn--orange-light .cj-torn__layer--back {
    background: #f5f2ec;
}

.cj-torn--orange-light .cj-torn__layer--front {
    background: #eb5d0f;
}

/* Orange sur sombre */
.cj-torn--orange-dark .cj-torn__layer--back {
    background: #0b0a09;
}

.cj-torn--orange-dark .cj-torn__layer--front {
    background: #eb5d0f;
}

/* Orange seul */
.cj-torn--orange-only .cj-torn__layer--back {
    display: none;
}

.cj-torn--orange-only .cj-torn__layer--front {
    background: #eb5d0f;
}

/* --- TRANSITIONS FOND --- */

/* Clair vers sombre */
.cj-torn--light-to-dark .cj-torn__layer--back {
    background: #0b0a09;
}

.cj-torn--light-to-dark .cj-torn__layer--front {
    background: #eb5d0f;
}

/* Sombre vers clair */
.cj-torn--dark-to-light .cj-torn__layer--back {
    background: #f5f2ec;
}

.cj-torn--dark-to-light .cj-torn__layer--front {
    background: #eb5d0f;
}

/* --- SUBTIL (sans orange) --- */

/* Ligne claire sur fond sombre */
.cj-torn--light-line .cj-torn__layer--back {
    display: none;
}

.cj-torn--light-line .cj-torn__layer--front {
    background: rgba(245, 242, 236, 0.15);
}

/* Ligne sombre sur fond clair */
.cj-torn--dark-line .cj-torn__layer--back {
    display: none;
}

.cj-torn--dark-line .cj-torn__layer--front {
    background: rgba(21, 19, 15, 0.1);
}

/* --- DÉGRADÉS --- */

/* Dégradé orange vers transparent */
.cj-torn--gradient.cj-torn--orange-fade-down .cj-torn__layer--front {
    background: linear-gradient(to bottom, #eb5d0f, transparent);
}

.cj-torn--gradient.cj-torn--orange-fade-up .cj-torn__layer--front {
    background: linear-gradient(to top, #eb5d0f, transparent);
}

/* Dégradé sombre vers transparent */
.cj-torn--gradient.cj-torn--dark-fade-down .cj-torn__layer--front {
    background: linear-gradient(to bottom, #0b0a09, transparent);
}

.cj-torn--gradient.cj-torn--dark-fade-up .cj-torn__layer--front {
    background: linear-gradient(to top, #0b0a09, transparent);
}

/* Dégradé clair vers transparent */
.cj-torn--gradient.cj-torn--light-fade-down .cj-torn__layer--front {
    background: linear-gradient(to bottom, #f5f2ec, transparent);
}

.cj-torn--gradient.cj-torn--light-fade-up .cj-torn__layer--front {
    background: linear-gradient(to top, #f5f2ec, transparent);
}

/* --- POINTILLÉS --- */

.cj-torn--dotted.cj-torn--orange-only .cj-torn__layer--front {
    background: repeating-linear-gradient(
        to right,
        #eb5d0f 0,
        #eb5d0f 8px,
        transparent 8px,
        transparent 16px
    ) !important;
}

.cj-torn--dotted.cj-torn--light-line .cj-torn__layer--front {
    background: repeating-linear-gradient(
        to right,
        rgba(245, 242, 236, 0.3) 0,
        rgba(245, 242, 236, 0.3) 8px,
        transparent 8px,
        transparent 16px
    ) !important;
}

.cj-torn--dotted.cj-torn--dark-line .cj-torn__layer--front {
    background: repeating-linear-gradient(
        to right,
        rgba(21, 19, 15, 0.15) 0,
        rgba(21, 19, 15, 0.15) 8px,
        transparent 8px,
        transparent 16px
    ) !important;
}

/* ================================================
   BUILDER PREVIEW - Indicateur visuel
   Visible uniquement dans l'éditeur Themify
   ================================================ */

/* Zone de preview pour les barres fines (horizontal/dotted) */
body.themify_builder_active .cj-torn--horizontal,
body.themify_builder_active .cj-torn--dotted {
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(200, 200, 200, 0.15),
            rgba(200, 200, 200, 0.15) 4px,
            rgba(180, 180, 180, 0.08) 4px,
            rgba(180, 180, 180, 0.08) 8px
        );
    border: 1px dashed rgba(128, 128, 128, 0.5);
    border-radius: 3px;
}

/* Dans le builder, les layers des barres fines gardent leur vraie hauteur */
body.themify_builder_active .cj-torn--horizontal .cj-torn__layer,
body.themify_builder_active .cj-torn--dotted .cj-torn__layer {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

body.themify_builder_active .cj-torn--horizontal.cj-torn--small .cj-torn__layer {
    height: 2px;
}
body.themify_builder_active .cj-torn--horizontal.cj-torn--medium .cj-torn__layer {
    height: 3px;
}
body.themify_builder_active .cj-torn--horizontal.cj-torn--large .cj-torn__layer {
    height: 4px;
}

body.themify_builder_active .cj-torn--dotted.cj-torn--small .cj-torn__layer {
    height: 2px;
}
body.themify_builder_active .cj-torn--dotted.cj-torn--medium .cj-torn__layer {
    height: 3px;
}
body.themify_builder_active .cj-torn--dotted.cj-torn--large .cj-torn__layer {
    height: 4px;
}

/* Label informatif pour les barres fines */
body.themify_builder_active .cj-torn--horizontal::after,
body.themify_builder_active .cj-torn--dotted::after {
    content: "Rendu final : " attr(data-height) " de haut";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: rgba(100, 100, 100, 0.9);
    background: rgba(255, 255, 255, 0.85);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .cj-torn--diagonal.cj-torn--small {
        height: 30px;
    }

    .cj-torn--diagonal.cj-torn--medium {
        height: 45px;
    }

    .cj-torn--diagonal.cj-torn--large {
        height: 60px;
    }

    .cj-torn--gradient.cj-torn--small {
        height: 30px;
    }

    .cj-torn--gradient.cj-torn--medium {
        height: 45px;
    }

    .cj-torn--gradient.cj-torn--large {
        height: 60px;
    }
}
