/**
 * Weekly Issue — front-end styles.
 *
 * Built for a permanently dark theme.
 * Everything tunable lives in the :root block below. Change a value there,
 * not further down.
 *
 * No background images and no external URLs: panels are solid dark surfaces
 * marked by a top accent rule and a hairline border.
 *
 * Selectors use two classes where a theme is likely to compete, so rules such
 * as `.td-post-content a` do not win on specificity.
 */

:root {
	/* Brand */
	--wki-accent: #F7CA2D;
	--wki-on-accent: #181300;

	/* Text */
	--wki-title: #ffffff;
	--wki-muted: rgba( 255, 255, 255, .72 );
	--wki-blurb: rgba( 255, 255, 255, .58 );
	--wki-faint: rgba( 255, 255, 255, .42 );
	--wki-rule: rgba( 255, 255, 255, .11 );

	/* Panels */
	--wki-panel: #1c1c1c;
	--wki-panel-edge: rgba( 255, 255, 255, .07 );

	/* Article thumbnail crop */
	--wki-thumb-ratio: 16 / 9;

	--wki-radius-card: 6px;
	--wki-radius-media: 6px;
	--wki-radius-btn: 4px;
}

/* =====================================================================
 * Panels
 * ================================================================== */

.wki-toc,
.wki-back {
	border: 1px solid var( --wki-panel-edge );
	border-top: 2px solid var( --wki-accent );
	border-radius: var( --wki-radius-card );
	background: var( --wki-panel );
}

/* =====================================================================
 * Table of contents
 * ================================================================== */

.wki-toc {
	margin: 34px 0;
	padding: 22px 24px;
}

.wki-toc .wki-toc__head {
	margin: 0 0 14px;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var( --wki-accent );
}

.wki-toc .wki-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wki-toc .wki-toc__item {
	display: flex;
	gap: 14px;
	align-items: baseline;
	margin: 0;
	padding: 9px 0;
	border-bottom: 1px solid var( --wki-rule );
}

.wki-toc .wki-toc__item:first-child {
	padding-top: 0;
}

.wki-toc .wki-toc__item:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.wki-toc .wki-toc__num {
	flex: none;
	min-width: 1.8em;
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var( --wki-accent );
}

.wki-toc .wki-toc__list a {
	color: var( --wki-title );
	font-weight: 600;
	line-height: 1.45;
	text-decoration: none;
}

.wki-toc .wki-toc__list a:hover,
.wki-toc .wki-toc__list a:focus {
	color: var( --wki-accent );
}

/* =====================================================================
 * Article entries
 * ================================================================== */

.wki-entries {
	margin-top: 34px;
}

.wki-entry {
	padding: 28px 0;
	border-bottom: 1px solid var( --wki-rule );

	/* Anchored jumps land below a sticky header instead of under it. */
	scroll-margin-top: 90px;
}

.wki-entry:first-child {
	padding-top: 0;
}

.wki-entry:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

/* ---- featured image -------------------------------------------------
 * The link is a fixed-ratio box and the image fills it absolutely, so a
 * theme rule on image width or height cannot change the crop. No extra
 * image size is registered, so existing uploads need no regeneration.
 * ------------------------------------------------------------------ */

.wki-entry .wki-entry__thumb {
	display: block;
	position: relative;
	width: 100%;
	margin: 0 0 16px;
	padding: 0;
	aspect-ratio: var( --wki-thumb-ratio );
	border-radius: var( --wki-radius-media );
	overflow: hidden;
	line-height: 0;
	background: var( --wki-panel );
}

.wki-entry .wki-entry__thumb img {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0 !important;
	padding: 0 !important;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	object-position: center;
	transition: transform .4s ease;
}

.wki-entry .wki-entry__thumb:hover img,
.wki-entry .wki-entry__thumb:focus img {
	transform: scale( 1.03 );
}

@media ( prefers-reduced-motion: reduce ) {
	.wki-entry .wki-entry__thumb img {
		transition: none;
	}

	.wki-entry .wki-entry__thumb:hover img,
	.wki-entry .wki-entry__thumb:focus img {
		transform: none;
	}
}

