/*
 * New Insights articles (inc/articles.php): the block styles a writer picks in the editor, the
 * video card, buttons, footnotes and the template changes. Loaded on new articles and in the editor
 * (where the site's main stylesheet isn't, hence the fallbacks on every colour).
 */

:root {
	--sw-a-orange: var(--orange, #F5601C);
	--sw-a-orange-hover: var(--orange-hover, #E0510F);
	--sw-a-ink: var(--ink, #343539);
	--sw-a-ink-dim: var(--ink-dim, #55575C);
	--sw-a-paper: var(--paper-2, #EDF1F5);
	--sw-a-line: var(--silver-line, rgba(52, 53, 57, 0.10));
	--sw-a-display: var(--font-display, "Roboto Condensed", "Arial Narrow", sans-serif);
	--sw-a-dark: #16181C;
}

/* Headings that links jump to stop below the fixed header. */
.sw-prose [id] { scroll-margin-top: 110px; }

/* Footnote numbers. */
.sw-prose sup { font-size: 0.68em; line-height: 0; }
.sw-prose sup a { text-decoration: none; padding: 0 1px 0 1px; margin-left: -1px; font-weight: 600; }

/* ---------- The easier way (Quote → "The easier way") ---------- */
.wp-block-quote.is-style-sw-easier {
	border: 0;
	border-radius: 16px;
	background: var(--sw-a-paper);
	padding: 18px 22px 20px;
	margin-left: 0;
	margin-right: 0;
	font-size: 1em;
	color: var(--sw-a-ink);
	position: relative;
}
.wp-block-quote.is-style-sw-easier::before {
	content: "";
	position: absolute;
	left: 0; top: 18px; bottom: 18px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--sw-a-orange);
}
.wp-block-quote.is-style-sw-easier p { margin: 0; }
.wp-block-quote.is-style-sw-easier strong:first-child {
	display: block;
	margin-bottom: 4px;
	font-family: var(--sw-a-display);
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sw-a-orange);
}
.wp-block-quote.is-style-sw-easier a {
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	color: var(--sw-a-orange);
}
.wp-block-quote.is-style-sw-easier a:hover { color: var(--sw-a-orange-hover); text-decoration: underline; }
.wp-block-quote.is-style-sw-easier cite { display: none; }

/* ---------- Pull question (Quote → "Pull question") ---------- */
.wp-block-quote.is-style-sw-pull {
	border: 0;
	margin: 1.8em 0;
	padding: 0 0 0 0;
	font-family: var(--sw-a-display);
	font-weight: 300;
	font-size: clamp(24px, 2.3vw, 32px);
	line-height: 1.22;
	letter-spacing: -0.005em;
	color: var(--sw-a-ink);
}
.wp-block-quote.is-style-sw-pull::before {
	content: "\201C";
	display: block;
	height: 0.55em;
	font-family: Georgia, serif;
	font-size: 2.2em;
	line-height: 1;
	color: var(--sw-a-orange);
}
.wp-block-quote.is-style-sw-pull p { margin: 0; }
.wp-block-quote.is-style-sw-pull strong { font-weight: 700; }
.wp-block-quote.is-style-sw-pull cite { display: none; }

/* ---------- Template (Code → "Template (copy button)") ---------- */
.wp-block-code.is-style-sw-template {
	position: relative;
	margin-left: 0;
	margin-right: 0;
	padding: 54px 22px 20px;
	background: #fff;
	border: 1px solid var(--sw-a-line);
	border-radius: 16px;
	box-shadow: 0 2px 6px rgba(52, 53, 57, 0.05), 0 14px 34px rgba(52, 53, 57, 0.08);
	font-family: inherit;
	font-size: 0.95em;
	line-height: 1.75;
	color: var(--sw-a-ink);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.wp-block-code.is-style-sw-template code { font-family: inherit; font-size: inherit; white-space: inherit; background: none; padding: 0; }
.wp-block-code.is-style-sw-template::before {
	content: "Template";
	position: absolute;
	left: 22px; top: 18px;
	font-family: var(--sw-a-display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sw-a-ink-dim);
}
.wp-block-code.is-style-sw-template::first-line { font-weight: 700; }
.sw-copy {
	position: absolute;
	right: 12px; top: 10px;
	padding: 7px 14px;
	border: 1px solid var(--sw-a-orange);
	border-radius: 999px;
	background: #fff;
	color: var(--sw-a-orange);
	font: 600 13px/1 var(--font-body, "Roboto", sans-serif);
	cursor: pointer;
	transition: background 200ms, color 200ms;
}
.sw-copy:hover, .sw-copy.is-done { background: var(--sw-a-orange); color: #fff; }
.sw-copy:focus-visible { outline: 2px solid var(--sw-a-orange); outline-offset: 2px; }

/* ---------- Series note, Next in this series, Closing line, Small note (Paragraph styles) ---------- */
p.is-style-sw-series {
	padding: 14px 18px;
	border: 1px solid rgba(52, 53, 57, 0.14);
	border-radius: 14px;
	background: transparent;
	font-size: 0.92em;
	line-height: 1.55;
	color: var(--sw-a-ink-dim);
}
p.is-style-sw-series strong:first-child,
p.is-style-sw-next strong:first-child {
	display: block;
	margin-bottom: 4px;
	font-family: var(--sw-a-display);
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sw-a-orange);
}
p.is-style-sw-next {
	margin-top: 2em;
	padding: 24px 26px;
	border-radius: 18px;
	background: var(--sw-a-dark);
	color: #E9EAEC;
	line-height: 1.6;
}
p.is-style-sw-next a { color: #fff; }
p.is-style-sw-closing {
	margin-top: 2.2em;
	text-align: center;
	font-family: var(--sw-a-display);
	font-weight: 300;
	font-size: clamp(26px, 2.6vw, 36px);
	line-height: 1.12;
	text-transform: uppercase;
	color: var(--sw-a-ink);
	text-wrap: balance;
}
p.is-style-sw-closing strong { font-weight: 700; color: var(--sw-a-orange); }
p.is-style-sw-note { font-size: 0.84em; line-height: 1.5; color: var(--sw-a-ink-dim); }
.wp-block-buttons + p.is-style-sw-note { margin-top: 0.7em; }

/* ---------- Buttons ---------- */
.sw-prose .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.sw-prose .wp-block-buttons.is-content-justification-center { justify-content: center; }
.wp-block-button .wp-block-button__link {
	display: inline-block;
	padding: 14px 28px;
	border: 1px solid var(--sw-a-orange);
	border-radius: 999px;
	background: var(--sw-a-orange);
	color: #fff;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.2;
	text-decoration: none;
	transition: background 200ms, transform 200ms;
}
.wp-block-button .wp-block-button__link:hover { background: var(--sw-a-orange-hover); color: #fff; transform: translateY(-1px); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--sw-a-orange); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--sw-a-orange); color: #fff; }

/* ---------- Link cards (List → "Link cards") ---------- */
ul.is-style-sw-links { list-style: none; padding: 0; display: grid; gap: 10px; }
ul.is-style-sw-links li { margin: 0; }
ul.is-style-sw-links li::marker { content: none; }
ul.is-style-sw-links a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	border: 1px solid var(--sw-a-line);
	border-radius: 14px;
	background: #fff;
	color: var(--sw-a-ink);
	font-weight: 500;
	line-height: 1.35;
	text-decoration: none;
	transition: border-color 200ms, transform 200ms;
}
ul.is-style-sw-links a::after { content: "\2197"; flex: none; color: var(--sw-a-orange); font-weight: 700; }
ul.is-style-sw-links a:hover { border-color: var(--sw-a-orange); color: var(--sw-a-ink); transform: translateY(-1px); }

/* ---------- Sources (List → "Sources") ---------- */
ol.is-style-sw-sources { font-size: 0.84em; line-height: 1.6; color: var(--sw-a-ink-dim); overflow-wrap: anywhere; }
ol.is-style-sw-sources a { color: var(--sw-a-ink-dim); }
.sw-fn-back { margin-left: 6px; text-decoration: none !important; color: var(--sw-a-orange) !important; }

/* ---------- Video card (YouTube embeds) ---------- */
.sw-video { margin: 1.8em 0; }
.sw-video-play,
.sw-video-frame {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	padding: 0;
	border: 0;
	border-radius: 16px;
	overflow: hidden;
	background: #0F1114;
	box-shadow: 0 2px 6px rgba(52, 53, 57, 0.06), 0 20px 46px rgba(52, 53, 57, 0.16);
}
.sw-video-play { cursor: pointer; }
.sw-video-play img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms; opacity: 0.92; }
.sw-video-play:hover img { transform: scale(1.03); opacity: 1; }
.sw-video-icon {
	position: absolute;
	left: 50%; top: 50%;
	width: 72px; height: 72px;
	margin: -36px 0 0 -36px;
	border-radius: 50%;
	background: var(--sw-a-orange);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	transition: transform 300ms;
}
.sw-video-icon::after {
	content: "";
	position: absolute;
	left: 29px; top: 23px;
	border-style: solid;
	border-width: 13px 0 13px 21px;
	border-color: transparent transparent transparent #fff;
}
.sw-video-play:hover .sw-video-icon { transform: scale(1.08); }
.sw-video-play:focus-visible { outline: 3px solid var(--sw-a-orange); outline-offset: 3px; }
.sw-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.sw-video figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--sw-a-ink-dim); }

/* ---------- Hero (design of 22 Nov): text on solid dark at the left, the image on the right fading in ---------- */
.sw-art-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: clamp(440px, 58vh, 580px);
	padding: calc(64px + 48px) 0 64px;
	background: #1C1D21;
	color: #fff;
}
.sw-art-hero-media { position: absolute; top: 0; right: 0; bottom: 0; width: 62%; z-index: -1; }
.sw-art-hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: brightness(0.62);
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.55) 22%, #000 55%);
	mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.55) 22%, #000 55%);
}
.sw-art-hero-text { position: relative; width: 100%; }
.sw-art-hero-text > * { max-width: 600px; }

