/* --- PAGE BANNER: full-width photo at its own ratio, title + divider over its bottom left. Opt-in: only pages that
   include it. --- */
.page-banner {
    position: relative;
    margin: var(--page-banner-margin, 0);
}

.page-banner picture {
    position: relative;
    display: block;
}

/* Optional shade over the bottom of the photo, under the caption (--page-banner-shade, e.g. a gradient; none by
   default), --page-banner-shade-height of the photo's height. */
.page-banner picture::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--page-banner-shade-height, 30%);
    background: var(--page-banner-shade, none);
    pointer-events: none;
}

.page-banner__image {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
}

/* The caption is anchored to the bottom of the photo: --page-banner-caption-bottom is the space under the divider. */
.page-banner__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--page-banner-caption-bottom, 40px);
}

.page-banner__inner {
    max-width: var(--page-banner-max-width, var(--content-max-width, 1200px));
    margin: 0 auto;
    padding: var(--page-banner-padding, 0 20px);
}

.page-banner__title {
    margin: var(--page-banner-title-margin, 0);
    font-size: var(--page-banner-title-size, 40px);
    line-height: var(--page-banner-title-line-height, 1.2);
    font-weight: var(--page-banner-title-weight, 700);
    text-transform: var(--page-banner-title-transform, none);
    color: var(--page-banner-title-color, #FFFFFF);
    text-shadow: var(--page-banner-title-shadow, none);
}

.page-banner__divider {
    width: var(--page-banner-divider-width, 80px);
    height: var(--page-banner-divider-height, 2px);
    margin: var(--page-banner-divider-margin, 20px 0 0);
    border: 0;
    background-color: var(--page-banner-divider-color, var(--color-secondary, currentColor));
}

/* Layers (data.foreground, page-banner--layers): the photo and a cut-out foreground, both at their own ratio in one
   grid cell from the top (the banner as tall as the taller one); a decoration over the photo (its ::before, which can
   reach below it with a negative --page-banner-decoration-bottom), under the foreground. Up to 767px (991px with
   page-banner--mobile-on-tablet) the decoration takes its phone values. */
.page-banner--layers {
    display: grid;
}

.page-banner--layers > picture {
    grid-area: 1 / 1;
    align-self: start;
    min-width: 0;
}

.page-banner--layers > picture:not(.page-banner__front)::before {
    content: "";
    position: absolute;
    inset: 0 0 var(--page-banner-decoration-bottom, 0);
    z-index: 1;
    pointer-events: none;
    background-image: var(--page-banner-decoration, none);
    background-repeat: no-repeat;
    background-position: var(--page-banner-decoration-position, center bottom);
    background-size: var(--page-banner-decoration-size, cover);
}

.page-banner--layers > .page-banner__front {
    z-index: 2;
}

/* the shade belongs to the photo, not to the foreground */
.page-banner--layers > .page-banner__front::after {
    content: none;
}

.page-banner--layers .page-banner__caption {
    z-index: 3;
}

@media (max-width: 767px) {
    .page-banner--layers > picture:not(.page-banner__front)::before {
        inset: 0 0 var(--page-banner-decoration-bottom-mobile, var(--page-banner-decoration-bottom, 0));
        background-image: var(--page-banner-decoration-mobile, var(--page-banner-decoration, none));
        background-position: var(--page-banner-decoration-position-mobile, var(--page-banner-decoration-position, center bottom));
        background-size: var(--page-banner-decoration-size-mobile, var(--page-banner-decoration-size, cover));
    }
}

@media (max-width: 991px) {
    .page-banner--layers.page-banner--mobile-on-tablet > picture:not(.page-banner__front)::before {
        inset: 0 0 var(--page-banner-decoration-bottom-mobile, var(--page-banner-decoration-bottom, 0));
        background-image: var(--page-banner-decoration-mobile, var(--page-banner-decoration, none));
        background-position: var(--page-banner-decoration-position-mobile, var(--page-banner-decoration-position, center bottom));
        background-size: var(--page-banner-decoration-size-mobile, var(--page-banner-decoration-size, cover));
    }
}
