@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@700&family=Nunito:wght@400&display=swap');
:root {
    --bg-general: #F2FAF6;
    --bg-blocks: #FFFFFF;
    --bg-header: #E4F5EC;
    --border: #CDEBDD;
    --text-heading: #5B4B66;
    --text-body: #4C6259;
    --color-primary: #4FB88F;
    --color-secondary: #FFF3D6;
    --alert-bg: #ff4b4b;
    --color-success: #10B981;
    --color-error: #EF4444;
    --font-heading: 'Quicksand', sans-serif;
    --font-body: 'Nunito', sans-serif;
}
.dark {
    --bg-general: #0F172A;
    --bg-blocks: #1B2340;
    --bg-header: #141B33;
    --border: #2A355C;
    --text-heading: #F1F0FA;
    --text-body: #C7C9DE;
    --color-primary: #7C9EFF;
    --color-secondary: #A78BFA;
    --alert-bg: #750000;
    --color-success: #10B981;
    --color-error: #EF4444;
}
h1, h2, h3, h4, h5, h6,
.fi-header-heading, .fi-modal-heading, .fi-section-header-heading {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    color: var(--text-heading);
}
body, .fi-body, .fi-input, .fi-btn, p, span, label, td, th {
    font-family: var(--font-body) !important;
    font-weight: 400;
}
body {
    background-color: var(--bg-general);
    color: var(--text-body);
}

/* Tailwind force les images en display:block par defaut (Preflight), ce qui empeche
   le centrage via text-align sur le paragraphe parent (comportement de l'editeur riche). */
.prose img {
    display: inline-block;
}
/* Fait suivre au plugin Typography (.prose) les couleurs du theme (clair/sombre)
   au lieu de ses gris fixes par defaut. */
.prose {
    --tw-prose-body: var(--text-body) !important;
    --tw-prose-headings: var(--text-heading) !important;
    --tw-prose-lead: var(--text-body) !important;
    --tw-prose-links: var(--color-primary) !important;
    --tw-prose-bold: var(--text-heading) !important;
    --tw-prose-counters: var(--text-body) !important;
    --tw-prose-bullets: var(--text-body) !important;
    --tw-prose-hr: var(--border) !important;
    --tw-prose-quotes: var(--text-heading) !important;
    --tw-prose-quote-borders: var(--border) !important;
    --tw-prose-captions: var(--text-body) !important;
    --tw-prose-code: var(--text-heading) !important;
    --tw-prose-pre-code: var(--text-body) !important;
    --tw-prose-pre-bg: var(--bg-general) !important;
    --tw-prose-th-borders: var(--border) !important;
    --tw-prose-td-borders: var(--border) !important;
}
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: var(--text-heading) !important;
}
.prose a {
    color: var(--color-primary) !important;
}

/* Filigrane diagonal pour les photos en attente de moderation */
.watermark-pending {
    position: relative;
    display: block;
}
.watermark-pending::after {
    content: 'En attente de moderation';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 4px 16px;
    font-size: 0.7rem;
    font-weight: bold;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
}
/* Editeur Quill (proposition d'histoire) - suit les couleurs du theme */
.ql-toolbar.ql-snow {
    background-color: var(--bg-general);
    border-color: var(--border) !important;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}
.ql-container.ql-snow {
    background-color: var(--bg-blocks);
    border-color: var(--border) !important;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    font-size: 0.875rem;
}
.ql-editor {
    color: var(--text-body);
    min-height: 220px;
}
.ql-editor.ql-blank::before {
    color: var(--text-body);
    opacity: 0.5;
    font-style: normal;
}
.ql-snow .ql-stroke,
.ql-snow .ql-stroke-miter {
    stroke: var(--text-body) !important;
}
.ql-snow .ql-fill,
.ql-snow .ql-picker-label,
.ql-snow .ql-picker-item {
    fill: var(--text-body) !important;
    color: var(--text-body) !important;
}
.ql-snow .ql-picker {
    color: var(--text-body) !important;
}
.ql-snow .ql-picker-options {
    background-color: var(--bg-blocks) !important;
    border-color: var(--border) !important;
}
.ql-toolbar.ql-snow .ql-formats button:hover .ql-stroke,
.ql-toolbar.ql-snow .ql-formats button.ql-active .ql-stroke,
.ql-toolbar.ql-snow .ql-formats button:hover .ql-picker-label,
.ql-toolbar.ql-snow .ql-formats .ql-picker-label:hover .ql-stroke {
    stroke: var(--color-primary) !important;
}
.ql-toolbar.ql-snow .ql-formats button:hover .ql-fill,
.ql-toolbar.ql-snow .ql-formats button.ql-active .ql-fill {
    fill: var(--color-primary) !important;
}
.ql-toolbar.ql-snow .ql-formats button:hover,
.ql-toolbar.ql-snow .ql-formats button.ql-active,
.ql-toolbar.ql-snow .ql-picker-label:hover {
    color: var(--color-primary) !important;
}