.sw-art-kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 0 0 22px;
	font-family: var(--sw-a-display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.78);
}
.sw-art-pill {
	padding: 6px 13px;
	border-radius: 999px;
	background: var(--sw-a-orange);
	color: #fff;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-decoration: none;
	transition: background 200ms;
}
.sw-art-pill:hover { background: var(--sw-a-orange-hover); color: #fff; }

.sw-art-hero .pg-h1.sw-art-title {
	max-width: 600px;
	font-size: clamp(36px, 3.6vw, 58px);
	font-weight: 300;
	line-height: 1.04;
	letter-spacing: 0.01em;
	white-space: normal;
	text-wrap: balance;
	color: #fff;
}
.sw-title-rest { font-weight: 300; }
.sw-title-lead { display: block; margin-top: 0.06em; font-weight: 700; color: var(--sw-a-orange); letter-spacing: -0.01em; }

.sw-art-author { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.sw-art-author-photo {
	flex: none;
	width: 52px;
	height: 52px;
	padding: 2px;
	border: 2px solid var(--sw-a-orange);
	border-radius: 50%;
}
.sw-art-author-photo img,
.sw-art-author-photo span {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	background: #2A2C31;
	font: 700 18px/1 var(--sw-a-display);
	color: #fff;
}
.sw-art-author-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sw-art-author-name { font-size: 17px; font-weight: 600; line-height: 1.3; color: #fff; }
.sw-art-author-name a { color: #fff; text-decoration: none; }
.sw-art-author-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sw-art-author-meta { font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, 0.7); }

/* Series band under the hero. */
.sw-art-series { padding: 20px 0; background: var(--sw-a-paper); }
.sw-art-series p { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 15px; line-height: 1.5; color: var(--sw-a-ink); }
.sw-art-series-tag {
	flex: none;
	padding: 4px 11px;
	border: 1px solid var(--sw-a-orange);
	border-radius: 999px;
	font-family: var(--sw-a-display);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sw-a-orange);
}

/* "In this article": a column on the left of the text on wide screens; left out on smaller ones. */
.sw-toc { display: none; }
@media (min-width: 1100px) {
	.sw-art-grid.has-toc {
		display: grid;
		grid-template-columns: 210px minmax(0, 760px);
		gap: clamp(40px, 5vw, 88px);
		justify-content: center;
		align-items: start;
	}
	.sw-art-grid.has-toc .sw-toc { display: block; position: sticky; top: 110px; }
}
.sw-toc-h {
	margin: 0 0 12px;
	font-family: var(--sw-a-display);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--sw-a-ink-dim);
}
.sw-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--sw-a-line); }
.sw-toc li { margin: 0; }
.sw-toc a {
	display: block;
	margin-left: -1px;
	padding: 7px 0 7px 14px;
	border-left: 2px solid transparent;
	font-size: 14px;
	line-height: 1.35;
	color: var(--sw-a-ink-dim);
	text-decoration: none;
	transition: color 200ms, border-color 200ms;
}
.sw-toc a:hover { color: var(--sw-a-ink); }
.sw-toc li.is-active a { border-left-color: var(--sw-a-orange); color: var(--sw-a-ink); font-weight: 500; }

