/* ============================================================
   INFOHAS — Styles de l'éditeur de blocs (Gutenberg / FSE)
   Chargés dans l'éditeur WordPress et sur le front-end
   pour les blocs Gutenberg rendus.
   ============================================================ */

/* ---- Variables de l'éditeur ---- */
.editor-styles-wrapper {
    --color-navy: #0A1628;
    --color-sky: #1E90FF;
    --color-sky-dark: #0066CC;
    --color-sky-light: #63B3ED;
    --color-gold: #D4A843;
    --color-gold-light: #F0D78C;
    --color-white: #FFFFFF;
    --color-bg: #FFFFFF;
    --color-text: #334155;
    --color-text-light: #64748B;
    --color-muted: #F8FAFC;
    --color-border: #E2E8F0;

    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;

    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;

    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
}

/* ---- Reset de l'éditeur ---- */
.editor-styles-wrapper *,
.editor-styles-wrapper *::before,
.editor-styles-wrapper *::after {
    box-sizing: border-box;
}

.editor-styles-wrapper p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.editor-styles-wrapper a {
    color: var(--color-sky);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.editor-styles-wrapper a:hover {
    color: var(--color-sky-dark);
    text-decoration: underline;
}

/* ---- Titres ---- */
.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6 {
    color: var(--color-navy);
    font-weight: 700;
    line-height: 1.2;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.editor-styles-wrapper h1 { font-size: clamp(2rem, 5vw, 3rem); }
.editor-styles-wrapper h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
.editor-styles-wrapper h3 { font-size: var(--font-size-xl); }
.editor-styles-wrapper h4 { font-size: var(--font-size-lg); }
.editor-styles-wrapper h5 { font-size: var(--font-size-md); }
.editor-styles-wrapper h6 { font-size: var(--font-size-base); font-weight: 600; }

/* ---- Listes ---- */
.editor-styles-wrapper ul {
    list-style: disc;
    padding-left: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.editor-styles-wrapper ol {
    list-style: decimal;
    padding-left: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.editor-styles-wrapper li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.8;
}

/* ---- Citation / Blockquote ---- */
.editor-styles-wrapper blockquote {
    border-left: 4px solid var(--color-gold);
    padding: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    background: var(--color-muted);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.editor-styles-wrapper blockquote p {
    margin-bottom: var(--spacing-sm);
}

.editor-styles-wrapper blockquote cite {
    display: block;
    font-style: normal;
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    font-weight: 600;
}

/* ---- Code / Pre ---- */
.editor-styles-wrapper code {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    background: var(--color-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--color-sky-dark);
}

.editor-styles-wrapper pre {
    background: var(--color-muted);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--spacing-xl) 0;
}

.editor-styles-wrapper pre code {
    background: none;
    padding: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

/* ---- Images ---- */
.editor-styles-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-lg) 0;
}

.editor-styles-wrapper figure {
    margin: var(--spacing-lg) 0;
    max-width: 100%;
}

.editor-styles-wrapper figcaption {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    text-align: center;
    margin-top: var(--spacing-sm);
}

/* ---- Tableau ---- */
.editor-styles-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-xl) 0;
    font-size: var(--font-size-sm);
}

.editor-styles-wrapper th,
.editor-styles-wrapper td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    text-align: left;
}

.editor-styles-wrapper th {
    background: var(--color-muted);
    font-weight: 700;
    color: var(--color-navy);
}

/* ---- Séparateur / HR ---- */
.editor-styles-wrapper hr {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: var(--spacing-2xl) auto;
    max-width: 200px;
}

.editor-styles-wrapper hr.is-style-wide {
    max-width: 100%;
}

.editor-styles-wrapper hr.is-style-dots {
    background: none;
    text-align: center;
    max-width: none;
}

.editor-styles-wrapper hr.is-style-dots::before {
    content: "···";
    color: var(--color-text-light);
    font-size: var(--font-size-xl);
    letter-spacing: 1em;
}

/* ---- Boutons (blocs) ---- */
.editor-styles-wrapper .wp-block-button {
    margin-bottom: var(--spacing-md);
}

.editor-styles-wrapper .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: var(--font-body);
    line-height: 1;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link {
    border: 2px solid var(--color-sky);
    color: var(--color-sky);
    background: transparent;
}

.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--color-sky);
    color: #fff;
}

.editor-styles-wrapper .wp-block-button.is-style-fill .wp-block-button__link {
    background: var(--color-sky);
    color: #fff;
    border: 2px solid var(--color-sky);
}

