/* Styles personnalisés du thème Terrena */

/* Variables CSS globales */
:root {
    --terrena-primary: #2563EB;
    --terrena-secondary: #10B981;
    --terrena-accent: #F59E0B;
    --terrena-text: #333333;
    --terrena-text-light: #666666;
    --terrena-border: #E5E5E5;
    --terrena-background: #FFFFFF;
    --terrena-surface: #F9FAFB;
}

/* Styles de base */
body {
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--terrena-text);
}

/* Polices pour les titres */
h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-site-title {
    font-weight: 700;
}

/* Police pour le corps de texte */
p, .wp-block-paragraph,
.wp-block-list,
.wp-block-quote {
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Utilitaires */
.terrena-text-center {
    text-align: center;
}

.terrena-mb-0 {
    margin-bottom: 0;
}

.terrena-hidden {
    display: none;
}

/* Styles pour les catégories personnalisées */
.wp-block-post-terms {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.terrena-category-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 8px 0;
    border-radius: 100px;
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    color: var(--wp--preset--color--text-main);
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.terrena-category-tag:hover {
    opacity: 0.8;
    text-decoration: none;
}

.terrena-category-tag:focus {
    outline: 2px solid var(--wp--preset--color--text-main);
    outline-offset: 2px;
}

/* Styles pour le lien auteur dans le binding redige-le-par */
.terrena-author-link {
    text-decoration: underline;
    color: inherit;
}

.terrena-author-link:hover {
    text-decoration: none;
}


/* Styles pour les liens englobants */
.link-wrapper{
    position:relative;
}

.link-wrapper .link-target a::before,
.link-wrapper  a.link-target::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    z-index:1;
}

.link-target a,
a.link-target{
	text-decoration:inherit;
}

.link-wrapper a[href]:not(.link-target):not(.link-target a) {
    position: relative;
    z-index: 2;
}

.link-wrapper.strict-wrapper{
    overflow:hidden
}

.link-wrapper.strict-wrapper .link-target a::before,
.link-wrapper.strict-wrapper a.link-target::before{
    content:'';
    position:absolute;
    top:-50vw;
    left:-50vw;
    right:-50vw;
    bottom:-50vw;
}

figure.has-caption.wp-block-post-featured-image{
    height:auto !important;
}

figure.has-caption.wp-block-post-featured-image figcaption{
    font-size:var(--wp--preset--font-size--17);
    color:var(--wp--preset--color--text-soft);
    font-weight:700;
    line-height:1.35;
    margin-top:var(--wp--preset--spacing--8);
}

.wp-block-post-author__name{
    font-size:var(--wp--preset--font-size--18);
    font-weight:700;
    line-height:1.5;
}

.wp-block-post-author__content{
    gap:var(--wp--preset--spacing--4);
}

.wp-block-post-author__bio{
    margin:0;
    font-size:var(--wp--preset--font-size--16);
}

/* Brevo form */
.brevo-subscribe-form { 
    max-width: 480px; 
    width: 100%;
    margin: 0 auto;
}

.brevo-field { 
    margin-top: var(--wp--preset--spacing--16); 
}

/* Input wrapper pour label flottant */
.brevo-input-wrapper {
    position: relative;
    width: 100%;
}

.brevo-input-wrapper input[type="email"] {
    width: 100%;
    height: 40px;
    padding: 8px 16px;
    background-color: var(--wp--preset--color--bg-input);
    border: 1px solid var(--wp--preset--color--border-light);
    border-radius: 3px;
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--wp--preset--font-size--16);
    font-weight: 400;
    color: var(--wp--preset--color--text-main);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.brevo-input-wrapper input[type="email"]:focus {
    border-color: var(--wp--preset--color--text-main);
}

.brevo-input-wrapper label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--wp--preset--font-size--16);
    font-weight: 400;
    color: var(--wp--preset--color--text-soft);
    pointer-events: none;
    transition: all 0.2s ease;
    background-color: var(--wp--preset--color--bg-input);
    padding: 0 4px;
}

.brevo-input-wrapper input[type="email"]:focus + label,
.brevo-input-wrapper input[type="email"]:not(:placeholder-shown) + label {
    top: 0;
    font-size: var(--wp--preset--font-size--14);
    color: var(--wp--preset--color--text-main);
}

