/*
 * NT Timeline — [nt_timeline] horizontal history timeline.
 *
 * Strict isolation: every selector starts with the doubled root class `.nt-tl.nt-tl` and targets only
 * `nt-tl-` classes, so nothing here can reach theme markup, and the doubled class (0,3,0 for children)
 * beats Salient's element rules (`h3`, `p`, `ol>li`, `.row .col h3` = 0,2,1); text colours are also locked
 * at 0,4,0 (see "Colour lock"). `!important` is used only where Salient / the child theme use `!important`
 * on the same property; each one is commented.
 *
 * Contrast (WCAG 1.4.3): ink #000014 = 20.79:1 on #FFF, 18.22:1 on #F0F0EE; muted #33333f = 12.46 / 10.92;
 * teal #00677F = 6.47 / 5.67; white on ink (button hover) = 20.79:1.
 */

/* ---- Root ---------------------------------------------------------------------------------------- */

.nt-tl.nt-tl {
	--nt-tl-ink: #000014;
	--nt-tl-teal: #00677F;
	--nt-tl-muted: #33333f;
	--nt-tl-paper: #fff;
}

/* ---- Reset: everything the theme is known to force on p / h2-h4 / ol / li / button -------------- */

.nt-tl.nt-tl,
.nt-tl.nt-tl .nt-tl-eyebrow,
.nt-tl.nt-tl .nt-tl-lede,
.nt-tl.nt-tl .nt-tl-track,
.nt-tl.nt-tl .nt-tl-list,
.nt-tl.nt-tl .nt-tl-card,
.nt-tl.nt-tl .nt-tl-year,
.nt-tl.nt-tl .nt-tl-headline,
.nt-tl.nt-tl .nt-tl-desc,
.nt-tl.nt-tl .nt-tl-note,
.nt-tl.nt-tl .nt-tl-media,
.nt-tl.nt-tl .nt-tl-img,
.nt-tl.nt-tl .nt-tl-sr,
.nt-tl.nt-tl .nt-tl-caption,
.nt-tl.nt-tl .nt-tl-controls,
.nt-tl.nt-tl .nt-tl-btn,
.nt-tl.nt-tl .nt-tl-arrow {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	float: none;
	width: auto;
	min-width: 0;
	min-height: 0;
	max-width: none;
	font-family: inherit;
	font-style: normal;
	font-weight: 400;
	text-transform: none;
	text-decoration: none;
	text-indent: 0;
	text-align: left;
	letter-spacing: normal;
	vertical-align: baseline;
	transition: none;
}

.nt-tl.nt-tl .nt-tl-list,
.nt-tl.nt-tl .nt-tl-card {
	list-style: none;
}

.nt-tl.nt-tl .nt-tl-card::marker {
	content: none;
}

/* ---- Root and heading block ---------------------------------------------------------------------- */

.nt-tl.nt-tl {
	display: block;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	color: var(--nt-tl-ink);
	background: transparent;
}

.nt-tl.nt-tl .nt-tl-eyebrow {
	display: block;
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--nt-tl-teal);
}

/* h2 or h3 (heading attr); styled by class only. */
.nt-tl.nt-tl .nt-tl-lede {
	display: block;
	max-width: 34ch;
	margin: 0 0 18px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--nt-tl-ink);
}

/* ---- Track (focusable scroll region) ------------------------------------------------------------- */

.nt-tl.nt-tl .nt-tl-track {
	display: block;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	padding: 6px 0 14px;
}

.nt-tl.nt-tl .nt-tl-list {
	display: flex;
	flex-wrap: nowrap;
	margin: 0;
	padding: 0;
}

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

/* A column, so a card's image (.nt-tl-media) can sit at the bottom: the list is a flex row, every card
   is as tall as the tallest, and images line up along the bottom whatever the length of the text. */
.nt-tl.nt-tl .nt-tl-card {
	display: flex;
	flex-direction: column;
	position: relative;
	flex: 0 0 260px;
	padding: 0 28px 0 0;
	scroll-snap-align: start;
}

/* The rule: runs into the card's right padding so the line is continuous from card to card. */
.nt-tl.nt-tl .nt-tl-card::before {
	content: "";
	display: block;
	height: 2px;
	margin: 0 -28px 14px 0;
	background: var(--nt-tl-ink);
}

/* The stop marker: a 12px ring centred on the 2px rule. */
.nt-tl.nt-tl .nt-tl-card::after {
	content: "";
	position: absolute;
	top: -5px;
	left: 0;
	box-sizing: border-box;
	width: 12px;
	height: 12px;
	border: 2px solid var(--nt-tl-ink);
	border-radius: 50%;
	background: var(--nt-tl-paper);
}

.nt-tl.nt-tl .nt-tl-card--since::after {
	border-color: var(--nt-tl-teal);
	background: var(--nt-tl-teal);
}

