/**
 * Templates outside Elementor.
 *
 * The 26 designed pages are Elementor documents and get their layout from
 * container controls. Everything else on the site is an ordinary WordPress
 * query: search results, a single story, category and date archives, the
 * blog index, 404. Those had no child-theme template at all, so they fell
 * through to Inlingua, which rendered them with its own serif headings, a
 * "Recent Posts / Recent Comments" sidebar and a giant inLingua watermark.
 *
 * The footer broke on those pages for a structural reason worth recording:
 * Inlingua's templates open `#primary.content-area`, which its stylesheet
 * floats to make room for the sidebar. Our header and footer are child-theme
 * overrides and do not emit the parent's `.col-full` wrapper, so nothing
 * cleared that float and the footer wrapped into the narrow column beside
 * the sidebar. The templates in this theme emit no `#primary` and call no
 * sidebar, which removes the cause rather than clearing after it.
 *
 * Values here come from brand.css. The Elementor equivalents live in
 * tokens.css; where a component exists in both, this file reproduces the
 * measurements rather than reusing a selector written against
 * `.e-con-inner`, because faking Elementor's class names in hand-written
 * markup would be worse than twenty duplicated lines.
 *
 * @package NYSF
 */

/* ==========================================================================
   Shell
   ========================================================================== */

/* brand.css .wrap */
.nysf-wrap {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 28px;
}

@media (max-width: 780px) {
	.nysf-wrap {
		padding: 0 18px;
	}
}

/* The body region between the banner and the footer. brand.css .sec is
   72px top and bottom; a banner already supplies the top edge. */
.nysf-tpl {
	padding: 56px 0 72px;
}

/* ==========================================================================
   Page banner, plain markup

   brand.css .page-banner. tokens.css has this component too, but written
   against Elementor's `.e-con-inner`, so it cannot be reused here. The
   `nysf-solarspin` keyframes are shared: they are declared in tokens.css,
   which always loads first.
   ========================================================================== */

.nysf-pbanner {
	position: relative;
	overflow: hidden;
	background: var(--nysf-navy);
	text-align: center;
	padding: 70px 0 78px;
}

.nysf-pbanner__inner {
	position: relative;
	z-index: 2;
}

.nysf-pbanner h1 {
	color: var(--nysf-light);
	font-size: clamp( 40px, 5vw, 64px );
	line-height: 1.04;
}

.nysf-pbanner__lead {
	color: #c3d1d7;
	max-width: 560px;
	margin: 14px auto 0;
}

/* The solar mark, bleeding off the right edge and turning once every eighty
   seconds, and the short gold rule at the bottom left. */
.nysf-pbanner::before {
	content: '';
	position: absolute;
	right: -170px;
	top: 50%;
	width: 520px;
	height: 520px;
	margin-top: -260px;
	background: url('../img/solar.svg') center / contain no-repeat;
	animation: nysf-solarspin 80s linear infinite;
	pointer-events: none;
	z-index: 0;
}

.nysf-pbanner::after {
	content: '';
	position: absolute;
	left: -30px;
	bottom: 0;
	width: 150px;
	height: 6px;
	background: var(--nysf-gold);
	pointer-events: none;
	z-index: 1;
}

@media (max-width: 980px) {
	.nysf-pbanner::before {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nysf-pbanner::before {
		animation: none;
	}
}

/* ==========================================================================
   Result and archive listings
   ========================================================================== */

/* brand.css .archive-bar */
.nysf-archive-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}

.nysf-archive-bar__count {
	color: var(--nysf-ink-soft);
	font-size: 14.5px;
	margin: 0;
}

.nysf-archive-bar .nysf-search {
	max-width: 420px;
	flex: 1 1 320px;
}

/* brand.css .courses. The story card itself is already styled in
   widgets/story-cards.css and is shared with the Elementor widget. */
.nysf-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 26px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1000px) {
	.nysf-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 680px) {
	.nysf-cards {
		grid-template-columns: 1fr;
	}
}