/* Phones: the image on top fading into the text below; the series tag on its own line. */
@media (max-width: 760px) {
	.sw-art-hero { display: block; min-height: 0; padding: 64px 0 30px; }
	.sw-art-hero-media { position: relative; width: 100%; aspect-ratio: 16 / 10; z-index: -1; }
	.sw-art-hero-media img {
		-webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
		mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
	}
	.sw-art-hero-text { margin-top: -34px; }
	.sw-art-hero .pg-h1.sw-art-title { font-size: clamp(30px, 8.4vw, 38px); line-height: 1.06; }
	.sw-art-kicker { margin-bottom: 16px; }
	.sw-art-author { margin-top: 20px; }
	.sw-art-series p { display: block; }
	.sw-art-series-tag { display: inline-block; margin-bottom: 10px; }
	.sw-art-series-text { display: block; }
}

/* Phones: the article starts closer to the hero, and a few cards tighten up. */
@media (max-width: 640px) {
	/* The site's phone section spacing is !important (wordpress.css); articles start closer. */
	.sw-article-v2 main > .act.sw-article-body:not(.door):not(.bflow):not(.zpd2):not(.cflow) { padding-top: 32px !important; }
	.wp-block-quote.is-style-sw-easier { padding: 16px 18px 18px; }
	.wp-block-code.is-style-sw-template { padding: 52px 18px 18px; }
	.sw-video-icon { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
	.sw-video-icon::after { left: 24px; top: 19px; border-width: 11px 0 11px 18px; }
}

/* A wider column (fewer short last lines), and no lone last words where the browser can help. */
.sw-article-v2 .sw-prose,
.sw-article-v2 .sw-article-back { max-width: 760px; }
.sw-article-v2 .sw-prose p,
.sw-article-v2 .sw-prose li { text-wrap: pretty; }

/* More room around the cards with shadows, so the text next to them doesn't blur into the shadow. */
.sw-prose > .wp-block-code.is-style-sw-template { margin-top: 1.6em; margin-bottom: 2.2em; }
.sw-prose > .wp-block-code.is-style-sw-template + * { margin-top: 2.2em; }
.sw-prose > .sw-video { margin-top: 2em; margin-bottom: 2.4em; }
.sw-prose > .sw-video + * { margin-top: 2.4em; }

/* Next in this series: with exactly one link ("Read part 2"), that link becomes a call to action and
   the whole card links to it. With several links (the series wrap-up in the last part), they stay
   ordinary links in the text. Without a link it says "Coming soon". */
p.is-style-sw-next { position: relative; }
p.is-style-sw-next > a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.45); }
p.is-style-sw-next > a:hover { text-decoration-color: var(--sw-a-orange); }
p.is-style-sw-next:has(> a:only-of-type) > a {
	display: inline-block;
	margin-top: 12px;
	font-weight: 600;
	text-decoration: none;
}
p.is-style-sw-next:has(> a:only-of-type) > a::after { content: " \2192"; color: var(--sw-a-orange); }
p.is-style-sw-next:has(> a:only-of-type) > a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
p.is-style-sw-next:has(> a:only-of-type) { transition: transform 200ms; }
p.is-style-sw-next:has(> a:only-of-type):hover { transform: translateY(-2px); }
p.is-style-sw-next sup a { color: var(--sw-a-orange); text-decoration: none; }
p.is-style-sw-next:not(:has(a))::after {
	content: "Coming soon";
	display: inline-block;
	margin-top: 12px;
	padding: 3px 10px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	font-family: var(--sw-a-display);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
}
p.is-style-sw-next:not(:has(a))::after { display: table; }

