/* --- Case studies ------------------------------------------------------
   More visual and immersive than a service page, and not the article
   template either. One system across all three projects. */

.sd-case-hero {
	display: grid;
	grid-template-columns: 0.82fr 1.18fr;
	gap: 56px;
	align-items: center;
	padding-block: var(--sd-section-y);
}
.sd-case-hero__title { margin-bottom: 18px; }
.sd-case-hero__context {
	font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
	font-weight: 700; color: var(--sd-coral-text); margin-bottom: 22px;
}
.sd-case-hero__lede { font-size: var(--sd-text-lead); line-height: 1.5; color: var(--sd-text-secondary); }
.sd-case-hero__media {
	border-radius: 16px; overflow: hidden;
	background: var(--sd-surface); border: 1px solid var(--sd-border-card);
}
.sd-case-hero__img { aspect-ratio: 4 / 3; object-fit: cover; object-position: top center; }

/* Scope strip */
.sd-case-meta {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 16px 30px;
	padding-block: 30px;
	border-top: 1px solid var(--sd-border);
	border-bottom: 1px solid var(--sd-border);
}
.sd-case-meta__label {
	font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
	font-weight: 700; color: var(--sd-text-secondary); margin: 0;
}

/* Text sections. Heading left, copy right, so the page keeps an editorial
   asymmetry instead of a centred column. */
.sd-case-section { padding-block: var(--sd-section-y); }
.sd-case-section--band { background: var(--sd-bg-alt); padding-block: var(--sd-section-y); }
.sd-case-section--band .sd-case-section__inner { padding-block: 0; }
.sd-case-section__inner { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 54px; align-items: start; }
.sd-case-section__title { margin: 0; }
.sd-case-section__body { max-width: 640px; }
.sd-case-section__body p { font-size: 17px; line-height: 1.72; margin-bottom: 1.2em; }
.sd-case-section__body p:last-child { margin-bottom: 0; }

/* Real screens, at a size worth looking at. */
.sd-case-gallery { padding-bottom: var(--sd-section-y); }
.sd-case-gallery__grid { display: grid; gap: 34px; }
.sd-case-gallery--two { grid-template-columns: repeat(2, 1fr); }
.sd-case-gallery--one { grid-template-columns: 1fr; max-width: 900px; margin-inline: auto; }
.sd-case-shot { margin: 0; }
.sd-case-shot__img {
	border-radius: 14px; border: 1px solid var(--sd-border-card);
	background: var(--sd-surface);
	aspect-ratio: 3 / 4; object-fit: cover; object-position: top center;
}
.sd-case-gallery--one .sd-case-shot__img { aspect-ratio: 16 / 10; }
.sd-case-shot figcaption {
	margin-top: 12px; font-size: 13.5px; line-height: 1.55; color: var(--sd-text-secondary);
}

/* A single supporting idea plus its asset. */
.sd-case-feature {
	display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 54px;
	align-items: center; padding-block: var(--sd-section-y);
}
.sd-case-feature__title { margin-bottom: 12px; }
.sd-case-feature__copy p { font-size: 17px; line-height: 1.7; color: var(--sd-text-secondary); }
.sd-case-feature__media { display: grid; gap: 26px; }
.sd-case-feature--two { grid-template-columns: repeat(2, 1fr); }
.sd-case-feature--one { grid-template-columns: 1fr; }
.sd-case-feature__img {
	border-radius: 14px;
	border: 1px solid var(--sd-border-card);
	background: #FFFFFF;
	object-fit: contain;
}

.sd-case-close { padding-bottom: var(--sd-section-y); }
.sd-case-close__text {
	max-width: 820px;
	font-size: 25px; line-height: 1.42; font-weight: 500; letter-spacing: -0.012em;
	color: var(--sd-text-primary);
	padding-left: 24px; border-left: 2px solid var(--sd-coral);
}

/* Next project */
.sd-case-next { background: var(--sd-ink-band); color: var(--sd-on-ink); padding-block: 66px; }
.sd-case-next__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sd-space-xs); flex-wrap: wrap; }
.sd-case-next__title { margin: 10px 0 8px; }
.sd-case-next__title a { color: var(--sd-on-ink); text-decoration: none; }
.sd-case-next__title a:hover { color: var(--sd-coral-on-ink); }
.sd-case-next__title a:focus-visible { outline: 3px solid var(--sd-coral-on-ink); outline-offset: 4px; }
.sd-case-next__context { font-size: var(--sd-text-small); color: var(--sd-on-ink-muted); }

