/* Shared typewriter + strike for “THE DIRECTORY” (Bebas). Load after base theme CSS. */

@font-face {
	font-family: "BebasNeueRegular";
	src: url("../fonts/bebasneue-webfont.eot");
	src: url("../fonts/bebasneue-webfont.eot?#iefix") format("embedded-opentype"),
		url("../fonts/bebasneue-webfont.woff") format("woff"),
		url("../fonts/bebasneue-webfont.ttf") format("truetype"),
		url("../fonts/bebasneue-webfont.svg#BebasNeueRegular") format("svg");
	font-style: normal;
	font-weight: normal;
}

.td-typewriter {
	position: relative;
	display: inline-block;
	margin: 0;
	padding: 0;
	box-sizing: content-box;
	overflow: hidden;
	white-space: nowrap;
	width: 0;
	max-width: max-content;
	vertical-align: baseline;
	font-family: "BebasNeueRegular", Impact, "Arial Narrow", sans-serif;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	border-right: 0.1em solid currentColor;
	color: #fff;
	animation:
		td-tw-steps 2.75s steps(13, end) forwards,
		td-tw-caret 0.55s step-end 0s 5,
		td-tw-caret-hide 0.01s linear 2.85s forwards;
}

.td-typewriter-text {
	display: inline-block;
}

.td-typewriter--on-dark-bg {
	color: #fff;
}

.td-typewriter--on-dark-bg::after {
	background: #fff;
}

.td-typewriter--on-light-bg {
	color: #000;
}

.td-typewriter--on-light-bg::after {
	background: #000;
}

.td-typewriter--fs-header {
	font-size: 45px;
	line-height: 45px;
}

.td-typewriter--fs-hero {
	font-size: clamp(28px, 4.5vw, 56px);
	line-height: 1.05;
	font-weight: 700;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.td-typewriter--fs-landing {
	font-size: clamp(2.25rem, 9vw, 4.75rem);
	line-height: 1.05;
}

.td-typewriter--fs-kicker {
	font-size: clamp(18px, 2.8vw, 30px);
	line-height: 1;
	font-weight: normal;
}

/* Article spread: black letters, white strikethrough line (matches prior .mag-hed-directory-strike) */
.td-typewriter--mag-hed {
	color: #000;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	line-height: inherit;
}

.td-typewriter--mag-hed::after {
	background: #fff;
}

.td-typewriter::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 0.08em;
	margin-top: -0.04em;
	transform: scaleX(0);
	transform-origin: center;
	animation: td-tw-strike 0.45s ease-out 2.85s forwards;
	pointer-events: none;
}

@keyframes td-tw-steps {
	from {
		width: 0;
	}
	to {
		/* em scales with each .td-typewriter font-size; avoids max-content in @keyframes (Safari leaves width 0) */
		width: min(14em, calc(100vw - 48px));
	}
}

@keyframes td-tw-caret {
	50% {
		border-color: transparent;
	}
}

@keyframes td-tw-caret-hide {
	to {
		border-right-color: transparent;
	}
}

@keyframes td-tw-strike {
	to {
		transform: scaleX(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.td-typewriter {
		width: auto !important;
		max-width: calc(100vw - 48px) !important;
		overflow: visible !important;
		border-right: none !important;
		animation: none !important;
	}
	.td-typewriter::after {
		transform: scaleX(1) !important;
		animation: none !important;
	}
}