/* Select wrapper pour label flottant */
.brevo-select-wrapper {
    position: relative;
    width: 100%;
}

.brevo-select-wrapper-popup {
    overflow: visible;
}

.brevo-select-wrapper label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--wp--preset--font-size--16);
    font-weight: 400;
    color: var(--wp--preset--color--text-soft);
    pointer-events: none;
    transition: all 0.2s ease;
    background-color: var(--wp--preset--color--bg-input);
    padding: 0 4px;
    z-index: 1;
}

.brevo-select-wrapper.is-focused label,
.brevo-select-wrapper:has(.has-value) label {
    top: -10px;
    transform: translateY(0);
    font-size: var(--wp--preset--font-size--14);
    color: var(--wp--preset--color--text-main);
}

/* .brevo-select-wrapper.has-value label {
    z-index: 0;
} */

.brevo-select-wrapper-popup .vscomp-wrapper {
    position: static !important;
}

.brevo-select-wrapper .virtual-select {
    width: 100%;
    height: 40px;
    background-color: var(--wp--preset--color--bg-input);
    border: 1px solid var(--wp--preset--color--border-light);
    border-radius: 3px;
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--wp--preset--font-size--16);
    font-weight: 400;
    color: var(--wp--preset--color--text-main);
    box-sizing: border-box;
}

.brevo-select-wrapper .virtual-select:focus {
    border-color: var(--wp--preset--color--text-main);
}



/* Bouton submit */
.brevo-subscribe-form button[type="submit"] {
    width: 100%;
    max-width: 240px;
    height: 48px;
    background-color: var(--wp--preset--color--bg-button);
    border: none;
    border-radius: 5px;
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--wp--preset--font-size--18);
    font-weight: 700;
    color: var(--wp--preset--color--text-reverse);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: var(--wp--preset--spacing--16) auto 0;
}

.brevo-select-wrapper-popup .vscomp-dropdown {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    margin-top: var(--wp--preset--spacing--12);
    box-shadow: none !important;
}

.brevo-select-wrapper-popup .vscomp-options-container {
    max-height: 240px !important;
}

.brevo-subscribe-form button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.brevo-subscribe-form button[type="submit"]:active {
    transform: translateY(0);
}

.brevo-subscribe-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.brevo-message { 
    margin-top: var(--wp--preset--spacing--12); 
    font-size: var(--wp--preset--font-size--14); 
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.brevo-message.is-success { 
    color: var(--wp--preset--color--text-success); 
}

.brevo-message.is-error { 
    color: var(--wp--preset--color--text-alert); 
}

/* Styles pour Virtual Select personnalisé */
.brevo-select-wrapper .vscomp-wrapper {
    width: 100% !important;
    height: 40px !important;
    border: 1px solid var(--wp--preset--color--border-light) !important;
    border-radius: 3px !important;
    background-color: var(--wp--preset--color--bg-input) !important;
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: var(--wp--preset--font-size--16) !important;
    font-weight: 400 !important;
    color: var(--wp--preset--color--text-main) !important;
    box-sizing: border-box !important;
}

.brevo-select-wrapper .vscomp-wrapper:focus-within {
    border-color: var(--wp--preset--color--text-main) !important;
}

.brevo-select-wrapper .vscomp-toggle-button {
    height: 38px !important;
    padding: 8px 16px !important;
    background-color: transparent !important;
    border: none !important;
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: var(--wp--preset--font-size--16) !important;
    font-weight: 400 !important;
    color: var(--wp--preset--color--text-main) !important;
    box-sizing: border-box !important;
}

.brevo-select-wrapper .vscomp-toggle-button:focus {
    outline: none !important;
}

.brevo-select-wrapper .vscomp-option {
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: var(--wp--preset--font-size--16) !important;
    font-weight: 400 !important;
    color: var(--wp--preset--color--text-main) !important;
    padding: 12px 16px !important;
}

.brevo-select-wrapper .vscomp-option:hover {
    background-color: var(--wp--preset--color--neutral-100) !important;
}

.brevo-select-wrapper .vscomp-option.selected {
    background-color: var(--wp--preset--color--bg-button) !important;
    color: var(--wp--preset--color--text-reverse) !important;
}

.brevo-select-wrapper .vscomp-dropdown {
    border: 1px solid var(--wp--preset--color--border-light) !important;
    border-radius: 3px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    background-color: var(--wp--preset--color--bg-primary) !important;
}

.brevo-select-wrapper .vscomp-searchbox {
    border: 1px solid var(--wp--preset--color--border-light) !important;
    border-radius: 3px !important;
    font-family: rooney-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: var(--wp--preset--font-size--16) !important;
    padding: 8px 12px !important;
}

.brevo-select-wrapper .vscomp-searchbox:focus {
    border-color: var(--wp--preset--color--text-main) !important;
    outline: none !important;
}

body .vscomp-ele{
    max-width:400px;
}

/* Styles pour la navigation des articles */
.wp-block-post-navigation-link {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--12);
}

