/* Styles pour le conteneur des cherjournal */
.cherjournal-container {
    position: relative;
    max-width: 660px;
    margin: 0 auto;
    overflow: visible; /* Changé de hidden à visible */
    min-height: 500px; /* Hauteur minimum au lieu de height fixe */
    height: auto;
}
/* Style pour chaque cherjournal */
.cherjournal-item {
    background: linear-gradient(to bottom right, rgba(159, 196, 247, 1), rgba(220, 241, 243, 1) 99.58%);
    border-radius: 20px;
    padding: 15px;
    color: white;
    transition: none !important;
    position: absolute;
    width: 100%;
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
    transform-origin: center;
    height: auto;
}



/* Animation pour la nouvelle cherjournal */
.cherjournal-item.new-cherjournal {
    background-color: rgba(239, 68, 176, 0.2); /* Rose avec transparence */
    animation: fadeInBackground 2s ease-out forwards;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 2s ease;
    z-index: 3;
}

@keyframes fadeInBackground {
    from {
        background-color: rgba(239, 68, 176, 0.2);
    }
    to {
        background-color: var(--background-color, transparent);
    }
}

.cherjournal-item.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.cherjournal-item.previous {
    transform: translateY(-100%);
    opacity: 0;
    z-index: 1;
}

.cherjournal-item.next {
    transform: translateY(100%);
    opacity: 0;
    z-index: 1;
}

.cherjournal-item.sliding-previous {
    transform: translateY(-100%);
}

.cherjournal-item.sliding-next {
    transform: translateY(100%);
}

.cherjournal-item::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background-image: linear-gradient(45deg, #5b7fae, #5b7fae 10%, transparent 30%, transparent 70%, #5b7fae 90%, #5b7fae);
    background-size: 200% 200%;
    animation: border-flow 20s cubic-bezier(0.64, 0.04, 0.35, 1) infinite;
    z-index: 1;
    border-radius: inherit;
    mix-blend-mode: lighten;
    pointer-events: none;
    filter: blur(1.5px);
}

@keyframes border-flow {
    0% {
        background-position: 0% 0%;
    }

    80% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

.cherjournal-item.active:hover {
    box-shadow: 0 15px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.cherjournal-item:hover {
    transform: none;
    box-shadow: none;
}

.cherjournal-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 0.8rem;
    color: #666;
    box-sizing: border-box;
    width: 100%;
}

/* Modification du layout pour le thème grand uniquement */
.cherjournal-widget-grand .cherjournal-header {
    flex-direction: column;
    align-items: stretch;
}
.cherjournal-anonyme {
    font-style: italic;
    display: flex;
    align-items: center;
    color: inherit;
    margin-left: 0; /* Supprimer le margin-left: auto */
    max-width: 100%; /* S'assure que l'élément ne dépasse pas son parent */
    white-space: normal; /* Permet le retour à la ligne */
}

/* Définition des couleurs pour les différents genres */
:root {
    --color-male: rgb(69, 111, 167);     /* Bleu pastel */
    --color-female: rgb(154, 91, 128);   /* Rose pastel */
    --color-other: rgb(230, 213, 185);    /* Beige pastel */
}

.cherjournal-anonyme[data-color="blue"] {
    color: var(--color-male);
}

.cherjournal-anonyme[data-color="pink"] {
    color: var(--color-female);
}

.cherjournal-anonyme[data-color="beige"] {
    color: var(--color-other);
}

.cherjournal-anonyme span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    margin-top: -3px;
    vertical-align: middle;
    background-color: currentColor;
    order: -1;
}



.cherjournal-bloc {
    background: white;
    border-radius: 20px;
    width: 100%;
    position: relative;
    padding-top: 10px;
}

.cherjournal-petit .cherjournal-bloc  {
    padding-top: 0;
}

.cherjournal-bloc::before {
    content: '';
    display: block;
    width: 100%;
    text-align: center;
    background: url('../images/logo.png') center no-repeat;
    background-size: contain;
    height: 55px;
}

.cherjournal-petit .cherjournal-bloc::before {
    display: none;
    /*position: absolute;
    text-align: right;
    background: url('../images/matatabi.ico') right no-repeat;
    background-size: contain;
    height: 25px;
    margin-top: 3px;
    right: 15px;
    z-index: 10;
    opacity:0.3;
    filter: grayscale(100%); */
}

.cherjournal-content {
    font-size: 1.1rem;
    color: black;
    border-radius: 20px;
    padding: 1rem 1rem 1rem 6rem;
    background: white;
    position: relative;
    opacity: 1;
    margin-bottom: 0;
}


.cherjournal-content::before {
    content: '"';
    position: absolute;
    top: 0;
    left: 1rem;
    width: 140px;
    font-size: 8em;
    color: rgba(91, 127, 173, 0.22);
    line-height: 1;
    font-family: Georgia, serif;
}

.cherjournal-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;  /* Changé à flex-start pour aligner à gauche */
    gap: 0.2rem;
}

