/* ==========================================================================
   PROSE: typography for article HTML written in Manage            (.dst-prose)
   --------------------------------------------------------------------------
   The body-text rule shared with pg / owf: PHP runs the editor text through
   pg_render_content() (config/content-security.php) first, which strips every
   inline style, class and colour, fixes the heading outline, lazy-loads images,
   wraps tables (.pg-prose__table) and gives each h2 an id for "On this page".
   So this file is the ONLY thing that styles that text.

   It owns type, headings, lists, links, quotes, images and tables. It does not
   own the page around the column (service.css does). Tokens come from nav.css.
   Site rules: Jost only, no italics, no shadows or borders on blocks.
   ========================================================================== */

.dst-prose {
	counter-reset: dst-h2;
	font-family: var(--dst-font);
	font-size: clamp(16px, .3vw + 15px, 17.5px);
	font-weight: 400;
	line-height: 1.78;
	color: var(--dst-body);
	overflow-wrap: break-word;
}
.dst-prose > :first-child { margin-top: 0 !important; }
.dst-prose > :last-child { margin-bottom: 0 !important; }

/* Paragraphs */
.dst-prose p { margin: 0 0 1.05em; }
.dst-prose strong, .dst-prose b { font-weight: 600; color: var(--dst-ink); }
.dst-prose em, .dst-prose i { font-style: normal; font-weight: 500; color: var(--dst-ink); }

/* The opening paragraphs (before the first heading) read as the standfirst */
.dst-prose > p:first-child, .dst-prose > p:first-child + p { font-size: 1.08em; color: var(--dst-ink); }

/* Section headings (h2): numbered, with a hairline above */
.dst-prose h2 {
	counter-increment: dst-h2;
	position: relative;
	margin: 2.4em 0 .7em;
	padding-top: 1.15em;
	border-top: 1px solid var(--dst-line);
	font: 500 clamp(24px, 1.3vw + 17px, 31px)/1.25 var(--dst-font);
	letter-spacing: -.01em;
	color: #8e2356;   /* deep rose: section headings read as a clear outline */
	text-transform: none;
	scroll-margin-top: calc(var(--dst-bar-h) + 28px);
}
.dst-prose h2::before {
	content: counter(dst-h2, decimal-leading-zero);
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .16em;
	color: var(--dst-rose);
}
.dst-prose > h2:first-child { padding-top: 0; border-top: 0; }

.dst-prose h3 {
	position: relative;
	margin: 1.8em 0 .55em;
	padding-left: 14px;
	font: 600 clamp(19px, .5vw + 16px, 21px)/1.35 var(--dst-font);
	color: var(--dst-rose-ink);
	text-transform: none;
	letter-spacing: 0;
	scroll-margin-top: calc(var(--dst-bar-h) + 28px);
}
.dst-prose h3::before { content: ""; position: absolute; left: 0; top: .3em; bottom: .3em; width: 3px; background: var(--dst-rose); }
.dst-prose h4, .dst-prose h5, .dst-prose h6 {
	margin: 1.5em 0 .45em;
	font: 600 17px/1.4 var(--dst-font);
	color: var(--dst-ink);
	text-transform: none;
	letter-spacing: 0;
}
.dst-prose h2 + h3 { margin-top: .9em; }

/* Links */
.dst-prose a {
	color: var(--dst-rose-ink);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: rgba(198, 58, 114, .45);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	background: linear-gradient(transparent 62%, rgba(240, 86, 151, .1) 62%);   /* a soft highlighter under the words */
	transition: color .2s ease, text-decoration-color .2s ease, background-color .2s ease;
}
.dst-prose a:hover { color: var(--dst-rose-deep); text-decoration-color: currentColor; background-color: rgba(240, 86, 151, .08); }

