/**
 * techrahal Route: the theme's components. Tokens come from theme.json
 * (colors, fonts, sizes, radii); this file only places them.
 *
 * 1. Base   2. Header   3. Home opening   4. Sections   5. Tools
 * 6. Rules that changed   7. Guides   8. How we check   9. Footer
 * 10. Motion
 */

/* 1. Base. */

:root {
	--th-ground: var(--wp--preset--color--ground);
	--th-panel: var(--wp--preset--color--panel);
	--th-line: var(--wp--preset--color--line);
	--th-field: var(--wp--preset--color--field);
	--th-ink: var(--wp--preset--color--ink);
	--th-ink-soft: var(--wp--preset--color--ink-soft);
	--th-ink-muted: var(--wp--preset--color--ink-muted);
	--th-accent: var(--wp--preset--color--accent);
	--th-on-accent: var(--wp--preset--color--on-accent);
	--th-accent-tint: var(--wp--preset--color--accent-tint);
	--th-night: var(--wp--preset--color--night);
	/* Text on the deep band and on the status tags, and the logo's two colors.
	   The light values are the ones the theme always used; the dark theme
	   (color-modes.css) gives each its own. */
	--th-on-night: #FFFFFF;
	--th-on-night-muted: var(--th-accent-tint);
	--th-on-go: var(--th-on-accent);
	--th-on-stop: var(--th-on-accent);
	--th-on-limit: var(--th-ink);
	--th-mark-tile: #1F4FD8;
	--th-mark-route: #FFFFFF;
	--th-display: var(--wp--preset--font-family--display);
	--th-radius-card: var(--wp--custom--radius--card);
	--th-section: 72px;
}

@media (max-width: 600px) {
	:root {
		--th-section: 56px;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-size-adjust: 100%;
}

a {
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 3px solid var(--th-accent);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.th-section-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--heading);
}

/* "Checked <date>" with the logo's check, as on every stop and guide. */
.th-checked {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--th-ink-muted);
}

.th-checked::before {
	content: "";
	flex: none;
	width: 14px;
	height: 14px;
	background: var(--th-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.4 6.4 11.8 13 4.6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.4 6.4 11.8 13 4.6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 2. Header. */

.th-header {
	gap: 8px 24px;
	padding-block: 24px;
}

.th-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--th-ink);
	font-family: var(--th-display);
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
	text-decoration: none;
}

.th-brand:hover {
	color: var(--th-ink);
	text-decoration: none;
}

.th-brand__mark {
	flex: none;
	width: 36px;
	height: 36px;
}

.th-brand__mark .th-mark__tile,
.th-brand__mark .th-mark__hole {
	fill: var(--th-mark-tile);
}

.th-brand__mark .th-mark__route {
	stroke: var(--th-mark-route);
}

.th-brand__mark .th-mark__stop {
	fill: var(--th-mark-route);
}

/* The light and dark switch: the moon asks for the dark theme, the sun for
   the light one. Hidden until its script runs; without it the site still
   follows the system setting. */
.th-header > .th-nav {
	order: 2;
	margin-inline-start: auto;
}

.th-header > .th-theme-toggle {
	order: 3;
}

.th-theme-toggle {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--th-ink);
	cursor: pointer;
}

.th-theme-toggle[hidden] {
	display: none;
}

/* With scripting (html.th-theme-js, set by the head script before the first
   paint) the switch keeps its place from the first paint, invisible and out
   of reach until color-mode.js shows it, so the header does not grow when it
   appears (by 8 px on a phone before 2.0.2). Without scripting the class is
   never set and the switch takes no space. */
.th-theme-js .th-theme-toggle[hidden] {
	display: inline-grid;
	visibility: hidden;
}

.th-theme-toggle:hover {
	background: var(--th-accent-tint);
}

.th-theme-toggle:focus-visible {
	outline: 3px solid var(--th-accent);
	outline-offset: 2px;
}

