/*
 * Heading block styles, shared by the front end and the block editor.
 * Loaded by functions/block-styles.php.
 * Ported from the "Heading appearance choices" Code Snippet.
 */

/* Default heading appearance. */
:is(article, .editor-styles-wrapper) .wp-block-heading {
    line-height: 1.3;
    font-weight: 700;
    text-align: left;
    border-bottom: none;
    text-decoration: none;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 24px;
    margin-bottom: 16px;
}

/* Default sizes; custom editor sizes can override these. */
:is(article, .editor-styles-wrapper) h2.wp-block-heading {
    font-size: 30px;
}

:is(article, .editor-styles-wrapper) h3.wp-block-heading,
:is(article, .editor-styles-wrapper) h4.wp-block-heading {
    font-size: 24px;
}

/* Black text unless an editor selects a color. */
:is(article, .editor-styles-wrapper) .wp-block-heading:not(.has-text-color) {
    color: #000;
}

/* Optional centered divider, independent of heading level. */
:is(article, .editor-styles-wrapper) .wp-block-heading.is-style-uch-section {
    font-size: 26px;
    text-align: center;
    border-bottom: 1px solid #dbdbdb;
    padding-bottom: 10px;
}

/* Preserve existing Simple heading blocks.
   This style is no longer offered for new selections. */
:is(article, .editor-styles-wrapper) .wp-block-heading.is-style-uch-simple {
    font-size: 20px;
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
}

/* Respect alignment explicitly selected in the editor. */
:is(article, .editor-styles-wrapper) .wp-block-heading.has-text-align-left {
    text-align: left;
}

:is(article, .editor-styles-wrapper) .wp-block-heading.has-text-align-center {
    text-align: center;
}

:is(article, .editor-styles-wrapper) .wp-block-heading.has-text-align-right {
    text-align: right;
}

/* Keep cover text white unless a text color is selected. */
:is(article, .editor-styles-wrapper) .wp-block-cover__inner-container {
    color: #fff;
}

:is(article, .editor-styles-wrapper) .wp-block-cover :is(
    h1, h2, h3, h4, h5, h6, p
):not(.has-text-color) {
    color: #fff;
}

:is(article, .editor-styles-wrapper) .wp-block-cover
.wp-block-heading:not(.has-text-color) {
    color: #fff;
}

/* Preserve the Large size selected for cover headings. */
:is(article, .editor-styles-wrapper) .wp-block-cover
.wp-block-heading.has-large-font-size {
    font-size: var(--wp--preset--font-size--large, 36px);
}

/* Linked heading hover and keyboard focus. */
:is(article, .editor-styles-wrapper) .wp-block-heading a:hover,
:is(article, .editor-styles-wrapper) .wp-block-heading a:focus-visible {
    color: #052E29;
    text-decoration: underline;
}

/* Keep focused and hovered cover links readable. */
:is(article, .editor-styles-wrapper) .wp-block-cover
.wp-block-heading a:hover,
:is(article, .editor-styles-wrapper) .wp-block-cover
.wp-block-heading a:focus-visible {
    color: #fff;
    text-decoration: underline;
}