/* ---- text ---------------------------------------------------------- */

.wki-entry .wki-entry__kicker {
	margin: 0 0 8px;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: .09em;
	text-transform: uppercase;
}

.wki-entry .wki-entry__num {
	margin-inline-end: 9px;
	font-variant-numeric: tabular-nums;
	color: var( --wki-accent );
}

.wki-entry .wki-entry__term {
	color: var( --wki-faint );
}

.wki-entry .wki-entry__title {
	margin: 0 0 10px;
	font-weight: 800;
	line-height: 1.35;
}

.wki-entry .wki-entry__title a {
	color: var( --wki-title );
	text-decoration: none;
}

.wki-entry .wki-entry__title a:hover,
.wki-entry .wki-entry__title a:focus {
	color: var( --wki-accent );
}

.wki-entry .wki-entry__blurb {
	margin: 0 0 16px;
	color: var( --wki-blurb );
	line-height: 1.7;
}

.wki-entry a.wki-entry__more {
	display: inline-block;
	padding: 10px 18px;
	border-radius: var( --wki-radius-btn );
	background: var( --wki-accent );
	color: var( --wki-on-accent );
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: filter .15s ease;
}

.wki-entry a.wki-entry__more:hover,
.wki-entry a.wki-entry__more:focus {
	color: var( --wki-on-accent );
	filter: brightness( 1.12 );
}

/* =====================================================================
 * Back-link card
 * ================================================================== */

.wki-back {
	margin: 40px 0 0;
	padding: 22px 24px;
}

.wki-back .wki-back__top {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	color: var( --wki-muted );
}

.wki-back .wki-back__top a {
	color: var( --wki-accent );
	font-weight: 700;
	text-decoration: none;
}

.wki-back .wki-back__top a:hover,
.wki-back .wki-back__top a:focus {
	text-decoration: underline;
}

.wki-back .wki-back__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 22px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var( --wki-rule );
}

.wki-back .wki-back__prev,
.wki-back .wki-back__next {
	min-width: 150px;
	max-width: 48%;
}

.wki-back .wki-back__next {
	text-align: end;
}

.wki-back .wki-back__nav small {
	display: block;
	margin-bottom: 5px;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var( --wki-accent );
}

.wki-back .wki-back__nav a {
	color: var( --wki-title );
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
}

.wki-back .wki-back__nav a:hover,
.wki-back .wki-back__nav a:focus {
	color: var( --wki-accent );
}

/* =====================================================================
 * Small screens
 * ================================================================== */

@media ( max-width: 600px ) {
	.wki-toc {
		padding: 18px;
	}

	.wki-back {
		padding: 20px 18px;
	}

	.wki-back .wki-back__prev,
	.wki-back .wki-back__next {
		max-width: 100%;
	}

	.wki-back .wki-back__next {
		text-align: start;
	}
}

/* =====================================================================
 * Article source line: Source: … | By: … | Date: …
 *
 * Shared by the issue page (under each article title) and by the
 * [wki_source] shortcode (under the title of the article itself).
 *
 * All three parts share one treatment: a muted label, a clear value.
 * Everything is inline, so the line takes the alignment of its container:
 * left in an issue, centred if its theme block is centred.
 * A div, not a p, so theme paragraph rules add no margins of their own.
 * ================================================================== */

.wki-source {
	display: block;
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.7;
	color: var( --wki-muted );
}

.wki-source .wki-source__part {
	display: inline;
	white-space: nowrap;
}

.wki-source .wki-source__label {
	color: var( --wki-muted );
	font-weight: 400;
}

.wki-source .wki-source__value {
	color: var( --wki-title );
	font-weight: 600;
}

.wki-source .wki-source__sep {
	display: inline;
	margin: 0 10px;
	color: var( --wki-faint );
}

/* =====================================================================
 * Executive summary label, leading each article's description
 * ================================================================== */

.wki-entry .wki-entry__summary-label {
	margin-inline-end: 4px;
	color: var( --wki-accent );
	font-size: .85em;
	font-weight: 800;
	letter-spacing: .06em;
}