.th-theme-toggle svg {
	width: 20px;
	height: 20px;
}

.th-theme-toggle[aria-pressed="true"] .th-icon-moon,
.th-theme-toggle:not([aria-pressed="true"]) .th-icon-sun {
	display: none;
}

.th-nav .wp-block-navigation__container {
	gap: 0 28px;
}

.th-nav .wp-block-navigation-item__content {
	display: inline-block;
	padding-block: 12px;
	color: var(--th-ink);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.th-nav .wp-block-navigation-item__content:hover,
.th-nav .current-menu-item > .wp-block-navigation-item__content,
.th-nav .current-menu-ancestor > .wp-block-navigation-item__content {
	text-decoration: underline;
}

@media (max-width: 600px) {
	.th-header {
		padding-block: 16px 8px;
	}

	.th-nav .wp-block-navigation__container {
		justify-content: flex-start;
		gap: 0 24px;
	}

	/* On a phone the switch stays on the logo's line and the links go below. */
	.th-header > .th-theme-toggle {
		order: 2;
		margin-inline-start: auto;
	}

	.th-header > .th-nav {
		order: 3;
		flex-basis: 100%;
		margin-inline-start: 0;
	}
}

/* 3. Home opening. */

.th-hero {
	padding-top: 48px;
}

@media (max-width: 600px) {
	.th-hero {
		padding-top: 24px;
	}
}

.th-eyebrow {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--th-ink-muted);
}

.th-hero__title {
	max-width: 1000px;
	text-wrap: balance;
}

.th-hero__lead {
	max-width: 620px;
	margin-bottom: 0;
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.55;
	color: var(--th-ink-soft);
}

/* 4. Sections on the home page. */

.th-home > .th-tools,
.th-home > .th-timeline,
.th-home > .th-guides,
.th-home > .th-promises {
	margin-block-start: var(--th-section);
}

/* 5. Tools. */

.th-tools {
	padding-top: calc(var(--th-section) - 16px);
	border-top: 1px solid var(--th-line);
}

.th-tools .th-section-title {
	margin-bottom: 16px;
}

.th-tools__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0 48px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.th-tool {
	margin: 0;
	border-bottom: 1px solid var(--th-line);
}

@media (min-width: 760px) {
	.th-tools__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: repeat(4, auto);
		grid-auto-flow: column;
	}
}

.th-tool__link {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	padding-block: 18px;
	color: var(--th-ink);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
}

.th-tool__link:hover {
	color: var(--th-ink);
	text-decoration: none;
}

.th-tool__link:hover .th-tool__name {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

.th-tool__count {
	color: var(--th-ink-muted);
	font-size: 15px;
	font-weight: 400;
}

.th-tools__note {
	margin: 20px 0 0;
	font-size: 15px;
	color: var(--th-ink-soft);
}

/* 6. Rules that changed: dated stops on a line, newest first. */

.th-timeline {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px 64px;
}

@media (min-width: 900px) {
	.th-timeline {
		grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	}
}

.th-timeline__head > * + * {
	margin-block-start: 12px;
}

.th-timeline__intro {
	max-width: 360px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--th-ink-soft);
}

.th-timeline__line {
	position: relative;
	padding-inline-start: 36px;
}

.th-timeline__line::before {
	content: "";
	position: absolute;
	inset-block: 6px 10px;
	inset-inline-start: 7px;
	border-inline-start: 2px dashed var(--th-field);
}

.th-timeline__group {
	margin: 0 0 16px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--th-ink-muted);
}

.th-timeline__list {
	display: flex;
	flex-direction: column;
	gap: 28px;
	margin: 0 0 40px;
	padding: 0;
	list-style: none;
}

.th-timeline__list:last-child {
	margin-bottom: 0;
}

.th-timeline__item {
	position: relative;
	margin: 0;
}

