/* =====================================================================
 *  NOA — updates.css
 *
 *  Front-end CSS that exists ONLY to address WordPress / ACF / CF7
 *  rendering quirks. ANY visual design tweak belongs in style.css's
 *  source, never here.
 *
 *  Sections:
 *    1. Light-weight span pattern (.lt) — universal
 *    2. wpautop'd body wrappers — first/last <p> margin reset
 *    3. Footer newsletter — Contact Form 7 wrapper neutralisation
 *    4. Long-form text — element defaults inside .long-form
 *    5. Contact form — CF7 → prototype-form visual alignment
 * ===================================================================== */

/* --- 1. Light-weight span pattern --------------------------------------
 * Prototype CSS targets <h2 span> in places. The [lt] shortcode now
 * outputs <span class="lt"> which we style explicitly.
 * -------------------------------------------------------------------- */
[class*="__heading"] span,
.hero__heading span,
.cap-hero__heading span,
.about-hero__heading span,
.intro__heading span,
.green-corner__heading span,
.team__heading span,
.community__heading span,
.clarity__heading span,
.founders__heading span,
.partners__heading span,
.ecosystem__heading span,
.ins-hero__heading span,
.art-hero__heading span,
.long-form__title span,
span.lt {
	font-weight: var(--font-light);
}

/* --- 2. wpautop body wrappers ------------------------------------------ */
.hero__description>p:first-child,
.about-hero__description>p:first-child,
.who-we-are__text>p:first-child,
.intro__text>p:first-child,
.long-form>p:first-child,
.cap-advisory__desc>p:first-child,
.cap-audit__desc>p:first-child {
	margin-top: 0;
}

.hero__description>p:last-child,
.about-hero__description>p:last-child,
.who-we-are__text>p:last-child,
.intro__text>p:last-child,
.long-form>p:last-child,
.cap-advisory__desc>p:last-child,
.cap-audit__desc>p:last-child,
.ecosystem__desc>p:last-child {
	margin-bottom: 0;
}

/* --- 3. Footer newsletter — Contact Form 7 ----------------------------
 * CF7 wraps in <div class="wpcf7"><form class="wpcf7-form"><p>…</p>…
 * Collapse with display:contents so the prototype's flex layout reaches
 * the real <input> + <button>.
 * -------------------------------------------------------------------- */
.wpcf7-submit {
	border: none;
	padding: 1.3rem 2.8rem;
}

.wpcf7 form .wpcf7-not-valid-tip {
	font-size: 0.6em;
	display: block;
	position: absolute;
	bottom: 0;
	left: 1.6rem;
}

.wpcf7 form .wpcf7-response-output {
	position: absolute;
	bottom: -25px;
	border: none;
	left: 0;
	margin: 0;
	padding: 0;
	font-size: 0.6em;
}

form {
	gap: var(--space-sm);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
}

.contact-form__row,
.contact-form__footer {
	width: 100%;
}