@media (max-width: 1100px) {
	.sd-case-hero { gap: 40px; }
	.sd-case-section__inner, .sd-case-feature { gap: 38px; }
}
@media (max-width: 900px) {
	.sd-case-hero { grid-template-columns: 1fr; gap: 32px; padding-block: calc(var(--sd-section-y) * 0.7); }
	.sd-case-section__inner { grid-template-columns: 1fr; gap: 22px; }
	.sd-case-feature { grid-template-columns: 1fr; gap: 30px; }
	.sd-case-gallery--two { grid-template-columns: 1fr; }
	.sd-case-hero__img { aspect-ratio: 16 / 10; }
	.sd-case-shot__img { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) {
	.sd-case-close__text { font-size: 21px; padding-left: 18px; }
	.sd-case-next { padding-block: 48px; }
}


/* --- 404 --------------------------------------------------------------- */

.sd-404 { padding-block: calc(var(--sd-section-y) * 1.15) var(--sd-section-y); max-width: 760px; }
.sd-404__code { color: var(--sd-coral-text); margin-bottom: 18px; }
.sd-404__title { margin-bottom: 20px; }
.sd-404__body { font-size: var(--sd-text-lead); line-height: 1.5; color: var(--sd-text-secondary); max-width: var(--sd-measure); }
.sd-404__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 36px; }
.sd-404__note { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--sd-border);
	font-size: var(--sd-text-small); color: var(--sd-text-secondary); }


/* --- Legal pages -------------------------------------------------------
   Deliberately plain. No CTA, no illustration, no marketing copy. */

.sd-legal { padding-block: var(--sd-section-y); }
.sd-legal__header { max-width: 800px; margin-bottom: 42px; }
.sd-legal__title { margin-bottom: 0; }
.sd-legal__toc { max-width: 800px; margin-bottom: 46px; }
.sd-legal__toc .sd-toc { max-width: none; margin-bottom: 0; }

.sd-legal__body { max-width: 760px; }
.sd-legal__body p { font-size: 16.5px; line-height: 1.72; margin-bottom: 1.25em; }
.sd-legal__body h2 {
	font-size: 24px; line-height: 1.25; letter-spacing: -0.015em;
	margin: 2.1em 0 0.55em; padding-top: 1.1em;
	border-top: 1px solid var(--sd-border);
	scroll-margin-top: 100px;
}
.sd-legal__body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sd-legal__body h3 { font-size: 18.5px; line-height: 1.3; margin: 1.6em 0 0.45em; scroll-margin-top: 100px; }
.sd-legal__body ul, .sd-legal__body ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.sd-legal__body li { font-size: 16.5px; line-height: 1.7; margin-bottom: 0.45em; }
.sd-legal__body li::marker { color: var(--sd-coral-text); }
/* Legal copy pastes bare URLs, which must not push the page sideways. */
.sd-legal__body a {
	color: var(--sd-text-primary);
	text-decoration: underline; text-underline-offset: 3px;
	word-break: break-word; overflow-wrap: anywhere;
}
.sd-legal__body a:hover { color: var(--sd-coral-text); }
.sd-legal__body p, .sd-legal__body li { overflow-wrap: anywhere; }
.sd-legal__body table { width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: 15px; }
.sd-legal__body th, .sd-legal__body td { padding: 10px 12px; border: 1px solid var(--sd-border); text-align: left; vertical-align: top; }
.sd-legal__body th { background: var(--sd-bg-alt); font-weight: 650; }
.sd-legal__body .wp-block-table { overflow-x: auto; }

@media (max-width: 900px) {
	.sd-legal__body h2 { font-size: 22px; }
}


/* --- Blog: editorial system --------------------------------------------
   Shared by the Blog index, category archives and the related-posts block at
   the end of an article. Deliberately quieter than the service pages: more
   whitespace, no numbered cards, no dark band, no FAQ. */

.sd-blog-intro { padding-block: var(--sd-section-y) 0; }
.sd-blog-intro__note {
	max-width: var(--sd-measure);
	margin-bottom: 40px;
	font-size: var(--sd-text-small);
	line-height: 1.65;
	color: var(--sd-text-secondary);
}

.sd-post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 52px 34px; }
.sd-post-grid--related { grid-template-columns: repeat(2, 1fr); gap: 34px; }
.sd-post-grid__empty { color: var(--sd-text-secondary); }

.sd-post-card { position: relative; display: flex; flex-direction: column; }
.sd-post-card__media {
	margin-bottom: 20px;
	border-radius: 13px;
	overflow: hidden;
	background: var(--sd-surface);
	border: 1px solid var(--sd-border-card);
}
.sd-post-card__media img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	transition: transform var(--sd-dur-slow, .5s) var(--sd-ease);
}
.sd-post-card:hover .sd-post-card__media img { transform: scale(1.03); }
.sd-post-card__body { display: flex; flex-direction: column; }