.cherjournal-date {
    font-size: 0.75rem;      /* Réduit la taille de police */
    color: #6c8fbd;
    display: inline-block;
    margin-left: 10px;
}

.cherjournal-mesuremeter {
    height: 90px;
    margin-top: 0;
    transform: translateY(-1px);
    position: relative;
    opacity: 1;
}

.cherjournal-left {
    flex: 0 0 23%; /* changé de 20% à 23% */
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 1rem;
    align-self: flex-start;
    width: 23%; /* Ajuster aussi la largeur fixe */
    min-width: 120px; /* Largeur minimum pour éviter qu'elle ne devienne trop petite */
    overflow: hidden; /* Pour empêcher le débordement */
    overflow-wrap: break-word; /* Permet le retour à la ligne des mots longs */
    word-wrap: break-word; /* Pour la compatibilité */
    word-break: break-word; /* Évite les débordements */
    hyphens: auto; /* Ajoute des tirets si nécessaire */
    box-sizing: border-box;
    margin-right: 2%;
}

/* Modification du layout pour le thème grand uniquement */
.cherjournal-widget-grand .cherjournal-left {
    width: 100%;
    margin-right: 0;
    margin-left: 25px;
    margin-top:-10px;
    flex: none;
    padding-top: 0;
}

.cherjournal-right {
    flex: 1; /* Prend tout l'espace restant */
    display: flex;
    justify-content: flex-end; /* Aligne le contenu à droite */
    align-items: center;
    box-sizing: border-box;
    width: 75%;
    flex: 0 0 75%;
    position: relative;
}

/* Modification du layout pour le thème grand uniquement */
.cherjournal-widget-grand .cherjournal-right {
    width: 100%;
    flex: none;
}

/*ajout style pour le titre*/
.cherjournal-title {
    color: white;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    white-space: normal; /* Changé de pre-wrap à normal */
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem 0 0;
    line-height: 1.8rem;
    max-width: 100%; /* S'assurer que le titre ne dépasse pas son conteneur */
    word-break: normal; /* Empêche la coupure des mots */
    overflow-wrap: break-word; /* Permet le retour à la ligne sur les mots entiers */
    hyphens: none; /* Désactive la césure automatique */
    display: inline-block;
}

/* Styles pour le bouton de signalement */
.report-cherjournal-btn {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.report-cherjournal-btn i {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.report-cherjournal-btn:hover {
    background: rgba(255, 68, 68, 0.2);
}

.report-cherjournal-btn:hover i {
    color: rgba(255, 68, 68, 0.9);
}

/* Animation tutoriel swipe */
@keyframes swipeArrowAnimation {
    0% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(20px); opacity: 1; }
    100% { transform: translateY(0); opacity: 0.8; }
}

.swipe-tutorial {
    position: absolute;
    left: calc(63% - 385px);
    top: 35%;
    transform: translateY(-50%);
    z-index: 990;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
}

.swipe-tutorial .instruction-text {
    color: rgb(212, 212, 212);
    font-size: 12px;
    font-weight: bold;
    font-style: italic;
    opacity: 0.8;
    margin: 20px 0 0 0;
    text-shadow: 0 0 5px rgba(0,0,0,0.3);
    max-width: 100px;
    line-height: 1.2;
    word-wrap: break-word;
    text-align: center;
    display: block;
}

@media (max-width: 1200px) {
    .swipe-tutorial {
        left: 40px;
    }
}

@media (max-width: 768px) {
    .swipe-tutorial {
        left: 20px;
    }
}

.swipe-tutorial.visible {
    opacity: 1;
}

.swipe-tutorial .arrow {
    color: white;
    font-size: 24px;
    animation: swipeArrowAnimation 2s infinite ease-in-out;
    opacity: 0.8;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.3));
}

.swipe-tutorial .arrow.up {
    animation-delay: 0s;
}

.swipe-tutorial .arrow.down {
    animation-delay: 0.3s;
}




/* Styles pour le mode inline */
.cherjournal-item.inline-mode {
    position: static;
    opacity: 1;
    transform: none;
    margin: 1rem 0;
    height: auto;
    max-width: 100%;
    transition: transform 0.3s ease;
}

.cherjournal-item.inline-mode:hover {
    transform: translateY(-5px);
}

.cherjournal-item.inline-mode .cherjournal-header {
    flex-direction: column;
}

