/* ===============================================================
   JNF Tech — editable-block layer
   ---------------------------------------------------------------
   Styles that let NATIVE core blocks reproduce the designs which
   previously required raw core/html blocks.

   Everything here is keyed to registered block-style variations
   (is-style-*) or simple utility classes, so the block editor shows
   the same result as the front end and the markup stays editable.
   =============================================================== */

/* ---------------------------------------------------------------
   A. Card grid — core/group with layout:grid
   --------------------------------------------------------------- */

/* Native grid layout already emits display:grid; we only set the
   track sizing so cards behave like the old .jnf-cards grid.

   The grid block carries align:wide, so it resolves to wide-size
   (1200px) rather than content-size (760px). At 760px only two
   290px tracks fit, which pairs a short card with a tall one and
   stretches the short one to match. Four tracks keep the height
   difference within a single row much smaller. */
/* Six cards laid out as two rows of three.

   `auto-fit` with a 290px minimum is not used here: at the 1200px wide
   size four columns would need 1232px, so it silently resolved to three
   and left the fourth card alone on its own row. Explicit column counts
   at each breakpoint keep the rows full and predictable. */
.jnf-cards.is-layout-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
	align-items: stretch;
}

/* Two across on tablets, one on phones. Six cards divide evenly into
   both, so no row is ever left with a single orphan card. */