.sd-post-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 9px 14px;
	margin-bottom: 12px;
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 700;
}
/* The category stays a real link and sits above the stretched title link. */
.sd-post-card__cat { position: relative; z-index: 2; color: var(--sd-coral-text); text-decoration: none; }
.sd-post-card__cat:hover { text-decoration: underline; text-underline-offset: 3px; }
.sd-post-card__date { color: var(--sd-text-secondary); font-weight: 650; letter-spacing: 0.08em; }

.sd-post-card__title { font-size: 22px; line-height: 1.22; letter-spacing: -0.015em; margin-bottom: 10px; }
.sd-post-card__title a { color: inherit; text-decoration: none; }
/* One link per card for assistive tech, a whole-card target for pointers. */
.sd-post-card__title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.sd-post-card__title a:hover { color: var(--sd-coral-text); }
.sd-post-card__title a:focus-visible { outline: 3px solid var(--sd-coral); outline-offset: 4px; border-radius: 3px; }
.sd-post-card__excerpt { font-size: var(--sd-text-small); line-height: 1.65; color: var(--sd-text-secondary); margin: 0; }

/* Pagination, only rendered when there is more than one page. */
.sd-pagination { margin-top: var(--sd-space-m, 54px); }
.sd-pagination ul, .sd-pagination .page-numbers { list-style: none; margin: 0; padding: 0; }
.sd-pagination ul { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-pagination a, .sd-pagination span.page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 14px;
	border: 1px solid var(--sd-border); border-radius: 999px;
	font-size: 14px; font-weight: 600; text-decoration: none; color: var(--sd-text-primary);
}
.sd-pagination a:hover { border-color: var(--sd-text-primary); }
.sd-pagination .current { background: var(--sd-ink-band); border-color: var(--sd-ink-band); color: var(--sd-on-ink); }

/* Category and search archives */
.sd-archive__title { margin-bottom: var(--sd-space-s, 38px); }

/* --- Blog: the article ------------------------------------------------ */

.sd-article { display: block; }
.sd-article__header { padding-top: var(--sd-section-y); max-width: 820px; margin-inline: auto; }
.sd-article__meta { display: flex; flex-wrap: wrap; gap: 9px 16px; align-items: baseline; margin-bottom: 18px;
	font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.sd-article__cat { color: var(--sd-coral-text); text-decoration: none; }
.sd-article__cat:hover { text-decoration: underline; text-underline-offset: 3px; }
.sd-editorial--ink-categories :is(.sd-article__cat, .sd-post-card__cat) { color: var(--sd-text-primary); }
.sd-article__date { color: var(--sd-text-secondary); font-weight: 650; letter-spacing: 0.08em; }
.sd-article__title { margin-bottom: 20px; }
.sd-article__standfirst { font-size: var(--sd-text-lead); line-height: 1.55; color: var(--sd-text-secondary); max-width: var(--sd-measure); }

.sd-article__figure { margin: 44px auto 0; max-width: 940px; }
.sd-article__figure img { border-radius: 15px; border: 1px solid var(--sd-border-card); }

.sd-article__wrap { padding-block: 52px var(--sd-section-y); }

/* Contents list, built in PHP from the article's own H2s. */
.sd-toc {
	max-width: 740px;
	margin-inline: auto;
	margin-bottom: 44px;
	padding: 22px 26px;
	background: var(--sd-bg-alt);
	border-left: 2px solid var(--sd-coral);
	border-radius: 0 11px 11px 0;
}
.sd-toc__title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
	color: var(--sd-text-secondary); margin-bottom: 12px; }
.sd-toc__list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.sd-toc__list li { font-size: var(--sd-text-small); line-height: 1.5; }
.sd-toc__list a { color: var(--sd-text-primary); text-decoration: none; }
.sd-toc__list a:hover { color: var(--sd-coral-text); text-decoration: underline; text-underline-offset: 3px; }

