/* ==========================================================================
   NJ Real Estate Licensing School: base (tokens, reset, type scale, buttons, lists, motion, utilities).
   Tokens come from theme.json (--wp--preset--*, --wp--custom--*).
   Look: schoolbook slab headlines (Besley) over a plain grotesque (Libre Franklin), square corners,
   hairline rules instead of floating cards, and two marks taken from the logo: the roof line (gabled
   photos, ridge dividers) and the four-pane window (eyebrow / list glyph).
   ========================================================================== */

:root {
	--nj-red: var(--wp--preset--color--red);          /* logo red #E64C50 */
	--nj-red-600: var(--wp--preset--color--red-600);  /* buttons, white text AA */
	--nj-red-700: var(--wp--preset--color--red-700);
	--nj-red-100: var(--wp--preset--color--red-100);
	--nj-red-50: var(--wp--preset--color--red-50);
	--nj-red-300: var(--wp--preset--color--red-300);
	--nj-ink: var(--wp--preset--color--ink);
	--nj-graphite: var(--wp--preset--color--graphite);
	--nj-stone: var(--wp--preset--color--stone);
	--nj-muted: var(--wp--preset--color--muted);
	--nj-line: var(--wp--preset--color--line);
	--nj-sand: var(--wp--preset--color--sand);
	--nj-paper: var(--wp--preset--color--paper);
	--nj-display: var(--wp--preset--font-family--display);
	--nj-body: var(--wp--preset--font-family--body);
	--nj-gutter: clamp(20px, 4vw, 40px);
	--nj-wide: 1240px;
	--nj-frame: 0px;
	--nj-section: 112px;
	--nj-r-btn: 2px;
	--nj-r-card: 4px;
	--nj-r-media: 3px;
	--nj-rule: 2px solid var(--nj-ink);               /* heavy rule on top of ruled panels */
	--nj-hair: 1px solid var(--nj-line);
	--nj-ease: cubic-bezier(.22, 1, .36, 1);
	--nj-ease-io: cubic-bezier(.44, 0, .56, 1);
	--nj-shadow: 0 10px 24px -12px rgb(26 28 31 / .22);
	--nj-shadow-float: 0 18px 40px -18px rgb(26 28 31 / .35);
	--nj-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='square'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E");
	--nj-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='m5 12.5 4.2 4.2L19 7'/%3E%3C/svg%3E");
	--nj-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2.8 2.8 5.9 6.4.8-4.7 4.4 1.2 6.3L12 17.1l-5.7 3.1 1.2-6.3L2.8 9.5l6.4-.8z'/%3E%3C/svg%3E");
	--nj-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.9 2z'/%3E%3C/svg%3E");
	/* the logo's four-pane window, drawn with four gradients (currentColor) */
	--nj-pane: linear-gradient(currentColor, currentColor);
	/* one roof peak on a hairline: the ridge divider */
	--nj-ridge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 18' fill='none' stroke='%23E64C50' stroke-width='2.5' stroke-linejoin='miter'%3E%3Cpath d='M2 16 20 4l10 6.6L46 2l24 14'/%3E%3C/svg%3E");
}
@media (max-width: 781px) { :root { --nj-section: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
body { margin: 0; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background: var(--nj-paper); font-feature-settings: "kern", "liga"; }
img, video, iframe { max-width: 100%; }
img { display: block; height: auto; }
figure { margin: 0; }
.wp-block-image { line-height: 0; }
::selection { background: var(--nj-ink); color: #fff; }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; overflow-wrap: break-word; margin-block: 0; }
p, li { overflow-wrap: break-word; text-wrap: pretty; }
p { margin-block: 0; }
strong { font-weight: 600; color: var(--nj-ink); }

a { text-underline-offset: .2em; text-decoration-thickness: 1px; transition: color .2s var(--nj-ease-io), text-decoration-color .2s; }
:where(p, li, td, dd, figcaption) a { color: var(--nj-ink); text-decoration-line: underline; text-decoration-color: var(--nj-red); text-decoration-thickness: 1.5px; }
:where(p, li, td, dd, figcaption) a:hover { color: var(--nj-red-700); }

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--nj-red-600);
	outline-offset: 3px;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Type scale: display 64 · h1 56 · h2 44 · h3 24 · h4 20 · lead 20 · body 16/17 · small 14 · eyebrow 12
   Old heading LEVELS are never changed; these classes only style them.
   -------------------------------------------------------------------------- */
.nj-display { font-size: 64px !important; line-height: 1.04 !important; letter-spacing: -.022em !important; font-weight: 500; }
.nj-h2 { font-size: 44px !important; line-height: 1.1 !important; letter-spacing: -.018em !important; }
.nj-h3 { font-size: 24px !important; line-height: 1.25 !important; letter-spacing: -.01em !important; font-family: var(--nj-display); font-weight: 600; color: var(--nj-ink); }
.nj-lead { font-size: 19px; line-height: 1.55; color: var(--nj-stone); }
.nj-small { font-size: 14px; line-height: 1.5; }
.nj-note { font-size: 16px; color: var(--nj-ink); font-weight: 500; }
.nj-center { text-align: center; }
.nj-uppercase { text-transform: uppercase; }
@media (max-width: 1100px) {
	.nj-display { font-size: 52px !important; }
	.nj-h2 { font-size: 38px !important; }
}
@media (max-width: 781px) {
	h1 { font-size: 36px !important; line-height: 1.1 !important; }
	.nj-display { font-size: 38px !important; line-height: 1.08 !important; }
	.nj-h2, h2.wp-block-heading { font-size: 30px !important; line-height: 1.14 !important; }
	h3.wp-block-heading:not(.nj-h2), .nj-h3 { font-size: 21px !important; }
	.nj-lead { font-size: 17px; }
}

/* Eyebrow: small tracked caps led by the logo's four-pane window. */
.nj-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--nj-body);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--nj-ink);
}
.nj-eyebrow::before {
	content: "";
	flex: none;
	width: 11px;
	height: 11px;
	color: var(--nj-red);
	background: var(--nj-pane) 0 0 / 5px 5px no-repeat, var(--nj-pane) 100% 0 / 5px 5px no-repeat, var(--nj-pane) 0 100% / 5px 5px no-repeat, var(--nj-pane) 100% 100% / 5px 5px no-repeat;
}