.wp-block-post-navigation-link a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--wp--preset--color--text-main);
    min-width: 0;
    flex: 1;
}

.wp-block-post-navigation-link a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.wp-block-post-navigation-link__arrow-previous,
.wp-block-post-navigation-link__arrow-next {
    font-size: var(--wp--preset--font-size--20);
    color: var(--wp--preset--color--text-main);
    font-weight: 400;
    line-height: 1;
    flex-shrink: 0;
}

.post-navigation-link__label {
    font-size: var(--wp--preset--font-size--14);
    font-weight: 400;
    line-height: 1.5;
    color: var(--wp--preset--color--text-main);
    margin-bottom: 2px;
}

.post-navigation-link__title {
    font-size: var(--wp--preset--font-size--17);
    font-weight: 700;
    line-height: 1.35;
    color: var(--wp--preset--color--text-main);
}

/* Styles pour les marges des titres dans le contenu des articles */
.wp-block-post-content h2 {
    margin-bottom: 16px;
}

.wp-block-post-content h3 {
    margin-bottom: 8px;
}

.wp-block-post-content h4 {
    margin-bottom: 8px;
}

.wp-block-post-content h5 {
    margin-bottom: 8px;
}

.wp-block-post-content h6 {
    margin-bottom: 4px;
}

/* Réduire le margin-top des éléments qui suivent les titres */
.wp-block-post-content h2 + * {
    margin-block-start: 16px;
}

.wp-block-post-content h3 + * {
    margin-block-start: 8px;
}

.wp-block-post-content h4 + * {
    margin-block-start: 8px;
}

.wp-block-post-content h5 + * {
    margin-block-start: 8px;
}

.wp-block-post-content h6 + * {
    margin-block-start: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-block-post-navigation-link {
        gap: var(--wp--preset--spacing--8);
    }
    
    .post-navigation-link__title {
        font-size: var(--wp--preset--font-size--15);
    }
    
    .post-navigation-link__label {
        font-size: var(--wp--preset--font-size--13);
    }
}

.is-select-pagination select{
    border:1px solid var(--wp--preset--color--border-light);
    border-radius:3px;
    padding:var(--wp--preset--spacing--12) var(--wp--preset--spacing--8);
    font-size:var(--wp--preset--font-size--14);
    text-transform:uppercase;
    letter-spacing:0.4px;
    text-decoration:none;
    transition:all .5s;
    display:inline-block;
    margin-right:var(--wp--preset--spacing--8);
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next{
    border:1px solid var(--wp--preset--color--border-light);
    border-radius:3px;
    padding:var(--wp--preset--spacing--8) var(--wp--preset--spacing--8);
    text-decoration:none;
}

.wp-block-query-pagination-previous::before,
.wp-block-query-pagination-next::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 12px;
    margin-right:var(--wp--preset--spacing--12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='12' viewBox='0 0 8 12' fill='none'%3E%3Cpath d='M6.25 1.41663L1.75 5.91663L6.25 10.4166' stroke='%231C1C19' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    vertical-align: middle;
}

.wp-block-query-pagination-next::after {
    transform: scaleX(-1);
    margin-left:var(--wp--preset--spacing--12);
    margin-right: 0;
}

.wp-block-query-pagination{
    gap:var(--wp--preset--spacing--12);
}
.wabeo-popup-content.brevo-popup-scroll{
    overflow: auto !important;
}