/* The reading column. 740px is roughly 70 characters at this size. */
.sd-article__body { max-width: 740px; margin-inline: auto; }
.sd-article__body > * { max-width: 100%; }
.sd-article__body p { font-size: 17.5px; line-height: 1.75; margin-bottom: 1.35em; }
.sd-article__body h2 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin: 2em 0 0.6em; scroll-margin-top: 100px; }
.sd-article__body h3 { font-size: 23px; line-height: 1.25; margin: 1.7em 0 0.5em; scroll-margin-top: 100px; }
.sd-article__body h4 { font-size: 19px; line-height: 1.3; margin: 1.5em 0 0.45em; }
.sd-article__body h2:first-child, .sd-article__body h3:first-child { margin-top: 0; }
.sd-article__body ul, .sd-article__body ol { margin: 0 0 1.35em; padding-left: 1.35em; }
.sd-article__body li { font-size: 17.5px; line-height: 1.7; margin-bottom: 0.5em; }
.sd-article__body li::marker { color: var(--sd-coral-text); }
.sd-article__body strong, .sd-article__body b { font-weight: 680; }
.sd-article__body img { height: auto; border-radius: 11px; }
.sd-article__body figure { margin: 2em 0; }
.sd-article__body figcaption, .sd-article__body .wp-caption-text {
	margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: var(--sd-text-secondary);
}
.sd-article__body blockquote {
	margin: 2em 0; padding: 4px 0 4px 26px;
	border-left: 2px solid var(--sd-coral);
	font-size: 21px; line-height: 1.5; font-weight: 500; color: var(--sd-text-primary);
}
.sd-article__body blockquote p:last-child { margin-bottom: 0; }
.sd-article__body hr { border: 0; border-top: 1px solid var(--sd-border); margin: 2.4em 0; }
.sd-article__body table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 15.5px; }
.sd-article__body th, .sd-article__body td { padding: 11px 13px; border: 1px solid var(--sd-border); text-align: left; vertical-align: top; }
.sd-article__body th { background: var(--sd-bg-alt); font-weight: 650; }
.sd-article__body pre {
	margin: 2em 0; padding: 18px 20px; overflow-x: auto;
	background: var(--sd-ink-band); color: var(--sd-on-ink);
	border-radius: 11px; font-size: 14px; line-height: 1.6;
}
.sd-article__body code { font-size: 0.92em; background: var(--sd-bg-alt); padding: 2px 6px; border-radius: 5px; }
.sd-article__body pre code { background: none; padding: 0; }
/* Tables and embeds must not push the page sideways. */
.sd-article__body .wp-block-table, .sd-article__body .wp-block-embed { overflow-x: auto; }
.sd-article__body iframe { max-width: 100%; }

.sd-article__body sup,
.sd-article__body sub {
	position: relative;
	font-size: 75%;
	line-height: 0;
	vertical-align: baseline;
}
.sd-article__body sup { top: -.5em; }
.sd-article__body sub { bottom: -.25em; }

/* Preserve the original reading column on the four converted articles. */
article:is(.post-1, .post-119, .post-121, .post-1528) .sd-article__body {
	padding: 10px;
}

article:is(.post-1, .post-119, .post-121, .post-1528) .sd-article__body > p:last-child {
	margin-block-end: 0;
}

/* These articles use compact spacing between text, headings and callouts. */
article:is(.post-1, .post-121, .post-1528) .sd-article__body > :is(h2, h3) {
	margin-block-start: 0;
}

article:is(.post-1, .post-121, .post-1528) .sd-article__body > p:has(+ :is(h2, h3, blockquote, .sd-article-trends)),
article.post-1528 .sd-article__body > p:has(> strong:first-child + br):not(:has(+ p > strong:first-child + br)) {
	margin-block-end: 0;
}

.sd-article__body .sd-article-trends {
	margin-block: 0;
}

article.post-121 .sd-article__body > blockquote {
	margin: 0;
	padding: 10px 0 10px 20px;
	border-inline-start: 7px solid #e85a4f;
	background-color: #eae7dc;
	color: #0a100d;
}

article:is(.post-1, .post-119, .post-121, .post-1528) .sd-article__body a {
	text-decoration-line: none;
}

.sd-related { border-top: 1px solid var(--sd-border); }
.sd-related.sd-container { max-width: 940px; }
.sd-related__title { margin-bottom: 32px; }

@media (max-width: 1100px) {
	.sd-post-grid { grid-template-columns: repeat(2, 1fr); gap: 44px 30px; }
}
@media (max-width: 900px) {
	.sd-article__header { padding-top: calc(var(--sd-section-y) * 0.7); }
	.sd-article__wrap { padding-block: 38px var(--sd-section-y); }
	.sd-article__figure { margin-top: 32px; }
	.sd-post-grid--related { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
	.sd-post-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 600px) {
	.sd-article__body p, .sd-article__body li { font-size: 16.5px; }
	.sd-article__body h2 { font-size: 25px; }
	.sd-article__body h3 { font-size: 20px; }
	.sd-toc { padding: 18px 20px; }
	.sd-post-card__title { font-size: 20px; }
}
