/*
 * Front-end styles for the blocks this plugin added after the theme was
 * written: type specimens, portrait circles and key figures.
 *
 * These live with the plugin rather than in the theme's brand.css on purpose.
 * The render callbacks and the CSS then ship in one file set with one version
 * number, so updating the plugin alone can never leave a block rendering
 * markup the stylesheet has not heard of yet.
 */

/* ------------------------------------------------ type specimen */
.wv-spec {
	border: 1px solid #e6e3dc;
	border-radius: 20px;
	background: #fff;
	padding: 28px 30px;
	margin: 22px 0;
	border-top: 4px solid var(--wv-spec-accent, #1D1D1B);
}
.wv-spec__head h3 {
	margin: 0 0 6px;
	font-size: clamp(22px, 3vw, 30px);
	line-height: 1.15;
}
.wv-spec__head p {
	margin: 0 0 4px;
	max-width: 62ch;
	color: #4a4741;
}
.wv-spec__licence {
	font-size: 13px;
	color: #75726b;
}
.wv-spec__rows {
	margin-top: 20px;
	display: grid;
	gap: 14px;
}
.wv-spec__row {
	padding-top: 12px;
	border-top: 1px solid #f0eee8;
}
.wv-spec__row .wv-meta {
	display: block;
	margin-bottom: 2px;
}
.wv-spec__sample {
	margin: 0;
	font-size: clamp(18px, 2.6vw, 26px);
	line-height: 1.35;
	letter-spacing: .01em;
	word-break: break-word;
}

/* --------------------------------------------------- portraits */
.wv-portraits {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 26px 20px;
	margin: 22px 0;
}
.wv-portrait {
	margin: 0;
	text-align: center;
}
.wv-portrait__disc {
	display: block;
	aspect-ratio: 1;
	border-radius: 50%;
	overflow: hidden;
	background: var(--wv-portrait-bg, #FDC300);
	display: grid;
	place-items: center;
}
.wv-portrait__disc img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	display: block;
}
/*
 * The speech bubble the brandbook puts beside some portraits. Set as a real
 * bubble rather than a bold line, so a set that uses it still reads as
 * portraits-with-a-caption and not as portraits-with-a-headline.
 */
.wv-portrait__quote {
	display: inline-block;
	position: relative;
	margin-top: 12px;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #1D1D1B;
	border-radius: 12px 12px 12px 2px;
	font-size: 12px;
	line-height: 1.3;
	font-weight: 700;
	text-align: left;
}
.wv-portrait figcaption {
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.4;
}
.wv-portrait figcaption strong {
	display: block;
}
.wv-portrait figcaption span {
	color: #75726b;
}

/* ------------------------------------------------- key figures */
.wv-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 18px;
	margin: 18px 0 26px;
}
.wv-stat {
	border: 1px solid #e6e3dc;
	border-radius: 20px 20px 20px 4px;
	padding: 22px 24px;
	background: #fff;
}
.wv-stat__value {
	display: block;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.05;
	font-weight: 700;
}
.wv-stat__label {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	line-height: 1.4;
	color: #4a4741;
}

/* ---------------------------------------------------- an aside */
.wv-note {
	border-left: 3px solid #FDC300;
	padding: 2px 0 2px 14px;
	margin: 18px 0;
	color: #4a4741;
	font-size: 15px;
	max-width: 66ch;
}

/*
 * A plate: one page from the printed brandbook, with a caption.
 *
 * The scans are white-backed artwork, so they need a hairline and a tint
 * behind them — without one they bleed into the page and stop reading as a
 * reproduction of something.
 */
.wv-figure--wide .wv-figure__media {
	background: #faf9f6;
	border: 1px solid #e6e3dc;
}
.wv-figure--wide .wv-figure__media img {
	border-radius: 0;
}
.wv-plate-note {
	margin: 6px 0 0;
	font-size: 13px;
	color: #75726b;
}

/*
 * The caption sits inside the plate's rounded, overflow-hidden frame, and the
 * theme gives it 2px of left padding — enough for a borderless figure, not
 * enough once there is a border and a corner radius to clear, which clipped
 * the first letter of every caption.
 */
.wv-figure--wide .wv-figure__media figcaption {
	padding: 8px 14px 10px;
}

/* An unnumbered rule badge would otherwise show as an empty circle. */
.wv-rule__n:empty { opacity: 0; }

/*
 * A wide figure runs the full column, so its words need a measure of their
 * own — a paragraph 1320px across is unreadable, and that is the width the
 * Escher panel fell back to once it stopped reserving an empty image column.
 */
.wv-figure--wide .wv-figure__text {
	max-width: 68ch;
}

/*
 * Wording in another language, marked so it is visibly a quotation of that
 * language rather than a slip. Only the tone-of-voice page uses this: it is
 * the one page where the language is the subject, not the wrapper.
 */
.wv-rules[lang]::before,
.wv-dd-wrap[lang]::before {
	content: attr(lang);
	display: inline-block;
	margin-bottom: 8px;
	padding: 3px 9px;
	border-radius: 999px;
	background: #1D1D1B;
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}
.wv-rules[lang] {
	border: 0;
	overflow: visible;
	display: block;
}
.wv-rules[lang] .wv-rule:first-of-type {
	border-top: 1px solid #E7E3DA;
	border-radius: 20px 20px 0 0;
}
.wv-rules[lang] .wv-rule {
	border-left: 1px solid #E7E3DA;
	border-right: 1px solid #E7E3DA;
}
.wv-rules[lang] .wv-rule:last-of-type {
	border-bottom: 1px solid #E7E3DA;
	border-radius: 0 0 20px 20px;
}

/*
 * The opening paragraph of a guideline: the lede, moved out of the page head
 * into the body. Set as body text, only a touch larger, so the page has one
 * beginning instead of three.
 */
.wv-opening {
	font-size: 1.08em;
	line-height: 1.6;
	max-width: 68ch;
}
