/* ==========================================================================
   NJ Real Estate Licensing School: content written in the block editor.
   Loaded on every page and in the editor, so whatever is added in Gutenberg (blog post, town page,
   new page) comes out styled: text flow, headings, lists, tables, quotes, accordions (Details),
   separators, images, embeds, columns, files, plus three Group styles (Callout, Card, CTA band).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Text flow. .nj-prose = blog articles and policy pages; .nj-rich = the content area of pages
      and town pages. Spacing is set on the flow (gap), never on the blocks themselves.
   -------------------------------------------------------------------------- */
.nj-prose { max-width: 760px !important; display: flex; flex-direction: column; gap: 20px; font-size: 18px; line-height: 1.7; color: var(--nj-stone); }
.nj-prose > * { margin: 0 !important; }
.nj-prose > :is(h2, h3, h4, h5, h6) { color: var(--nj-ink); }
.nj-prose h2 { font-size: 32px; line-height: 1.16; margin-top: 28px !important; }
.nj-prose h3 { font-size: 24px; margin-top: 16px !important; }
.nj-prose h4 { font-size: 20px; margin-top: 8px !important; }
.nj-prose > :first-child { margin-top: 0 !important; }
.nj-prose__lead { margin-top: 16px !important; font-family: var(--nj-display); font-size: 24px; font-weight: 500; line-height: 1.25; letter-spacing: -.01em; color: var(--nj-ink); }
.nj-prose__lead strong { font-weight: 500; }
.nj-prose__label { margin-top: 24px !important; display: flex; align-items: center; gap: 10px; font-family: var(--nj-body); font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--nj-ink); }
.nj-prose__label::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-prose__rule { font-size: 0; height: 1px; background: var(--nj-line); margin-block: 8px !important; }
.nj-prose__bullet { padding-left: 4px; }
.nj-prose .wp-block-list { display: grid; gap: 8px; }
.nj-prose .wp-block-list li + li { margin: 0; }
.nj-prose > .wp-block-image img { width: 100%; }
.nj-prose > :is(.wp-block-table, .wp-block-quote, .wp-block-pullquote, .wp-block-image, .wp-block-embed, .wp-block-group, .wp-block-columns, .wp-block-media-text, .wp-block-separator, .wp-block-buttons, .wp-block-gallery) { margin-block: 12px !important; }
.nj-prose > .wp-block-details + :not(.wp-block-details) { margin-top: 12px !important; }
.nj-checks-card { padding: 30px 32px; border-radius: var(--nj-r-card); background: #fff; border: var(--nj-hair); border-top: 3px solid var(--nj-ink); color: var(--nj-ink); font-size: 18px; }
.nj-mini-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 40px !important; padding: 32px; border-radius: var(--nj-r-card); background: var(--nj-ink); border-top: 4px solid var(--nj-red); }
.nj-mini-cta h2 { color: #fff; text-transform: capitalize; }
@media (max-width: 781px) { .nj-prose { font-size: 17px; } .nj-prose h2 { font-size: 26px; } .nj-prose__lead { font-size: 20px; } }

/* Pages typed straight into the editor (no theme sections): blocks get the reading column and the gutter.
   Theme sections and full-width blocks keep their own width. */
.nj-rich > :where(:not(.nj-section, .nj-page-hero, .nj-hero-home, .nj-lp-hero, .nj-locked, .alignfull, .alignwide)) { width: min(760px, 100% - 2 * var(--nj-gutter)); margin-inline: auto !important; }
.nj-rich > .alignwide { width: min(var(--nj-wide), 100% - 2 * var(--nj-gutter)); max-width: none; margin-inline: auto !important; }
.nj-rich > :where(:not(.nj-section, .nj-page-hero, .nj-hero-home, .nj-lp-hero, .nj-locked)) { margin-block: 0 22px !important; }
.nj-rich > :where(p, ul, ol, .wp-block-group, .wp-block-columns) { font-size: 18px; line-height: 1.7; }
.nj-rich > :where(h2, h3, h4):where(:not(.nj-section *)) { margin-top: 40px !important; margin-bottom: 14px !important; color: var(--nj-ink); }
.nj-rich > h2:where(.wp-block-heading) { font-size: 34px; line-height: 1.15; }
.nj-rich > :where(.wp-block-table, .wp-block-quote, .wp-block-pullquote, .wp-block-image, .wp-block-embed, .wp-block-group, .wp-block-columns, .wp-block-media-text, .wp-block-separator, .wp-block-gallery):where(:not(.nj-section, .nj-page-hero, .nj-hero-home, .nj-lp-hero, .nj-locked)) { margin-block: 12px 34px !important; }
.nj-rich > .wp-block-details:where(:not(:has(+ .wp-block-details))) { margin-bottom: 34px !important; }
.nj-rich > .wp-block-details:where(:has(+ .wp-block-details)) { margin-bottom: 0 !important; }
.nj-rich > :where(:not(.nj-section, .nj-page-hero, .nj-hero-home, .nj-lp-hero, .nj-locked)):first-child { margin-top: 48px !important; }

/* --------------------------------------------------------------------------
   2. Tables: ruled like a class schedule. Wide tables scroll sideways on phones.
   -------------------------------------------------------------------------- */
.wp-block-table { margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wp-block-table table { width: 100%; border-collapse: collapse; border: 0; border-top: var(--nj-rule); border-bottom: 1px solid var(--nj-ink); background: #fff; font-size: 16px; line-height: 1.5; color: var(--nj-stone); }
.wp-block-table :is(td, th) { padding: 14px 18px; border: 0; border-bottom: var(--nj-hair); text-align: left; vertical-align: top; }
.wp-block-table :is(td, th).has-text-align-center { text-align: center; }
.wp-block-table :is(td, th).has-text-align-right { text-align: right; }
.wp-block-table thead { border: 0; }
.wp-block-table thead th { padding-block: 13px; background: var(--nj-paper); border-bottom: 1px solid var(--nj-ink); font-family: var(--nj-body); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--nj-ink); white-space: nowrap; }
.wp-block-table tbody tr:last-child :is(td, th) { border-bottom: 0; }
.wp-block-table tbody :is(td, th):first-child { font-weight: 600; color: var(--nj-ink); }
.wp-block-table tfoot { border: 0; }
.wp-block-table tfoot td { border-top: 1px solid var(--nj-ink); border-bottom: 0; font-weight: 600; color: var(--nj-ink); background: var(--nj-paper); }
.wp-block-table.is-style-stripes { border: 0; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: transparent; }
.wp-block-table.is-style-stripes tbody tr:nth-child(even) { background: var(--nj-paper); }
.wp-block-table :is(figcaption, .wp-element-caption) { margin-top: 10px; text-align: left; }
@media (max-width: 640px) {
	.wp-block-table table { font-size: 15px; }
	.wp-block-table :is(td, th) { padding: 12px 14px; }
	.wp-block-table table:has(tr > :nth-child(3)) { min-width: 560px; }
}

/* --------------------------------------------------------------------------
   3. Quotes
   -------------------------------------------------------------------------- */
.wp-block-quote { margin: 0; padding: 6px 0 6px 28px; border: 0; border-left: 3px solid var(--nj-red); }
.wp-block-quote > * { margin: 0; }
.wp-block-quote > * + * { margin-top: 12px; }
.wp-block-quote p { font-family: var(--nj-display); font-size: 22px; font-weight: 400; line-height: 1.45; letter-spacing: -.005em; color: var(--nj-ink); }
.wp-block-quote cite, .wp-block-pullquote cite { display: block; margin-top: 14px; font-family: var(--nj-body); font-size: 12px; font-style: normal; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--nj-stone); }
.wp-block-pullquote { margin: 0; padding: 36px 0 32px; border: 0; border-top: var(--nj-rule); border-bottom: var(--nj-hair); text-align: center; }
.wp-block-pullquote::before { content: ""; display: block; width: 72px; height: 18px; margin: 0 auto 20px; background: var(--nj-ridge) center / contain no-repeat; }
.wp-block-pullquote blockquote { margin: 0; }
.wp-block-pullquote p { margin: 0; font-family: var(--nj-display); font-size: 28px; font-weight: 500; line-height: 1.3; letter-spacing: -.012em; color: var(--nj-ink); }
@media (max-width: 640px) { .wp-block-quote { padding-left: 20px; } .wp-block-quote p { font-size: 19px; } .wp-block-pullquote p { font-size: 22px; } }

/* --------------------------------------------------------------------------
   4. Separator: a hairline broken by the roof ridge
   -------------------------------------------------------------------------- */
.wp-block-separator {
	height: 18px;
	border: 0 !important;
	opacity: 1;
	color: var(--nj-line);
	background:
		var(--nj-ridge) center / 72px 18px no-repeat,
		linear-gradient(to right, currentColor calc(50% - 52px), transparent calc(50% - 52px), transparent calc(50% + 52px), currentColor calc(50% + 52px)) center 14px / 100% 1px no-repeat;
}
:where(.nj-prose, .nj-suburb__content) > .wp-block-separator:not(.is-style-dots) { width: 100%; max-width: 100%; }
.wp-block-separator.is-style-dots { background: none; height: auto; }

/* --------------------------------------------------------------------------
   5. Media
   -------------------------------------------------------------------------- */
:where(.nj-prose, .nj-rich, .nj-suburb__content) .wp-block-image img { border-radius: var(--nj-r-media); }
:is(.wp-block-image, .wp-block-embed, .wp-block-video, .wp-block-gallery) :is(figcaption, .wp-element-caption),
.wp-block-table :is(figcaption, .wp-element-caption) { margin: 10px 0 0; font-family: var(--nj-body); font-size: 13px; line-height: 1.5; color: var(--nj-muted); }
.wp-block-embed { margin: 0; }
.wp-block-embed iframe { display: block; border-radius: var(--nj-r-media); }
.wp-block-embed.is-type-video .wp-block-embed__wrapper { background: var(--nj-ink); border-radius: var(--nj-r-media); }
.wp-block-video video { width: 100%; border-radius: var(--nj-r-media); }
.wp-block-gallery { gap: 12px !important; }
.wp-block-gallery .wp-block-image img { border-radius: var(--nj-r-media); }
.wp-block-media-text { gap: 0; }
.wp-block-media-text > .wp-block-media-text__content { padding: 0 0 0 clamp(20px, 4vw, 48px); }
.wp-block-media-text.has-media-on-the-right > .wp-block-media-text__content { padding: 0 clamp(20px, 4vw, 48px) 0 0; }
.wp-block-media-text__media img { border-radius: var(--nj-r-media); }
@media (max-width: 600px) { .wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content { padding: 20px 0 0; } }
.wp-block-columns { gap: 24px 40px; margin: 0; }
.wp-block-column > * + * { margin-top: 16px; }
/* Lazy Google map (.nj-map with data-src): the iframe loads when it scrolls near or on click (site.js) */
.nj-map { position: relative; min-height: 320px; overflow: hidden; background: var(--nj-sand); border-radius: var(--nj-r-media); }
.nj-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nj-map__load { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; border: 0; background: transparent; cursor: pointer; font: inherit; }
.nj-map.is-loaded::before { content: "Loading map…"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--nj-stone); } /* sits under the iframe until Google paints */
.nj-map__load span { background: var(--nj-ink); color: #fff; padding: 13px 20px; border-radius: var(--nj-r-btn); font-weight: 600; font-size: 15px; }
.nj-map.is-loaded .nj-map__load { display: none; }
.nj-map--inline { min-height: 0; aspect-ratio: 16 / 8; border: var(--nj-hair); }
@media (max-width: 640px) { .nj-map--inline { aspect-ratio: 4 / 3.4; } }
/* a map or other iframe dropped in with a Custom HTML block */
:where(.nj-prose, .nj-rich, .nj-suburb__content) > iframe, .nj-embed-map iframe { display: block; width: 100%; border: 0; border-radius: var(--nj-r-media); }
.nj-embed-map { margin: 0; border-radius: var(--nj-r-media); overflow: hidden; background: var(--nj-sand); border: var(--nj-hair); line-height: 0; }
.nj-embed-map iframe { height: 420px; border-radius: 0; }
@media (max-width: 640px) { .nj-embed-map iframe { height: 320px; } }

/* --------------------------------------------------------------------------
   6. Code, files, footnotes
   -------------------------------------------------------------------------- */
:where(.wp-block-code, .wp-block-preformatted, .wp-block-verse) { margin: 0; padding: 20px 24px; background: #fff; border: var(--nj-hair); border-radius: var(--nj-r-card); font-size: 15px; line-height: 1.6; color: var(--nj-ink); overflow-x: auto; }
.wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; background: #fff; border: var(--nj-hair); border-radius: var(--nj-r-card); font-weight: 600; }
.wp-block-file__embed { border-radius: var(--nj-r-media); background: #fff; }
.wp-block-file .wp-block-file__button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--nj-r-btn); background: var(--nj-red-600); color: #fff; text-decoration: none; font-size: 15px; font-weight: 600; }
.wp-block-file .wp-block-file__button:hover { background: var(--nj-ink); color: #fff; }
.wp-block-footnotes { font-size: 14px; color: var(--nj-stone); padding-top: 16px; border-top: var(--nj-hair); }

/* --------------------------------------------------------------------------
   7. Group styles (Styles panel of the Group block)
      Callout  = a note set off by a red edge
      Card     = a ruled sheet for a summary, checklist or key facts
      CTA band = ink panel with heading, a line of copy and buttons
   -------------------------------------------------------------------------- */
.wp-block-group:is(.is-style-nj-callout, .is-style-nj-card, .is-style-nj-cta) > * { margin-block: 0 !important; }
.wp-block-group:is(.is-style-nj-callout, .is-style-nj-card, .is-style-nj-cta) > * + * { margin-top: 14px !important; }
.wp-block-group.is-style-nj-callout { padding: 22px 26px; background: #fff; border: var(--nj-hair); border-left: 4px solid var(--nj-red); border-radius: var(--nj-r-card); color: var(--nj-ink); }
.wp-block-group.is-style-nj-callout :is(h2, h3, h4) { font-size: 20px !important; font-weight: 600; }
.wp-block-group.is-style-nj-card { padding: 30px 32px 32px; background: #fff; border: var(--nj-hair); border-top: 3px solid var(--nj-ink); border-radius: var(--nj-r-card); }
.wp-block-group.is-style-nj-card :is(h2, h3) { font-size: 24px !important; margin-top: 0 !important; }
.wp-block-group.is-style-nj-cta { padding: 40px; background: var(--nj-ink); border-top: 4px solid var(--nj-red); border-radius: var(--nj-r-card); color: rgb(255 255 255 / .8); }
.wp-block-group.is-style-nj-cta :is(h2, h3, h4, strong) { color: #fff; }
.wp-block-group.is-style-nj-cta :is(h2, h3) { font-size: 30px !important; line-height: 1.15 !important; margin-top: 0 !important; }
.wp-block-group.is-style-nj-cta a:not(.wp-block-button__link) { color: #fff; text-decoration-color: var(--nj-red-300); }
.wp-block-group.is-style-nj-cta .wp-block-buttons { margin-top: 22px !important; }
.wp-block-group.is-style-nj-cta .wp-block-button__link.nj-btn:hover { background: #fff; color: var(--nj-ink); }
.wp-block-group.is-style-nj-cta .is-style-nj-outline .wp-block-button__link.nj-btn { color: #fff; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .5); }
.wp-block-group.is-style-nj-cta .is-style-nj-outline .wp-block-button__link.nj-btn:hover { background: #fff; color: var(--nj-ink); }
@media (max-width: 640px) {
	.wp-block-group.is-style-nj-callout { padding: 18px 20px; }
	.wp-block-group.is-style-nj-card { padding: 24px 20px; }
	.wp-block-group.is-style-nj-cta { padding: 30px 22px; }
	.wp-block-group.is-style-nj-cta :is(h2, h3) { font-size: 25px !important; }
}

/* Numbered steps (List block → style "Steps") */
ol.is-style-nj-steps { list-style: none; padding: 0; counter-reset: nj-li; display: grid; gap: 0; border-top: var(--nj-rule); }
ol.is-style-nj-steps > li { counter-increment: nj-li; position: relative; margin: 0 !important; padding: 18px 0 18px 64px; border-bottom: var(--nj-hair); }
ol.is-style-nj-steps > li::before { content: counter(nj-li); position: absolute; left: 0; top: 12px; font-family: var(--nj-display); font-size: 36px; font-weight: 500; line-height: 1.1; color: var(--nj-red-600); font-feature-settings: "lnum"; }

/* --------------------------------------------------------------------------
   8. Layout helpers for long pages built from theme sections
   -------------------------------------------------------------------------- */
/* white band behind a section, edge to edge (breaks up long pages) */
.nj-section--band { background: #fff; border-block: var(--nj-hair); }
.nj-section--band + .nj-section--band { border-top: 0; }
/* sections that are themselves a centred grid (FAQ split, teacher, local): the band still runs edge to edge */
.nj-section--band:is(.nj-faq-split, .nj-teacher, .nj-local, .nj-contact) { border: 0; box-shadow: 0 0 0 100vmax #fff; clip-path: inset(0 -100vmax); }
.nj-section--band :is(.nj-card:not(.nj-card--dark), .wp-block-group.is-style-nj-card, .nj-rules) { background: var(--nj-paper); }
.nj-section--band .wp-block-table table { background: var(--nj-paper); }
.nj-section--band .wp-block-table thead th { background: var(--nj-sand); }
/* two columns: copy + side panel (or heading + copy with .nj-two--head) */
.nj-two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px 72px; align-items: start; }
.nj-two--head { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); padding-top: 28px; border-top: var(--nj-rule); }
.nj-two > * { margin: 0 !important; }
.nj-two__main > * + *, .nj-two__text > * + * { margin-top: 18px !important; }
.nj-two__main > *, .nj-two__text > * { margin-block: 0; }
.nj-two__main, .nj-two__text { font-size: 18px; line-height: 1.7; }
.nj-two__main > h2 { margin-bottom: 6px !important; }
/* a reading column inside a wide section */
.nj-flow { max-width: 920px !important; margin-left: 0 !important; }
.nj-section > .nj-flow { margin-inline: auto !important; max-width: var(--nj-wide) !important; }
.nj-flow > * { margin-block: 0 !important; max-width: 920px; }
.nj-flow > * + * { margin-top: 18px !important; }
.nj-flow > .wp-block-table, .nj-flow > .nj-cols-2 { max-width: none; margin-top: 28px !important; }
.nj-flow > h3 { font-size: 26px; font-weight: 500; }
.nj-flow > p { font-size: 18px; line-height: 1.7; }
.nj-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 56px; }
.nj-cols-2 > * { margin: 0 !important; }
.nj-prose--wide { max-width: 860px !important; }
.nj-callout--wide { max-width: var(--nj-wide); }
.nj-callout--wide :is(h2, h3) { font-family: var(--nj-display); }
.nj-features--1 { grid-template-columns: 1fr !important; gap: 28px !important; margin: 0 !important; }
.nj-features--1 .nj-feature h3 { font-size: 22px; }
.nj-features--1 .nj-feature > * { margin-block: 0; }
.nj-page-hero__media--contain { background: none; aspect-ratio: 1 / 1; max-width: 460px; justify-self: end; width: 100%; }
.nj-page-hero__media--contain img { object-fit: cover; }
.nj-cta__nap { color: rgb(255 255 255 / .7); line-height: 1.7; }
.nj-cta__nap strong { color: #fff; }
.nj-cards > .nj-card > :is(h2, h3) { font-weight: 500; }
@media (max-width: 900px) {
	.nj-two, .nj-two--head { grid-template-columns: 1fr; gap: 24px; }
	.nj-cols-2 { grid-template-columns: 1fr; }
	.nj-page-hero__media--contain { justify-self: start; max-width: 360px; }
	.nj-two__main, .nj-two__text, .nj-flow > p { font-size: 17px; }
}

/* Flyer-style graphics (Exam Prep): show the whole image, never crop it to the card */
.nj-img-poster img { height: auto !important; aspect-ratio: auto !important; object-fit: contain !important; }
:is(.nj-product__media, .nj-page-hero__media):has(.nj-img-poster) { aspect-ratio: auto; height: auto; background: none; align-self: start; }
