/* Show all reveal-on-scroll sections when JS is off */
.reveal {
	opacity: 1;
	transform: none;
}

/* Fix non-JS navbar height */
#navbar {
	padding: 0;
}

/* Make sure mobile nav isn’t hidden by JS-only classes */
#navbar .nav-links {
	display: block;
	max-height: none;
	opacity: 1;
}

/* No-JS heading underlines — centered & color-correct */
section h2,
section h3 {
	display: block;
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
	position: relative;
}

/* Ensure h2 and following h3 don't sit on the same line in no-JS */
/* section h2 { margin-right: 100%; } */

/* h2: brand yellow, centered at 80% of text width */
section h2::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: -0.15em;
	width: 80%;
	height: 0em;
	background: var(--underline-color, #FFD34F);
	border-radius: 2px;
}

/* h3: muted gray, centered at 70% of text width */
section h3::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: -0.4em;
	width: 30%;
	height: 0.05em;
	background: var(--underline-muted, #CBD5E1);
	border-radius: 2px;
}

/* Ensure the contact panel is visible so the <noscript> image shows */
#contact-info {
	display: block;
	opacity: 1;
	visibility: visible;
	max-height: none;
}

/* Hide the JS-only placeholder links when JS is off */
#phoneLink, #emailLink {
	display: none;
}

/* Optional: if you add class="js-only" to any element, it will vanish for no-JS */
.js-only {
	display: none;
}

/* Hide the JS carousel UI/track; we'll show a plain image list instead */
.carousel .track,
.carousel .controls,
.carousel .prev,
.carousel .next,
.carousel .pause-btn,
.carousel .status {
	display: none;
}

/* Show our no-JS fallback list */
.carousel .no-js-carousel {
	display: block;
}

/* Hide JS carousel pieces when JS is off; show fallback */
.panel.carousel .carousel-viewport,
.panel.carousel .carousel-images {
	display: none;
}

.carousel-controls {
	display: none;
}

.panel.carousel .no-js-carousel {
	display: block;
}

/* No-JS snapping carousel */
.panel.carousel .no-js-carousel {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	gap: 12px;
	padding-inline: 12px;
	scroll-padding-inline: 12px;
	border-radius: 1rem;
}

.panel.carousel .no-js-carousel img {
	width: 100%;
	height: auto;
	display: block;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	border-radius: 1rem;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}


/* Hint text below the no-JS carousel */
.panel.carousel .no-js-hint {
	display: block;
	text-align: center;
	margin-top: 6px;
	margin-bottom: -10px;
	font-size: 1.05rem;
	opacity: 0.85;
	animation: njs-pulse 1.2s ease-in-out infinite;
}

/* .panel.carousel .no-js-hint .arrow {
	display: inline-block;
	animation: njs-pulse 1.2s ease-in-out infinite;
} */

@keyframes njs-pulse {
	0%, 100% {
		opacity: .25;
		transform: translateX(0);
	}

	50% {
		opacity: 1;
		transform: translateX(2px);
	}
}

@keyframes njs-fade-out {
	from {
		opacity: 0.85;
	}

	to {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.panel.carousel .no-js-hint {
		animation: none;

		#faq .faq-njs details[open]>div {
			animation: none;
		}
	}

	.panel.carousel .no-js-hint .arrow {
		animation: none;
	}
}

/* --- No-JS navbar layout fixes --- */
/* Hide hamburger entirely when JS is off */
#navbar .hamburger {
	display: none;
}

/* Mobile (≤768px): keep links stacked and visible */
@media (max-width: 900px) {
	#navbar {
		padding: 1rem 0;
	}

	#navbar .nav-links {
		display: block;
		max-height: none;
		opacity: 1;
	}
}

/* Desktop (≥769px): show links inline horizontally */
@media (min-width: 901px) {
	#navbar .nav-links {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 1rem;
		max-height: none;
		opacity: 1;
	}

	#navbar .nav-links li {
		display: inline-flex;
	}
}