.footer__newsletter-form .wpcf7,
.footer__newsletter-form .wpcf7-form,
.footer__newsletter-form .wpcf7-form>p,
.footer__newsletter-form .wpcf7-form-control-wrap {
	display: flex;
	position: relative;
	gap: 20px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.footer__newsletter-form .screen-reader-response,
.footer__newsletter-form .hidden-fields-container,
.footer__newsletter-form .wpcf7-form>p>br,
.footer__newsletter-form .wpcf7-spinner {
	display: none;
}

.wpcf7-spinner {
	position: absolute;
}

.footer__newsletter-form {
	flex-wrap: wrap;
}

.footer__newsletter-form .wpcf7 form.invalid .wpcf7-response-output,
.footer__newsletter-form .wpcf7 form.unaccepted .wpcf7-response-output,
.footer__newsletter-form .wpcf7 form.payment-required .wpcf7-response-output,
.footer__newsletter-form .wpcf7 form.failed .wpcf7-response-output {
	color: #ff9a8a;
}

.footer__newsletter-form .wpcf7 form.sent .wpcf7-response-output {
	color: #a8e5b8;
}

/* --- 4. Long-form text — element defaults inside .long-form -----------
 * The prototype CSS only styles BEM classes. Raw <h2>, <p>, <ul>, <a>
 * inside our .long-form wrapper need defaults. Used by long_form_text
 * Flex layout (legal pages) AND by single.php's article body wrapper.
 * -------------------------------------------------------------------- */
.long-form-section {
	background-color: var(--color-bg, #f5f3ea);
	padding: 16rem 0 8rem;
	color: var(--color-dark, #1a1a1a);
}

.long-form-section__inner {
	max-width: 80rem;
	margin: 0 auto;
}


.long-form p {
	margin: 0 0 1.6rem;
}

.long-form ul,
.long-form ol {
	margin: 0 0 1.6rem;
}

.long-form ul ul,
.long-form ul ol,
.long-form ol ul,
.long-form ol ol {
	margin-top: 1.6rem;
}

.long-form li {
	margin-bottom: 0.6rem;
}

.long-form a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.long-form a:hover {
	opacity: 0.6;
}

@media (max-width: 767px) {
	.long-form-section {
		padding: 12rem 0 6rem;
	}

	.long-form__title {
		font-size: 3.6rem;
	}

}

/* --- 5. Contact form — CF7 → prototype-form alignment -----------------
 * When the editor pastes a CF7 shortcode, CF7 emits its own field
 * wrappers (.wpcf7-form-control-wrap, .wpcf7-form-control). The
 * prototype's static form uses .contact-form__input / __select /
 * __textarea. The rules below let CF7's output inherit the prototype's
 * styling without forcing the editor to write custom classes on every
 * tag.
 * -------------------------------------------------------------------- */
.contact-form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

.contact-form input[type="text"].wpcf7-form-control,
.contact-form input[type="email"].wpcf7-form-control,
.contact-form input[type="tel"].wpcf7-form-control,
.contact-form input[type="url"].wpcf7-form-control {
	/* Match .contact-form__input — the prototype's styling will apply
	 * naturally when the editor adds class:contact-form__input to each
	 * CF7 input, but we also style the bare CF7 controls for editors who
	 * paste the shortcode unmodified. */
	width: 100%;
}

.contact-form textarea.wpcf7-form-control {
	width: 100%;
	min-height: 12rem;
}

.contact-form .wpcf7-not-valid-tip {
	color: #c44;
	font-size: 1.3rem;
	margin-top: 0.4rem;
}

.contact-form .wpcf7-response-output {
	margin-top: 1.6rem;
	padding: 1rem 1.2rem;
	border-width: 1px;
	font-size: 1.4rem;
}

.footer__bottom-left {
	width: auto
}

.footer__links-row {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 1rem;
}

.navbar__logo img {
	height: 4.8rem;
	transition: all .3s ease;
}

.scrolled .navbar__logo img {
	height: 3.9rem;
}

/* Anchor scroll offset — pushes the scroll target down so the fixed navbar
 * doesn't cover it. Applied at the <html> level so every #anchor click on
 * the site (in-page nav, /advisory/#pillar-N, mobile menu items, etc.)
 * leaves room for the navbar. */
html {
	scroll-padding-top: 9rem;
}

.section-label {
	flex-wrap: wrap;
}

.cap-hero,
.ins-hero {
	min-height: unset;
}

.cap-hero__inner.content,
.ins-hero__inner.content {
	padding-top: 16rem;
}

.cap-hero__left {
	gap: var(--space-lg);
}

.high-stakes__card-text {
	font-size: 1.8rem;
}

.high-stakes__card-link {
	font-weight: var(--font-medium);
}

.navbar__dropdown {
	min-width: 22rem;
}

.footer__copyright {
	font-size: 1.6rem;
}

.green-corner__item:not(:has(.green-corner__item-title)) .green-corner__number {
	padding-top: 0.3rem;
}

.cap-audit__card-text {
	font-size: 1.8rem;
}

.international {
	min-height: 80vh
}

.article-content img {
	width: auto;
	height: auto;
	max-width: 100%;
}

.ins-image {
	max-height: 700px;
	overflow: hidden;
}

.ins-image img {
	width: 100%;
	height: 700px;
	object-fit: cover;
	object-position: center;
}

/* Article video embeds — .bt-video-container is the wrapper editors on
 * noagroup.ro put around iframe embeds. The wrapper has no styling on the
 * live site, so the iframe inherits its hard-coded width/height attributes
 * and overflows on mobile. Use aspect-ratio to keep a fluid 16:9 box, then
 * absolutely fill it with the iframe. */
.bt-video-container {
	position: relative;
	width: 100%;
	margin: 2.4rem 0;
	aspect-ratio: 16 / 9;
	background: #000;
}

.bt-video-container iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.cap-hero__right {
	max-width: 45rem;
}

.ins-card__image {
	object-fit: cover;
	object-position: center;
	width: auto;
	height: auto;
	min-width: 100%;
	min-height: 100%;
}

.ins-articles__tabs {
	flex-wrap: wrap;
	row-gap: 1rem;
}

.ins-image img.desktop,
.cap-image img.desktop,
.about-team-image img.desktop {
	display: block;
}

.ins-image img.mobile,
.cap-image img.mobile,
.about-team-image img.mobile {
	display: none;
}

@media (max-width: 932px) {
	.footer__noa {
		max-width: 100%;
	}
}

/* Full-width image sections — cap their height on tablet/mobile and
 * crop with object-fit so the visual break stays consistent. */
@media (max-width: 767px) {

	.ins-image,
	.cap-image,
	.about-team-image {
		max-height: 400px;
		overflow: hidden;
	}

	.ins-image img,
	.cap-image img,
	.about-team-image img {
		width: 100%;
		height: 400px;
		object-fit: cover;
		object-position: center;
	}
}

/* Mobile-image swap — only hide the desktop <img> when a sibling
 * .mobile <img> actually exists (the PHP only renders it when an ACF
 * mobile_image was uploaded). Otherwise the desktop image stays visible. */
@media (max-width: 479px) {

	.ins-image:has(img.mobile) img.desktop,
	.cap-image:has(img.mobile) img.desktop,
	.about-team-image:has(img.mobile) img.desktop {
		display: none;
	}

	.ins-image img.mobile,
	.cap-image img.mobile,
	.about-team-image img.mobile {
		display: block;
	}
}

/* Card swipers stack vertically on small mobile.
 * JS destroys the Swiper instance below 480px (see functions.js).
 * These rules override Swiper's base CSS so the leftover wrapper/slide
 * elements lay out as a normal block stack instead of a flex row. */
@media (max-width: 479px) {

	.high-stakes__swiper .swiper-wrapper,
	.cap-advisory__swiper .swiper-wrapper,
	.cap-audit__swiper .swiper-wrapper {
		display: block;
	}

	.high-stakes__swiper .swiper-slide,
	.cap-advisory__swiper .swiper-slide,
	.cap-audit__swiper .swiper-slide {
		width: 100% !important;
		margin-bottom: 1.6rem;
	}

	.high-stakes__swiper .swiper-slide:last-child,
	.cap-advisory__swiper .swiper-slide:last-child,
	.cap-audit__swiper .swiper-slide:last-child {
		margin-bottom: 0;
	}

	.cap-advisory__card,
	.high-stakes__card,
	.cap-audit__card {
		min-height: unset;
		gap: var(--space-xl);
	}

	.ins-card, .ins-card__body {
		gap: var(--space-xs);
	}

	.ins-hero__inner.content {
		padding-bottom: 0;
	}
}
/* -----------------------------------------------------------------------
 * built_for_rigor — editor-positioned decorative corner images.
 *
 * All rules are gated behind .built-for-rigor--has-decor (added by the
 * template only when the corner_images repeater has rows), so existing
 * built_for_rigor sections are untouched. Offsets and width come from the
 * ACF row as inline styles; negative offsets bleed off the edge and get
 * clipped by the overflow below.
 * -------------------------------------------------------------------- */
.built-for-rigor--has-decor {
	overflow: hidden;
}

.built-for-rigor--has-decor .built-for-rigor__inner {
	z-index: 1;
}

.built-for-rigor__decor {
	position: absolute;
	z-index: 0;
	height: auto;
	pointer-events: none;
}

.built-for-rigor__decor--mobile {
	display: none;
}

@media (max-width: 932px) {
	.built-for-rigor__decor--desktop {
		display: none;
	}

	.built-for-rigor__decor--mobile {
		display: block;
	}
}

/* -----------------------------------------------------------------------
 * green_corner — "FAQ accordion" right variant.
 *
 * Markup comes from green-corner.php when right_variant === 'accordion'.
 * One item open at a time (functions.js toggles .is-open). The open/close
 * animation uses the grid-template-rows 0fr→1fr technique so no JS height
 * measurement is needed.
 * -------------------------------------------------------------------- */
.green-corner__acc-item {
	border-bottom: 1px solid rgba(10, 6, 17, 0.15);
	padding: var(--space-sm) 0;
}

.green-corner__acc-item:first-child {
	border-top: 1px solid rgba(10, 6, 17, 0.15);
}

.green-corner__acc-q {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-sm);
	width: 100%;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: var(--font-primary);
}

.green-corner__acc-q-text {
	font-size: 2.4rem;
	font-weight: var(--font-light);
	line-height: 1.3;
	color: var(--color-dark);
}

.green-corner__acc-icon {
	position: relative;
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	margin-top: 0.4rem;
}

.green-corner__acc-icon::before,
.green-corner__acc-icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1.6rem;
	height: 2px;
	background-color: var(--color-dark);
	transform: translate(-50%, -50%);
	transition: transform 0.25s ease;
}

.green-corner__acc-icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.green-corner__acc-item.is-open .green-corner__acc-icon::after {
	transform: translate(-50%, -50%) rotate(0deg);
}

.green-corner__acc-a {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.3s ease;
}

.green-corner__acc-item.is-open .green-corner__acc-a {
	grid-template-rows: 1fr;
}

.green-corner__acc-a-text {
	overflow: hidden;
	font-weight: var(--font-light);
	color: rgba(10, 6, 17, 0.6);
	line-height: 1.6;
	max-width: 60rem;
}

.green-corner__acc-item.is-open .green-corner__acc-a-text {
	padding-top: var(--space-xs);
}

@media (max-width: 932px) {
	.green-corner__acc-q-text {
		font-size: 2rem;
	}
}

/* -----------------------------------------------------------------------
 * international — optional numbered list (number + title + description).
 *
 * Rendered by international.php only when the numbered_items repeater has
 * rows (e.g. the "three lines of defense" section). All rules scoped to
 * new .international__numbered* classes, so existing international sections
 * are untouched. The section is dark, so text is white like the rest of
 * the international layout.
 * -------------------------------------------------------------------- */
.international__numbered {
	display: flex;
	flex-direction: column;
}

.international__numbered-item {
	display: grid;
	grid-template-columns: 6rem 1fr;
	gap: var(--space-sm);
	padding: var(--space-md) 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Dividers sit BETWEEN items only (matches the design): no rule above the
 * first item, none below the last. */
.international__numbered-item:last-child {
	border-bottom: none;
}

.international__numbered-num {
	font-size: 1.4rem;
	font-weight: var(--font-light);
	color: var(--color-white);
	padding-top: 1rem;
}

.international__numbered-body {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.international__numbered-title {
	font-size: 2.8rem;
	font-weight: var(--font-light);
	line-height: 1.2;
	color: var(--color-white);
}

.international__numbered-desc {
	font-weight: var(--font-light);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 932px) {
	.international__numbered-title {
		font-size: 2.2rem;
	}
}

/* green_corner "topLine" — hairline divider above a stacked prose section
 * (Internal Audit page: divider between Deliverables and Benefits). Scoped
 * to the topLine modifier, so no other green_corner section is affected. */
.green-corner.topLine::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: min(144rem, calc(100% - 8rem));
	height: 1px;
	background-color: rgba(10, 6, 17, 0.12);
}

/* -----------------------------------------------------------------------
 * Internal Audit page — per-page green_corner tweaks.
 * page-id-2303 = EN /internal-audit/, page-id-2316 = RO /ro/audit-intern/
 * (its Romanian translation). Scoped to those body classes so the Tax
 * Advisory page and every other green_corner section keep their sizing.
 * -------------------------------------------------------------------- */

/* Body prose in the right column: 1.8rem. The editor-added
 * .built-for-rigor__lead paragraph (NOA Group Methodology) is excluded so
 * it keeps its larger lead size. */
.page-id-2303 .green-corner__right > p:not(.built-for-rigor__lead),
.page-id-2316 .green-corner__right > p:not(.built-for-rigor__lead) {
	font-size: 1.8rem;
}

/* Processes numbered list: more breathing room between items, grey number,
 * and item text pinned to 1.8rem to match the surrounding prose. */
.page-id-2303 .green-corner__item,
.page-id-2316 .green-corner__item {
	padding-top: var(--space-lg);
	padding-bottom: var(--space-lg);
}

.page-id-2303 .green-corner__number,
.page-id-2316 .green-corner__number {
	color: rgba(10, 6, 17, 0.55);
}

.page-id-2303 .green-corner__item-text,
.page-id-2316 .green-corner__item-text {
	font-size: 2.2rem;
	color: var(--color-dark);
}
