/*
 * RPA HQ 0.19.0 (D33): building blocks for text pages. Each is a block style on a core block
 * (includes/content-blocks.php registers them, so they show in the editor's Styles panel):
 *
 *   Paragraph  is-style-rpa-lead      the larger opening paragraph
 *   Paragraph  is-style-rpa-eyebrow   the small gold line above a heading
 *   List       is-style-rpa-stats     big figures: "<strong>1994</strong> Chartered"
 *   List       is-style-rpa-timeline  a vertical line of dated entries: "<strong>1994</strong> text"
 *   List       is-style-rpa-cards     cards: "<strong>Title</strong><br>text" (or a link)
 *   List       is-style-rpa-chips     names as chips
 *   Quote      is-style-rpa-quote     a large pull quote with a gold rule
 *   Group      is-style-rpa-callout   a crimson call-to-action band (put a Buttons block in it)
 *   Group      is-style-rpa-band      a full-width cream section behind the text column
 *   Media&Text is-style-rpa-feature   a photo beside text, on a cream card
 *
 * Self-contained: every rule is scoped to its is-style class; without this file each block
 * falls back to the theme's plain list, paragraph, quote or group.
 */

:is(.entry-content, .editor-styles-wrapper) {
	--rpa-cb-cream: var(--rpa-cream, #f7f1e6);
	--rpa-cb-gold: var(--rpa-gold, #c9a227);
	--rpa-cb-red: var(--rpa-red, #8f0a0e);
	--rpa-cb-red-text: var(--rpa-red-text, #a41722);
	--rpa-cb-ink: var(--rpa-ink, #111);
	--rpa-cb-muted: var(--rpa-muted, #5f5f5f);
	--rpa-cb-line: var(--rpa-line, #e2e2e2);
	--rpa-cb-head: var(--rpa-font-heading, "Oswald", "Arial Narrow", sans-serif);
}

/* ---- Lead and eyebrow ---- */

:is(.entry-content, .editor-styles-wrapper) .is-style-rpa-lead {
	margin-bottom: 1.5em;
	color: var(--rpa-cb-ink);
	font-size: clamp(1.15rem, 1rem + 0.6vw, 1.375rem);
	line-height: 1.55;
}

:is(.entry-content, .editor-styles-wrapper) .is-style-rpa-lead::first-line {
	font-weight: 600;
}

:is(.entry-content, .editor-styles-wrapper) .is-style-rpa-eyebrow {
	margin: 2.5em 0 0.25em;
	color: var(--rpa-cb-red-text);
	font-family: var(--rpa-cb-head);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

:is(.entry-content, .editor-styles-wrapper) .is-style-rpa-eyebrow + :is(h2, h3) {
	margin-top: 0;
}

/* ---- Stat tiles ---- */

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1px;
	margin: 2em 0;
	padding: 0;
	overflow: hidden;
	border-radius: 10px;
	background: rgba(201, 162, 39, 0.35);
	list-style: none;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-stats > li {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 22px 18px;
	background: linear-gradient(160deg, #7a0103 0, #4a0002 100%);
	color: rgba(255, 255, 255, 0.86);
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	line-height: 1.35;
	text-transform: uppercase;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-stats > li strong {
	color: var(--rpa-gold-soft, #e7cf7a);
	font-family: var(--rpa-cb-head);
	font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1;
	text-transform: none;
}

/* ---- Timeline ---- */

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-timeline {
	position: relative;
	margin: 2em 0;
	padding: 0 0 0 28px;
	list-style: none;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-timeline::before {
	content: "";
	position: absolute;
	top: 8px;
	bottom: 8px;
	left: 7px;
	width: 2px;
	background: linear-gradient(180deg, var(--rpa-cb-gold), var(--rpa-cb-red));
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-timeline > li {
	position: relative;
	margin: 0 0 12px;
	padding: 10px 16px;
	border: 1px solid var(--rpa-cb-line);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(17, 17, 17, 0.06);
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-timeline > li::before {
	content: "";
	position: absolute;
	top: 16px;
	left: -27px;
	width: 14px;
	height: 14px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--rpa-cb-red);
	box-shadow: 0 0 0 2px var(--rpa-cb-gold);
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-timeline > li > strong:first-child {
	display: inline-block;
	margin: 0 10px 6px 0;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--rpa-cb-red);
	color: #fff;
	font-family: var(--rpa-cb-head);
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.04em;
}

/* ---- Cards ---- */

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 16px;
	margin: 2em 0;
	padding: 0;
	list-style: none;
	counter-reset: rpa-card;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li {
	position: relative;
	margin: 0;
	padding: 20px 20px 18px;
	border: 1px solid var(--rpa-cb-line);
	border-top: 4px solid var(--rpa-cb-red);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 8px 22px rgba(17, 17, 17, 0.06);
	line-height: 1.5;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(17, 17, 17, 0.1);
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li > strong:first-child {
	display: block;
	margin-bottom: 6px;
	color: var(--rpa-cb-ink);
	font-family: var(--rpa-cb-head);
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li > strong:first-child + br {
	display: none;
}

/* A card that is one link fills the card. */
:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li > a:only-child {
	display: block;
	margin: -20px -20px -18px;
	padding: 20px 44px 18px 20px;
	color: var(--rpa-cb-ink);
	font-weight: 600;
	text-decoration: none;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li > a:only-child::after {
	content: "\2192";
	position: absolute;
	top: 50%;
	right: 18px;
	color: var(--rpa-cb-red-text);
	transform: translateY(-50%);
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li > a:only-child:hover,
:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li > a:only-child:focus-visible {
	color: var(--rpa-cb-red-text);
}

/* Numbered cards: an ordered list. */
:is(.entry-content, .editor-styles-wrapper) ol.is-style-rpa-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 16px;
	margin: 2em 0;
	padding: 0;
	list-style: none;
	counter-reset: rpa-card;
}

:is(.entry-content, .editor-styles-wrapper) ol.is-style-rpa-cards > li {
	position: relative;
	margin: 0;
	padding: 52px 20px 18px;
	border: 1px solid var(--rpa-cb-line);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 8px 22px rgba(17, 17, 17, 0.06);
	counter-increment: rpa-card;
	line-height: 1.5;
}

:is(.entry-content, .editor-styles-wrapper) ol.is-style-rpa-cards > li::before {
	content: counter(rpa-card, decimal-leading-zero);
	position: absolute;
	top: 14px;
	left: 20px;
	color: var(--rpa-cb-gold);
	font-family: var(--rpa-cb-head);
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1;
}

/* ---- Chips ---- */

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 1.25em 0 2em;
	padding: 0;
	list-style: none;
}

:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-chips > li {
	margin: 0;
	padding: 6px 14px;
	border: 1px solid rgba(143, 10, 14, 0.25);
	border-radius: 999px;
	background: #fff;
	color: var(--rpa-cb-ink);
	font-size: 0.9375rem;
}

/* ---- Pull quote ---- */

:is(.entry-content, .editor-styles-wrapper) .wp-block-quote.is-style-rpa-quote {
	position: relative;
	margin: 2.5em 0;
	padding: 28px 0 8px 0;
	border: 0;
	border-top: 4px solid var(--rpa-cb-gold);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-quote.is-style-rpa-quote::before {
	content: "\201C";
	position: absolute;
	top: -6px;
	right: 0;
	color: rgba(143, 10, 14, 0.12);
	font-family: Georgia, serif;
	font-size: 8rem;
	line-height: 1;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-quote.is-style-rpa-quote p {
	color: var(--rpa-red-deep, #7a0103);
	font-family: var(--rpa-cb-head);
	font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
	font-weight: 500;
	line-height: 1.3;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-quote.is-style-rpa-quote cite {
	display: block;
	margin-top: 12px;
	color: var(--rpa-cb-muted);
	font-size: 0.875rem;
	font-style: normal;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---- Call-to-action band ---- */

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout {
	position: relative;
	margin: 3em 0;
	padding: clamp(28px, 4vw, 44px);
	overflow: hidden;
	border-radius: 12px;
	background: radial-gradient(ellipse 70% 80% at 85% 30%, rgba(176, 20, 27, 0.9) 0, rgba(176, 20, 27, 0) 70%), linear-gradient(160deg, #7a0103 0, #4a0002 100%);
	color: rgba(255, 255, 255, 0.9);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout::after {
	content: "";
	position: absolute;
	right: -40px;
	bottom: -60px;
	width: 220px;
	height: 220px;
	border: 2px solid rgba(231, 207, 122, 0.25);
	border-radius: 50%;
	pointer-events: none;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout :is(h2, h3) {
	margin-top: 0;
	color: #fff;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout a:not(.wp-block-button__link) {
	color: var(--rpa-gold-soft, #e7cf7a);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout .wp-block-button__link {
	padding: 12px 22px;
	border: 2px solid var(--rpa-gold, #c9a227);
	border-radius: 4px;
	background: var(--rpa-gold, #c9a227);
	color: var(--rpa-cb-ink);
	font-family: var(--rpa-cb-head);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout .is-style-outline .wp-block-button__link {
	border-color: #fff;
	background: transparent;
	color: #fff;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout .wp-block-button__link:hover,
:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-callout .wp-block-button__link:focus-visible {
	border-color: #fff;
	background: #fff;
	color: var(--rpa-cb-red);
}

/* ---- Full-width cream band behind the text column ---- */

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-band {
	margin: 3em 0;
	padding: clamp(28px, 4vw, 48px) 0;
	background: var(--rpa-cb-cream);
	box-shadow: 0 0 0 100vmax var(--rpa-cb-cream);
	clip-path: inset(0 -100vmax);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-band > :first-child {
	margin-top: 0;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-rpa-band > :last-child {
	margin-bottom: 0;
}

/* ---- Feature: a photo beside text ---- */

:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature {
	margin: 2.5em 0;
	overflow: hidden;
	border-radius: 12px;
	background: var(--rpa-cb-cream);
	box-shadow: 0 10px 30px rgba(17, 17, 17, 0.08);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature .wp-block-media-text__media img {
	height: 100%;
	min-height: 260px;
	object-fit: cover;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature .wp-block-media-text__content {
	padding: clamp(20px, 3vw, 36px);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature .wp-block-media-text__content > :first-child {
	margin-top: 0;
}

/* Fallbacks for the core layouts (core loads its own block CSS with the page; these keep the
   feature and the buttons laid out wherever it doesn't). */
@media (min-width: 700px) {
	:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature {
		display: grid;
		grid-template-columns: 1fr 1fr;
		align-items: center;
	}

	:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature.has-media-on-the-right .wp-block-media-text__media {
		grid-column: 2;
		grid-row: 1;
	}
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature .wp-block-media-text__media {
	margin: 0;
	height: 100%;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature .wp-block-media-text__media img {
	display: block;
	width: 100%;
}

:is(.entry-content, .editor-styles-wrapper) .is-style-rpa-callout .wp-block-buttons,
:is(.entry-content, .editor-styles-wrapper) .wp-block-buttons:has(+ *) {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* ---- The History page's "On this page" list as pills (0.18.5 content class) ---- */

:is(.entry-content, .editor-styles-wrapper) .rpa-jump-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	border-left: 0;
	border-radius: 10px;
	background: var(--rpa-cb-cream);
	line-height: 1.4;
}

:is(.entry-content, .editor-styles-wrapper) .rpa-jump-list a {
	padding: 6px 12px;
	border-radius: 999px;
	background: #fff;
	color: var(--rpa-cb-red-text);
	font-weight: 600;
	text-decoration: none;
}

:is(.entry-content, .editor-styles-wrapper) .rpa-jump-list a:hover,
:is(.entry-content, .editor-styles-wrapper) .rpa-jump-list a:focus-visible {
	background: var(--rpa-cb-red);
	color: #fff;
}

/* ---- Tables on text pages: striped rows, a crimson head ---- */

:is(.entry-content, .editor-styles-wrapper) .wp-block-table table {
	overflow: hidden;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--rpa-cb-line);
	border-radius: 8px;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-table thead th {
	border: 0;
	background: var(--rpa-cb-red);
	color: #fff;
	font-family: var(--rpa-cb-head);
	letter-spacing: 0.06em;
	text-align: left;
	text-transform: uppercase;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-table td {
	border: 0;
	border-top: 1px solid var(--rpa-cb-line);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-table tbody tr:nth-child(even) td {
	background: #faf7f0;
}

@media (prefers-reduced-motion: reduce) {
	:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li {
		transition: none;
	}

	:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-cards > li:hover {
		transform: none;
	}
}

@media (max-width: 599.98px) {
	:is(.entry-content, .editor-styles-wrapper) ul.is-style-rpa-stats {
		grid-template-columns: repeat(2, 1fr);
	}

	:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text.is-style-rpa-feature .wp-block-media-text__media img {
		min-height: 200px;
	}
}
