/**
 * JNF Tech Solutions — component styles
 * Design tokens live in theme.json; this file covers components
 * the block system cannot express on its own.
 */

/* ---------------------------------------------------------------
   1. Base refinements
   --------------------------------------------------------------- */

:root {
	--jnf-radius: 8px;
	--jnf-radius-sm: 6px;
	--jnf-border: var(--wp--preset--color--accent-4, #e2e8ef);
	--jnf-shadow: 0 1px 2px rgba(11, 31, 51, .04), 0 2px 8px rgba(11, 31, 51, .04);
	--jnf-shadow-hover: 0 2px 4px rgba(11, 31, 51, .06), 0 8px 24px rgba(11, 31, 51, .08);
	--jnf-transition: .18s cubic-bezier(.4, 0, .2, 1);
}

html {
	scroll-behavior: smooth;
	/* Offset anchor targets so the sticky header does not cover headings. */
	scroll-padding-top: 90px;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Keep long technical strings from breaking the layout. */
p, li, td { overflow-wrap: break-word; }

/* Visible focus for keyboard users everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-2, #1e6fd9);
	outline-offset: 2px;
	border-radius: 3px;
}

/* Skip link */
.skip-link:focus {
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #0b1f33);
	padding: .75rem 1.25rem;
	z-index: 100000;
}

/* ---------------------------------------------------------------
   2. Header
   --------------------------------------------------------------- */

.jnf-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--jnf-border);
}

.jnf-header .wp-block-site-title a { color: var(--wp--preset--color--contrast, #0b1f33); }

/* ---- Header bar layout -------------------------------------------
   Small screens: brand on the left, hamburger + CTA on the right.
   Wide screens: a 3-track grid so the nav sits in the true centre of
   the page while the brand is pulled in towards the middle.
   ------------------------------------------------------------------ */

.jnf-header-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 1rem;
}

.jnf-header-brand,
.jnf-header-nav,
.jnf-header-actions { min-width: 0; }

/* The bar keeps WordPress' flow-layout class, which adds a top margin to
   every child after the first. That would drop the nav and CTA below the
   logo, so it is reset here. */
.jnf-header-bar > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Hide the empty middle track on mobile: the nav renders as a
   hamburger which we group with the CTA instead. */
.jnf-header-nav { margin-left: auto; }

@media (min-width: 1024px) {
	.jnf-header-bar {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		align-items: center;
		column-gap: clamp(1.5rem, 4vw, 3.25rem);
	}

	/* Brand hugs the centre column rather than the far-left edge. */
	.jnf-header-brand {
		grid-column: 1;
		justify-self: end;
	}

	.jnf-header-nav {
		grid-column: 2;
		justify-self: center;
		margin-left: 0;
	}

	.jnf-header-actions {
		grid-column: 3;
		justify-self: end;
	}
}

/* Nav spacing */
.jnf-header .wp-block-navigation { --wp--style--block-gap: 0; }

.jnf-header .wp-block-navigation .wp-block-navigation__container {
	flex-wrap: nowrap;
}

.jnf-header .wp-block-navigation .wp-block-navigation-item__content {
	padding: .4rem 0;
	position: relative;
}

/* Understated underline on hover instead of a colour flash. */
.jnf-header .wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--wp--preset--color--accent-2, #1e6fd9);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--jnf-transition);
}

.jnf-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.jnf-header .wp-block-navigation .current-menu-item .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

/* The CTA button inside the nav area should not get the underline. */
.jnf-header .wp-block-button__link::after { display: none; }

/* Mobile overlay menu */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: 2rem 1.5rem;
	background: var(--wp--preset--color--base, #fff);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.25rem;
	font-weight: 600;
}

/* ---------------------------------------------------------------
   3. Hero
   --------------------------------------------------------------- */

.jnf-hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(120% 90% at 82% 8%, rgba(30, 111, 217, .22) 0%, transparent 58%),
		linear-gradient(160deg, #0b1f33 0%, #123c5e 100%);
	color: #fff;
	isolation: isolate;
}

/* Subtle technical grid — communicates "infrastructure" without noise. */
.jnf-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
	background-size: 56px 56px;
	mask-image: radial-gradient(80% 70% at 50% 30%, #000 30%, transparent 78%);
	-webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 30%, transparent 78%);
	pointer-events: none;
}

