/* ==========================================================================
   Figma redesign — news-contact (owned by the news-contact agent)
   Layouts: news (News page 311), contacts_map + contact_form (Contact page 313).
   Markup: template-parts/redesign/news-contact-*.php · JS: js/redesign/news-contact.js
   Breakpoints: mobile design <= 767px (Figma 440), tablet 768–1199px, desktop >= 1200px.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. News — tabs (Figma 2016:1039 desktop / 2060:8103 mobile)
   -------------------------------------------------------------------------- */
.np-news .is-hidden {
	display: none !important;
}

.np-news__tabs {
	display: flex;
}

.np-news__tab {
	flex: 1 1 0;
	min-width: 0;
	height: 70px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 30px;
	border: 0;
	border-radius: 0;
	background-color: var(--np-dark, #292929);
	color: var(--np-white, #FFFFFF);
	font: 21px/1.5 var(--np-font-title, 'TitlingGothicFBWideMedium');
	text-align: center;
	cursor: pointer;
	transition: background-color 0.3s ease;
	-webkit-appearance: none;
	appearance: none;
}

.np-news__tab span {
	cursor: pointer;
	white-space: nowrap;
}

.np-news__tab:hover,
.np-news__tab.active {
	background-color: var(--np-gold, #D69C36);
}

.np-news__tab:focus-visible {
	outline: 2px solid var(--np-white, #FFFFFF);
	outline-offset: -6px;
}

/* labels line up with the 1171px content column (first tab left, last tab right) */
@media screen and (min-width: 1200px) {
	.np-news__tab:first-child {
		justify-content: flex-start;
		padding-left: max(30px, calc((100% - 1171px) / 2));
	}

	.np-news__tab:last-child {
		justify-content: flex-end;
		padding-right: max(30px, calc((100% - 1171px) / 2));
	}

	.np-news__tabs--1 .np-news__tab {
		justify-content: center;
	}

	/* 3+ tabs (e.g. Downloads kept next to the two design tabs): equal thirds can't fit the long
	   "NexPhase …" labels next to the 262px column offset, so size tabs by their content */
	.np-news__tabs:not(.np-news__tabs--1):not(.np-news__tabs--2) .np-news__tab {
		flex: 1 1 auto;
	}
}

@media screen and (max-width: 1199px) {
	.np-news__tab {
		font-size: 18px;
		padding: 0 20px;
	}

	.np-news__tab span {
		white-space: normal;
	}
}

@media screen and (max-width: 767px) {
	.np-news__tabs {
		flex-direction: column;
	}

	.np-news__tab {
		flex: 0 0 70px;
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
   2. News — panel, year filter (Frame 2192 2048:1979 / mobile 2060:8177)
   -------------------------------------------------------------------------- */
.np-news__inner {
	width: 1171px;
	max-width: calc(100% - 60px);
	margin: 0 auto;
	padding-top: 80px;
}

.np-news__panel--downloads .np-news__inner,
.np-news__panel--videos .np-news__inner {
	padding-bottom: 120px;
}

.np-news h2.np-news__heading {
	margin-bottom: 50px;
}

.np-news__filter {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 52px;
}

.np-news__filter-label {
	font: 16px/1.3 var(--np-font-title, 'TitlingGothicFBWideMedium');
	color: var(--np-dark, #292929);
	cursor: default;
}

.np-news__year {
	width: 120px;
	height: 38px;
	padding: 0 34px 0 16px;
	border: 0;
	border-radius: 0;
	background: var(--np-light, #F3F4F5) url(../../img/redesign/nc-chevron.svg) no-repeat right 14px center / 11px 6px;
	color: var(--np-dark, #292929);
	font: 11px/1.3 var(--np-font-ui, 'SackersGothicStd-Heavy');
	letter-spacing: 0.913px;
	text-transform: uppercase;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.np-news__year:focus-visible {
	outline: 1px solid var(--np-gold, #D69C36);
}

@media screen and (max-width: 767px) {
	.np-news__inner {
		padding-top: 60px;
	}

	.np-news__filter {
		justify-content: center;
		margin-bottom: 60px;
	}
}

/* --------------------------------------------------------------------------
   3. News — list items (component `news item` 2050:2855: default / hover)
   -------------------------------------------------------------------------- */
.np-news__list {
	display: flex;
	flex-direction: column;
	gap: 60px;
	padding-bottom: 32px;
}

.np-news__item {
	position: relative;
	display: flex;
	align-items: stretch;
	background-color: var(--np-white, #FFFFFF);
	transition: background-color 0.3s ease;
}

.np-news__thumb {
	flex: 0 0 330px;
	height: 180px;
	overflow: hidden;
	background-color: var(--np-light, #F3F4F5);
}

.np-news__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1); /* design shows all thumbnails in b/w */
}

.np-news__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 9px; /* Figma: 20px between trimmed cap heights */
	padding: 0 60px;
}

/* items without a featured image (all Media Coverage posts): text aligned to the column edge */
.np-news__item.no-thumb .np-news__body {
	padding: 20px 30px;
	margin-left: -30px;
}

.np-news__item.no-thumb + .np-news__item.no-thumb {
	margin-top: -20px; /* text-to-text rhythm 80px, as in the mobile list */
}

.np-news__date {
	margin: 0;
	font: 11px/1.5 var(--np-font-ui, 'SackersGothicStd-Heavy');
	color: var(--np-gold, #D69C36);
}

.np-news__title {
	margin: 0;
	font: var(--np-fs-h3, 18px)/1.5 var(--np-font-title, 'TitlingGothicFBWideMedium');
	color: var(--np-dark, #292929);
	transition: color 0.3s ease;
}

.np-news__title a {
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

/* whole row is the link target */
.np-news__title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.np-news__item:hover,
.np-news__item:focus-within {
	background-color: var(--np-light, #F3F4F5);
}

.np-news__item:hover .np-news__title,
.np-news__item:focus-within .np-news__title {
	color: var(--np-gold, #D69C36);
}

.np-news__title a:focus-visible {
	outline: none;
}

.np-news__item:focus-within {
	outline: 1px solid var(--np-gold, #D69C36);
}

/* Load more (Frame 2228 2016:1146) */
.np-news__more {
	text-align: center;
	padding: 40px 0 120px;
}

@media screen and (max-width: 1199px) {
	.np-news__thumb {
		flex-basis: 34%;
		height: auto;
		aspect-ratio: 330 / 180;
	}

	.np-news__body {
		padding: 20px 40px;
	}
}

/* mobile design: text-only list, 80px rhythm */
@media screen and (max-width: 767px) {
	.np-news__list {
		gap: 80px;
		padding-bottom: 0;
	}

	.np-news__thumb {
		display: none;
	}

	.np-news__body,
	.np-news__item.no-thumb .np-news__body {
		padding: 0;
		margin-left: 0;
		gap: 12px;
	}

	.np-news__item:hover,
	.np-news__item:focus-within {
		background-color: transparent;
	}

	.np-news__more {
		padding: 80px 0;
	}
}

/* --------------------------------------------------------------------------
   4. News — Downloads / Videos tabs (not in the design; aligned with the list style)
   -------------------------------------------------------------------------- */
.np-news__downloads {
	border-top: 1px solid var(--np-line, #C2C7CB);
}

.np-news__download {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
	padding: 24px 0;
	border-bottom: 1px solid var(--np-line, #C2C7CB);
}

.np-news__download-title {
	display: flex;
	align-items: baseline;
	gap: 14px;
	font: var(--np-fs-h3, 18px)/1.5 var(--np-font-title, 'TitlingGothicFBWideMedium');
	color: var(--np-dark, #292929);
	transition: color 0.3s ease;
}

.np-news__download-title span {
	cursor: pointer;
}

.np-news__download-title i {
	color: var(--np-gold, #D69C36);
	font-size: 20px;
}

.np-news__download:hover .np-news__download-title {
	color: var(--np-gold, #D69C36);
}

.np-news__download .button_box {
	flex: 0 0 auto;
	padding-right: 15px; /* room for the skewed button corner */
}

.np-news__video + .np-news__video {
	margin-top: 60px;
}

@media screen and (max-width: 767px) {
	.np-news__download {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
	}

	.np-news__download .button_box {
		padding-left: 15px;
	}
}

/* --------------------------------------------------------------------------
   5. Contact — form (Frame 2192 2048:2163 / mobile 2060:8598) — WPForms, CSS only
   -------------------------------------------------------------------------- */
.np-cform {
	padding-top: 40px;
	padding-bottom: 120px !important;
}

/* design order: the form is the first block under the hero */
main > section.np-cform:first-child {
	padding-top: 118px;
}

.np-cform__inner {
	width: 857px;
	max-width: calc(100% - 60px);
	margin: 0 auto;
}

.np-cform .contact_form_box {
	max-width: none;
}

.np-cform .contact_form_box .wpforms-container {
	margin: 0;
}

.np-cform .contact_form_box .wpforms-container .wpforms-field {
	margin-bottom: 30px;
	padding: 0;
}

.np-cform .contact_form_box .wpforms-container .wpforms-field-label {
	margin-bottom: 20px;
	font: 20px/31px 'PragmaticaBold';
	color: var(--np-dark, #292929);
}

.np-cform .contact_form_box .wpforms-container .wpforms-required-label {
	color: var(--np-gold, #D69C36);
}

.np-cform .contact_form_box .wpforms-container input[type],
.np-cform .contact_form_box .wpforms-container textarea,
.np-cform .contact_form_box .select2-container--default .select2-selection--single {
	height: 71px;
	padding: 20px 30px;
	border: 0;
	border-radius: 6px;
	background: var(--np-light, #F3F4F5);
	color: var(--np-dark, #292929);
	font: 20px/31px var(--np-font-body, 'PragmaticaLight'); /* Figma: Pragmatica Book (not in the theme) */
	box-shadow: none;
}

.np-cform .contact_form_box .wpforms-container textarea,
.np-cform .contact_form_box .wpforms-container textarea.wpforms-field-large {
	height: 183px;
	resize: vertical;
}

.np-cform .contact_form_box .wpforms-container input[type]:focus,
.np-cform .contact_form_box .wpforms-container textarea:focus {
	box-shadow: inset 0 0 0 1px var(--np-gold, #D69C36);
}

/* select (select2) */
.np-cform .contact_form_box .select2-container--default .select2-selection--single {
	display: flex;
	align-items: center;
	padding: 0;
}

.np-cform .contact_form_box .select2-container .select2-selection--single .select2-selection__rendered {
	padding: 0 84px 0 30px;
	color: var(--np-dark, #292929);
	line-height: 31px;
}

.np-cform .contact_form_box .select2-container--default .select2-selection--single .select2-selection__arrow {
	width: 84px;
	height: 100%;
	top: 0;
	right: 0;
}

.np-cform .contact_form_box .select2-container--default .select2-selection--single .select2-selection__arrow:before {
	width: 26px;
	height: 15px;
	left: auto;
	right: 30px;
	top: calc(50% - 7px);
	border: 0;
	transform: none;
	background: url(../../img/redesign/nc-select-chevron.svg) no-repeat center / 26px 15px;
}

.np-cform .contact_form_box .select2-container--open .select2-selection--single .select2-selection__arrow:before {
	transform: rotate(180deg);
}

/* "* required" note (WPForms HTML field) */
.np-cform .contact_form_box .wpforms-container .wpforms-field-html {
	margin-top: -10px;
	margin-bottom: 0;
}

.np-cform .contact_form_box .wpforms-container .wpforms-field-html .required-label {
	font: 20px/31px var(--np-font-body, 'PragmaticaLight');
}

.np-cform .contact_form_box .wpforms-container .wpforms-submit-container {
	margin-top: -10px; /* 20px under "* required" (the last field keeps its 30px bottom margin) */
	padding: 0;
	text-align: center;
}

.np-cform .contact_form_box .wpforms-container label.wpforms-error {
	font-size: 16px;
	line-height: 1.4;
}

@media screen and (max-width: 767px) {
	.np-cform {
		padding-top: 30px;
	}

	main > section.np-cform:first-child {
		padding-top: 118px;
	}

	.np-cform .contact_form_box .wpforms-container .wpforms-field-label,
	.np-cform .contact_form_box .wpforms-container .wpforms-field-html .required-label {
		font-size: 18px;
	}
}

/* --------------------------------------------------------------------------
   6. Contact — contact card + map (map 2016:1166 / mobile 2060:8628)
   -------------------------------------------------------------------------- */
.np-contacts {
	position: relative;
	padding-top: 0;
}

.np-contacts.np-contacts--has-map {
	padding-bottom: 0 !important;
}

.np-contacts__wrap {
	position: relative; /* no z-index: the outline sits under the map, the card above it */
}

.np-contacts__title {
	margin: 0 0 14px;
	font: var(--np-fs-h3, 18px)/1.5 var(--np-font-title, 'TitlingGothicFBWideMedium');
	color: var(--np-gold, #D69C36);
}

.np-contacts__text,
.np-contacts__text p {
	font: 16px/1.5 var(--np-font-body, 'PragmaticaLight');
	color: var(--np-dark, #292929);
}

.np-contacts__text p {
	margin: 0 0 16px;
}

.np-contacts__text p:last-child {
	margin-bottom: 0;
}

.np-contacts__text strong,
.np-contacts__text b {
	font-family: 'PragmaticaBold';
}

.np-contacts__text a[href^="mailto:"] {
	text-decoration: underline;
	cursor: pointer;
}

.np-contacts__text a:hover {
	color: var(--np-gold, #D69C36);
}

/* stray Google-Translate widget markup saved in the WYSIWYG content */
.np-contacts__text [id^="gtx-trans"] {
	display: none;
}

.np-contacts__map {
	position: relative;
	z-index: 1;
	overflow: hidden;
	background-color: var(--np-light, #F3F4F5);
}

.np-contacts__map iframe {
	display: block;
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

/* desktop/tablet: skewed white card with the gold outline, overlapping the map */
@media screen and (min-width: 1024px) {
	.np-contacts__wrap {
		width: min(1206px, calc(100% - 240px));
		margin: 0 auto;
		padding-top: 36px;
	}

	/* gold outline: same parallelogram, offset 22px left / 36px up */
	.np-contacts__wrap::before {
		content: '';
		position: absolute;
		top: 0;
		bottom: 36px;
		left: -22px;
		right: 22px;
		z-index: 0;
		border: 1px solid var(--np-gold, #D69C36);
		transform: skewX(-30deg);
		pointer-events: none;
	}

	.np-contacts__card {
		position: relative;
		z-index: 3;
		background-color: var(--np-white, #FFFFFF);
		box-shadow: var(--np-shadow, 0 7px 7.5px rgba(0, 0, 0, 0.1));
		transform: skewX(-30deg);
		padding: 53px 60px 46px clamp(110px, 10vw, 168px);
	}

	/* auto tracks grow toward max-content evenly, so short columns (phones) don't get squeezed */
	.np-contacts__cols {
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: auto;
		justify-content: start;
		gap: clamp(40px, 5.9vw, 100px);
		transform: skewX(30deg);
	}

	.np-contacts--c4 .np-contacts__card {
		padding-left: clamp(90px, 7vw, 120px);
	}

	.np-contacts--c4 .np-contacts__cols {
		gap: clamp(30px, 3.5vw, 60px);
	}

	.np-contacts__btn {
		position: absolute;
		z-index: 4;
		right: 40px;
		bottom: 0;
		transform: translateY(50%);
	}

	.np-contacts--has-map .np-contacts__map {
		height: 512px;
		margin-top: -89px;
	}
}

@media screen and (min-width: 1024px) and (max-width: 1399px) {
	.np-contacts__text,
	.np-contacts__text p {
		font-size: 15px;
	}
}

/* mobile (design 440) + small tablets: plain stacked columns, map below, centered button */
@media screen and (max-width: 1023px) {
	.np-contacts {
		display: flex;
		flex-direction: column;
	}

	.np-contacts__wrap {
		display: contents;
	}

	.np-contacts__card {
		order: 1;
		width: calc(100% - 60px);
		margin: 0 auto 40px;
	}

	.np-contacts__cols {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
		gap: 60px 40px;
	}

	.np-contacts__title {
		font-size: 19px;
		margin-bottom: 14px;
	}

	.np-contacts__title br {
		display: none;
	}

	.np-contacts__text,
	.np-contacts__text p {
		font-size: 14px;
	}

	.np-contacts__text p {
		margin-bottom: 0;
	}

	.np-contacts__btn {
		order: 3;
		position: relative;
		z-index: 2;
		align-self: center;
		margin: -29px 0 60px;
	}

	.np-contacts--has-map .np-contacts__map {
		order: 2;
		aspect-ratio: 440 / 357;
		width: 100%;
	}

	.np-contacts:not(.np-contacts--has-map) .np-contacts__btn {
		margin-top: 0;
	}
}