@supports (animation-timeline: auto) {

	/* Scroll-driven fade-out of the hint near the end of the strip */
	.panel.carousel .no-js-carousel {
		/* Tie a horizontal scroll timeline to the fallback strip */
		scroll-timeline-name: --njs-gallery;
		scroll-timeline-axis: inline;
		/* horizontal */
	}

	/* The hint fades out as the user approaches the end */
	.panel.carousel .no-js-hint {
		animation: njs-fade-out 1s linear both;
		animation-timeline: --njs-gallery;
		/* Keep fully visible through ~70% of the gallery, then fade to 0 by the end */
		animation-range: 70% 100%;
	}
}

/* No-JS FAQ: match JS look */
#faq .faq-njs {
	display: block;
}

/* Each FAQ item */
#faq .faq-njs details {
	margin: 0 0 12px 0;
	border-radius: 12px;
	overflow: hidden;
	/* keeps rounded corners on the answer box */
	background: transparent;
	display: grid;
	grid-template-rows: auto 0fr;
	/* summary row, content row collapsed */
	transition: grid-template-rows 350ms ease;
}

/* Big blue question “button” */
#faq .faq-njs summary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .75rem;
	padding: 14px 18px;
	font-weight: 700;
	color: #fff;
	background: var(--brand-blue, #0B5EC7);
	/* border-radius: 12px; */
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
	cursor: pointer;
	list-style: none;
}

#faq .faq-njs summary::-webkit-details-marker {
	display: none;
}

/* Chevron */
/* #faq .faq-njs summary::after {
	content: "▸";
	font-size: 1.1em;
	line-height: 1;
	transition: transform .2s ease;
	opacity: .95;
} */

#faq .faq-njs details[open] {
	grid-template-rows: auto 1fr;
	/* expand content row smoothly */
}

/* #faq .faq-njs details[open] > summary::after { transform: rotate(90deg); } */

/* Answer box with border */
#faq .faq-njs details>div {
	border: 1px solid rgba(0, 0, 0, .12);
	border-top: none;
	/* seamless with the blue header */
	background: #fff;
	padding: 16px 18px;
	color: inherit;
	border-radius: 0 0 12px 12px;
}

/* Smooth expand/collapse for no-JS FAQ answers */
#faq .faq-njs details>div {
	max-height: none;
	opacity: 0;
	overflow: hidden;
	padding: 0 18px;
	/* collapse vertical padding when closed */
	border: 0;
	/* hide border when closed */
	transition:
		max-height 350ms ease,
		opacity 250ms ease,
		padding 300ms ease,
		border-width 300ms ease;
}

/* Open state */
#faq .faq-njs details[open]>div {
	animation: njs-faq-open 350ms ease forwards;
	max-height: var(--faq-ans-max, 800px);
	/* pick a value taller than your longest answer */
	opacity: 1;
	padding: 16px 18px;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(0, 0, 0, .12);
	border-top: none;
	/* seamless with the summary “button” */
	border-radius: 0 0 12px 12px;
	background: #fff;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	#faq .faq-njs details>div {
		transition: none;
	}
}

#faq .faq-item {
	display: none;
}

/* No-JS FAQ (checkbox accordion) */
#faq .faq-njs {
	display: block;
}

#faq .faq-njs .nfaq-item {
	margin: 0 0 12px 0;
}

#faq .faq-njs .nfaq-toggle {
	position: absolute;
	left: -9999px;
}

#faq .faq-njs label.nfaq-question {
	display: block;
	padding: 14px 18px;
	font-weight: 700;
	color: #fff;
	background: var(--brand-blue, #0B5EC7);
	border-radius: 12px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
	cursor: pointer;
	text-align: center;
	transition: border-radius 200ms ease;
}

#faq .faq-njs .nfaq-answer {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	padding: 0 18px;
	border: 0;
	background: #fff;
	transition:
		max-height 350ms ease,
		opacity 250ms ease,
		padding 300ms ease,
		border-width 300ms ease;
	border-radius: 0 0 12px 12px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-top: none;
}

#faq .faq-njs .nfaq-toggle:checked~.nfaq-answer {
	max-height: var(--faq-ans-max, 800px);
	opacity: 1;
	padding: 16px 18px;
	border-width: 1px;
}

#faq .faq-njs .nfaq-toggle:checked+label.nfaq-question {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

@media (prefers-reduced-motion: reduce) {
	#faq .faq-njs .nfaq-answer {
		transition: none;
	}
}

