/* ==========================================================================
   Knowledge article — refreshed design
   New vanilla CSS for effectory/single-knowledge.php. Also reused as-is by
   effectory/single-casestudies.php for case studies with "Full width design"
   off (see template-parts/casestudies/) so both read as the same kind of
   article. Deliberately kept separate from css/screens/article.css (legacy —
   still enqueued for backward compatibility) so neither file has to fight
   the other's rules.

   Structure:
     .knowledge-article__header       title / author (or, for a case study,
                                       its logo) / date / share / image
     .knowledge-article__content      the_content() wrapper (width + <p> size only)
     .knowledge-article__extra        share / author bio / related themes / articles
   ========================================================================== */

.knowledge-article__header,
.knowledge-article__content,
.knowledge-article__extra {
	box-sizing: border-box;
}

.knowledge-article__header *,
.knowledge-article__content *,
.knowledge-article__extra * {
	box-sizing: border-box;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.knowledge-article__header {
	position: relative;
	overflow: hidden;
	border-radius: 0 0 80px 0;
	padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 6vw, 5rem) 0;
	/* Extends the background down behind ~80% of the first primary-visual
	   image (js/pages/knowledge-article.js measures it and sets the custom
	   property); the equal negative margin keeps the extra padding from
	   pushing the rest of the page down. 300px is a sane pre-JS/no-JS
	   fallback. The overlap ratio is read by that JS too (0.5 on mobile). */
	--knowledge-header-overlap: 0.8;
	padding-bottom: var(--knowledge-header-extend, 300px);
	margin-bottom: calc(-1 * var(--knowledge-header-extend, 300px));
	-webkit-font-smoothing: antialiased;
}

.knowledge-article__header::before {
	content: "";
	position: absolute;
	inset: -10% -10% 0% -10%;
	background: var(--wp--preset--gradient--atmosphere);
	filter: blur(60px);
	z-index: -1;
	pointer-events: none;
	top:17%;
}

.knowledge-article__header-inner {
	position: relative;
	z-index: 1;
	max-width: 61.25rem; /* 980px */
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
}

.knowledge-article__titleblock {
	width: 100%;
}

.knowledge-article__title {
	margin: 0;
	text-align: center;
	font-family: Poppins;
	font-weight: 700;
	line-height: 1.4;
	color: var(--wp--preset--color--dark);
	font-size: clamp(1.75rem, 1.35rem + 2vw, 2.5rem); /* 28px → 40px */
}

.knowledge-article__details {
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1rem 3.5rem;
}

.knowledge-article__authordate {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.knowledge-article__author {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.knowledge-article__avatar {
	flex-shrink: 0;
	width: 60px;
	height: 60px;
	background-color: #FFC192;
	background-size: cover;
	background-position: center;
	border-radius: 24% 24% 0 24% ;
}

.knowledge-article__avatar--large {
	width: 80px;
	height: 80px;
}

/* Case study header: a customer logo stands in for the author avatar. Kept
   at the same box height as the avatar so the row's baseline still lines up,
   but shown uncropped (object-fit: contain) rather than as a circular photo,
   since a logo's own aspect ratio has to be respected. */
.knowledge-article__logo {
	display: block;
	max-width: 140px;
	max-height: 60px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.knowledge-article__authorname {
	margin: 0;
	font-family: Poppins;
	font-weight: 700;
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); /* 16px → 18px */
	color: var(--wp--preset--color--dark);
}

.knowledge-article__dot {
	color: #AAB0BA;
	font-size: 1rem;
}

.knowledge-article__date {
	font-family: Poppins;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--wp--preset--color--dark);
}

.knowledge-article__social {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0;
	padding: 0;
}

.knowledge-article__social-link {
	display: flex;
	width: 24px;
	height: 24px;
}

.knowledge-article__social-link img {
	display: block;
	width: 100%;
	height: 100%;
}

.knowledge-article__social-link_xing {
	width: auto;
	height: auto;
	font-family: Poppins;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--wp--preset--color--dark);
}

.knowledge-article__media {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 61.25rem;
	margin: 2.5rem auto 0;
}

.knowledge-article__image {
	display: block;
	max-width: 100%;
	aspect-ratio: 140/59;
	object-fit: cover;
	border-radius: 1rem;
	box-shadow: 0 4px 80px 0 rgba(44, 57, 83, 0.08);
}

