/*
Theme Name: Legacy Inc.
Theme URI: https://ourmissionistuition.org/
Author: Caedmon Coley Design
Author URI: https://caedmoncoley.design
Description: This is a bespoke theme for Legacy Inc., a nonprofit aimed at providing tuition for students seeking a classical Christian education. 
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.0
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: legacyinc
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns
*/

@media (max-width: 599px) {
	.site-header-navigation.wp-block-navigation.items-justified-right,
	.site-header-navigation.wp-block-navigation__container.items-justified-right {
		--navigation-layout-justification-setting: center;
		--navigation-layout-justify: center;
	}

	.site-header-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
	.site-header-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,
	.site-header-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
	.site-header-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item {
		align-items: center;
		justify-content: center;
	}

	.site-header-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		text-align: center;
	}
}

/* Fade the page title hero image into the page background from the bottom. */
.page-title-hero > .wp-block-cover__image-background,
.page-title-hero > .wp-block-cover__background {
	-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}

.page-title-hero > .wp-block-cover__background {
	background-color: var(--wp--preset--color--orange) !important;
	opacity: 0.65 !important;
}

/* Homepage top image section: single, deterministic orange overlay + bottom fade. */
.home-top-image-section {
	position: relative;
	min-height: 520px;
	overflow: hidden;
}

.home-top-image-section .wp-block-image,
.home-top-image-section .wp-block-image img {
	width: 100%;
	height: 520px;
	margin: 0;
}

.home-top-image-section .wp-block-image img {
	display: block;
	object-fit: cover;
	object-position: center top;
}

.home-top-image-section::before,
.home-top-image-section::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.home-top-image-section::before {
	background: rgba(239, 116, 48, 0.75);
	z-index: 2;
}

.home-top-image-section::after {
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 1) 100%);
	z-index: 3;
}

.home-top-image-section .home-top-image-title-wrap {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 var(--wp--preset--spacing--30);
	pointer-events: none;
}

.home-top-image-section .home-top-image-title {
	margin: 0;
	max-width: 24ch;
	line-height: 1.15;
	font-size: clamp(2.8rem, 6.6vw, 5.6rem);
	text-align: center;
	text-wrap: balance;
}

/* Let the site header sit on top of page content on all templates. */
.wp-site-blocks {
	position: relative;
}

.wp-site-blocks > .wp-block-template-part:first-child {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 30;
}

.wp-site-blocks > .wp-block-template-part:first-child .legacyinc-global-overlay-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 30;
}

.wp-site-blocks > .wp-block-template-part:first-child .legacyinc-global-overlay-header {
	background-color: transparent !important;
	box-shadow: none;
	transition: background-color 260ms ease-out, box-shadow 260ms cubic-bezier(0.22, 1, 0.36, 1);
	will-change: background-color;
}

.legacyinc-header-actions .site-header-give-mobile {
	display: none;
}

.legacyinc-header-actions .wp-block-button__link {
	font-family: var(--wp--preset--font-family--heading) !important;
	font-style: normal !important;
	font-weight: 400 !important;
}

body.legacyinc-header-sticky-active {
	--legacyinc-sticky-top-offset: 0px;
}

body.legacyinc-header-sticky-active .wp-site-blocks > .wp-block-template-part:first-child,
body.legacyinc-header-sticky-active .wp-site-blocks > .wp-block-template-part:first-child .legacyinc-global-overlay-header {
	position: fixed !important;
	top: var(--legacyinc-sticky-top-offset, 0px);
	left: 0;
	right: 0;
}

body.legacyinc-header-sticky-active .wp-site-blocks > .wp-block-template-part:first-child .legacyinc-global-overlay-header {
	background-color: var(--wp--preset--color--orange) !important;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

@media (max-width: 599px) {
	.legacyinc-header-actions {
		align-items: center;
		gap: var(--wp--preset--spacing--10);
	}

	.legacyinc-header-actions .site-header-give-mobile {
		display: flex;
		margin-top: 0;
	}

	.legacyinc-header-actions .site-header-give-mobile .wp-block-button__link {
		padding: 0.45rem 0.85rem;
		line-height: 1;
		white-space: nowrap;
	}

	.legacyinc-header-actions .site-header-navigation .wp-block-buttons {
		display: none !important;
	}

	.legacyinc-global-overlay-header .wp-block-navigation__responsive-container.is-menu-open,
	.legacyinc-global-overlay-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
		background-color: var(--wp--preset--color--orange) !important;
	}

	.legacyinc-global-overlay-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
	.legacyinc-global-overlay-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,
	.legacyinc-global-overlay-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list {
		gap: var(--wp--preset--spacing--30) !important;
	}

	.legacyinc-global-overlay-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		padding-block: var(--wp--preset--spacing--20) !important;
	}
}

/* Header text styling: white Libre Caslon bold. */
.legacyinc-global-overlay-header,
.legacyinc-global-overlay-header a,
.legacyinc-global-overlay-header .wp-block-navigation-item__content,
.legacyinc-global-overlay-header .wp-block-navigation__responsive-container-open,
.legacyinc-global-overlay-header .wp-block-navigation__responsive-container-close,
.legacyinc-global-overlay-header .wp-block-site-title a {
	color: var(--wp--preset--color--white) !important;
}

