/************************************************
* Theme Name:   Simmelink
*
* Block Name:   Page Hero
************************************************/

.simmelink-block.simmelink-page-hero {
    background-color: var(--blue-light);
    border-bottom: 1px solid var(--hairline-on-light);
    color: var(--blue-dark);
    padding: var(--subhero-top) 0 var(--subhero-bottom);

    .wrapper {
        padding-bottom: 0;
        padding-top: 0;
    }

    .hero-copy {
        align-items: flex-start;
        display: flex;
        flex-flow: column wrap;
        min-width: 0;

        .lijntitel {
            width: 100%;
        }

        .page-title {
            font-family: var(--font-heading);
            font-size: var(--wp--preset--font-size--display);
            font-synthesis: none;
            font-weight: 500;
            line-height: 1.15;
            margin: 0 0 var(--wp--preset--spacing--30);

            /* Below 375px a long word (Echtscheidingsconvenant) is wider than the column at 34px. */
            @media screen and (max-width: 374px) {
                font-size: 1.9375rem;
                overflow-wrap: break-word;
            }

            /*
             * Below 340px it does not fit at 31px either: there it breaks with a hyphen. Where the browser
             * has no Dutch hyphenation, "anywhere" breaks the word without one instead of widening the page.
             */
            @media screen and (max-width: 339px) {
                hyphens: auto;
                overflow-wrap: anywhere;
            }
        }

        .page-subtitle {
            font-size: var(--wp--preset--font-size--large);
            font-weight: 500;
            margin: 0 0 var(--wp--preset--spacing--30);
            max-width: var(--wp--style--global--content-size);
        }

        .hero-text {
            margin: 0 0 var(--wp--preset--spacing--30);
            max-width: var(--wp--style--global--content-size);

            a {
                color: var(--blue-normal);
                text-decoration: underline;
                text-decoration-thickness: 1px;
                text-underline-offset: 3px;
                transition: var(--transition);

                &:hover {
                    color: var(--blue-dark);
                }
            }

            /* The first paragraph is the lead. */
            &:not(.hero-text + .hero-text) {
                font-size: var(--wp--preset--font-size--large);
            }
        }

        .hero-button {
            align-items: center;
            display: inline-flex;
            height: var(--control-height);
            padding: 0 1.5rem;
        }

        .hero-microcopy {
            font-size: var(--wp--preset--font-size--small);
            margin: var(--wp--preset--spacing--30) 0 0;

            a {
                color: var(--blue-normal);
                text-decoration: underline;
                text-decoration-thickness: 1px;
                text-underline-offset: 3px;
                transition: var(--transition);

                &:hover {
                    color: var(--blue-dark);
                }
            }
        }

        > :last-child {
            margin-bottom: 0;
        }
    }

    /* Low hero (/contact/): only the h1, so the form starts in the first screen. */
    &.hero-laag {
        padding: var(--wp--preset--spacing--50) 0;

        .hero-copy .page-title {
            margin-bottom: 0;
        }
    }

    /*
     * The photo under the text, 3:2. The faces stand in the upper third of the image, between a fifth
     * and three quarters of its width: the crop starts at the top and a little left of the middle, so
     * a high, narrow frame keeps both faces. Check this position when the photo is replaced.
     */
    .hero-photo {
        aspect-ratio: 3 / 2;
        margin: var(--wp--preset--spacing--40) 0 0;
        position: relative;

        img {
            border-radius: var(--radius);
            display: block;
            height: 100%;
            inset: 0;
            object-fit: cover;
            object-position: 40% 0;
            position: absolute;
            width: 100%;
        }
    }
}

/* From 1024px the photo stands right of the text, on five of the twelve columns and as high as the text. */
@media screen and (min-width: 1024px) {
    .simmelink-block.simmelink-page-hero.has-photo {
        .wrapper {
            column-gap: var(--wp--preset--spacing--50);
            display: grid;
            grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        }

        .hero-photo {
            aspect-ratio: auto;
            margin: 0;
            min-height: 340px;
        }
    }
}