/* ----------------------------------------------------------- Result list

   brand.css .course-list: the story card turned on its side. Used by search,
   where results are a mix of pages, stories and programs and most of them
   have no featured image.
   -------------------------------------------------------------------------- */

.nysf-results {
	display: grid;
	gap: 20px;
}

.nysf-result {
	position: relative;
	display: flex;
	background: var(--nysf-card);
	border: 1px solid var(--nysf-line);
	border-radius: 24px;
	overflow: hidden;
	box-shadow: var(--nysf-shadow-sm);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nysf-result:hover,
.nysf-result:focus-within {
	transform: translateY(-4px);
	box-shadow: var(--nysf-shadow);
}

.nysf-result__media {
	flex: 0 0 300px;
	overflow: hidden;
}

.nysf-result__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nysf-result__body {
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

.nysf-result__kind {
	font-size: 12px;
	font-weight: 700;
	/* Small text, so the ink variant. See --nysf-flare-ink in tokens.css. */
	color: var(--nysf-flare-ink);
	text-transform: uppercase;
	letter-spacing: 1.5px;
	margin: 0;
}

.nysf-result__title {
	font-family: var(--nysf-display);
	font-weight: 600;
	font-size: 22px;
	line-height: 1.22;
	letter-spacing: -0.3px;
	margin: 0;
}

.nysf-result__title a {
	color: var(--nysf-navy);
	text-decoration: none;
}

/* One click target for the whole row, same trick as the story card. */
.nysf-result__link::after {
	content: '';
	position: absolute;
	inset: 0;
}

.nysf-result__excerpt {
	color: var(--nysf-ink-soft);
	font-size: 14.5px;
	margin: 0;
}

.nysf-result__go {
	font-weight: 600;
	font-size: 14px;
	color: var(--nysf-navy);
	margin-top: auto;
	padding-top: 6px;
}

.nysf-result:hover .nysf-result__go {
	color: var(--nysf-flare-ink);
}

@media (max-width: 680px) {
	.nysf-result {
		flex-direction: column;
	}

	.nysf-result__media {
		flex: 0 0 auto;
		aspect-ratio: 16 / 9;
	}

	.nysf-result__body {
		padding: 22px 24px 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nysf-result {
		transition: none;
	}

	.nysf-result:hover,
	.nysf-result:focus-within {
		transform: none;
	}
}

/* --------------------------------------------------------------- Pagination */

.nysf-pagination {
	margin-top: 48px;
}

.nysf-pagination .nav-links,
.nysf-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}

.nysf-pagination .page-numbers {
	display: inline-flex;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border-radius: var(--nysf-r-pill);
	background: var(--nysf-card);
	border: 1px solid var(--nysf-line);
	color: var(--nysf-navy);
	font-weight: 600;
	font-size: 14.5px;
	text-decoration: none;
	transition: 0.2s;
}

.nysf-pagination a.page-numbers:hover,
.nysf-pagination a.page-numbers:focus-visible {
	background: var(--nysf-navy);
	border-color: var(--nysf-navy);
	color: var(--nysf-light);
}

.nysf-pagination .page-numbers.current {
	background: var(--nysf-navy);
	border-color: var(--nysf-navy);
	color: var(--nysf-light);
}

.nysf-pagination .page-numbers.dots {
	background: none;
	border-color: transparent;
}

/* --------------------------------------------------------------- No results */

.nysf-noresults {
	max-width: 620px;
	margin: 0 auto;
	text-align: center;
}

.nysf-noresults h2 {
	font-size: 30px;
	margin-bottom: 12px;
}

.nysf-noresults p {
	color: var(--nysf-ink-soft);
	margin-bottom: 26px;
}

.nysf-noresults .nysf-search {
	margin: 0 auto 30px;
}

/* A row of plain pill links. Used under a no-results message and on the 404,
   where the useful thing is not an apology but a way out. */
.nysf-waysout {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nysf-waysout a {
	display: inline-flex;
	padding: 11px 22px;
	border-radius: var(--nysf-r-pill);
	background: var(--nysf-card);
	border: 1px solid var(--nysf-line);
	color: var(--nysf-navy);
	font-weight: 600;
	font-size: 14.5px;
	text-decoration: none;
	transition: 0.2s;
}

.nysf-waysout a:hover,
.nysf-waysout a:focus-visible {
	background: var(--nysf-navy);
	border-color: var(--nysf-navy);
	color: var(--nysf-light);
}

/* ==========================================================================
   Single article

   From the prototype's article.html, which carries its own <style> block
   rather than living in brand.css. Values reproduced from it exactly.
   ========================================================================== */

.nysf-article {
	padding-bottom: 20px;
}

.nysf-art-head {
	max-width: 760px;
	margin: 0 auto;
	text-align: center;
	padding: 46px 0 24px;
}

.nysf-art-head .nysf-crumb {
	color: var(--nysf-ink-soft);
	font-size: 14px;
	margin-bottom: 6px;
}

/* On cream rather than navy, so the crumb link is navy, not light. */
.nysf-art-head .nysf-crumb a {
	color: var(--nysf-navy);
}

.nysf-art-head .nysf-crumb a:hover,
.nysf-art-head .nysf-crumb a:focus-visible {
	color: var(--nysf-flare-ink);
}

.nysf-acat {
	font-size: 12px;
	font-weight: 700;
	color: var(--nysf-flare-ink);
	text-transform: uppercase;
	letter-spacing: 1.5px;
}

.nysf-art-head h1 {
	font-size: clamp( 30px, 4.2vw, 50px );
	line-height: 1.06;
	letter-spacing: -1px;
	margin: 12px 0 16px;
}

.nysf-art-meta {
	display: flex;
	gap: 18px;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	color: var(--nysf-ink-soft);
	font-size: 14px;
}

.nysf-art-hero {
	max-width: 1000px;
	margin: 0 auto 40px;
	border-radius: var(--nysf-r-lg);
	overflow: hidden;
	aspect-ratio: 16 / 8;
}

.nysf-art-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * Branded stand-in for an article with no featured image, which after the
 * news migration is most of them. Same width and radius as the image hero so
 * the page rhythm does not shift, but shorter: it is a marker, not a picture.
 * Navy with the site's gold dome glow rising from the lower right, the same
 * motif as the footer and the hero scrims, drawn entirely in CSS so it needs
 * no asset and cannot 404. Static, because an article is a calm read.
 */
.nysf-art-hero--brand {
	aspect-ratio: auto;
	height: 200px;
	background:
		radial-gradient( 120% 150% at 85% 125%, rgba(232, 163, 61, 0.22), transparent 55% ),
		linear-gradient( 120deg, var(--nysf-navy) 0%, #0d3547 100% );
}

@media (max-width: 620px) {
	.nysf-art-hero--brand {
		height: 132px;
	}
}

/*
 * The body reuses .nysf-richtext, which tokens.css already defines for the
 * policy and privacy documents: same 760px measure, same heading scale, same
 * link colour. Only the centring is new, because the document pages sit in a
 * two-column grid with a contents nav and an article does not.
 */
.nysf-article .nysf-richtext {
	margin-inline: auto;
}

.nysf-article .nysf-richtext > :first-child {
	margin-top: 0;
}

.nysf-article .nysf-richtext img {
	border-radius: var(--nysf-r-md);
	margin: 28px 0;
}

.nysf-article .nysf-richtext figure {
	margin: 28px 0;
}

.nysf-article .nysf-richtext figcaption {
	color: var(--nysf-ink-soft);
	font-size: 13.5px;
	margin-top: 10px;
}

.nysf-article .nysf-richtext blockquote,
.nysf-pullquote {
	font-family: var(--nysf-quote);
	font-style: italic;
	font-size: 26px;
	line-height: 1.4;
	color: var(--nysf-navy);
	border-left: 4px solid var(--nysf-gold);
	padding: 6px 0 6px 24px;
	margin: 28px 0;
}

/* --------------------------------------------------------------- Share row */

.nysf-share {
	display: flex;
	gap: 10px;
	align-items: center;
	max-width: 760px;
	margin: 34px auto;
	padding-top: 22px;
	border-top: 1px solid var(--nysf-line);
}

.nysf-share__label {
	font-weight: 600;
	color: var(--nysf-ink-soft);
	font-size: 14px;
	margin-right: 4px;
}

.nysf-share a,
.nysf-share button {
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	background: var(--nysf-bg);
	border: 1px solid var(--nysf-line);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--nysf-navy);
	cursor: pointer;
	transition: 0.2s;
}

.nysf-share a:hover,
.nysf-share a:focus-visible,
.nysf-share button:hover,
.nysf-share button:focus-visible {
	background: var(--nysf-navy);
	border-color: var(--nysf-navy);
	color: var(--nysf-light);
}

.nysf-share svg {
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Confirmation after the copy button, announced as well as shown. */
.nysf-share__said {
	font-size: 13.5px;
	color: var(--nysf-ink-soft);
}

/* ------------------------------------------------------------------ Related */

.nysf-related {
	padding: 72px 0 0;
}

.nysf-related__head {
	margin-bottom: 42px;
}

.nysf-related__head h2 {
	font-size: clamp( 32px, 3.6vw, 46px );
	line-height: 1.06;
}

/* ==========================================================================
   404
   ========================================================================== */

.nysf-404 {
	text-align: center;
	max-width: 680px;
	margin: 0 auto;
}

/*
 * The number is the graphic. No illustration: the design language is
 * photography, brand shapes and type, and an illustration here would be the
 * only one on the site. Bricolage at this size with the gold underline reads
 * as NYSF rather than as a stock error page.
 */
.nysf-404__num {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	font-family: var(--nysf-display);
	font-weight: 700;
	font-size: clamp( 96px, 18vw, 200px );
	line-height: 0.9;
	letter-spacing: -6px;
	color: var(--nysf-navy);
	margin: 0;
}

/*
 * The solar mark standing in for the zero.
 *
 * Sized in `em` so it tracks the clamp on the number rather than needing its
 * own breakpoints. 0.78 is the cap height of Bricolage at this weight, near
 * enough that the disc sits on the same optical line as the two fours.
 *
 * It turns, like it does behind the page banner, but a full revolution takes
 * 80 seconds: slow enough to read as ambient rather than as something
 * demanding attention on a page where the visitor is already lost.
 */
.nysf-404__orbit {
	width: 0.78em;
	height: 0.78em;
	margin: 0 0.04em;
	animation: nysf-solarspin 80s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
	.nysf-404__orbit {
		animation: none;
	}
}

.nysf-404__rule {
	width: 150px;
	height: 6px;
	background: var(--nysf-gold);
	margin: 22px auto 30px;
}

.nysf-404 h1 {
	font-size: clamp( 28px, 3.4vw, 40px );
	margin-bottom: 12px;
}

.nysf-404 p {
	color: var(--nysf-ink-soft);
	margin-bottom: 26px;
}

.nysf-404 .nysf-search {
	margin: 0 auto 30px;
}

/* ==========================================================================
   Search form on cream

   searchform.php was written for the navy header drawer, where the field sits
   on a --line-navy bed. The same form appears on the 404 and the no-results
   page, both on cream, where that bed is invisible.
   ========================================================================== */

.nysf-tpl .nysf-search,
.nysf-noresults .nysf-search,
.nysf-404 .nysf-search {
	background: var(--nysf-card);
	border: 1px solid var(--nysf-line);
}

.nysf-tpl .nysf-search__field,
.nysf-noresults .nysf-search__field,
.nysf-404 .nysf-search__field {
	color: var(--nysf-navy);
}

.nysf-tpl .nysf-search__field::placeholder,
.nysf-noresults .nysf-search__field::placeholder,
.nysf-404 .nysf-search__field::placeholder {
	color: var(--nysf-ink-soft);
}
