/************************************************************/
/*
/*      Typography CSS
/*
/*      Author: Marc-Antoine Brassard
/*      Created: 2026-03-20
/*      Last modified: 2026-09-03
/*
/************************************************************/
.wp-site-blocks * {
	-webkit-font-smoothing: antialiased;
}

:is(.wp-site-blocks, .is-root-container) {
	h1, h2, h3, h4, h5, h6, big, p, span, label, blockquote, q, b, strong, i, em, mark, small, li, dt, dd {
		word-break: keep-all;
		word-wrap: normal;
		
		&:is(h1, h2, h3, h4, h5, h6, big) {
			text-wrap: balance;
		}
		
		&:is(p, span, label, blockquote, q, b, strong, i, em, mark, small, li, dt, dd) {
			text-wrap: pretty;
		}
	}

    .h1 {
        font-family: var(--wp--preset--font-family--fifties-vf) !important;
        font-size: var(--wp--preset--font-size--3-x-large) !important;
        line-height: var(--wp--custom--line-height--x-small);
        font-weight: 600 !important;
    }

    .h2 {
        font-family: var(--wp--preset--font-family--fifties-vf) !important;
        font-size: var(--wp--preset--font-size--2-x-large) !important;
        line-height: var(--wp--custom--line-height--x-small);
        font-weight: 600 !important;
    }

    .h3 {
        font-family: var(--wp--preset--font-family--late-serif-variable) !important;
        font-size: var(--wp--preset--font-size--x-large) !important;
        line-height: var(--wp--custom--line-height--medium);
        font-weight: 400 !important;
    }

    .h4 {
        font-family: var(--wp--preset--font-family--fifties-vf) !important;
        font-size: var(--wp--preset--font-size--x-large) !important;
        line-height: var(--wp--custom--line-height--x-small);
        font-weight: 600 !important;
    }

    .h5 {
        font-family: var(--wp--preset--font-family--late-serif-variable) !important;
        font-size: var(--wp--preset--font-size--x-large) !important;
        line-height: var(--wp--custom--line-height--medium);
        font-weight: 400 !important;
    }

    .h6 {
        font-family: var(--wp--preset--font-family--late-serif-variable) !important;
        font-size: var(--wp--preset--font-size--large) !important;
        line-height: var(--wp--custom--line-height--medium);
        font-weight: 400 !important;
    }

    
    a[href]:not(.wp-block-button__link) {
        transition: color var(--wp--custom--duration--short);
        
        .wp-block-post-content :not(.has-text-color) > &:not(:hover, :focus,:active) {
            color: var(--wp--custom--color--default--accent);
        }
    }

    /* Necessary since WP added CSS code that breaks <p> font-size */
    p:is(p) {
        font-size: var(--wp--preset--font-size--medium-small);
    }
}

@media (width <= 500px) {
    :is(.wp-site-blocks, .is-root-container) {
        h1, h2, h3, h4, h5, h6, p, span, label, blockquote, q, b, strong, i, em, mark, small, li, dt, dd {
            overflow-wrap: break-word;
            word-break: break-word;
            
            /* &:not(.keep-all),
            &.has-omega-font-size { */
            &.hyphenate:not(.keep-all) {
                hyphens: auto;
                hyphenate-limit-chars: 10 3 2; /* Prevent hyphenation on shorter words */
            }
        }
	}
}

@media (width <= 300px) {
    :is(.wp-site-blocks, .is-root-container) {
        h1, h2, h3, h4, h5, h6, p, span, label, blockquote, q, b, strong, i, em, mark, small, li, dt, dd {
            hyphens: auto;
            hyphenate-limit-chars: unset; /* Remove hyphenation word-length requirement */
        }
	}
}