/* ---- Colonnes / Columns ---- */
.editor-styles-wrapper .wp-block-columns {
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* ---- Group / Groupe ---- */
.editor-styles-wrapper .wp-block-group {
    margin-bottom: var(--spacing-xl);
}

.editor-styles-wrapper .wp-block-group.has-background {
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
}

/* ---- Cover / Image de couverture ---- */
.editor-styles-wrapper .wp-block-cover {
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 300px;
}

.editor-styles-wrapper .wp-block-cover h2,
.editor-styles-wrapper .wp-block-cover h3 {
    color: #fff;
}

/* ---- Media & Text ---- */
.editor-styles-wrapper .wp-block-media-text {
    margin: var(--spacing-xl) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.editor-styles-wrapper .wp-block-media-text__content {
    padding: var(--spacing-xl);
}

/* ---- Spacer ---- */
.editor-styles-wrapper .wp-block-spacer {
    clear: both;
}

/* ---- Galerie ---- */
.editor-styles-wrapper .wp-block-gallery {
    margin: var(--spacing-xl) 0;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-grid {
    gap: var(--spacing-sm);
}

.editor-styles-wrapper .wp-block-gallery figure {
    margin: 0;
}

/* ---- Accordion / Détails ---- */
.editor-styles-wrapper details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
}

.editor-styles-wrapper details summary {
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.editor-styles-wrapper details summary:hover {
    background: var(--color-muted);
}

.editor-styles-wrapper details[open] {
    border-color: var(--color-sky);
}

.editor-styles-wrapper details[open] > summary {
    border-bottom: 1px solid var(--color-border);
}

/* ---- Navigation (bloc) ---- */
.editor-styles-wrapper .wp-block-navigation {
    font-family: var(--font-body);
}

.editor-styles-wrapper .wp-block-navigation a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.editor-styles-wrapper .wp-block-navigation a:hover {
    color: var(--color-sky);
}

/* ---- Post Content ---- */
.editor-styles-wrapper .wp-block-post-content {
    max-width: 800px;
}

/* ---- File / Fichier ---- */
.editor-styles-wrapper .wp-block-file {
    margin-bottom: var(--spacing-md);
}

.editor-styles-wrapper .wp-block-file .wp-block-file__button {
    background: var(--color-sky);
    color: #fff;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: var(--font-size-sm);
}

/* ---- Pullquote ---- */
.editor-styles-wrapper .wp-block-pullquote {
    border-top: 4px solid var(--color-gold);
    border-bottom: 4px solid var(--color-gold);
    padding: var(--spacing-xl) 0;
    margin: var(--spacing-xl) 0;
    text-align: center;
}

.editor-styles-wrapper .wp-block-pullquote blockquote {
    border: none;
    background: none;
    padding: 0;
    font-size: var(--font-size-xl);
}

.editor-styles-wrapper .wp-block-pullquote cite {
    font-style: normal;
    font-weight: 600;
    color: var(--color-text-light);
}

/* ---- Verse / Poésie ---- */
.editor-styles-wrapper .wp-block-verse {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    line-height: 1.8;
    padding: var(--spacing-lg);
    background: var(--color-muted);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-gold);
}

/* ---- HTML personnalisé ---- */
.editor-styles-wrapper .wp-block-html {
    font-family: 'Fira Code', monospace;
    font-size: var(--font-size-sm);
    background: var(--color-muted);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

/* ---- Formations card (bloc personnalisé) ---- */
.editor-styles-wrapper .formation-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    transition: all var(--transition-base);
}

.editor-styles-wrapper .formation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

/* ---- Testimonial card (bloc personnalisé) ---- */
.editor-styles-wrapper .testimonial-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    position: relative;
}

.editor-styles-wrapper .testimonial-card::before {
    content: "\201C";
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-lg);
    font-size: 4rem;
    color: var(--color-sky);
    opacity: 0.15;
    font-family: Georgia, serif;
    line-height: 1;
}

/* ---- Stats section (bloc personnalisé) ---- */
.editor-styles-wrapper .stat-number {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--color-gold);
    margin-bottom: var(--spacing-xs);
}

.editor-styles-wrapper .stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    font-weight: 500;
}

/* ---- Hero dans l'éditeur ---- */
.editor-styles-wrapper .hero {
    background: var(--color-navy);
    color: #fff;
    padding: var(--spacing-3xl) var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.editor-styles-wrapper .hero__title {
    color: #fff !important;
}

.editor-styles-wrapper .hero__subtitle {
    color: rgba(255,255,255,0.85);
}

/* ---- Largeur du contenu de l'éditeur ---- */
.editor-styles-wrapper .is-root-container {
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

/* ---- Couleurs personnalisées dans l'éditeur ---- */
.editor-styles-wrapper .has-sky-color { color: var(--color-sky); }
.editor-styles-wrapper .has-sky-background-color { background-color: var(--color-sky); }
.editor-styles-wrapper .has-navy-color { color: var(--color-navy); }
.editor-styles-wrapper .has-navy-background-color { background-color: var(--color-navy); }
.editor-styles-wrapper .has-gold-color { color: var(--color-gold); }
.editor-styles-wrapper .has-gold-background-color { background-color: var(--color-gold); }
.editor-styles-wrapper .has-muted-color { color: var(--color-text-light); }
.editor-styles-wrapper .has-muted-background-color { background-color: var(--color-muted); }

/* ---- Placeholder ---- */
.editor-styles-wrapper .is-placeholder {
    opacity: 0.5;
}