/* ── Content (the_content) ──────────────────────────────────────────────── */

.knowledge-article__content {
	max-width: calc(980px + (2*clamp(2.5rem, 6vw, 5rem)));
	margin: 0 auto;
	padding: clamp(3rem, 5vw, 3rem) clamp(2.5rem, 6vw, 5rem);
	color: var(--wp--preset--color--dark);
}


.knowledge-article__content p {
	font-family: Poppins;
	font-size: clamp(1rem, 2.5vw, 1rem);
	line-height: 1.6;
	color: var(--wp--preset--color--dark);

}
.knowledge-article__content p:first-child {
	font-size: clamp(1rem, 2.5vw, 1.125rem);

}
.article__introduction {
	margin-bottom:3rem;
}
.knowledge-article__content h2, .knowledge-article__content h3, .knowledge-article__content h4, .knowledge-article__content h5, .knowledge-article__content h6, .knowledge-article__content li {
	color: var(--wp--preset--color--dark);
}
.knowledge-article__content h2 {
	font-size: clamp(1.625rem, 2.5vw, 1.875rem);
	color: var(--wp--preset--color--dark);
	margin-top:56px;
}

/* Links, lists and tables below are scoped to WordPress's own text blocks
   (paragraph, list, table, quote, heading) or to direct children for classic
   content — never to markup inside other blocks — so rf-* / ACF blocks such
   as rf-request keep their own link and button styling. */

/* Links — Figma 3397:73604: same weight/colour as the running text, just
   underlined. */
:is(.knowledge-article__content :is(.wp-block-paragraph, .wp-block-list, .wp-block-table, .wp-block-quote, .wp-block-heading), .knowledge-article__content > :is(p, ul, ol, table, blockquote, h2, h3, h4, h5, h6)) a {
	position: relative;
	font-family: inherit;
	font-weight: inherit;
	color: var(--wp--preset--color--dark);
	text-decoration: underline;
	text-underline-position: from-font;
	word-break: break-word;
}

:is(.knowledge-article__content :is(.wp-block-paragraph, .wp-block-list, .wp-block-table, .wp-block-quote, .wp-block-heading), .knowledge-article__content > :is(p, ul, ol, table, blockquote, h2, h3, h4, h5, h6)) a:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--dark);
	text-decoration-thickness: 2px;
}

/* Lists — disc / decimal markers, 24px indent, 8px between items */
:is(.knowledge-article__content .wp-block-list, .knowledge-article__content > ul, .knowledge-article__content > ol) {
	margin: 0 0 1rem;
	padding: 0.5rem 0 0.5rem 24px;
	font-family: Poppins;
	font-size: 16px;
	line-height: 1.6;
	color: var(--wp--preset--color--dark);
	list-style: disc;
}

:is(.knowledge-article__content ol.wp-block-list, .knowledge-article__content > ol) {
	list-style: decimal;
}

:is(.knowledge-article__content .wp-block-list, .knowledge-article__content > ul, .knowledge-article__content > ol) ul {
	list-style: circle;
}

:is(.knowledge-article__content .wp-block-list, .knowledge-article__content > ul, .knowledge-article__content > ol) li :is(ul, ol) {
	margin: 8px 0 0;
	padding-block: 0;
}

:is(.knowledge-article__content .wp-block-list, .knowledge-article__content > ul, .knowledge-article__content > ol) li {
	margin: 0;
	padding: 0;
	font-size: 16px;
	line-height: 1.6;
}

:is(.knowledge-article__content .wp-block-list, .knowledge-article__content > ul, .knowledge-article__content > ol) li + li {
	margin-top: 8px;
}

:is(.knowledge-article__content .wp-block-list, .knowledge-article__content > ul, .knowledge-article__content > ol) li::marker {
	color: var(--wp--preset--color--dark);
}

/* Tables (core/table) — 1px cloud outline with 4px radius, cloud header row,
   cloud row dividers, bold first column. */
.knowledge-article__content .wp-block-table {
	margin: 1.5rem 0;
	overflow-x: auto;
}

:is(.knowledge-article__content .wp-block-table, .knowledge-article__content) > table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--wp--preset--color--cloud);
	border-radius: 4px;
	overflow: hidden;
	font-family: Poppins;
	font-size: 16px;
	line-height: 1.6;
	color: var(--wp--preset--color--dark);
}

