/* TRJ Growth Toolkit: site polish. Loaded last so it can settle conflicts between older layers. */

/* ---------------------------------------------------------------
 * 1. Calm motion: one gentle reveal, never stacked entrances
 * ------------------------------------------------------------- */
/* The trjm entrance (inline styles for ~2.6s) runs on top of each hero's own animation and the
   section reveal, so heroes flicker or sit half-transparent. Hero content now shows at once. */
html.trjm-load body.trjgt-calm :is(.trj-rd-hero-inner > *, .trjgh-hero-copy > *, aside.trjgh-hero-panel, .trjho-ahero-text > *, .trjho-ahero-media, .trjfgd-hero > *, .trjtp-band-in > *),
html.trjm-load body.trjgt-calm :is(.trj-rd-hero-inner, .trjgh-hero-copy, .trjho-ahero-text) h1 :is(span, em, i) {
	opacity: 1 !important;
	transform: none !important;
	filter: none !important;
	clip-path: none !important;
	transition: none !important;
	animation: none !important;
}
/* Whole-page wrappers must never fade in as one block (it hides everything until JS runs). */
body.trjgt-calm :is(#content, .related-journal, .standard-page).trj-rd-reveal {
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
}
/* Section reveals: shorter and smaller, so fast scrolling doesn't show blank gaps. */
@media (prefers-reduced-motion: no-preference) {
	body.trjgt-calm .trj-rd-js .trj-rd-reveal:not(#content) { transform: translateY(10px); transition: opacity .45s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
	body.trjgt-calm .trj-rd-js .trj-rd-reveal.is-in { transform: none; }
}

/* ---------------------------------------------------------------
 * 2. Photo book page
 * ------------------------------------------------------------- */
/* "Every page" no longer hijacks vertical scrolling: it becomes a normal swipe/scroll row. */
body.trjgt-book .trjq-inside,
body.trjgt-book .trjq-inside.is-driven { height: auto !important; }
body.trjgt-book .trjq-inside__stick { position: relative !important; top: auto !important; height: auto !important; min-height: 0 !important; }
body.trjgt-book .trjq-track {
	transform: none !important;
	overflow-x: auto !important;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	scroll-padding-inline: max(20px, 4vw);
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #141414 transparent;
	padding-bottom: 14px;
	padding-inline: max(20px, 4vw);
	box-sizing: border-box;
}
body.trjgt-book .trjq-track > .trjq-page { scroll-snap-align: start; }
body.trjgt-book .trjq-prog { display: none !important; }
body.trjgt-book .trjgt-track-nav { display: flex; gap: 10px; justify-content: flex-end; margin: 6px max(20px, 4vw) 0; }
body.trjgt-book .trjgt-track-nav button {
	width: 48px; height: 48px; border-radius: 50%; border: 1px solid #141414; background: #fff; color: #141414;
	font: 600 18px/1 Geist, "TRJ Geist", Arial, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
	transition: background-color .2s;
}
body.trjgt-book .trjgt-track-nav button:hover:not([disabled]) { background: #D4FF00; }
body.trjgt-book .trjgt-track-nav button[disabled] { opacity: .35; cursor: default; }
@media (max-width: 899px) { body.trjgt-book .trjgt-track-nav { display: none; } }
/* Film: reserve its space so the page below doesn't jump when it loads; no pre-state transform. */
body.trjgt-book .trjq-film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
body.trjgt-book .trjq-film video.is-pre { opacity: 1 !important; transform: none !important; }

/* Header: same height as the site's other full-image headers (race hub, coaching):
   fills the screen below the menu, between 620px and 920px; natural height on phones. */
@media (min-width: 861px) {
	html body.trjgt-book:not(#trjgt1):not(#trjgt2):not(#trjgt3):not(#trjgt4):not(#trjgt5):not(#trjgt6):not(#trjgt7):not(#trjgt8):not(#trjgt9) .trjq-hero { height: clamp(620px, calc(100svh - 96px), 920px) !important; min-height: 0 !important; }
	html body.trjgt-book:not(#trjgt1):not(#trjgt2):not(#trjgt3):not(#trjgt4):not(#trjgt5):not(#trjgt6):not(#trjgt7):not(#trjgt8):not(#trjgt9) .trjq-hero__inner { height: 100% !important; min-height: 0 !important; justify-content: center !important; box-sizing: border-box !important; }
	html body.trjgt-book:not(#trjgt1):not(#trjgt2):not(#trjgt3):not(#trjgt4):not(#trjgt5):not(#trjgt6):not(#trjgt7):not(#trjgt8):not(#trjgt9) .trjq-hero__bg { height: 100% !important; top: 0 !important; }
}

/* Tighter spacing around "Laid out by shape" (the page's own rules use !important with 8 ids). */
html body.trjgt-book:not(#trjgt1):not(#trjgt2):not(#trjgt3):not(#trjgt4):not(#trjgt5):not(#trjgt6):not(#trjgt7):not(#trjgt8):not(#trjgt9) .trjq-cards { margin-top: clamp(48px, 6vw, 72px) !important; }
html body.trjgt-book:not(#trjgt1):not(#trjgt2):not(#trjgt3):not(#trjgt4):not(#trjgt5):not(#trjgt6):not(#trjgt7):not(#trjgt8):not(#trjgt9) .trjq-offer { margin-top: clamp(40px, 5vw, 64px) !important; padding-top: clamp(24px, 3vw, 40px) !important; }
html body.trjgt-book:not(#trjgt1):not(#trjgt2):not(#trjgt3):not(#trjgt4):not(#trjgt5):not(#trjgt6):not(#trjgt7):not(#trjgt8):not(#trjgt9) .trjq-inside { margin-top: clamp(56px, 7vw, 96px) !important; }

/* ---------------------------------------------------------------
 * 3. Homepage: book example video
 * ------------------------------------------------------------- */
.trjw-book-fig.trjgt-has-video { margin: 0; }
.trjgt-book-video {
	display: block; position: relative; overflow: hidden; border-radius: 18px; background: #F3F4F2;
	box-shadow: rgba(20, 20, 20, .35) 0 40px 80px -40px, rgba(20, 20, 20, .05) 0 2px 6px 0;
}
.trjgt-book-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #F3F4F2; }

/* ---------------------------------------------------------------
 * 4. Article pages: match the journal posts
 * ------------------------------------------------------------- */
body.trjgt-article-page {
	--g-ink: #141414; --g-soft: #45453F; --g-lime: #D4FF00; --g-paper: #F3F4F2; --g-paper2: #F5F6F4; --g-line: #E4E4DC;
	--g-head: Geist, "TRJ Geist", Arial, sans-serif;
	--g-read: TRJGHReadingInter, Inter, Arial, sans-serif;
}
body.trjgt-article-page #content.standard-page { padding-top: 0 !important; max-width: none !important; width: 100% !important; }
body.trjgt-article-page #content .entry-content { max-width: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }

/* Hero */
.trjgt-ahero { background: var(--g-paper); width: 100vw; margin-left: calc(50% - 50vw); }
.trjgt-ahero-in { max-width: 1180px; margin: 0 auto; padding: clamp(28px, 4vw, 56px) max(20px, 4vw) clamp(36px, 5vw, 72px); display: grid; gap: clamp(28px, 4vw, 64px); align-items: center; }
.trjgt-ahero-in.has-aside { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 900px) { .trjgt-ahero-in.has-aside { grid-template-columns: 1fr; } }
.trjgt-crumbs ol { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; font: 500 13px/1.4 var(--g-read); color: var(--g-soft); }
.trjgt-crumbs li + li::before { content: "›"; margin-right: 10px; opacity: .6; }
.trjgt-crumbs a { color: inherit !important; text-decoration: none; border-bottom: 1px solid transparent; }
.trjgt-crumbs a:hover { border-bottom-color: currentColor; }
.trjgt-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 700 13px/1.2 var(--g-head); letter-spacing: .14em; text-transform: uppercase; color: var(--g-ink); }
.trjgt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--g-lime); box-shadow: 0 0 0 1px var(--g-ink); }
.trjgt-ahero h1 { margin: 0 0 20px !important; font: 650 clamp(38px, 5vw, 64px)/1.02 var(--g-head) !important; letter-spacing: -.04em !important; color: var(--g-ink) !important; text-transform: none !important; max-width: 16ch; }
.trjgt-deck { margin: 0 0 22px; max-width: 56ch; font: 400 clamp(17px, 1.5vw, 20px)/1.55 var(--g-read); color: var(--g-soft); }
.trjgt-byline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font: 500 14px/1.4 var(--g-read); color: var(--g-soft); }
.trjgt-byline span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; margin-right: 18px; vertical-align: middle; }
@media (max-width: 600px) { .trjgt-byline { flex-direction: column; gap: 4px; } .trjgt-byline span + span::before { display: none; } }
.trjgt-byline a { color: var(--g-ink) !important; font-weight: 600; text-decoration: none; background: linear-gradient(transparent 62%, rgba(212, 255, 0, .8) 62%); }
.trjgt-ahero-media { margin: 0; border-radius: 28px; overflow: hidden; }
.trjgt-ahero-media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.trjgt-answer { background: #fff; border-radius: 28px; padding: clamp(24px, 3vw, 36px); box-shadow: 0 1px 0 var(--g-line), 0 24px 60px -36px rgba(20, 20, 20, .35); border-top: 4px solid var(--g-lime); }
.trjgt-answer p { margin: 0 0 12px; font: 400 16.5px/1.7 var(--g-read); color: #222; }
.trjgt-answer p:first-child { font: 700 13px/1.2 var(--g-head); letter-spacing: .14em; text-transform: uppercase; color: var(--g-ink); }
.trjgt-answer p:last-child { margin-bottom: 0; }
.trjgt-answer strong { color: var(--g-ink); }

/* Two-column body */
.trjgt-layout { max-width: 1180px; margin: 0 auto; padding: clamp(36px, 5vw, 72px) max(20px, 4vw) 40px; display: grid; grid-template-columns: 216px minmax(0, 700px); gap: clamp(32px, 5vw, 80px); justify-content: center; align-items: start; }
@media (max-width: 1000px) { .trjgt-layout { grid-template-columns: minmax(0, 700px); } .trjgt-side { display: none; } }
.trjgt-side { position: sticky; top: 92px; font: 500 14px/1.45 var(--g-read); max-height: calc(100vh - 120px); overflow: auto; }
.trjgt-side-h { margin: 0 0 12px; font: 700 11px/1.2 var(--g-head); letter-spacing: .14em; text-transform: uppercase; color: var(--g-ink); }
.trjgt-side ol, .trjgt-side ul { list-style: none; margin: 0 0 32px; padding: 0; }
.trjgt-toc li a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid var(--g-line); color: var(--g-soft) !important; text-decoration: none; transition: border-color .2s, color .2s; }
.trjgt-toc li a:hover, .trjgt-toc li a.is-current { border-left-color: var(--g-ink); color: var(--g-ink) !important; }
.trjgt-toc li a.is-current { font-weight: 600; }
.trjgt-related li { margin-bottom: 12px; }
.trjgt-related a { color: var(--g-ink) !important; font-weight: 600; text-decoration: none; }
.trjgt-related a:hover { text-decoration: underline; text-decoration-color: var(--g-lime); text-decoration-thickness: 3px; }

/* Body typography */
.trjgt-main { min-width: 0; font: 400 17px/1.75 var(--g-read); color: #222; }
.trjgt-main > :first-child { margin-top: 0 !important; }
.trjgt-main h2 { margin: 56px 0 16px !important; font: 600 clamp(27px, 3vw, 36px)/1.1 var(--g-head) !important; letter-spacing: -.035em !important; color: var(--g-ink) !important; text-transform: none !important; scroll-margin-top: 100px; }
.trjgt-main h3 { margin: 32px 0 10px !important; font: 600 21px/1.25 var(--g-head) !important; letter-spacing: -.02em !important; color: var(--g-ink) !important; }
.trjgt-main p { margin: 0 0 18px; }
.trjgt-main a:not(.trjgt-btn):not([class*="trj-btn"]):not([class*="cta"]) { color: var(--g-ink) !important; font-weight: 500; text-decoration: none; background: linear-gradient(transparent 62%, rgba(212, 255, 0, .8) 62%); }
.trjgt-main ul, .trjgt-main ol { margin: 0 0 22px; padding-left: 1.25em; }
.trjgt-main li { margin-bottom: 10px; padding-left: 4px; }
.trjgt-main li::marker { color: var(--g-ink); font-weight: 700; }
.trjgt-main strong { color: var(--g-ink); }
.trjgt-main .trjns-answer { background: var(--g-paper); border-radius: 22px; padding: 24px 28px; border-left: 4px solid var(--g-lime); margin: 0 0 32px; }
.trjgt-main .trjns-answer p:last-child { margin: 0; }
.trjgt-main table { width: 100%; border-collapse: collapse; margin: 8px 0 28px; font-size: 15.5px; }
.trjgt-main th, .trjgt-main td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--g-line); }
.trjgt-main thead th { font: 700 11.5px/1.3 var(--g-head); letter-spacing: .1em; text-transform: uppercase; color: var(--g-ink); border-bottom: 2px solid var(--g-ink); }
.trjgt-main .trjns-facts { background: var(--g-paper); border-radius: 22px; padding: 6px 22px; margin: 0 0 32px; }
.trjgt-main .trjns-facts table { margin: 0; }
.trjgt-main .trjns-facts tr:last-child th, .trjgt-main .trjns-facts tr:last-child td { border-bottom: 0; }
.trjgt-main .trjns-facts th { width: 42%; font-weight: 600; color: var(--g-ink); }
.trjgt-main .trjns-callout { border: 1px solid var(--g-line); border-radius: 22px; padding: 20px 24px; margin: 0 0 28px; background: #fff; }
.trjgt-main .trjns-callout > :last-child { margin-bottom: 0; }
.trjgt-main .trjns-steps { counter-reset: s; list-style: none; padding: 0; }
.trjgt-main .trjns-steps > li { counter-increment: s; position: relative; padding: 0 0 0 52px; margin-bottom: 20px; }
.trjgt-main .trjns-steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--g-lime); box-shadow: 0 0 0 1px var(--g-ink); display: grid; place-items: center; font: 700 14px/1 var(--g-head); color: var(--g-ink); }

/* FAQ, next steps, sources */
.trjgt-main .trjns-faq { margin-top: 56px; }
.trjgt-main .trjns-faq details { border-radius: 18px; background: var(--g-paper); margin-bottom: 8px; padding: 0 22px; }
.trjgt-main .trjns-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 18px; padding: 18px 0; font: 600 17px/1.35 var(--g-head); color: var(--g-ink); }
.trjgt-main .trjns-faq summary::-webkit-details-marker { display: none; }
.trjgt-main .trjns-faq summary::after { content: "+"; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 500; transition: transform .25s; }
.trjgt-main .trjns-faq details[open] summary::after { transform: rotate(45deg); }
.trjgt-main .trjns-faq details > :not(summary) { margin: 0 0 18px; }
.trjgt-main .trjns-next { background: var(--g-ink) !important; color: #fff !important; border-radius: 28px; padding: clamp(24px, 3vw, 36px); margin: 48px 0 32px; }
.trjgt-main .trjns-next h2 { color: #fff !important; margin-top: 0 !important; }
.trjgt-main .trjns-next p { color: rgba(255, 255, 255, .85); }
.trjgt-main .trjns-next a { color: #141414 !important; background: var(--g-lime) !important; padding: 10px 16px; border-radius: 999px; display: inline-block; margin: 4px 6px 4px 0; font-weight: 600; }
.trjgt-main .trjns-sources { border-top: 1px solid var(--g-line); margin-top: 40px; padding-top: 24px; font-size: 14.5px; }
.trjgt-main .trjns-sources h2 { font-size: 20px !important; margin: 0 0 12px !important; }
.trjgt-main .trjns-sources li { margin-bottom: 8px; }
.trjgt-reviewed { margin: 40px 0 14px !important; font-size: 14px; color: var(--g-soft); }
.trjgt-author { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; background: var(--g-paper); border-radius: 22px; padding: 22px 26px; margin-bottom: 8px; }
.trjgt-author strong { display: block; font: 600 17px/1.3 var(--g-head); color: var(--g-ink); margin-bottom: 4px; }
.trjgt-author p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--g-soft); }
.trjgt-author a { flex: 0 0 auto; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--g-ink); color: var(--g-ink) !important; background: #fff !important; font: 600 14px/1 var(--g-read); text-decoration: none; }
@media (max-width: 560px) { .trjgt-author { flex-direction: column; } }

@media (prefers-reduced-motion: reduce) {
	.trjgt-toc li a, .trjgt-main .trjns-faq summary::after, .trjgt-book-nav button { transition: none; }
}