/* =====================================================================
 * Interest button (from the Email Notification Alerts plugin)
 *
 * The secondary action beside "Read the full article": same size, radius
 * and type, but outlined rather than filled, so the two read as a pair
 * with a clear primary. One treatment for the issue page and for the
 * back-link card on the article.
 *
 * Written for either an <a> or a <button>, and reset so the theme's own
 * button styles cannot leak in. Padding is one pixel less than the filled
 * button on each side to absorb the border, so both are the same height.
 * ================================================================== */

:root {
	--wki-accent-tint: rgba( 247, 202, 45, .12 );
}

.wki-entry .wki-interest,
.wki-back .wki-interest {
	display: inline-block;
	box-sizing: border-box;
	margin: 0;
	padding: 9px 17px;
	border: 1px solid var( --wki-accent );
	border-radius: var( --wki-radius-btn );
	background: transparent;
	box-shadow: none;
	color: var( --wki-accent );
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color .15s ease;
}

.wki-entry .wki-interest:hover,
.wki-entry .wki-interest:focus,
.wki-back .wki-interest:hover,
.wki-back .wki-interest:focus {
	background: var( --wki-accent-tint );
	color: var( --wki-accent );
	text-decoration: none;
}

.wki-entry .wki-interest:focus-visible,
.wki-back .wki-interest:focus-visible {
	outline: 2px solid var( --wki-accent );
	outline-offset: 2px;
}

/* Once requested, the other plugin may disable it. */
.wki-entry .wki-interest:disabled,
.wki-entry .wki-interest[aria-disabled="true"],
.wki-back .wki-interest:disabled,
.wki-back .wki-interest[aria-disabled="true"] {
	opacity: .55;
	cursor: default;
	background: transparent;
}

/* ---- issue page: the two buttons side by side ----------------------- */

.wki-entry .wki-entry__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

/* ---- back-link card: text on one side, button on the other ---------- */

.wki-back .wki-back__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 20px;
}

/* Phones: the line is too narrow for both, so the button drops below the
   text and spans the card. */
@media ( max-width: 600px ) {
	.wki-back .wki-back__head {
		flex-direction: column;
		align-items: stretch;
	}

	.wki-back .wki-back__head > * {
		width: 100%;
	}

	.wki-back .wki-interest {
		display: block;
		width: 100%;
	}
}

/* =====================================================================
 * Executive summary formatting
 *
 * The summary is now a block holding paragraphs, lists and inline
 * formatting. Colours inherit from the block, so theme paragraph rules
 * cannot recolour it.
 * ================================================================== */

.wki-entry .wki-entry__blurb p {
	margin: 0 0 10px;
	color: inherit;
	line-height: inherit;
}

.wki-entry .wki-entry__blurb > :last-child {
	margin-bottom: 0;
}

.wki-entry .wki-entry__blurb ul,
.wki-entry .wki-entry__blurb ol {
	margin: 0 0 10px;
	padding-inline-start: 22px;
	color: inherit;
}

.wki-entry .wki-entry__blurb ul {
	list-style: disc;
}

.wki-entry .wki-entry__blurb ol {
	list-style: decimal;
}

.wki-entry .wki-entry__blurb li {
	margin: 0 0 4px;
	color: inherit;
}

.wki-entry .wki-entry__blurb strong,
.wki-entry .wki-entry__blurb b {
	color: var( --wki-title );
	font-weight: 700;
}

.wki-entry .wki-entry__blurb em,
.wki-entry .wki-entry__blurb i {
	font-style: italic;
}

.wki-entry .wki-entry__blurb mark {
	padding: 0 3px;
	border-radius: 2px;
	background: var( --wki-accent-tint );
	color: var( --wki-accent );
}

.wki-entry .wki-entry__blurb a {
	color: var( --wki-accent );
	text-decoration: underline;
}

.wki-entry .wki-entry__blurb a:hover,
.wki-entry .wki-entry__blurb a:focus {
	text-decoration: none;
}