/* "Or copy the message" beside an email button. */
.sw-prose .wp-block-buttons { align-items: center; }
.sw-copy-message {
	padding: 6px 2px;
	border: 0;
	background: none;
	color: var(--sw-a-ink-dim);
	font: 500 15px/1.3 var(--font-body, "Roboto", sans-serif);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
	cursor: pointer;
}
.sw-copy-message:hover { color: var(--sw-a-orange); }
.sw-copy-message:focus-visible { outline: 2px solid var(--sw-a-orange); outline-offset: 2px; }
.sw-art-author-meta .sw-nowrap:last-child { white-space: nowrap; }

/* ---------- Terms of Service (legal/02-terms), from the handover pack of 25 Nov 2026 ---------- */
.tos-meta { background: #EEF0F2; }
.sw-prose.tos h2 { display: flex; align-items: baseline; gap: 16px; margin-top: 2.6em; padding-top: 1.4em; border-top: 1px solid rgba(52, 53, 57, 0.12); scroll-margin-top: 110px; }
.sw-prose.tos h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.tos-n { flex: none; font: 500 13px var(--font-body, "Roboto", sans-serif); letter-spacing: 0.14em; color: var(--sw-a-orange); }
.sw-prose.tos li { margin-bottom: 0.5em; }
.sw-prose.tos .tos-contact { line-height: 1.9; }
/* Placeholders still open in the source document. */
.tos-todo { background: #FDEFE7; color: #9A3412; padding: 1px 6px; border-radius: 4px; }
/* 21 clauses: the contents list scrolls inside itself when it's taller than the screen. */
.tos-grid .sw-toc ol { max-height: calc(100vh - 170px); overflow: auto; }
@media (min-width: 1100px) {
	.tos-grid.sw-art-grid.has-toc { grid-template-columns: minmax(210px, 1fr) minmax(0, 760px) minmax(0, 1fr); gap: 0 clamp(24px, 3vw, 48px); justify-content: stretch; }
	.tos-grid .sw-toc { width: 210px; justify-self: start; }
}
