/* ==========================================================================
   Opinion hub
   Shared styles for the context-opinion-* blocks.
   Namespace: ctx-op
   Root font size: 16px. Values taken from the legacy 10px-root build have
   been converted (legacy value / 1.6).
   ========================================================================== */

.ctx-op {
	--ctx-op-surface: #ffffff;
	--ctx-op-ink: var(--ctx-navy-page, #00213f);
	--ctx-op-ink-muted: #3d5468;
	--ctx-op-chip: var(--ctx-blue-accent, #006daa);
	--ctx-op-label: var(--ctx-blue-deep, #004a7c);
	--ctx-op-blue: var(--ctx-blue-accent-hover, #005e93);
	--ctx-op-blue-dark: var(--ctx-blue-band, #004371);
	--ctx-op-rule: #d8dce0;
	--ctx-op-field: #f0f1f2;
	--ctx-op-field-border: #cccccc;
	--ctx-op-max: var(--ctx-max-width, 87.5rem);

	box-sizing: border-box;
	width: 100%;
	max-width: var(--ctx-op-max);
	margin-inline: auto;
	/* No page gutter here: the .wp-block-columns wrapper owns it, so a value
	   on the block would stack on top of the wrapper's. */
	padding-inline: 0;
	background-color: var(--ctx-op-surface);
	color: var(--ctx-op-ink);
	font-family: var(--fontfamily-body, "Noto Sans", sans-serif);
}

.ctx-op *,
.ctx-op *::before,
.ctx-op *::after {
	box-sizing: inherit;
}

.ctx-op a {
	color: inherit;
	text-decoration: none;
}

.ctx-op a:hover,
.ctx-op a:focus-visible {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Shared atoms
   -------------------------------------------------------------------------- */

.ctx-op-media {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 100 / 58;
	overflow: hidden;
	background-color: var(--ctx-op-field);
}

.ctx-op-media__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
}

/*
 * Topic label. Padding keeps the legacy metrics converted from the 10px root
 * build; the radius and type follow the shared label spec (4px / 11px).
 */
.ctx-op-chip {
	display: inline-block;
	max-width: 100%;
	padding: 0.25rem 0.75rem;
	border-radius: 0.25rem;
	background-color: var(--ctx-op-label);
	color: #ffffff;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.0625rem;
	text-transform: uppercase;
}

@media (min-width: 75rem) {
	.ctx-op-chip {
		padding: 0.1875rem 0.75rem 0.3125rem;
	}
}

.ctx-op a.ctx-op-chip,
.ctx-op a.ctx-op-chip:hover,
.ctx-op a.ctx-op-chip:focus,
.ctx-op a.ctx-op-chip:visited,
.ctx-op a.ctx-op-chip > span {
	color: #ffffff;
}

.ctx-op-chip--invert {
	background-color: #ffffff;
}

/*
 * Inverted chips carry the card background colour as an inline style on the
 * inner span, which wins over the rule above.
 */
.ctx-op a.ctx-op-chip--invert > span {
	color: inherit;
}

/* Double quote flag ------------------------------------------------------- */

.ctx-op-quote {
	position: relative;
	margin: 0;
	padding-left: 1rem;
	font-family: var(--fontfamily-headings, "Noto Sans", sans-serif);
	line-height: 1.25;
}

.ctx-op-quote::before {
	content: "";
	position: absolute;
	top: 0.25rem;
	left: 0;
	width: 0.625rem;
	height: 0.5625rem;
	background: url(image/icon-double-quote.svg) 50% no-repeat;
	background-size: 0.625rem 0.5625rem;
}

@media (min-width: 40rem) {
	.ctx-op-quote::before {
		width: 0.875rem;
		height: 0.75rem;
		background-size: 0.8125rem 0.625rem;
	}
}

@media (min-width: 75rem) {
	.ctx-op-quote {
		padding-left: 1.25rem;
	}

	.ctx-op-quote::before {
		top: 0.3125rem;
		width: 0.8125rem;
		height: 0.75rem;
		background-size: 0.8125rem 0.75rem;
	}
}

/* Authors ----------------------------------------------------------------- */

.ctx-op-authors {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-top: 0.75rem;
}

.ctx-op-authors__avatars {
	display: flex;
	flex-shrink: 0;
}

.ctx-op-avatar {
	display: block;
	position: relative;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	overflow: hidden;
	background-color: var(--ctx-op-field);
}

.ctx-op-avatar + .ctx-op-avatar {
	margin-left: -0.75rem;
}

.ctx-op-avatar__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 20%;
}

.ctx-op-avatar--framed {
	border: 0.1875rem solid transparent;
	background-clip: padding-box;
}

.ctx-op-authors__names {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.ctx-op-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
	padding-top: 1.5rem;
}

@media (min-width: 56.25rem) {
	.ctx-op-hero__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 2.5rem;
	}
}

.ctx-op-hero__right {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem;
	align-content: start;
}

@media (min-width: 56.25rem) {
	.ctx-op-hero__right {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 2rem 1.5rem;
	}
}

/* Main item --------------------------------------------------------------- */

.ctx-op-main__media {
	margin-bottom: 0.75rem;
}

.ctx-op-main__headline {
	margin: 0.5rem 0 0;
	font-size: 1.5rem;
}

@media (min-width: 56.25rem) {
	.ctx-op-main__headline {
		font-size: 1.875rem;
	}
}

.ctx-op-main__teaser {
	margin-top: 0.75rem;
	color: var(--ctx-op-ink-muted);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.ctx-op-main__teaser p {
	margin: 0 0 0.75rem;
}

.ctx-op-main__teaser p:last-child {
	margin-bottom: 0;
}

.ctx-op-main .ctx-op-authors {
	margin-top: 1.25rem;
}

/* Sub item ---------------------------------------------------------------- */

.ctx-op-sub {
	display: grid;
	grid-template-columns: 10rem minmax(0, 1fr);
	gap: 0.875rem;
	align-items: start;
}

/* Same taller crop as the most popular row while the card is side by side. */
.ctx-op-sub__media {
	aspect-ratio: 10 / 7;
}

@media (min-width: 56.25rem) {
	.ctx-op-sub {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.75rem;
	}

	.ctx-op-sub__media {
		aspect-ratio: 100 / 58;
	}
}

.ctx-op-sub__headline {
	margin-top: 0.5rem;
	font-size: 1rem;
}

@media (min-width: 75rem) {
	.ctx-op-sub__headline {
		font-size: 1.125rem;
	}
}

.ctx-op-sub .ctx-op-avatar,
.ctx-op-popular .ctx-op-avatar {
	width: 2rem;
	height: 2rem;
}

.ctx-op-sub .ctx-op-authors__names,
.ctx-op-popular .ctx-op-authors__names {
	font-size: 0.8125rem;
}

/* Solid background item --------------------------------------------------- */

.ctx-op-blue {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 12.5rem;
	padding: 1.25rem;
	color: #ffffff;
}

.ctx-op-blue__info {
	padding-top: 2.5rem;
}

.ctx-op-blue__headline {
	padding-left: 0;
	font-size: 1.125rem;
}

@media (min-width: 75rem) {
	.ctx-op-blue__headline {
		font-size: 1.25rem;
	}
}

.ctx-op-blue__headline::before {
	top: -2.1875rem;
	left: 0;
	width: 1.5625rem;
	height: 1.4375rem;
	background-image: url(image/icon-double-quote-white.svg);
	background-size: 1.4375rem 1.1875rem;
}

.ctx-op-blue__author {
	margin: 0.75rem 0 1rem;
	font-size: 0.875rem;
	font-weight: 700;
}

.ctx-op-blue__avatars {
	display: flex;
	justify-content: flex-end;
	margin-top: 1.25rem;
}

.ctx-op-blue .ctx-op-avatar {
	width: 4.5rem;
	height: 4.5rem;
}

/* --------------------------------------------------------------------------
   Section title
   -------------------------------------------------------------------------- */

.ctx-op-section-title {
	position: relative;
	margin: 0 0 1.25rem;
	padding-left: 1.0625rem;
	padding-right: 1.25rem;
	font-family: var(--fontfamily-body, "Noto Sans", sans-serif);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.5625rem;
	letter-spacing: normal;
	text-transform: uppercase;
}

.ctx-op-section-title::before {
	content: "";
	display: block;
	position: absolute;
	top: 0.375rem;
	left: 0;
	width: 0.5rem;
	height: 0.8125rem;
	background-color: var(--ctx-op-chip);
}

.ctx-op-rule {
	height: 0.0625rem;
	margin: 2rem 0 0;
	border: 0;
	background-color: var(--ctx-op-rule);
}

/* --------------------------------------------------------------------------
   Most popular
   -------------------------------------------------------------------------- */

.ctx-op-popular-block {
	padding-top: 2rem;
	padding-bottom: 0;
}

.ctx-op-popular__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem;
}

@media (min-width: 56.25rem) {
	.ctx-op-popular__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 1.5rem;
	}
}

.ctx-op-popular {
	display: grid;
	grid-template-columns: 10rem minmax(0, 1fr);
	gap: 0.875rem;
	align-items: start;
}

/*
 * The narrow column reads as a strip at the 100/58 shared ratio, so the
 * thumbnail is taller here and fills the row beside two or three headline
 * lines. The desktop stack goes back to the shared ratio.
 */
.ctx-op-popular__media {
	aspect-ratio: 10 / 7;
}

@media (min-width: 56.25rem) {
	.ctx-op-popular {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.75rem;
	}

	.ctx-op-popular__media {
		aspect-ratio: 100 / 58;
	}
}

.ctx-op-popular__headline {
	margin-top: 0.5rem;
	font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Archive: search row
   -------------------------------------------------------------------------- */

.ctx-op-archive {
	padding-block: 2rem;
}

.ctx-op-search {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

@media (min-width: 56.25rem) {
	.ctx-op-search {
		flex-direction: row;
		align-items: stretch;
		gap: 1rem;
	}
}

.ctx-op input.ctx-op-search__field {
	flex: 1 1 auto;
	min-width: 0;
	height: 3rem;
	padding: 0 1.25rem;
	border: 0.0625rem solid var(--ctx-op-field-border);
	background-color: var(--ctx-op-field);
	color: var(--ctx-op-ink);
	font-family: inherit;
	font-size: 0.9375rem;
}

.ctx-op-select {
	display: flex;
	position: relative;
	flex: 1 1 auto;
	align-items: stretch;
	min-width: 0;
	border: 0.0625rem solid var(--ctx-op-field-border);
	background-color: var(--ctx-op-field);
}

.ctx-op select.ctx-op-select__input {
	width: 100%;
	min-width: 0;
	height: 2.875rem;
	padding: 0 3rem 0 1.25rem;
	border: 0;
	appearance: none;
	-webkit-appearance: none;
	background-color: transparent;
	color: var(--ctx-op-ink);
	font-family: inherit;
	font-size: 0.9375rem;
	cursor: pointer;
}

.ctx-op-select__toggle {
	display: block;
	position: absolute;
	top: 50%;
	right: 0.75rem;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: -0.625rem;
	background: url(image/page-header-tabs-chevron-white.svg) no-repeat 50%;
	background-color: var(--ctx-blue-deep, #004a7c);
	background-size: 0.5rem;
	pointer-events: none;
}

.ctx-op-search__submit {
	flex: 0 0 auto;
	height: 3rem;
	padding: 0 2.5rem;
	border: 0;
	background-color: var(--ctx-op-chip);
	color: #ffffff;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
}

.ctx-op-search__submit:hover,
.ctx-op-search__submit:focus-visible {
	background-color: var(--ctx-blue-deep, #004a7c);
}

/* Order by ---------------------------------------------------------------- */

.ctx-op-orderby {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 2rem;
	padding-block: 1.375rem;
	border-top: 0.0625rem solid var(--ctx-op-rule);
	border-bottom: 0.0625rem solid var(--ctx-op-rule);
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ctx-op-orderby__label {
	font-weight: 700;
}

.ctx-op-orderby__item {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
}

.ctx-op-orderby__item.is-active {
	font-weight: 700;
	text-decoration: underline;
}

.ctx-op-orderby__divider {
	color: var(--ctx-op-rule);
}

/* --------------------------------------------------------------------------
   Archive: feed
   -------------------------------------------------------------------------- */

.ctx-op-results {
	position: relative;
	min-height: 6.25rem;
	padding-top: 1.5rem;
}

.ctx-op-results.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

.ctx-op-feed__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem 2.5rem;
}

@media (min-width: 56.25rem) {
	.ctx-op-feed__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ctx-op-feed {
	display: grid;
	grid-template-columns: 10rem minmax(0, 1fr);
	gap: 0.875rem;
	align-items: start;
	padding-bottom: 1.5rem;
	border-bottom: 0.0625rem solid var(--ctx-op-rule);
}

/*
 * The archive row never stacks, so the taller crop applies on the narrow
 * column only. The wider desktop column goes back to the shared ratio.
 */
.ctx-op-feed__media {
	aspect-ratio: 10 / 7;
}

@media (min-width: 56.25rem) {
	.ctx-op-feed {
		grid-template-columns: 10.625rem minmax(0, 1fr);
		gap: 1.25rem;
	}

	.ctx-op-feed__media {
		aspect-ratio: 100 / 58;
	}
}

/*
 * On wide viewports the row height is set by the chip, headline and author
 * stack, which runs taller than a 10.625rem thumbnail. The wider column
 * brings the image up to that height so the rule below closes a full row.
 */
@media (min-width: 75rem) {
	.ctx-op-feed {
		grid-template-columns: 13.75rem minmax(0, 1fr);
	}
}

.ctx-op-feed__headline {
	margin-top: 0.5rem;
	font-size: 1.125rem;
	line-height: 1.28;
}

@media (min-width: 75rem) {
	.ctx-op-feed__headline {
		font-size: 1.25rem;
	}
}

.ctx-op-empty {
	padding: 2.5rem 0 3rem;
	text-align: center;
}

.ctx-op-empty__text {
	margin: 0;
	color: var(--ctx-op-ink);
	font-size: 1rem;
	line-height: 1.5;
}

.ctx-op a.ctx-op-empty__clear,
.ctx-op a.ctx-op-empty__clear:visited {
	display: inline-block;
	margin-top: 1.5rem;
	color: var(--ctx-op-ink);
	font-size: 1rem;
	font-weight: 700;
	text-decoration: underline;
}

.ctx-op a.ctx-op-empty__clear:hover,
.ctx-op a.ctx-op-empty__clear:focus-visible {
	color: var(--ctx-op-chip);
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.ctx-op-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	/* The boxes keep their size and the row wraps instead of running past the
	   page gutter, which is what a narrow viewport would otherwise force. */
	flex-wrap: wrap;
	row-gap: 0.625rem;
	padding-block: 2.5rem;
}

.ctx-op-pagination__pages {
	display: flex;
}

.ctx-op-pagination__pages--wide {
	display: none;
}

@media (min-width: 48rem) {
	.ctx-op-pagination__pages--wide {
		display: flex;
	}

	.ctx-op-pagination__pages--narrow {
		display: none;
	}
}

/*
 * Legacy values converted from the 10px root build:
 * 5rem box, .5rem radius, 2.2rem type, .5rem side margin.
 */
.ctx-op a.ctx-op-pagination__item {
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 3.125rem;
	max-width: 3.125rem;
	min-height: 3.125rem;
	max-height: 3.125rem;
	margin: 0 0.3125rem;
	border: none;
	border-radius: 0.3125rem;
	background-color: var(--ctx-navy-mid, #042d52);
	color: #ffffff;
	font-family: inherit;
	font-size: 1.375rem;
	font-weight: 500;
	line-height: 1.375rem;
	text-decoration: none;
}

.ctx-op a.ctx-op-pagination__item:hover,
.ctx-op a.ctx-op-pagination__item:focus-visible {
	background-color: var(--ctx-blue-accent, #006daa);
	color: #ffffff;
	text-decoration: none;
}

.ctx-op a.ctx-op-pagination__item.is-active {
	background-color: var(--ctx-blue-accent, #006daa);
	color: #ffffff;
	cursor: default;
}

.ctx-op a.ctx-op-pagination__item.is-disabled {
	background-color: #c9ced3;
	color: #ffffff;
	pointer-events: none;
}

/* On a phone the narrow window still prints seven boxes. They step down so
   the row fits between the page gutters instead of wrapping. Mirrors the
   step tag-archive.css applies to its own pagination. */
@media (max-width: 639.98px) {
	.ctx-op a.ctx-op-pagination__item {
		min-width: 2.5rem;
		max-width: 2.5rem;
		min-height: 2.5rem;
		max-height: 2.5rem;
		margin: 0 0.1875rem;
		font-size: 1.125rem;
		line-height: 1.125rem;
	}
}

/* --------------------------------------------------------------------------
   Defensive resets
   The base theme applies clamping and positioning rules to generic elements
   that make card content overlap. These declarations restore normal flow
   inside the Opinion scope.
   -------------------------------------------------------------------------- */

.ctx-op .ctx-op-media {
	display: block;
	position: relative;
	overflow: hidden;
}

.ctx-op .ctx-op-media__img,
.ctx-op .ctx-op-avatar__img {
	display: block;
	max-width: 100%;
	max-height: none;
}

.ctx-op .ctx-op-media__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ctx-op .ctx-op-main__teaser p,
.ctx-op .ctx-op-authors__names,
.ctx-op .ctx-op-blue__author {
	display: block;
	height: auto;
	min-height: 0;
	max-height: none;
	overflow: visible;
	-webkit-line-clamp: none;
	-webkit-box-orient: horizontal;
}

.ctx-op .ctx-op-main__teaser p {
	margin: 0 0 0.75rem;
	line-height: 1.55;
}

.ctx-op .ctx-op-main__teaser p:last-child {
	margin-bottom: 0;
}

.ctx-op .ctx-op-main__headline,
.ctx-op .ctx-op-sub__headline,
.ctx-op .ctx-op-popular__headline,
.ctx-op .ctx-op-feed__headline,
.ctx-op .ctx-op-blue__headline {
	height: auto;
	max-height: none;
	overflow: visible;
	-webkit-line-clamp: none;
}

.ctx-op .ctx-op-authors__names {
	display: flex;
}

/* --------------------------------------------------------------------------
   Editor preview
   -------------------------------------------------------------------------- */

.block-editor-block-list__layout .ctx-op {
	max-width: none;
}