.cherjournal-item.inline-mode .cherjournal-content {
    font-size: 1rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.cherjournal-item.inline-mode .cherjournal-title {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}




/* Thème Petit - Styles similaires aux article-card de index.php et style.css */

a.cherjournal-widget {
    text-decoration: none;
}

.cherjournal-widget-petit {
    width: 100%;
    height: 330px;
    max-width: 260px; 
    min-width: 0; /* Suppression de la largeur min */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    flex: 1; /* Permet l'expansion */
    box-sizing: border-box;
}

.cherjournal-widget {
    display: block; /* Changé en block */
    width: 100%; /* Prend toute la largeur disponible */
}

.cherjournal-item.cherjournal-petit {
    background-color: #fff;
    border-radius: 10px;
    padding: 10px;
    color: #333;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%; /* Force la pleine largeur */
    height: 330px;
}

.cherjournal-petit .cherjournal-anonyme {
    font-size: 0.7rem;

}

.cherjournal-item.cherjournal-petit .cherjournal-header {
    flex-direction: column;
    align-items: flex-start; /* Optionnel : aligne les éléments à gauche */
}

/* Assurer que les blocs prennent toute la largeur */
.cherjournal-item.cherjournal-petit .cherjournal-left,
.cherjournal-item.cherjournal-petit .cherjournal-right {
    display: block;
    width: 100%;
    flex: none; /* Supprimer les propriétés flex par défaut */
}

/* Optionnel : Ajuster les marges et les paddings si nécessaire */
.cherjournal-item.cherjournal-petit .cherjournal-left {
    padding-top: 0;
}



.cherjournal-item.cherjournal-petit:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cherjournal-item.cherjournal-petit .cherjournal-header {
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: #333;
}

.cherjournal-item.cherjournal-petit .cherjournal-content {
    font-size: 0.9rem;
    color: #333;
    padding: 1rem;
    line-height: 1.2;
    height: 260px;
    overflow: hidden;
    position: relative;
}
.cherjournal-item.cherjournal-petit .cherjournal-content p {
    text-indent: 3.5em;
    display: -webkit-box;           
    -webkit-line-clamp: 13;          
    -webkit-box-orient: vertical; 
    overflow: hidden;            
    text-overflow: ellipsis;    
    margin-top: 15px; 
}

.cherjournal-petit h3 {
    font-size: clamp(0.9em, 1.3em, 1.3em);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}



/* Bouton de signalement pour le thème Petit */
.cherjournal-item.cherjournal-petit .report-cherjournal-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}


.cherjournal-item.cherjournal-petit .report-cherjournal-btn i {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.cherjournal-item.cherjournal-petit .report-cherjournal-btn:hover {
    background: rgba(255, 68, 68, 0.2);
}

.cherjournal-item.cherjournal-petit .report-cherjournal-btn:hover i {
    color: rgba(255, 68, 68, 0.9);
}

.cherjournal-item.cherjournal-petit.active:hover {
    transform: none;
}

/* Colonne de gauche */
.left-column {
    position: relative;
    z-index: 1;
    top: 0;
    transition: transform 0.3s ease;
}

/* Colonne de droite */
.right-column {
    min-width: 0;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1;
    position: relative;
}

/* Media query - uniquement structure */
@media (max-width: 768px) {
    .cherjournal-page {
max-height: 888px !important;
}
    .cherjournal-content {
text-indent: 15%;
padding: 1rem 1rem 1rem 2rem;
}

    .cherjournal-content.next,  .cherjournal-content.end-message {
text-indent: 0 !important;
}
    .cherjournal-item {
        will-change: transform;
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-transform-style: preserve-3d;
    }

    /* Réduire les effets coûteux en performance sur mobile */
    .cherjournal-item::before {
        filter: none; /* Supprimer le blur qui est coûteux */
        animation: none; /* Désactiver l'animation du gradient sur mobile */
    }

    .cherjournal-bloc {
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
    }
    
.three-columns-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.center-column {
    transform: scale(0.7);
    transform-origin: top;
       transform:scale(0.7);
       margin-left: -25%;
       
    }
   .cherjournal-container {
        min-width: 400px; /* Ajout du min-width ! */
        box-sizing: border-box;
margin: initial!important;
min-height: initial!important;
height: initial !important;
}
 
       
 .deblok {
        padding: 20px !important;
        margin-top: -86px;
    }
    
}

@media (max-width: 580px) {

    .cherjournal-widget-petit {
        height: auto;
        max-width: 100%;
    }
}


.deblok {
    width: 100%;
    text-align: center;
    padding: 30% 0;
}
.deblok i.fa-key {
    font-size: 5em;
    color: #fff;
    opacity: 0.1;
}

/* Styles pour le cherJournal de navigation */
.cherjournal-item.navigation-cherjournal .cherjournal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    min-height: 300px;
}

.cherjournal-item.navigation-cherjournal h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #5b7fae;
}

.cherjournal-item.navigation-cherjournal p {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: #666;
}

.cherjournal-item.navigation-cherjournal .load-next-page {
    background: linear-gradient(45deg, #5b7fae, #ef4444);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 176, 0.2);
}

.cherjournal-item.navigation-cherjournal .load-next-page:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(68, 172, 238, 0.3);
}

.cherjournal-item.navigation-cherjournal .load-next-page i {
    margin-right: 0.5rem;
}

/* Force le mesuremeter à ignorer les contraintes du viewport pendant la capture */
.cherjournal-item.capturing .desire-meter-wrapper {
    width: 100% !important;
    min-width: 473px !important;
    position: relative !important;
}