#faq .faq-njs .nfaq-none {
	position: absolute;
	left: -9999px;
}


/* Overlay close control positioning */
#faq .faq-njs .nfaq-item {
	position: relative;
}


/* Invisible overlay that targets #nfaq-none to collapse when clicking the open header */
#faq .faq-njs .nfaq-close {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: var(--nfaq-qh, 52px);
	/* approximate header height; tweak via --nfaq-qh if needed */
	cursor: pointer;
	background: transparent;
}

/* Show overlay only when this item is open */
#faq .faq-njs .nfaq-toggle:checked+label.nfaq-question+.nfaq-close {
	display: block;
}

/* No-JS: snap with momentum; both Hero and Services are snap points */
:root {
	--nav-h: 64px;
}

/* adjust to your sticky nav height */

html {
	scroll-snap-type: y proximity;
	scroll-padding-top: var(--nav-h);
}

body {
	scroll-snap-type: y proximity;
	scroll-padding-top: var(--nav-h);
}

/* Snap targets */

/* Ensure Services lands below the sticky navbar */
#services {
	scroll-snap-align: start;
	scroll-snap-stop: always;
	scroll-margin-top: var(--nav-h);
	scroll-margin-bottom: 120vh;
}

/* Undo the previous mandatory/override rules if present */
#hero {
	scroll-snap-align: start;
}

/* cancels any `none` you tried */
@media (prefers-reduced-motion: reduce) {
	html, body {
		scroll-snap-type: none;
	}
}

/* No-JS scroll snap: Page title H1 is the snap point (works up & down) */
main > h1 {
	scroll-snap-align: start;
	scroll-snap-stop: always;
	scroll-margin-top: var(--nav-h); /* ensure H1 lands below sticky navbar */
}

/* Turn off snap on Services to avoid competing snap targets */
#services {
	scroll-snap-align: none;
}

/* Keep Hero from stealing the snap */
#hero {
	scroll-snap-align: none;
	z-index: 2;
}

/* If you used a sentinel before, keep it inert */
#services-snap-sentinel {
	scroll-snap-align: none;
	height: 0;
	margin: 0;
}

/* Non-JS mobile nav toggle (fade transitions) */
@media (max-width: 900px) {

	/* keep the dropdown in DOM so opacity can animate */
	#nav-toggle-fallback+#navbar-links {
		display: flex;
		opacity: 0;
		pointer-events: none;
		transition: opacity 220ms ease-in-out;
	}

	#nav-toggle-fallback:checked+#navbar-links {
		opacity: 1;
		pointer-events: auto;
	}
}

/* --- Close no-JS mobile nav after a link jump ---
   When any in-page anchor becomes the :target (e.g., after clicking a nav link),
   force the menu closed even if the checkbox remains checked.
   This uses :has(), supported in modern browsers (including Firefox 140+).
*/
@media (max-width: 900px) {
	body:has(main :target) #nav-toggle-fallback + #navbar-links {
		opacity: 0 !important;
		pointer-events: none !important;
		transition: opacity 220ms ease-in-out;
	}
}

/* Prevent carousel hydration from nudging anchoring (no-JS view) */
.carousel { overflow-anchor: none; }

/* Desktop ≥1101px (no-JS): inline links with full spacing */
@media (min-width: 1101px) {
	#navbar .nav-links {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 1rem;
		max-height: none;
		opacity: 1;
		pointer-events: auto;
	}
}

/* Mid-range 901–1100px (no-JS): keep inline links, tighten spacing to fit one line */
@media (min-width: 901px) and (max-width: 1100px) {
	#navbar {
		padding-top: 0.5rem;
		padding-bottom: 0.5rem;
	}
	.nav-container {
		padding-top: 0.5rem;
	}
	#navbar .nav-links {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: center;
		align-items: center;
		gap: 0.5rem;
		max-height: none;
		opacity: 1;
		pointer-events: auto;
		position: static;
		background: transparent;
		padding: 0;
		margin: 0;
	}
	#navbar .nav-links li { margin: 0; }
	#navbar .nav-links a {
		font-size: 0.9rem;
		padding-inline: 0.25rem;
		padding-block: 0.35rem;
		line-height: 1.1;
		white-space: nowrap;
	}
}