/* Lists: rose dots and numbers. A list item that starts with a bold label reads as a term. */
.dst-prose ul, .dst-prose ol { margin: .2em 0 1.4em; padding: 0; list-style: none; }
.dst-prose li { position: relative; margin: 0 0 .6em; padding-left: 1.7em; }
.dst-prose li > p { margin: 0; }
.dst-prose li > p + p { margin-top: .5em; }
.dst-prose ul > li::before {   /* a bullet, centred on the first line (line-height 1.78) */
	content: "";
	position: absolute;
	left: .35em;
	top: calc(.89em - 3.5px);
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--dst-rose);
	box-shadow: 0 0 0 4px var(--dst-blush);
}
.dst-prose ol { counter-reset: dst-ol; }
.dst-prose ol > li { counter-increment: dst-ol; padding-left: 2.4em; }
.dst-prose ol > li::before {   /* a number, centred on the first line */
	content: counter(dst-ol);
	position: absolute;
	left: 0;
	top: .11em;
	display: grid;
	place-items: center;
	width: 2em;
	height: 2em;
	border-radius: 50%;
	background: var(--dst-blush);
	box-shadow: 0 0 0 4px #fff;
	font-size: .8em;
	font-weight: 600;
	line-height: 1;
	color: var(--dst-rose-ink);
	font-variant-numeric: lining-nums tabular-nums;
}
/* numbered steps read as a timeline: a rose thread joins each number to the next */
.dst-prose ol > li { margin-bottom: 1em; }
.dst-prose ol > li:not(:last-child)::after {
	content: ""; position: absolute; left: calc(.8em - 1px); top: 1.9em; bottom: -1em; width: 2px;
	background: linear-gradient(var(--dst-rose), rgba(240, 86, 151, .15));
}
.dst-prose li li { margin-top: .5em; }
.dst-prose li > strong:first-child, .dst-prose li > p:first-child > strong:first-child { color: var(--dst-ink); }

/* Quotes */
.dst-prose blockquote {
	margin: 1.6em 0;
	padding: 1.1em 1.4em 1.1em 1.5em;
	border-left: 3px solid var(--dst-rose);
	border-radius: 0 var(--dst-r) var(--dst-r) 0;
	background: var(--dst-spots-soft), var(--dst-blush);
	font-size: 1.06em;
	color: var(--dst-ink);
}
.dst-prose blockquote p:last-child { margin-bottom: 0; }

/* Rules */
.dst-prose hr { height: 1px; margin: 2em 0; border: 0; background: var(--dst-line); opacity: 1; }

/* Images: a picture in its own paragraph runs the full width of the column */
.dst-prose img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 1.8em 0;
	border-radius: var(--dst-r);
	background: var(--dst-blush);
}
.dst-prose p > img:only-child { margin: 0; aspect-ratio: 16 / 9; object-fit: cover; }
.dst-prose p:has(> img:only-child) { margin: 1.9em 0; }

/* Tables: scroll sideways inside their wrapper, hairline rows, a tinted head */
.dst-prose .pg-prose__table { margin: 1.7em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--dst-r); background: #fff; box-shadow: inset 0 0 0 1px var(--dst-line); }
.dst-prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .93em; line-height: 1.55; }
.dst-prose tbody tr:last-child td { border-bottom: 0; }
.dst-prose th, .dst-prose td { padding: 13px 16px; border-bottom: 1px solid var(--dst-line); text-align: left; vertical-align: top; }
.dst-prose thead th, .dst-prose tr:first-child th {
	background: var(--dst-blush);
	font-weight: 600;
	color: var(--dst-ink);
	border-bottom: 0;
}
.dst-prose thead th, .dst-prose tr:first-child th { color: #8e2356; }
.dst-prose tbody td:first-child { font-weight: 500; color: var(--dst-ink); }
.dst-prose td p { margin: 0; }

/* Video */
.dst-prose .pg-prose__video { position: relative; margin: 1.8em 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--dst-r); background: var(--dst-blush); }
.dst-prose .pg-prose__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.dst-prose code { padding: .1em .35em; border-radius: 6px; background: var(--dst-blush); font-size: .9em; }
.dst-prose sub, .dst-prose sup { font-size: .72em; }

@media (max-width: 767.98px) {
	.dst-prose h2 { margin-top: 2em; }
	.dst-prose th, .dst-prose td { padding: 11px 12px; }
}