.nj-lead-in { display: inline-block; font-family: var(--nj-display); font-weight: 600; font-size: 19px; line-height: 1.3; letter-spacing: -.005em; color: var(--nj-ink); margin-bottom: 8px; }

/* --------------------------------------------------------------------------
   Buttons: square, 50px tall, solid. The arrow steps forward on hover.
   All core buttons get .nj-btn + an inner label span (inc/blocks.php).
   -------------------------------------------------------------------------- */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.wp-block-button__link.nj-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 50px;
	padding: 0 22px;
	border-radius: var(--nj-r-btn);
	background: var(--nj-red-600);
	color: #fff;
	font-family: var(--nj-body);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .01em;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .22s var(--nj-ease-io), color .22s var(--nj-ease-io), box-shadow .22s var(--nj-ease-io), transform .1s;
}
.wp-block-button__link.nj-btn:hover { background: var(--nj-ink); color: #fff; }
.wp-block-button__link.nj-btn:active { transform: translateY(1px); }
.nj-btn__label { display: inline-block; line-height: 1.25; }
.nj-btn__arrow { width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--nj-arrow) center / 16px no-repeat; mask: var(--nj-arrow) center / 16px no-repeat; transition: transform .28s var(--nj-ease); }
.nj-btn:hover .nj-btn__arrow { transform: translateX(4px); }
.nj-btn--tel .nj-btn__arrow { -webkit-mask-image: var(--nj-phone); mask-image: var(--nj-phone); -webkit-mask-size: 15px; mask-size: 15px; order: -1; }
.nj-btn--tel:hover .nj-btn__arrow { transform: rotate(-12deg); }
/* Long labels wrap instead of pushing the page wider on small screens */
.wp-block-button { max-width: 100%; }
@media (max-width: 600px) {
	.wp-block-button__link.nj-btn { max-width: 100%; white-space: normal; text-align: center; padding-block: 12px; }
}

