/* ==========================================================================
   Disparity in Loss — story-specific styles
   Loaded after bootstrap.min.css and style.css.
   ========================================================================== */

:root {
	--story-accent: #6e0000;
	--story-ink: #1c1c1c;
	--story-muted: #5a5a5a;
	--story-rule: #dcdcdc;
	--story-serif: 'Crimson Text', Georgia, 'Times New Roman', serif;
	--story-sans: Lato, 'Helvetica Neue', Arial, sans-serif;
}

body {
	color: var(--story-ink);
	background-color: #fff;
}

/* Skip link sits above the hero image */
.skip-link {
	position: absolute;
	z-index: 10;
	margin: 0.5rem;
}

/* Target of the skip link. It takes focus so screen readers follow the jump,
   but it isn't in the tab order, so it doesn't need a focus ring. */
#story:focus {
	outline: none;
}


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

.story-hero {
	position: relative;
	isolation: isolate; /* keeps the negative z-index layers inside the hero */
	display: flex;
	align-items: flex-end;
	min-height: 32rem;
	min-height: min(88svh, 46rem);
	padding: 8rem 0 3.5rem;
	overflow: hidden;
	background-color: #111;
	color: #fff;
}

/* min-width:0 lets the flex item shrink below its content's intrinsic width,
   which keeps the deck from overflowing on narrow screens */
.story-hero__inner {
	position: relative;
	flex: 1 1 100%;
	min-width: 0;
}

.story-hero__media {
	position: absolute;
	inset: 0;
	z-index: -2;
	display: block;
}

.story-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 55%;
}

/* Black screen over the photo so the headline stays legible */
.story-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-color: rgba(0, 0, 0, 0.55);
	background-image: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.35) 0%,
		rgba(0, 0, 0, 0.45) 40%,
		rgba(0, 0, 0, 0.75) 100%
	);
}

.story-hero__kicker {
	margin-bottom: 0.75rem;
	font-family: var(--story-sans);
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #ffb3a7;
}

.story-hero__title {
	max-width: min(22ch, 100%);
	margin-bottom: 1rem;
	font-weight: 600;
	font-size: clamp(2.25rem, 6.5vw, 4.25rem);
	line-height: 1.05;
	color: #fff;
	text-wrap: balance;
	text-shadow: 0 1px 20px rgba(0, 0, 0, 0.6);
}

.story-hero__deck {
	max-width: min(52ch, 100%);
	margin-bottom: 0;
	font-family: var(--story-sans);
	font-size: clamp(1.05rem, 2.1vw, 1.35rem);
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.92);
	text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6);
}


/* --------------------------------------------------------------------------
   Byline
   -------------------------------------------------------------------------- */

.story-byline {
	margin: 0 0 2.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--story-rule);
	font-family: var(--story-sans);
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--story-muted);
}

.story-byline strong {
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--story-ink);
}


/* --------------------------------------------------------------------------
   Body copy
   -------------------------------------------------------------------------- */

.story-body p {
	font-family: var(--story-serif);
	font-size: clamp(1.15rem, 1.1rem + 0.35vw, 1.4rem);
	line-height: 1.6;
	margin-bottom: 1.4rem;
}

.story-body a {
	color: var(--story-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.story-body a:hover,
.story-body a:focus {
	color: #a11a1a;
}

.story-subhead {
	margin: 3rem 0 1.25rem;
	font-weight: 600;
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	color: var(--story-accent);
}


/* --------------------------------------------------------------------------
   Figures: photos and charts
   -------------------------------------------------------------------------- */

.story-figure {
	margin: 3rem 0;
}

.story-figure img {
	display: block;
	width: 100%;
	height: auto;
}

.story-caption {
	margin-top: 0.75rem;
	font-family: var(--story-sans);
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--story-muted);
}

/* Datawrapper embeds. The iframe is sized by the height message it posts back;
   the height attribute in the markup is the starting value. */
.chart {
	margin: 2.5rem 0 3rem;
}

.chart__embed iframe {
	display: block;
	width: 100%;
	min-width: 100%;
	border: 0;
}

/* Static PNG swapped in by js/story.js when an embed fails to load */
.chart__fallback {
	display: block;
	width: 100%;
	height: auto;
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.story-footer {
	margin-top: 4rem;
	padding: 3rem 0;
	font-family: var(--story-sans);
	font-size: 0.95rem;
}

.story-footer p {
	margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
	.story-hero {
		min-height: 0;
		padding: 0 0 1rem;
		color: #000;
	}

	.story-hero::after,
	.story-hero__media {
		display: none;
	}

	.story-hero__title,
	.story-hero__deck {
		color: #000;
		text-shadow: none;
	}
}