.knowledge-article__content .wp-block-table :is(thead, tfoot) {
	border: 0;
}

:is(.knowledge-article__content .wp-block-table, .knowledge-article__content) > table :is(th, td) {
	padding: 16px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--cloud);
	text-align: left;
	vertical-align: top;
	font-weight: 400;
}

:is(.knowledge-article__content .wp-block-table, .knowledge-article__content) > table tr:last-child > :is(td, th) {
	border-bottom: 0;
}

:is(.knowledge-article__content .wp-block-table, .knowledge-article__content) > table thead :is(th, td) {
	padding: 24px 16px;
	background: var(--wp--preset--color--cloud);
	font-size: clamp(1rem, 1.3vw, 1.125rem);
	font-weight: 700;
	border-bottom: 0;
}

:is(.knowledge-article__content .wp-block-table, .knowledge-article__content) > table tbody :is(td:first-child, th) {
	font-weight: 700;
}

.knowledge-article__content .wp-block-table figcaption {
	margin-top: 0.5rem;
	font-size: 14px;
	color: var(--wp--preset--color--dark);
	opacity: 0.7;
}
.wp-block-image img {
	border-radius:1rem;
}



.knowledge-article__content .is-style-box-also {
	border-radius: 8px;
	background: linear-gradient(282deg, #FFE6D3 -29.56%, #FFF5ED 83.81%);
	width:100%;
	padding:1rem;
	font-weight:700;

}
.knowledge-article__content .is-style-box-also:before {
	border-radius: 8px;
	background: var(--Orange, #FF984A);
	margin-right:1.5rem;
	padding: 4px 1rem;
	color:#fff;
	font-size:14px;
	font-weight:600;
}

.knowledge-article__content .article__image {
	margin: 2rem auto 5rem;
}

/* Default pages (page.php with "Show in container") reuse the content styling
   above. The wrapper itself is full width so full/wide-aligned blocks (the
   hero) can span the page; every other block sits in a centred 980px column
   with a side gutter on small screens. */
.knowledge-article__content--page {
	--page-content-gutter: clamp(1.25rem, 4vw, 2.5rem);
	max-width: none;
	margin: 0;
	padding: 0 0 clamp(2rem, 5vw, 5rem);
}

.knowledge-article__content--page > :not(.alignfull):not(.alignwide) {
	max-width: min(980px, calc(100% - (2 * var(--page-content-gutter))));
	margin-inline: auto;
}

/* ── Quote (core/quote) ───────────────────────────────────────────────────
   Replaces every previous blockquote treatment (the old "Default"/"Long
   Quote" styles — see js/editor.js, which no longer offers that choice) with
   one design, applied regardless of which — if any — is-style-* class is on
   the block. Scoped to the body class rather than .knowledge-article__content
   so it also reaches a case study using "Full width design", which has no
   such wrapper. The citation is whatever an editor puts in the block's
   citation field (rendered as a <cite>). */

.single-knowledge .wp-block-quote,
.knowledge-article__content--page .wp-block-quote,
.single-casestudies .wp-block-quote {
	--quote-rule: color-mix(in srgb, var(--wp--preset--color--amber) 24%, white); /* Figma: #FFE6D3 */
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	width: 100%;
	max-width: 61.25rem; /* 980px — matches the article's own content width */
	margin: 3.5rem auto 3.5rem;
	padding: 2.5rem 0;
	border-top: 2px solid var(--quote-rule);
	border-bottom: 2px solid var(--quote-rule);
	text-align: center;
}

.single-knowledge .wp-block-quote p,
.knowledge-article__content--page .wp-block-quote p,
.single-casestudies .wp-block-quote p {
	position: relative;
	margin: 0;
	padding: 0 2.5rem; /* clears the quote-mark icons on either side */
	font-family: Poppins;
	font-weight: 500;
	font-size: clamp(1.125rem, 4vw, 1.25rem); /* 20px */
	line-height: 1.4;
	color: var(--wp--preset--color--dark);
}

.single-knowledge .wp-block-quote p::before,
.knowledge-article__content--page .wp-block-quote p::before,
.single-casestudies .wp-block-quote p::before,
.single-knowledge .wp-block-quote p::after,
.knowledge-article__content--page .wp-block-quote p::after,
.single-casestudies .wp-block-quote p::after {
	content: "";
	position: absolute;
	width: 24px;
	height: 22px;
	background-color: var(--wp--preset--color--amber);
	-webkit-mask-image: url("../../img/icon-quote-mark.svg");
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	-webkit-mask-size: contain;
	mask-image: url("../../img/icon-quote-mark.svg");
	mask-repeat: no-repeat;
	mask-position: center;
	mask-size: contain;
}

.single-knowledge .wp-block-quote p::before,
.knowledge-article__content--page .wp-block-quote p::before,
.single-casestudies .wp-block-quote p::before {
	top: 0;
	left: 0;
}

.single-knowledge .wp-block-quote p::after,
.knowledge-article__content--page .wp-block-quote p::after,
.single-casestudies .wp-block-quote p::after {
	bottom: 0;
	right: 0;
	transform: rotate(180deg);
}

.single-knowledge .wp-block-quote cite,
.knowledge-article__content--page .wp-block-quote cite,
.single-casestudies .wp-block-quote cite {
	display: block;
	margin: 0;
	font-family: Poppins;
	font-weight: 700;
	font-style: normal;
	font-size: 1rem; /* 16px */
	line-height: 1.4;
	color: var(--wp--preset--color--dark);
}

/* ── Extra details (share / author / related) ───────────────────────────── */

.knowledge-article__extra {
	max-width: calc(980px + (2 * clamp(2.5rem, 6vw, 5rem)));
	margin: 0 auto;
	padding: 0 clamp(1.5rem, 6vw, 5rem) clamp(0.5rem, 6vw, 0.5rem);
	display: flex;
	flex-direction: column;
	gap: 3rem;
	-webkit-font-smoothing: antialiased;
}

.knowledge-article__share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
}

.knowledge-article__share-label {
	margin: 0;
	font-family: Poppins;
	font-weight: 700;
	font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem); /* 18px → 20px */
	color: var(--wp--preset--color--dark);
}

