/*
 * FLOO GLOBAL TYPOGRAPHY 2.1.4
 *
 * One source of truth for Gutenberg font-size presets.
 * Loaded globally in the frontend and inside the editor canvas.
 */

:root {
    --floo-reading-size: clamp(1rem, 0.96rem + 0.20vw, 1.125rem);
    --floo-reading-line-height: 1.62;

    /*
     * Override the common WordPress/Kadence preset variables as well.
     * !important is intentional here: these are the Floo-wide sizes.
     */
    --wp--preset--font-size--small: clamp(0.875rem, 0.84rem + 0.18vw, 0.95rem) !important;
    --wp--preset--font-size--medium: clamp(1rem, 0.96rem + 0.22vw, 1.125rem) !important;
    --wp--preset--font-size--large: clamp(1.25rem, 1.15rem + 0.55vw, 1.625rem) !important;
    --wp--preset--font-size--x-large: clamp(1.8rem, 1.45rem + 1.6vw, 2.5rem) !important;
    --wp--preset--font-size--xx-large: clamp(2.6rem, 1.85rem + 3.2vw, 4rem) !important;
}

/*
 * Explicit class rules are the decisive safety net.
 * They cover already existing blocks that stored the classic WordPress slugs.
 */
.has-small-font-size,
.editor-styles-wrapper .has-small-font-size {
    font-size: clamp(0.875rem, 0.84rem + 0.18vw, 0.95rem) !important;
    line-height: 1.55 !important;
}

.has-medium-font-size,
.editor-styles-wrapper .has-medium-font-size {
    font-size: clamp(1rem, 0.96rem + 0.22vw, 1.125rem) !important;
    line-height: 1.58 !important;
}

.has-large-font-size,
.editor-styles-wrapper .has-large-font-size {
    font-size: clamp(1.25rem, 1.15rem + 0.55vw, 1.625rem) !important;
    line-height: 1.30 !important;
}

.has-x-large-font-size,
.editor-styles-wrapper .has-x-large-font-size {
    font-size: clamp(1.8rem, 1.45rem + 1.6vw, 2.5rem) !important;
    line-height: 1.16 !important;
}

.has-xx-large-font-size,
.editor-styles-wrapper .has-xx-large-font-size {
    font-size: clamp(2.6rem, 1.85rem + 3.2vw, 4rem) !important;
    line-height: 1.04 !important;
}

/*
 * Future-proof aliases. They let Floo move to unique preset slugs later
 * without changing the visual system.
 */
.has-floo-s-font-size { font-size: clamp(0.875rem, 0.84rem + 0.18vw, 0.95rem) !important; line-height: 1.55 !important; }
.has-floo-m-font-size { font-size: clamp(1rem, 0.96rem + 0.22vw, 1.125rem) !important; line-height: 1.58 !important; }
.has-floo-l-font-size { font-size: clamp(1.25rem, 1.15rem + 0.55vw, 1.625rem) !important; line-height: 1.30 !important; }
.has-floo-xl-font-size { font-size: clamp(1.8rem, 1.45rem + 1.6vw, 2.5rem) !important; line-height: 1.16 !important; }
.has-floo-xxl-font-size { font-size: clamp(2.6rem, 1.85rem + 3.2vw, 4rem) !important; line-height: 1.04 !important; }

/* Normal reading paragraphs remain calm and consistent unless a preset is chosen. */
:where(.entry-content, .editor-styles-wrapper) p:not(
    .has-small-font-size,
    .has-medium-font-size,
    .has-large-font-size,
    .has-x-large-font-size,
    .has-xx-large-font-size,
    .has-floo-s-font-size,
    .has-floo-m-font-size,
    .has-floo-l-font-size,
    .has-floo-xl-font-size,
    .has-floo-xxl-font-size
) {
    line-height: var(--floo-reading-line-height);
}