.jnf-hero h1,
.jnf-hero h2,
.jnf-hero p { color: #fff; }

.jnf-hero .jnf-sub {
	color: rgba(255, 255, 255, .82);
	max-width: 46ch;
}

/* Technology strip under the hero copy */
.jnf-techstrip {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem .75rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.jnf-techstrip li {
	font-family: var(--wp--preset--font-family--fira-code, monospace);
	font-size: .8125rem;
	letter-spacing: .01em;
	color: rgba(255, 255, 255, .9);
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 100px;
	padding: .3rem .75rem;
	margin: 0;
	white-space: nowrap;
}

/* Trust badges row */
.jnf-trust {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: .875rem;
	color: rgba(255, 255, 255, .72);
}

.jnf-trust li {
	margin: 0;
	display: flex;
	align-items: center;
	gap: .5rem;
}

.jnf-trust li::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #4ade80;
	flex: 0 0 auto;
}

/* ---------------------------------------------------------------
   4. Sections & headings
   --------------------------------------------------------------- */

.jnf-section { padding-block: clamp(56px, 8vw, 96px); }

.jnf-section--alt { background: var(--wp--preset--color--accent-5, #f7f9fb); }

.jnf-section--navy {
	background: var(--wp--preset--color--contrast, #0b1f33);
	color: #fff;
}

.jnf-section--navy h2,
.jnf-section--navy h3,
.jnf-section--navy li,
.jnf-section--navy p { color: #fff; }

/* Body copy in list items is slightly softened, matching paragraphs. */
.jnf-section--navy li { color: rgba(255, 255, 255, .85); }

.jnf-section--navy p { color: rgba(255, 255, 255, .8); }

/* Eyebrow label above section headings */
.is-style-jnf-eyebrow {
	font-family: var(--wp--preset--font-family--manrope, sans-serif);
	font-size: .8125rem !important;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-2, #1e6fd9);
	margin-bottom: .5rem;
}

.jnf-section--navy .is-style-jnf-eyebrow { color: #7cb2f5; }

/*
 * .jnf-lead carries colour and measure only.
 *
 * The size comes from the `lead` font-size preset, applied in the editor
 * via the Size control (has-lead-font-size). Keeping a font-size here as
 * well would fight that preset — WordPress emits preset classes with
 * !important, so an author changing the size in the sidebar would see no
 * effect on some elements and a jump on others.
 */
.jnf-lead {
	color: var(--wp--preset--color--accent-3, #64748b);
	max-width: 65ch;
}

/* Fallback size for lead paragraphs with no explicit preset applied. */
.jnf-lead:not([class*="has-"][class*="-font-size"]) {
	font-size: var(--wp--preset--font-size--lead, 1.125rem);
}

.jnf-section--navy .jnf-lead { color: rgba(255, 255, 255, .78); }

/* ---------------------------------------------------------------
   5. Service cards
   --------------------------------------------------------------- */

.jnf-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
	gap: 1.5rem;
}

.is-style-jnf-card,
.jnf-card {
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--jnf-border);
	border-radius: var(--jnf-radius);
	padding: 1.75rem;
	box-shadow: var(--jnf-shadow);
	transition: box-shadow var(--jnf-transition), border-color var(--jnf-transition), transform var(--jnf-transition);
	height: 100%;
	display: flex;
	flex-direction: column;
}

.is-style-jnf-card:hover,
.jnf-card:hover {
	border-color: #c9d6e5;
	box-shadow: var(--jnf-shadow-hover);
	transform: translateY(-2px);
}

.jnf-card h3 {
	font-size: 1.125rem !important;
	margin: 0 0 .25rem;
	display: flex;
	align-items: center;
	gap: .625rem;
}

.jnf-card p { margin: 0 0 1rem; }

/* Icon holder */
.jnf-icon {
	width: 40px;
	height: 40px;
	border-radius: var(--jnf-radius-sm);
	background: rgba(30, 111, 217, .09);
	color: var(--wp--preset--color--accent-2, #1e6fd9);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin-bottom: 1rem;
}

.jnf-icon svg {
	width: 21px;
	height: 21px;
	stroke: currentColor;
	stroke-width: 1.75;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Feature list inside a card */
.jnf-card ul {
	list-style: none;
	padding: 0;
	margin: 0 0 auto;
	font-size: .9375rem;
	color: var(--wp--preset--color--accent-3, #64748b);
}

.jnf-card ul li {
	position: relative;
	padding-left: 1.375rem;
	margin: 0 0 .5rem;
	line-height: 1.55;
}

.jnf-card ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .5em;
	width: 6px;
	height: 6px;
	border-radius: 1px;
	background: var(--wp--preset--color--accent-2, #1e6fd9);
	opacity: .55;
}

/* Wide card that spans the grid on large screens */
.jnf-card--wide { grid-column: 1 / -1; }

@media (min-width: 900px) {
	.jnf-card--wide {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
		gap: 2rem;
		align-items: start;
	}
	.jnf-card--wide .jnf-icon { margin-bottom: .75rem; }
}

/* ---------------------------------------------------------------
   6. Checkmark / tag lists
   --------------------------------------------------------------- */

.is-style-jnf-check {
	list-style: none;
	padding: 0;
	margin: 0;
}

.is-style-jnf-check li {
	position: relative;
	padding-left: 2rem;
	margin-bottom: .875rem;
	line-height: 1.6;
}

.is-style-jnf-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .2em;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(30, 111, 217, .1);
}

.is-style-jnf-check li::after {
	content: "";
	position: absolute;
	left: 6px;
	top: .5em;
	width: 8px;
	height: 4px;
	border-left: 2px solid var(--wp--preset--color--accent-2, #1e6fd9);
	border-bottom: 2px solid var(--wp--preset--color--accent-2, #1e6fd9);
	transform: rotate(-45deg);
}

.jnf-section--navy .is-style-jnf-check li::before { background: rgba(255, 255, 255, .12); }
.jnf-section--navy .is-style-jnf-check li::after {
	border-left-color: #7cb2f5;
	border-bottom-color: #7cb2f5;
}

.is-style-jnf-inline {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.is-style-jnf-inline li {
	margin: 0;
	font-size: .875rem;
	padding: .3rem .7rem;
	border: 1px solid var(--jnf-border);
	border-radius: 100px;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--accent-1, #123c5e);
}

/* ---------------------------------------------------------------
   7. Stats strip
   --------------------------------------------------------------- */

.jnf-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 1.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.jnf-stats li {
	margin: 0;
	padding: 1.25rem 0 1.25rem 1.25rem;
	border-left: 3px solid rgba(30, 111, 217, .3);
}

.jnf-stats .jnf-stat-num {
	display: block;
	font-family: var(--wp--preset--font-family--manrope, sans-serif);
	font-size: clamp(1.75rem, 3.5vw, 2.25rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -.02em;
	color: var(--wp--preset--color--contrast, #0b1f33);
}

.jnf-stats .jnf-stat-label {
	display: block;
	font-size: .875rem;
	color: var(--wp--preset--color--accent-3, #64748b);
	margin-top: .25rem;
}

.jnf-section--navy .jnf-stats li { border-left-color: rgba(124, 178, 245, .45); }
.jnf-section--navy .jnf-stats .jnf-stat-num { color: #fff; }
.jnf-section--navy .jnf-stats .jnf-stat-label { color: rgba(255, 255, 255, .7); }

/* ---------------------------------------------------------------
   8. Contact details block
   --------------------------------------------------------------- */

.jnf-contact-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.jnf-contact-list li {
	display: flex;
	gap: .875rem;
	align-items: flex-start;
	margin-bottom: 1.5rem;
}

.jnf-contact-list .jnf-icon {
	width: 36px;
	height: 36px;
	margin-bottom: 0;
}

.jnf-contact-list .jnf-c-label {
	display: block;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-3, #64748b);
	margin-bottom: .125rem;
}

.jnf-contact-list .jnf-c-value {
	display: block;
	font-size: 1rem;
	font-weight: 500;
	color: var(--wp--preset--color--contrast, #0b1f33);
	word-break: break-word;
}

.jnf-contact-list a.jnf-c-value { color: var(--wp--preset--color--accent-2, #1e6fd9); }

/* ---------------------------------------------------------------
   9. Contact form
   --------------------------------------------------------------- */

.jnf-form-wrap {
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--jnf-border);
	border-radius: var(--jnf-radius);
	padding: clamp(1.5rem, 3vw, 2.25rem);
	box-shadow: var(--jnf-shadow);
}

.jnf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0 1.25rem;
}

.jnf-field { margin: 0 0 1.25rem; }

.jnf-field label {
	display: block;
	font-family: var(--wp--preset--font-family--manrope, sans-serif);
	font-size: .875rem;
	font-weight: 600;
	color: var(--wp--preset--color--contrast, #0b1f33);
	margin-bottom: .375rem;
}

.jnf-req { color: #d64545; font-weight: 400; }

.jnf-form input[type="text"],
.jnf-form input[type="email"],
.jnf-form input[type="tel"],
.jnf-form select,
.jnf-form textarea {
	width: 100%;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--wp--preset--color--contrast, #0b1f33);
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid #cbd5e1;
	border-radius: var(--jnf-radius-sm);
	padding: .6875rem .875rem;
	transition: border-color var(--jnf-transition), box-shadow var(--jnf-transition);
	appearance: none;
	-webkit-appearance: none;
}

.jnf-form textarea {
	resize: vertical;
	min-height: 140px;
}

.jnf-form select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .75rem center;
	background-size: 18px;
	padding-right: 2.5rem;
	cursor: pointer;
}

.jnf-form input:focus,
.jnf-form select:focus,
.jnf-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent-2, #1e6fd9);
	box-shadow: 0 0 0 3px rgba(30, 111, 217, .14);
}

.jnf-form input::placeholder,
.jnf-form textarea::placeholder { color: #94a3b8; }

/* Honeypot: hidden from humans but not via display:none, which some bots detect. */
.jnf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.jnf-field-error {
	display: block;
	font-size: .8125rem;
	color: #c53030;
	margin-top: .3125rem;
	font-weight: 500;
}

/* Submit row */
.jnf-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .875rem 1.25rem;
	margin: .5rem 0 0;
}

.jnf-btn {
	font-family: var(--wp--preset--font-family--manrope, sans-serif);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: .01em;
	color: #fff;
	background: var(--wp--preset--color--accent-2, #1e6fd9);
	border: 1px solid var(--wp--preset--color--accent-2, #1e6fd9);
	border-radius: var(--jnf-radius-sm);
	padding: .875rem 1.75rem;
	cursor: pointer;
	transition: background-color var(--jnf-transition), border-color var(--jnf-transition), transform var(--jnf-transition);
}

.jnf-btn:hover {
	background: var(--wp--preset--color--accent-7, #0f5ab8);
	border-color: var(--wp--preset--color--accent-7, #0f5ab8);
}

.jnf-btn:active { transform: translateY(1px); }

.jnf-privacy {
	font-size: .8125rem;
	color: var(--wp--preset--color--accent-3, #64748b);
}

/* Notices */
.jnf-notice {
	border-radius: var(--jnf-radius-sm);
	padding: 1rem 1.125rem;
	margin-bottom: 1.5rem;
	border-left: 3px solid;
	font-size: .9375rem;
}

.jnf-notice p { margin: .375rem 0 0; font-size: .9375rem; }

.jnf-notice--success {
	background: #f0fdf4;
	border-left-color: #16a34a;
	color: #14532d;
}

.jnf-notice--error {
	background: #fef2f2;
	border-left-color: #dc2626;
	color: #7f1d1d;
}

/* ---------------------------------------------------------------
   10. Footer
   --------------------------------------------------------------- */

.jnf-footer {
	background: var(--wp--preset--color--contrast, #0b1f33);
	color: rgba(255, 255, 255, .68);
	font-size: .9375rem;
}

.jnf-footer h2,
.jnf-footer h3,
.jnf-footer .wp-block-site-title a { color: #fff; }

.jnf-footer p { color: rgba(255, 255, 255, .68); }

.jnf-footer a {
	color: rgba(255, 255, 255, .82);
	text-decoration: none;
}

.jnf-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.jnf-footer ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.jnf-footer ul li { margin-bottom: .5rem; }

.jnf-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .12);
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	font-size: .8125rem;
	color: rgba(255, 255, 255, .5);
}

.jnf-footer-bottom a { color: rgba(255, 255, 255, .6); }

/* ---------------------------------------------------------------
   11. Utilities
   --------------------------------------------------------------- */

.jnf-mw-60 { max-width: 60ch; }
.jnf-mw-70 { max-width: 70ch; }

.jnf-divider {
	height: 1px;
	background: var(--jnf-border);
	border: 0;
	margin: 0;
}

/* Buttons should wrap gracefully on small screens. */
@media (max-width: 480px) {
	.wp-block-buttons { width: 100%; }
	.wp-block-button { width: 100%; }
	.wp-block-button__link { width: 100%; text-align: center; }
	.jnf-btn { width: 100%; }
}

/* Print: hide chrome, keep content readable. */
@media print {
	.jnf-header, .jnf-footer, .jnf-form-wrap { display: none !important; }
	.jnf-hero { background: none !important; color: #000 !important; }
	.jnf-hero h1, .jnf-hero p { color: #000 !important; }
}