.nt-tl.nt-tl .nt-tl-card--next::before {
	background: repeating-linear-gradient(90deg, var(--nt-tl-ink) 0 8px, transparent 8px 14px);
}

.nt-tl.nt-tl .nt-tl-year {
	display: block;
	margin: 0 0 6px;
	font-size: 40px;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--nt-tl-ink);
}

/* h3 or h4 (heading attr); styled by class only, never by tag. */
.nt-tl.nt-tl .nt-tl-headline {
	display: block;
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--nt-tl-ink);
}

.nt-tl.nt-tl .nt-tl-desc {
	display: block;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--nt-tl-muted);
}

.nt-tl.nt-tl .nt-tl-note {
	display: block;
	margin: 10px 0 0;
	padding: 0 0 0 12px;
	border-left: 3px solid var(--nt-tl-teal);
	font-size: 13px;
	line-height: 1.45;
	color: var(--nt-tl-muted);
}

/* Optional card image: 3:2 crop, pinned to the bottom of the card (see .nt-tl-card). */
.nt-tl.nt-tl .nt-tl-media {
	display: block;
	margin: auto 0 0;
	padding: 14px 0 0;
}
.nt-tl.nt-tl .nt-tl-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 5px;
	background: #F0F0EE;
}
.nt-tl.nt-tl .nt-tl-caption {
	display: block;
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--nt-tl-muted);
}

/* Visually hidden, still announced. */
.nt-tl.nt-tl .nt-tl-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---- Controls (inserted by js/timeline.js) ------------------------------------------------------- */

.nt-tl.nt-tl .nt-tl-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 6px 0 0;
}

.nt-tl.nt-tl .nt-tl-btn {
	display: inline-block;
	width: auto;
	height: auto;
	margin: 0;
	padding: 8px 14px;
	border: 2px solid var(--nt-tl-ink);
	/* audited: no Salient rule forces radius on type=button (rounded variants target type=submit only) */
	border-radius: 0;
	background: var(--nt-tl-paper);
	color: var(--nt-tl-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: none;
	-webkit-appearance: none;
	appearance: none;
}

.nt-tl.nt-tl .nt-tl-btn[aria-disabled="true"] {
	opacity: .45;
	cursor: default;
}

/* Hover only on devices that really hover, so the navy state never sticks after a tap. */
@media (hover: hover) {
	.nt-tl.nt-tl .nt-tl-btn:hover {
		background: var(--nt-tl-ink);
		color: var(--nt-tl-paper);
	}

	/* A disabled button keeps its resting look under the pointer. */
	.nt-tl.nt-tl .nt-tl-btn[aria-disabled="true"]:hover {
		background: var(--nt-tl-paper);
		color: var(--nt-tl-ink);
	}
}

.nt-tl.nt-tl .nt-tl-arrow {
	display: inline;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
}

/* ---- Colour lock (0,4,0) ------------------------------------------------------------------------
 * beats Salient: [data-color-change-section-bg-color]:not(.container-wrap) .light h1-h6, p
 * {color:var(--nectar-page-light-text-color,…)} at 0,3,1, which outranks the 0,3,0 rules above.
 * Tripled root class instead of !important; colour only. */

.nt-tl.nt-tl.nt-tl .nt-tl-eyebrow {
	color: var(--nt-tl-teal);
}

.nt-tl.nt-tl.nt-tl .nt-tl-lede,
.nt-tl.nt-tl.nt-tl .nt-tl-year,
.nt-tl.nt-tl.nt-tl .nt-tl-headline {
	color: var(--nt-tl-ink);
}

.nt-tl.nt-tl.nt-tl .nt-tl-desc,
.nt-tl.nt-tl.nt-tl .nt-tl-note,
.nt-tl.nt-tl.nt-tl .nt-tl-caption {
	color: var(--nt-tl-muted);
}

/* ---- Focus (track and buttons)------------------------------------------------------------------- */

.nt-tl.nt-tl .nt-tl-track:focus-visible,
.nt-tl.nt-tl .nt-tl-btn:focus-visible {
	/* beats Salient child: :focus-visible {outline:3px solid #00677f!important; outline-offset:2px!important} */
	outline: 3px solid var(--nt-tl-teal) !important;
	outline-offset: 3px !important;
}

/* ---- Phone (Salient's 690px breakpoint): stays a horizontal swipe line --------------------------- */

@media only screen and (max-width: 690px) {
	.nt-tl.nt-tl .nt-tl-card {
		flex-basis: 78vw;
	}

	.nt-tl.nt-tl .nt-tl-year {
		font-size: 34px;
	}
}

/* ---- Reduced motion ------------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.nt-tl.nt-tl .nt-tl-track {
		scroll-behavior: auto;
	}
}