.legacyinc-global-overlay-header .wp-block-navigation-item__content,
.legacyinc-global-overlay-header .wp-block-site-title,
.legacyinc-global-overlay-header .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--heading) !important;
	font-weight: 700 !important;
}

.legacyinc-global-overlay-header a:hover,
.legacyinc-global-overlay-header a:focus-visible,
.legacyinc-global-overlay-header a:active,
.legacyinc-global-overlay-header .wp-block-navigation-item__content:hover,
.legacyinc-global-overlay-header .wp-block-navigation-item__content:focus-visible,
.legacyinc-global-overlay-header .wp-block-navigation-item__content:active {
	font-style: italic !important;
	text-decoration: none !important;
}

/* Remove root block gap between the overlaid header template part and main content. */
.wp-site-blocks > .wp-block-template-part:first-child + * {
	margin-block-start: 0 !important;
}

/* Reusable section fade: transitions solid backgrounds to white at top and bottom edges. */
.legacyinc-edge-fade-orange {
	background-image: linear-gradient(
		to bottom,
		var(--wp--preset--color--white) 0%,
		var(--wp--preset--color--orange) var(--wp--preset--spacing--40),
		var(--wp--preset--color--orange) calc(100% - var(--wp--preset--spacing--40)),
		var(--wp--preset--color--white) 100%
	);
}

.legacyinc-edge-fade-light-orange {
	background-image: linear-gradient(
		to bottom,
		var(--wp--preset--color--white) 0%,
		var(--wp--preset--color--light-orange) var(--wp--preset--spacing--40),
		var(--wp--preset--color--light-orange) calc(100% - var(--wp--preset--spacing--40)),
		var(--wp--preset--color--white) 100%
	);
}

.legacyinc-edge-fade-black {
	background-image: linear-gradient(
		to bottom,
		var(--wp--preset--color--white) 0%,
		var(--wp--preset--color--black) var(--wp--preset--spacing--40),
		var(--wp--preset--color--black) calc(100% - var(--wp--preset--spacing--40)),
		var(--wp--preset--color--white) 100%
	);
}

/* Newsletter CTA button: inverse base colors, then match requested hover colors. */
.legacyinc-newsletter-button .wp-block-button__link,
.legacyinc-newsletter-button .wp-block-button__link:visited {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--orange);
	border-color: var(--wp--preset--color--white);
}

.legacyinc-newsletter-button .wp-block-button__link:hover,
.legacyinc-newsletter-button .wp-block-button__link:focus-visible,
.legacyinc-newsletter-button .wp-block-button__link:active {
	background-color: var(--wp--preset--color--light-orange);
	color: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--light-orange);
}

/* Fade the site footer in from white at the top edge into orange. */
.legacyinc-footer-fade {
	background-image: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 1) 0%,
		rgba(255, 255, 255, 0.74) 8%,
		rgba(255, 255, 255, 0.46) 20%,
		rgba(255, 255, 255, 0.24) 36%,
		rgba(255, 255, 255, 0.10) 54%,
		rgba(255, 255, 255, 0) 74%,
		rgba(255, 255, 255, 0) 100%
	);
	padding-top: var(--wp--preset--spacing--60) !important;
}

/* Footer text styling: Libre Caslon regular with italic hover interactions. */
.legacyinc-footer-fade,
.legacyinc-footer-fade p,
.legacyinc-footer-fade a,
.legacyinc-footer-fade .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--heading) !important;
	font-weight: 400 !important;
	font-style: normal;
}

.legacyinc-footer-fade a:hover,
.legacyinc-footer-fade a:focus-visible,
.legacyinc-footer-fade a:active,
.legacyinc-footer-fade .wp-block-navigation-item__content:hover,
.legacyinc-footer-fade .wp-block-navigation-item__content:focus-visible,
.legacyinc-footer-fade .wp-block-navigation-item__content:active {
	font-style: italic !important;
	text-decoration: none !important;
}

.legacyinc-footer-fade .legacyinc-footer-credit,
.legacyinc-footer-fade .legacyinc-footer-credit a {
	font-family: var(--wp--preset--font-family--body) !important;
	font-weight: 400 !important;
}

.legacyinc-footer-meta-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
}

.legacyinc-footer-meta-row .wp-block-paragraph,
.legacyinc-footer-meta-row .wp-block-navigation {
	margin: 0;
}

.legacyinc-footer-meta-row .wp-block-navigation__container {
	gap: 0.5rem;
}

@media (max-width: 600px) {
	.legacyinc-footer-fade {
		padding-left: var(--wp--preset--spacing--20) !important;
		padding-right: var(--wp--preset--spacing--20) !important;
	}

	.legacyinc-footer-meta-row {
		flex-direction: column;
		gap: 0.35rem;
	}

	.legacyinc-footer-meta-copy,
	.legacyinc-footer-credit {
		max-width: 30ch;
		margin-left: auto;
		margin-right: auto;
		text-align: center;
		line-height: 1.35;
		overflow-wrap: anywhere;
	}

	.legacyinc-footer-meta-separator {
		display: none;
	}

	.legacyinc-footer-meta-nav {
		max-width: 30ch;
		margin-left: auto;
		margin-right: auto;
	}

	.legacyinc-footer-meta-nav .wp-block-navigation__container {
		justify-content: center;
		flex-wrap: wrap;
	}
}