@media (max-width: 1023px) {
	.jnf-cards.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 639px) {
	.jnf-cards.is-layout-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Cards in a row are stretched to the tallest sibling by align-items.
   Anchoring the intro paragraph's height to the longest one in the row
   means the bullet lists start on a common baseline, so an uneven
   sentence length no longer opens a visible gap under the heading. */
.jnf-cards.is-layout-grid > .is-style-jnf-card:not(.jnf-span-all) > p {
	min-height: 3.9em;
}

/* Below the three-column breakpoint the cards are wider, so the intros
   wrap to fewer lines and a reserved height would only add whitespace.
   This threshold must track the grid breakpoint above. */
@media (max-width: 1023px) {
	.jnf-cards.is-layout-grid > .is-style-jnf-card:not(.jnf-span-all) > p {
		min-height: 0;
	}
}

/* A card that should span the full grid width. */
.jnf-span-all {
	grid-column: 1 / -1;
}

/* In a full-width card the feature list flows into two columns on
   larger screens. Using CSS columns keeps the block markup a single
   plain list, so it stays easy to edit. */
@media (min-width: 900px) {
	.jnf-span-all > .is-style-jnf-feature {
		columns: 2;
		column-gap: 2.5rem;
	}

	.jnf-span-all > .is-style-jnf-feature li {
		break-inside: avoid;
	}
}

/* ---------------------------------------------------------------
   A1. Sub-card grid — grouped subsections inside a page section
   Used on Services where each capability area has its own heading
   and checklist. A grid means the columns reflow on their own, so
   there is no hand-balanced Columns block to keep in sync.
   --------------------------------------------------------------- */

.jnf-subcards.is-layout-grid {
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: var(--wp--preset--spacing--50, 2rem) var(--wp--preset--spacing--60, 2.5rem);
	align-items: start;
}

/* ---------------------------------------------------------------
   A1b. Two-column reflowing list
   One editable list that renders as two columns on wide screens.
   Replaces paired Columns blocks holding half a list each.
   --------------------------------------------------------------- */

@media (min-width: 782px) {
	.jnf-2col {
		columns: 2;
		column-gap: var(--wp--preset--spacing--60, 2.5rem);
	}

	.jnf-2col li {
		break-inside: avoid;
	}
}

/* ---------------------------------------------------------------
   A2. Large call-to-action buttons
   Replaces per-button inline padding so the design is not lost when
   the padding controls are touched in the editor.
   --------------------------------------------------------------- */

.jnf-btn-lg > .wp-block-button__link {
	padding: 1rem 2rem;
}

/* ---------------------------------------------------------------
   B. Card internals for native blocks
   --------------------------------------------------------------- */

.is-style-jnf-card > h3,
.is-style-jnf-card > .wp-block-heading {
	font-size: 1.125rem !important;
	margin: 0 0 .25rem;
	line-height: 1.35;
}

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

/* Push the feature list to fill remaining height so card footers align. */
.is-style-jnf-card > .is-style-jnf-feature {
	margin-bottom: auto;
}
/* ===============================================================
   JNF Tech — CSS icon system
   ---------------------------------------------------------------
   Icons attach to a native block through a utility class such as
   `has-icon-microsoft`. The glyph lives in a CSS mask, so the block
   editor shows plain editable text with no inline SVG markup for the
   user to break.

   Two pseudo-elements are used:
     ::before  the translucent rounded tile
     ::after   the glyph, painted in the accent colour via a mask
   =============================================================== */

[class*="has-icon-"] {
	--jnf-icon-size: 40px;
	--jnf-icon-glyph: 21px;
	--jnf-icon-tile-bg: rgba(30, 111, 217, .09);
	--jnf-icon-color: var(--wp--preset--color--accent-2, #1e6fd9);
	position: relative;
}

/* The tile. Sits in normal flow so it pushes content down. */
[class*="has-icon-"]::before {
	content: "";
	display: block;
	width: var(--jnf-icon-size);
	height: var(--jnf-icon-size);
	margin-bottom: 1rem;
	border-radius: var(--jnf-radius-sm, 6px);
	background-color: var(--jnf-icon-tile-bg);
	flex: 0 0 auto;
}

/* The glyph, overlaid on the tile. */
[class*="has-icon-"]::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: var(--jnf-icon-size);
	height: var(--jnf-icon-size);
	background-color: var(--jnf-icon-color);
	-webkit-mask-image: var(--jnf-icon-mask);
	mask-image: var(--jnf-icon-mask);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: var(--jnf-icon-glyph) var(--jnf-icon-glyph);
	mask-size: var(--jnf-icon-glyph) var(--jnf-icon-glyph);
	pointer-events: none;
}

/* Inside a card the tile is offset by the card padding. */
.is-style-jnf-card[class*="has-icon-"]::after {
	top: 1.75rem;
	left: 1.75rem;
}

/* On navy sections the tile and glyph invert. */
.jnf-section--navy [class*="has-icon-"] {
	--jnf-icon-tile-bg: rgba(124, 178, 245, .16);
	--jnf-icon-color: #7cb2f5;
}

/* ---------------------------------------------------------------
   Icon glyph masks
   --------------------------------------------------------------- */

.has-icon-microsoft { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2215%22%20width%3D%2218%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Cpath%20d%3D%22M7%206.5h.01M7%2017.5h.01%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-network { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M12%202v7M12%2015v7M2%2012h7M15%2012h7%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-virtualization { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%228%22%20height%3D%228%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2213%22%20y%3D%223%22%20width%3D%228%22%20height%3D%228%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2213%22%20width%3D%228%22%20height%3D%228%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2213%22%20y%3D%2213%22%20width%3D%228%22%20height%3D%228%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-endpoint { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%2220%22%20height%3D%2212%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%2020h8M12%2016v4%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-linux { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%223%22%20width%3D%2220%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22m7%209%202.5%202.5L7%2014%22%2F%3E%3Cpath%20d%3D%22M13%2014.5h4%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-ai { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M9%209h6v6H9zM12%201v3M12%2020v3M1%2012h3M20%2012h3%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-email { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%2220%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22m2%207%2010%206%2010-6%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-phone { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M22%2016.9v3a2%202%200%200%201-2.2%202%2019.8%2019.8%200%200%201-8.6-3.1%2019.5%2019.5%200%200%201-6-6A19.8%2019.8%200%200%201%202.1%204.2%202%202%200%200%201%204.1%202h3a2%202%200%200%201%202%201.7c.1%201%20.4%201.9.7%202.8a2%202%200%200%201-.5%202.1L8.1%209.9a16%2016%200%200%200%206%206l1.3-1.3a2%202%200%200%201%202.1-.4c.9.3%201.8.5%202.8.6a2%202%200%200%201%201.7%202Z%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-location { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2010c0%206-8%2012-8%2012s-8-6-8-12a8%208%200%200%201%2016%200Z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2210%22%20r%3D%223%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-linkedin { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M16%208a6%206%200%200%201%206%206v7h-4v-7a2%202%200%200%200-4%200v7h-4v-7a6%206%200%200%201%206-6Z%22%2F%3E%3Crect%20x%3D%222%22%20y%3D%229%22%20width%3D%224%22%20height%3D%2212%22%2F%3E%3Ccircle%20cx%3D%224%22%20cy%3D%224%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-shield { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2022s8-4%208-10V5l-8-3-8%203v7c0%206%208%2010%208%2010Z%22%2F%3E%3Cpath%20d%3D%22m9%2012%202%202%204-4%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-clock { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M12%207v5l3%202%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-wrench { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14.7%206.3a4%204%200%200%200%205%205L21%2021H3l9.7-14.7Z%22%2F%3E%3C%2Fsvg%3E"); }
.has-icon-lock { --jnf-icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%2210%22%20width%3D%2216%22%20height%3D%2211%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%2010V7a4%204%200%200%201%208%200v3%22%2F%3E%3C%2Fsvg%3E"); }
/* ===============================================================
   JNF Tech — native-block equivalents of former raw-HTML designs
   =============================================================== */

/* ---------------------------------------------------------------
   Feature list inside a card  (core/list, is-style-jnf-feature)
   Replaces `.jnf-card ul`
   --------------------------------------------------------------- */

.is-style-jnf-feature {
	list-style: none;
	padding: 0;
	margin: 0 0 auto;
	font-size: .9375rem;
	color: var(--wp--preset--color--accent-3, #64748b);
}

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

.is-style-jnf-feature 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;
}

.jnf-section--navy .is-style-jnf-feature { color: rgba(255, 255, 255, .72); }
.jnf-section--navy .is-style-jnf-feature li::before { background: #7cb2f5; opacity: .8; }

/* ---------------------------------------------------------------
   Stats  (core/group layout:grid + core/group per stat)
   Replaces `.jnf-stats`
   --------------------------------------------------------------- */

.jnf-stats-grid.is-layout-grid {
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 1.5rem;
}

.is-style-jnf-stat {
	padding: 1.25rem 0 1.25rem 1.25rem;
	border-left: 3px solid rgba(30, 111, 217, .3);
}

/* First paragraph/heading in a stat = the big number. */
.is-style-jnf-stat > :first-child {
	display: block;
	font-family: var(--wp--preset--font-family--manrope, sans-serif);
	font-size: clamp(1.75rem, 3.5vw, 2.25rem) !important;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -.02em;
	color: var(--wp--preset--color--contrast, #0b1f33);
	margin: 0;
}

/* Second = the label. */
.is-style-jnf-stat > :last-child {
	display: block;
	font-size: .875rem;
	color: var(--wp--preset--color--accent-3, #64748b);
	margin: .25rem 0 0;
}

.jnf-section--navy .is-style-jnf-stat { border-left-color: rgba(124, 178, 245, .45); }
.jnf-section--navy .is-style-jnf-stat > :first-child { color: #fff; }
.jnf-section--navy .is-style-jnf-stat > :last-child { color: rgba(255, 255, 255, .7); }

/* ---------------------------------------------------------------
   Contact detail row  (core/group, is-style-jnf-contact-row)
   Replaces `.jnf-contact-list li`
   --------------------------------------------------------------- */

.is-style-jnf-contact-row {
	display: flex;
	gap: .875rem;
	align-items: flex-start;
	margin-bottom: 1.5rem;
}

/*
 * The row and its text wrapper use the default (flow) block layout so that
 * WordPress does not emit `max-width` + `margin-inline: auto`, which would
 * centre the label/value pair inside the flex row.
 *
 * Flow layout still injects `margin-block-start: 1.5rem` on every child
 * after the first, via `:root :where(.is-layout-flow) > *`. That would push
 * the value away from its label, so it is reset here. `:root` is included to
 * match that rule's specificity (0,2,0) and win on source order.
 */
:root .is-style-jnf-contact-row > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

:root .is-style-jnf-contact-row > div > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* The text wrapper must not stretch or centre; it hugs its content. */
.is-style-jnf-contact-row > div {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

/* Smaller tile, aligned to the top of the text, no bottom margin. */
.is-style-jnf-contact-row[class*="has-icon-"] {
	--jnf-icon-size: 36px;
}

.is-style-jnf-contact-row[class*="has-icon-"]::before {
	margin-bottom: 0;
}

/* Label / value typography, driven by block styles not raw spans. */
.is-style-jnf-contact-row .jnf-c-label,
.is-style-jnf-contact-row > div > :first-child {
	display: block;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-3, #64748b);
	margin: 0 0 .125rem;
}

.is-style-jnf-contact-row > div > :last-child {
	display: block;
	font-size: 1rem;
	font-weight: 500;
	color: var(--wp--preset--color--contrast, #0b1f33);
	word-break: break-word;
	margin: 0;
}

.is-style-jnf-contact-row > div > :last-child a {
	color: var(--wp--preset--color--accent-2, #1e6fd9);
}
