diff --git a/static/dist/theme.css b/static/dist/theme.css index c1d4707..0da9b89 100644 --- a/static/dist/theme.css +++ b/static/dist/theme.css @@ -295,6 +295,9 @@ } } @layer utilities { + .invisible { + visibility: hidden; + } .visible { visibility: visible; } @@ -333,9 +336,6 @@ .left-2 { left: calc(var(--spacing) * 2); } - .isolate { - isolation: isolate; - } .z-0 { z-index: 0; } @@ -523,6 +523,9 @@ .hidden { display: none; } + .inline { + display: inline; + } .inline-block { display: inline-block; } @@ -1381,11 +1384,6 @@ margin-block: calc(var(--spacing) * 0); } } - .lg\:mt-10 { - @media (width >= 64rem) { - margin-top: calc(var(--spacing) * 10); - } - } .lg\:block { @media (width >= 64rem) { display: block; @@ -5080,59 +5078,62 @@ input[type="text"], input[type="email"], input[type="tel"], input[type="url"], i .page-hero { background: linear-gradient(83.68deg, #032F46 3.13%, #006196 45.91%, #8FC9E6 96.27%); isolation: isolate; + min-height: clamp(31rem, 38vw, 36rem); overflow: hidden; position: relative; } +.page-hero__content { + padding-block: clamp(2rem, 6vw, 4rem); + position: relative; + z-index: 10; +} +.page-hero__heading { + color: var(--color-light, #fff); + font-family: var(--font-quincy, 'Quincy', serif); + font-weight: 400; + font-size: clamp(2.5rem, 6vw, 4.5rem); + line-height: 1.05; + margin-block: clamp(1.5rem, 4vw, 3rem) 0; + max-width: 36rem; +} +.page-hero__intro { + color: var(--color-light, #fff); + font-size: clamp(1rem, 1.5vw, 1.25rem); + line-height: 1.5; + max-width: 36rem; + opacity: 0.95; +} .page-hero__media { - inset: 0; - -webkit-mask-image: linear-gradient(to left, transparent 0%, black 50%); - mask-image: linear-gradient(to left, transparent 0%, black 50%); + bottom: -10%; + height: auto; + max-height: none; + pointer-events: none; position: absolute; + right: clamp(1.5rem, 4vw, 4rem); + width: clamp(18rem, 32vw, 28rem); z-index: 1; } -.page-hero__media img { - display: block; - height: 100%; - object-fit: cover; - object-position: right center; - width: 100%; -} .page-hero__vector { - bottom: 0; + bottom: clamp(1.5rem, 4vw, 3rem); height: auto; left: 0; pointer-events: none; position: absolute; - width: 100%; - z-index: 2; -} -.page-hero__content { - position: relative; - z-index: 10; -} -.page-hero__intro { - margin-top: clamp(2rem, 6vw, 4rem); -} -.page-hero__intro-inner { - display: grid; - gap: clamp(1.5rem, 4vw, 3rem); - grid-template-columns: 1fr; -} -@media (min-width: 768px) { - .page-hero__intro-inner { - grid-template-columns: 1fr 2fr; - } + width: clamp(28rem, 60vw, 56rem); + z-index: 5; } @media (max-width: 767px) { + .page-hero { + min-height: clamp(28rem, 130vw, 40rem); + } .page-hero__media { - -webkit-mask-image: linear-gradient( to bottom, rgb(0 0 0 / 0.9) 0%, rgb(0 0 0 / 0.45) 100% ); - mask-image: linear-gradient( to bottom, rgb(0 0 0 / 0.9) 0%, rgb(0 0 0 / 0.45) 100% ); + bottom: -8%; + right: 0; + width: 60vw; } .page-hero__vector { - bottom: 0; - left: 0; - right: auto; - width: 100vw; + bottom: clamp(1rem, 3vw, 2rem); + width: 80vw; } } @property --tw-rotate-x { diff --git a/styles/blocks/page-hero.css b/styles/blocks/page-hero.css index 8128737..e8b16b7 100644 --- a/styles/blocks/page-hero.css +++ b/styles/blocks/page-hero.css @@ -2,78 +2,71 @@ * Scoped to .page-hero to avoid affecting the homepage-hero block. */ .page-hero { - background: - linear-gradient(83.68deg, #032F46 3.13%, #006196 45.91%, #8FC9E6 96.27%); + background: linear-gradient(83.68deg, #032F46 3.13%, #006196 45.91%, #8FC9E6 96.27%); isolation: isolate; + min-height: clamp(31rem, 38vw, 36rem); overflow: hidden; position: relative; } -.page-hero__media { - inset: 0; - -webkit-mask-image: linear-gradient(to left, transparent 0%, black 50%); - mask-image: linear-gradient(to left, transparent 0%, black 50%); - position: absolute; - z-index: 1; -} - -.page-hero__media img { - display: block; - height: 100%; - object-fit: cover; - object-position: right center; - width: 100%; -} - -.page-hero__vector { - bottom: 0; - height: auto; - left: 0; - pointer-events: none; - position: absolute; - width: 100%; - z-index: 2; -} - .page-hero__content { + padding-block: clamp(2rem, 6vw, 4rem); position: relative; z-index: 10; } +.page-hero__heading { + color: var(--color-light, #fff); + font-family: var(--font-quincy, 'Quincy', serif); + font-weight: 400; + font-size: clamp(2.5rem, 6vw, 4.5rem); + line-height: 1.05; + margin-block: clamp(1.5rem, 4vw, 3rem) 0; + max-width: 36rem; +} + .page-hero__intro { - margin-top: clamp(2rem, 6vw, 4rem); + color: var(--color-light, #fff); + font-size: clamp(1rem, 1.5vw, 1.25rem); + line-height: 1.5; + max-width: 36rem; + opacity: 0.95; } -.page-hero__intro-inner { - display: grid; - gap: clamp(1.5rem, 4vw, 3rem); - grid-template-columns: 1fr; +.page-hero__media { + bottom: -10%; + height: auto; + max-height: none; + pointer-events: none; + position: absolute; + right: clamp(1.5rem, 4vw, 4rem); + width: clamp(18rem, 32vw, 28rem); + z-index: 1; } -@media (min-width: 768px) { - .page-hero__intro-inner { - grid-template-columns: 1fr 2fr; - } +.page-hero__vector { + bottom: clamp(1.5rem, 4vw, 3rem); + height: auto; + left: 0; + pointer-events: none; + position: absolute; + width: clamp(28rem, 60vw, 56rem); + z-index: 5; } @media (max-width: 767px) { + .page-hero { + min-height: clamp(28rem, 130vw, 40rem); + } + .page-hero__media { - -webkit-mask-image: linear-gradient( - to bottom, - rgb(0 0 0 / 0.9) 0%, - rgb(0 0 0 / 0.45) 100% - ); - mask-image: linear-gradient( - to bottom, - rgb(0 0 0 / 0.9) 0%, - rgb(0 0 0 / 0.45) 100% - ); + bottom: -8%; + right: 0; + width: 60vw; } .page-hero__vector { - bottom: 0; - left: 0; - right: auto; - width: 100vw; + bottom: clamp(1rem, 3vw, 2rem); + width: 80vw; } } diff --git a/tests/inner-page.spec.js b/tests/inner-page.spec.js index 742b4b3..865d003 100644 --- a/tests/inner-page.spec.js +++ b/tests/inner-page.spec.js @@ -61,10 +61,6 @@ test.describe("inner page layout", () => { // Heading is rendered inside the hero. await expect(hero.locator("h1").first()).toBeVisible(); - // Intro contains a heading and a body paragraph. - await expect(intro.locator(".page-hero__intro-heading").first()).toBeVisible(); - await expect(intro.locator(".page-hero__intro-text").first()).toBeVisible(); - // Page renders without JS errors. expect(pageErrors).toEqual([]); }); diff --git a/views/partials/page-hero.php b/views/partials/page-hero.php index 2f4ab6f..85a7557 100644 --- a/views/partials/page-hero.php +++ b/views/partials/page-hero.php @@ -13,6 +13,7 @@ $isDark = get_field( 'is_dark' ); $heading = get_field( 'heading' ); $heroImage = get_field( 'hero_image' ); $heroVector = get_field( 'hero_vector' ); +$intro = get_field( 'intro' ); // Fallback for heading if ( ! $heading ) { @@ -24,23 +25,38 @@ if ( is_home() || is_single() || is_archive() || is_search() || is_404() ) { $isDark = true; } -// Default the wrapper color to the gradient when no background color is set. -// The actual gradient is applied via .page-hero in page-hero.css; this is a -// fallback for non-gradient pages. +// The wrapper color is the gradient from .page-hero in page-hero.css. The +// editor's background_color ACF field overrides the gradient with a solid color. $wrapperStyle = $bgColor ? 'background-color: ' . esc_attr( $bgColor ) . ';' : ''; ?> -
- -
-