.th-timeline__item::before {
	content: "";
	position: absolute;
	inset-inline-start: -36px;
	top: 2px;
	box-sizing: border-box;
	width: 16px;
	height: 16px;
	border: 3px solid var(--th-accent);
	border-radius: 50%;
	background: var(--th-ground);
}

.th-timeline__list.is-done .th-timeline__item::before {
	border-color: var(--th-ink-soft);
	background: var(--th-ink-soft);
}

.th-timeline__date {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--th-ink-muted);
}

.th-timeline__title {
	margin: 6px 0 0;
	font-family: var(--th-display);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--th-ink);
}

.th-timeline__text {
	max-width: 600px;
	margin: 6px 0 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--th-ink-soft);
}

/* 7. Latest guides. */

.th-guides__head {
	gap: 8px 24px;
	margin-bottom: 24px;
}

.th-guides__all {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

.th-guides__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.th-guides__list > li {
	margin: 0;
}

.th-guide {
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-sizing: border-box;
	height: 100%;
	padding: 24px;
	border-radius: var(--th-radius-card);
	background: var(--th-panel);
}

.th-guide > * {
	margin: 0;
}

.th-guide__topic {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--th-ink-muted);
}

.th-guide__topic a {
	color: inherit;
	text-decoration: none;
}

.th-guide__topic a:hover {
	text-decoration: underline;
}

.th-guide__title {
	font-size: 20px;
	line-height: 1.25;
	text-wrap: pretty;
}

.th-guide__title a {
	color: var(--th-ink);
	text-decoration: none;
}

.th-guide__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

.th-guide__excerpt p {
	margin: 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--th-ink-soft);
}

.th-guide__date {
	margin-top: auto;
	padding-top: 6px;
	font-size: 13px;
	color: var(--th-ink-muted);
}

/* 8. How we check: the page's one dark band. */

.th-promises {
	padding-block: var(--th-section);
	background: var(--th-night);
	color: var(--th-on-night);
}

.th-promises .th-section-title {
	margin-bottom: 32px;
	color: var(--th-on-night);
}

.th-promises__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 32px 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.th-promise {
	margin: 0;
	padding-top: 20px;
	border-top: 3px solid var(--th-accent);
}

.th-promise__title {
	margin: 0;
	font-family: var(--th-display);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--th-on-night);
}

.th-promise__text {
	margin: 8px 0 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--th-on-night-muted);
}

.th-promises__more {
	margin: 32px 0 0;
	font-size: 15px;
	font-weight: 600;
}

.th-promises a {
	color: var(--th-on-night);
}

.th-promises :focus-visible {
	outline-color: var(--th-on-night);
}

/* 9. Footer. */

.th-footer {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	padding-block: 56px 32px;
}

@media (min-width: 960px) {
	.th-footer {
		grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
		gap: 40px 64px;
	}
}

.th-footer > * {
	margin: 0;
}

.th-footer__promise > * {
	margin: 0;
}

.th-footer__motto {
	margin-top: 16px;
	font-weight: 700;
}

.th-footer__fine {
	max-width: 420px;
	margin-top: 8px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--th-ink-muted);
}

.th-footer__links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

@media (min-width: 720px) {
	.th-footer__links {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.th-footer__label {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--th-ink-muted);
}

.th-footer__links ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.th-footer__links li {
	margin: 0;
}

.th-footer__links a {
	display: inline-block;
	padding-block: 6px;
	color: var(--th-ink-soft);
	font-size: 15px;
	line-height: 1.4;
	text-decoration: none;
}

.th-footer__links a:hover {
	color: var(--th-ink);
	text-decoration: underline;
}

.th-footer__base {
	grid-column: 1 / -1;
	padding-top: 20px;
	border-top: 1px solid var(--th-line);
	font-size: 13px;
	line-height: 1.5;
	color: var(--th-ink-muted);
}

/* 10. Motion: short, and off for visitors who ask for less. */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
