/*
Theme Name: Navii Starter
Theme URI: https://naviitech.com
Author: NaviiTech
Author URI: https://naviitech.com
Description: NaviiTech's starter block theme. Every section is a pattern the client can add, reorder and edit in the WordPress editor, so no page builder is needed. The look (colours, fonts) is changed in Appearance > Editor > Styles.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.5.8
License: GPL-2.0-or-later
Text Domain: navii-starter
*/

/* Small touches theme.json cannot express. */
:where(.wp-site-blocks) :focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; }
.is-style-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem !important; font-weight: 600; color: var(--wp--preset--color--accent); }
.is-style-card { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--line); border-radius: 20px; transition: transform .25s ease, box-shadow .25s ease; }
.is-style-card:hover { transform: translateY(-3px); box-shadow: var(--wp--preset--shadow--soft); }
.wp-block-button.is-style-outline > .wp-block-button__link { border: 1.5px solid currentColor; background: transparent; color: inherit; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); border-color: var(--wp--preset--color--contrast); }
/* The frosted glass lives on a ::before layer: backdrop-filter on the header itself would make it
   the containing block for the mobile menu overlay (position: fixed) and crop it to header height. */
.navii-header { background: transparent; isolation: isolate; z-index: 50; }
.navii-header::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity .35s ease;
	background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.navii-stat { font-family: var(--wp--preset--font-family--heading); font-size: var(--wp--preset--font-size--xx-large); line-height: 1; }
.navii-header .wp-block-button__link { white-space: nowrap; }
@media (max-width: 600px) {
	.navii-header-cta { display: none; }
	.navii-header .wp-block-site-title { font-size: 1rem; }
	.navii-header .wp-block-button__link { padding: 0.7em 1.1em; }
}

/* ---- Motion layer (assets/js/motion.js). Classes are opt-in per block. ---- */
/* Header: sticky on every page. Over a full-width hero it starts transparent and turns solid on scroll. */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 100; }
.wp-site-blocks .navii-header { position: relative; top: auto; transition: background-color .35s ease, box-shadow .35s ease, border-color .35s ease; }
.navii-header.is-scrolled { box-shadow: 0 10px 30px -18px rgb(0 0 0 / 0.55); }
.navii-has-hero .wp-site-blocks > header.wp-block-template-part { margin-bottom: calc(-1 * var(--navii-header-h, 76px)); }
.navii-has-hero .wp-site-blocks > header.wp-block-template-part + * { margin-block-start: 0; }
.navii-has-hero .navii-header:not(.is-scrolled) { background: linear-gradient(rgb(0 0 0 / .35), transparent); border-bottom-color: transparent !important; box-shadow: none; }
.navii-has-hero .navii-header:not(.is-scrolled)::before { opacity: 0; }
.navii-has-hero .wp-block-post-content > .wp-block-cover:first-child { padding-top: calc(var(--navii-header-h, 76px) + var(--wp--preset--spacing--50)) !important; }

.navii-reveal { opacity: 0; transform: translate3d(0, 28px, 0); }
.navii-reveal.is-in { opacity: 1; transform: none; transition: opacity .8s cubic-bezier(.2,.7,.2,1) var(--navii-delay, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--navii-delay, 0ms); }

/* Hero entrance (first section is never hidden; it just eases in). */
.navii-js .wp-block-post-content > :first-child .wp-block-cover__inner-container > *,
.navii-js .wp-block-post-content > :first-child > .wp-block-columns { animation: navii-rise 1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes navii-rise { from { opacity: 0; transform: translate3d(0, 22px, 0); } }

/* 3D tilt + glare on cards. */
.is-style-card { transform-style: preserve-3d; position: relative; overflow: hidden; }
.is-style-card.is-tilting { transform: perspective(900px) rotateX(var(--navii-rx, 0)) rotateY(var(--navii-ry, 0)) translateY(-4px); transition: transform .08s linear, box-shadow .25s ease; box-shadow: var(--wp--preset--shadow--soft); }
.is-style-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease; background: radial-gradient(420px circle at var(--navii-gx, 50%) var(--navii-gy, 50%), rgb(255 255 255 / 0.10), transparent 60%); }
.is-style-card.is-tilting::after { opacity: 1; }

/* Live canvas effects on Cover blocks (snow). Sits above the overlay, below the content. */
.navii-fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.navii-parallax { overflow: hidden; }
.navii-parallax .wp-block-cover__image-background { will-change: transform; }

/* Gold light sweep, masked to the image's own shape. */
.navii-shimmer { position: relative; }
.navii-shimmer::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
	background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.95) 50%, transparent 65%) no-repeat;
	background-size: 250% 100%; animation: navii-shimmer 5s ease-in-out infinite 1.2s;
	-webkit-mask: var(--navii-mask) center / contain no-repeat; mask: var(--navii-mask) center / contain no-repeat; }
