/**
 * Style Quentin Paper Block v0.7 - VERSION SIMPLIFIÉE
 * Font héritée du thème, pas de styles prédéfinis
 */

/* ==========================================================================
   CONTENEUR PRINCIPAL
   ========================================================================== */


.qba-paper-container {
    /* Layout */
    position: relative;
    margin: 2rem auto;
    padding: 3rem 2.5rem;
    
    /* Apparence papier basique */
    background-color: #fffef7;
    
    /* Texture papier très subtile */
    background-image: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.01) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 0, 0, 0.01) 3px
        );
    
    /* Bordure et ombre */
    border: 1px solid rgba(210, 180, 140, 0.3);
    border-radius: 2px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    
    /* Transitions */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Effet hover */
.qba-paper-container:hover {
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.12),
        0 12px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   PLI DÉCORATIF
   ========================================================================== */

.qba-paper-fold {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent #f5f5f0 transparent transparent;
    filter: drop-shadow(-1px 1px 2px rgba(0, 0, 0, 0.1));
}

/* ==========================================================================
   ZONE DE CONTENU
   ========================================================================== */

.qba-paper-content {
    position: relative;
    z-index: 1;
    min-height: 200px;
    
    /* IMPORTANT : Hérite la font du site */
    font-family: inherit;
    font-size: inherit;
    line-height: 1.8;
    color: inherit;
    color: #444;
}

/* Espacement des blocs enfants */
.qba-paper-content > * {
    margin-bottom: 1rem;
}

.qba-paper-content > *:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   SIGNATURE
   ========================================================================== */
/* ==========================================================================
   SIGNATURE AVEC TEXTE ÉDITABLE
   ========================================================================== */

.qba-paper-signature {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Texte de signature */
.qba-signature-text {
    font-style: italic;
    text-align: right;
    
    color: inherit;
    color: #444;
    
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

/* Plume décorative (toujours affichée si signature activée) */
.qba-paper-signature::after {
    content: '✒';
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 1.2rem;
    opacity: 0.3;
}

/* Style pour l'éditeur RichText */
.qba-signature-text .block-editor-rich-text__editable {
    text-align: right;
    font-style: italic;
}

/* Placeholder dans l'éditeur */
.qba-signature-text .block-editor-rich-text__editable[data-is-placeholder-visible="true"]::before {
    font-style: italic;
    opacity: 0.6;
}


/* ==========================================================================
   TAILLES
   ========================================================================== */

.qba-paper-size-small {
    max-width: 500px;
    padding: 2rem 1.5rem;
}

.qba-paper-size-medium {
    max-width: 700px;
    padding: 3rem 2.5rem;
}

.qba-paper-size-large {
    max-width: 900px;
    padding: 4rem 3.5rem;
}

/* ==========================================================================
   PAPIER LIGNÉ
   ========================================================================== */

.qba-paper-lined .qba-paper-content {
    background-image: repeating-linear-gradient(
        transparent,
        transparent 31px,
        rgba(100, 149, 237, 0.15) 31px,
        rgba(100, 149, 237, 0.15) 32px
    );
    background-attachment: local;
    padding-top: 8px;
}

/* ==========================================================================
   MODE ÉDITEUR
   ========================================================================== */

.editor-styles-wrapper .qba-paper-container {
    min-height: 300px;
}

/* Placeholder */
.qba-paper-container .block-editor-inner-blocks > .block-editor-block-list__layout:empty::before {
    content: 'Cliquez pour ajouter du contenu à votre lettre...';
    display: block;
    padding: 2rem;
    text-align: center;
    color: #999;
    font-style: italic;
}

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

@media (max-width: 768px) {
    .qba-paper-container {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .qba-paper-size-small,
    .qba-paper-size-medium,
    .qba-paper-size-large {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    
    .qba-paper-fold {
        border-width: 0 30px 30px 0;
    }
}

/* ==========================================================================
   IMPRESSION
   ========================================================================== */

@media print {
    .qba-paper-container {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        margin: 0;
        transform: none !important;
    }
    
    .qba-paper-fold {
        display: none;
    }
}

/* ==========================================================================
   ANIMATION D'APPARITION
   ========================================================================== */

@keyframes paper-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qba-paper-container {
    animation: paper-appear 0.4s ease-out;
}