.knowledge-article__authorcard {
	display: flex;
	align-items: flex-start;
	gap: 1.5rem;
}

.knowledge-article__authorcard-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.knowledge-article__authorbio {
	margin: 0;
	font-family: Poppins;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--wp--preset--color--dark);
}

.knowledge-article__authorbio p {
	margin: 0 0 0.5rem;
}

.knowledge-article__authorbio a {
	color: var(--wp--preset--color--dark);
	text-decoration: underline;
}

.knowledge-article__relatedthemes {
	padding-top: 2rem;
	border-top: 1px solid var(--wp--preset--color--cloud, #F0EBE6);
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.knowledge-article__extra-title {
	margin: 0;
	font-family: Poppins;
	font-weight: 700;
	font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem); /* 18px → 20px */
	color: var(--wp--preset--color--dark);
}

.knowledge-article__themes {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0 !important;
}

.knowledge-article__theme {
	margin: 0 !important;
}

.knowledge-article__relatedarticles {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
}

.knowledge-article__related-link {
	font-family: Poppins;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--wp--preset--color--dark);
	text-decoration: underline;
}

/* ── Responsive (mobile) ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.knowledge-article__header {
		--knowledge-header-overlap: 0.5;
		border-radius: 0 0 40px 0;
		padding-top: 2rem;
	}

	.knowledge-article__details {
		flex-direction: column;
		gap: 1.5rem;
	}

	.knowledge-article__authordate {
		flex-direction: column;
		gap: 0.5rem;
	}

	.knowledge-article__dot {
		display: none;
	}

	.knowledge-article__date {
		text-align: center;
	}

	.knowledge-article__media {
		margin-top: 1.5rem;
	}

	.knowledge-article__authorcard {
		flex-direction: column;
		gap: 1rem;
	}

	.knowledge-article__relatedthemes {
		align-items: flex-start;
	}

	.knowledge-article__themes {
		flex-direction: column;
		align-items: flex-start;
	}
	.knowledge-article__content .is-style-box-also:before {
		position: relative;
		display: inline-block;
		width: auto;
		white-space: nowrap;
		margin-right: 100%;
		margin-bottom: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.knowledge-article__header *,
	.knowledge-article__content *,
	.knowledge-article__extra * {
		animation: none !important;
		transition: none !important;
	}
}