@keyframes navii-shimmer { 0% { background-position: 150% 0; } 45%, 100% { background-position: -50% 0; } }

/* Endless sideways ticker. */
.navii-marquee { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem var(--wp--preset--spacing--50); }
.navii-marquee > p { margin: 0 !important; }
.navii-marquee:has(> .navii-marquee__track) { display: block; }
.navii-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.navii-marquee__track { display: flex; flex-wrap: nowrap; width: max-content; gap: var(--wp--preset--spacing--50); animation: navii-marquee var(--navii-marquee-duration, 30s) linear infinite; }
.navii-marquee__track > * { flex: none; margin: 0 !important; white-space: nowrap; }
.navii-marquee:hover .navii-marquee__track { animation-play-state: paused; }
@keyframes navii-marquee { to { transform: translate3d(-50%, 0, 0); } }

/* Mobile menu overlay in the site's own colours: big links, current page in the accent colour. */
.wp-block-navigation__responsive-container.is-menu-open { background-color: var(--wp--preset--color--base) !important; color: var(--wp--preset--color--contrast) !important; padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: flex-start !important; padding-top: var(--wp--preset--spacing--60); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list { align-items: flex-start !important; gap: var(--wp--preset--spacing--30) !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--x-large); font-weight: 700; letter-spacing: -0.02em; }
.wp-block-navigation__responsive-container.is-menu-open .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { animation: navii-rise .45s cubic-bezier(.2,.7,.2,1) both; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:nth-child(2) { animation-delay: .06s; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:nth-child(3) { animation-delay: .12s; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:nth-child(4) { animation-delay: .18s; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:nth-child(n+5) { animation-delay: .24s; }

/* Compact footer (.navii-footer): one row on desktop, a centred stack on phones. */
.navii-footer p { margin-block: 0; }
.navii-footer__nav { font-size: var(--wp--preset--font-size--small); }
.navii-footer__contact a { text-decoration: none; }
@media (max-width: 781px) {
	.navii-footer { text-align: center; }
	.navii-footer__main, .navii-footer__bar { flex-direction: column; justify-content: center !important; align-items: center !important; gap: var(--wp--preset--spacing--30) !important; }
	.navii-footer__brand { flex-direction: column; align-items: center !important; }
	.navii-footer__brand > .wp-block-group, .navii-footer__contact { align-items: center !important; }
	.navii-footer__nav .wp-block-navigation__container { justify-content: center; }
	.navii-footer__bar { gap: 0.25rem !important; }
}

/* Alternating media rows: keep the photo first when columns stack on phones. */
@media (max-width: 781px) { .navii-media-first-mobile { flex-direction: column-reverse; } }

/* 3D scenes (three-scenes.js). Without WebGL the fallback content simply stays. */
.navii-3d-crew { position: relative; }
.navii-3d-crew.is-3d, .navii-3d-crew.is-3d-pending { min-height: 200vh; padding-top: 0 !important; padding-bottom: 0 !important; }
.navii-3d-crew > .navii-3d-stage { position: sticky; top: 0; height: 100vh; z-index: 0; overflow: hidden; max-width: none !important; width: auto;
	margin-left: calc(var(--wp--style--root--padding-left, 0px) * -1) !important; margin-right: calc(var(--wp--style--root--padding-right, 0px) * -1) !important; margin-block: 0 !important; }
.navii-3d-stage > .navii-3d-canvas { display: block; width: 100%; height: 100%; }
.navii-3d-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(color-mix(in srgb, var(--wp--preset--color--base) 70%, transparent), transparent 18%), radial-gradient(ellipse 55% 50% at 14% 20%, color-mix(in srgb, var(--wp--preset--color--base) 78%, transparent), transparent 72%); }
.navii-3d-overlay { position: relative; z-index: 2; padding-block: var(--wp--preset--spacing--60); }
/* Inside the stage the heading lines up with the page grid (wide size, root padding). */
.navii-3d-stage > .navii-3d-overlay { position: absolute; top: calc(var(--navii-header-h, 76px) + 4vh); left: 0; right: 0; box-sizing: content-box; max-width: var(--wp--style--global--wide-size, 1240px); margin-inline: auto !important;
	padding: 0 var(--wp--style--root--padding-right, 1.5rem) 0 var(--wp--style--root--padding-left, 1.5rem); pointer-events: none; text-shadow: 0 2px 24px rgb(0 0 0 / .6); }

@media (prefers-reduced-motion: reduce) {
	.is-style-card, .is-style-card:hover { transition: none; transform: none; }
	.navii-js .wp-block-post-content > :first-child * { animation: none !important; }
	.navii-shimmer::after, .navii-marquee__track, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { animation: none; }
	.navii-marquee__track { flex-wrap: wrap; justify-content: center; width: auto; }
}