/* Outline (on light) */
.is-style-nj-outline .wp-block-button__link.nj-btn { background: transparent; color: var(--nj-ink); box-shadow: inset 0 0 0 1.5px var(--nj-ink); }
.is-style-nj-outline .wp-block-button__link.nj-btn:hover { background: var(--nj-ink); color: #fff; }
/* Light (on ink / red panels) */
.is-style-nj-light .wp-block-button__link.nj-btn { background: #fff; color: var(--nj-ink); }
.is-style-nj-light .wp-block-button__link.nj-btn:hover { background: var(--nj-red-600); color: #fff; }
/* Ghost (on ink) */
.is-style-nj-ghost .wp-block-button__link.nj-btn { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .5); }
.is-style-nj-ghost .wp-block-button__link.nj-btn:hover { background: #fff; color: var(--nj-ink); box-shadow: inset 0 0 0 1.5px #fff; }
/* Dark */
.is-style-nj-dark .wp-block-button__link.nj-btn { background: var(--nj-ink); color: #fff; }
.is-style-nj-dark .wp-block-button__link.nj-btn:hover { background: var(--nj-red-600); }

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */
.wp-block-list { padding-left: 1.25em; }
.wp-block-list li + li { margin-top: 8px; }
ul.wp-block-list li::marker { color: var(--nj-red); }
ol.wp-block-list li::marker { color: var(--nj-red-700); font-family: var(--nj-display); font-weight: 600; }
.is-style-nj-check { list-style: none; padding-left: 0; }
.is-style-nj-check li { position: relative; padding-left: 30px; }
.is-style-nj-check li + li { margin-top: 12px; }
.is-style-nj-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .2em;
	width: 18px;
	height: 18px;
	background: var(--nj-red-600);
	-webkit-mask: var(--nj-check) center / 16px no-repeat;
	mask: var(--nj-check) center / 16px no-repeat;
}
.is-style-nj-check li::after { content: none; }

/* --------------------------------------------------------------------------
   The roof. A photo wrapper with .nj-roofed (or one of the theme's hero media
   wrappers) gets a gabled top and the logo's red roof line floating above it.
   Rise is tied to the wrapper width (container units), so the pitch is the
   same at every size; browsers without container units show a plain photo.
   -------------------------------------------------------------------------- */
@supports (width: 1cqw) {
	:is(.nj-roofed, .nj-hero-home__media, .nj-teacher__media, .nj-suburb-hero__media-wrap) {
		--nj-rise: 15cqw;
		--nj-roof-t: 8px;
		position: relative;
		container-type: inline-size;
		padding-top: 22px;
	}
	:is(.nj-roofed, .nj-hero-home__media, .nj-teacher__media, .nj-suburb-hero__media-wrap)::before {
		content: "";
		position: absolute;
		z-index: 1;
		top: 0;
		left: -3.5%;
		width: 107%;
		height: calc(var(--nj-rise) * 1.07 + var(--nj-roof-t));
		background: var(--nj-red);
		clip-path: polygon(0 calc(100% - var(--nj-roof-t)), 50% 0, 100% calc(100% - var(--nj-roof-t)), 100% 100%, 50% var(--nj-roof-t), 0 100%);
		pointer-events: none;
	}
	:is(.nj-roofed, .nj-hero-home__media, .nj-teacher__media, .nj-suburb-hero__media-wrap) > :is(figure, .wp-block-image, .wp-block-post-featured-image):first-of-type {
		clip-path: polygon(0 var(--nj-rise), 50% 0, 100% var(--nj-rise), 100% 100%, 0 100%);
		border-radius: 0 !important;
	}
}

/* --------------------------------------------------------------------------
   Motion. Reveal is gated by html.js and applied (by site.js) only to blocks below the first viewport.
   -------------------------------------------------------------------------- */
.js .nj-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--nj-ease), transform .6s var(--nj-ease); transition-delay: calc(min(var(--i, 0), 4) * 60ms); }
.js .nj-reveal.is-in { opacity: 1; transform: none; }
/* Word-split headline hook (words wrapped server-side, inc/blocks.php): kept static, no entrance animation */
.nj-w { display: inline; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
	.js .nj-reveal { opacity: 1 !important; transform: none !important; }
}

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
