/* ==========================================================================
   Subject and test-prep pages (site/templates/pages/_subject.php)
   Loaded after site.css: every token and component there is available.
   Light and dark come from the tokens; nothing here is light-only.
   ========================================================================== */

/* ── H1 in sentence case: the text stays the page's H1, CSS sets the case ─ */
.t1 .t1s-lc { text-transform: lowercase; }
.t1 .t1s-uc { text-transform: uppercase; }
.t1 .t1s-cap { display: inline-block; text-transform: lowercase; }
.t1 .t1s-cap::first-letter { text-transform: uppercase; }

/* ── Hero: faces, and the subject's drawn icon on a disc ────────────────── */
.t1 .t1s-visual { position: relative; min-width: 0; }
.t1 .t1s-badge {
	position: absolute; z-index: 2; left: -40px; bottom: 64px;
	display: grid; place-items: center;
	width: 112px; height: 112px; border-radius: 50%;
	background: var(--t1-surface); border: 1px solid var(--t1-line);
	box-shadow: var(--t1-shadow-lift);
}
.t1 .t1s-badge__icon {
	width: 60px; height: auto; overflow: visible;
	fill: none; stroke: var(--t1-gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.t1 .t1s-hero .t1-hero__chips { margin-top: -4px; }
/* On phones the faces become a sliding strip; a disc on top of it covers a
   face, so the strip stands alone there. */
@media (max-width: 960px) {
	.t1 .t1s-badge { display: none; }
}

/* ── Numbers ─────────────────────────────────────────────────────────────── */
.t1 .t1s-stats { padding: clamp(36px, 4vw, 56px) 0; }
.t1 .t1s-stats__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.t1 .t1s-stats__list li { display: grid; gap: 6px; padding: 8px clamp(16px, 3vw, 40px); border-left: 1px solid var(--t1-line); }
.t1 .t1s-stats__list li:first-child { border-left: 0; padding-left: 0; }
.t1 .t1s-stats__num {
	font-family: var(--t1-font-head); font-weight: 700; letter-spacing: -.03em; line-height: 1;
	font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); font-variant-numeric: tabular-nums;
	color: var(--t1-ink);
}
.t1 .t1s-stats__label { color: var(--t1-ink-2); font-size: var(--t1-fs-sm); font-weight: 500; max-width: 26ch; }
@media (max-width: 640px) {
	.t1 .t1s-stats__list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.t1 .t1s-stats__list li { border-left: 0; padding: 0 0 20px; border-bottom: 1px solid var(--t1-line); }
	.t1 .t1s-stats__list li:last-child { border-bottom: 0; padding-bottom: 0; }
}

/* ── Cards (levels, programs, cases, tests) ─────────────────────────────── */
.t1 .t1s-cards { display: grid; grid-template-columns: repeat(var(--t1s-cols, 3), minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1099px) { .t1 .t1s-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .t1 .t1s-cards { grid-template-columns: minmax(0, 1fr); } }
.t1 ol.t1s-cards { list-style: none; }
.t1 .t1s-card { gap: 12px; }
.t1 .t1s-card .t1-h3 { line-height: 1.25; }
.t1 .t1s-card__mark { font-size: clamp(2.75rem, 2.2rem + 1.6vw, 3.75rem); margin-bottom: 0; white-space: nowrap; }
.t1 .t1s-card__icon { width: 52px; margin-bottom: 2px; }
.t1 .t1s-card__n {
	font-family: var(--t1-font-head); font-weight: 600; font-size: 2.75rem; line-height: 1;
	color: transparent; -webkit-text-stroke: 1.3px var(--t1-gold);
}
.t1 .t1s-card:hover .t1s-card__mark::after,
.t1 .t1s-card:focus-within .t1s-card__mark::after { clip-path: inset(0 0 0 0); }
.t1 .t1s-card:not(.t1s-card--link):hover { border-color: color-mix(in srgb, var(--t1-gold) 40%, var(--t1-line)); }
.t1 .t1s-card--link .t1-link { margin-top: auto; padding-top: 4px; align-self: flex-start; }
.t1 .t1s-card--link p { flex: none; }

/* Small facts as tags. */
.t1 .t1s-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.t1 .t1s-tags li {
	padding: 4px 11px; border-radius: 999px; font-size: .8125rem; font-weight: 600;
	background: var(--t1-bg-alt); color: var(--t1-ink); border: 1px solid var(--t1-line);
}
.t1 .t1-band--alt .t1s-tags li { background: var(--t1-surface); }
.t1 .t1s-card .t1s-tags li { background: var(--t1-bg-alt); }
.t1 .t1s-tags--lg li { padding: 6px 14px; font-size: .875rem; }

/* Gold ticks. */
.t1 .t1s-ticks { display: grid; gap: 9px; }
.t1 .t1s-ticks li { position: relative; padding-left: 26px; color: var(--t1-ink); font-size: .9688rem; line-height: 1.45; }
.t1 .t1s-ticks li::before {
	content: ""; position: absolute; left: 3px; top: .42em; width: 11px; height: 6px;
	border-left: 2px solid var(--t1-gold); border-bottom: 2px solid var(--t1-gold); transform: rotate(-45deg);
}

/* "Read more": the long copy stays in the page, folded. */
.t1 .t1s-more { margin-top: auto; }
.t1 .t1s-more summary {
	display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
	font-family: var(--t1-font-head); font-weight: 600; font-size: .9063rem; color: var(--t1-rose-text);
}
.t1 .t1s-more summary::-webkit-details-marker { display: none; }
.t1 .t1s-more summary::after {
	content: ""; width: 7px; height: 7px; margin-top: -4px;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg); transition: transform .3s var(--t1-ease), margin .3s var(--t1-ease);
}
.t1 .t1s-more[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.t1 .t1s-more summary:hover { text-decoration: underline; text-underline-offset: .2em; }
.t1 .t1s-more__body { padding-top: 12px; color: var(--t1-ink-2); font-size: .9688rem; line-height: 1.65; }
.t1 .t1s-more__body > * + * { margin-top: .8em; }
.t1 .t1s-more[open] .t1s-more__body { animation: t1-open .35s var(--t1-ease); }
.t1 .t1s-more--prose { margin-top: 1.6em; }
.t1 .t1s-more--prose .t1s-more__body { color: var(--t1-ink); font-size: inherit; line-height: inherit; }
.t1 .t1s-more--prose .t1s-more__body > * + * { margin-top: 1.1em; }

/* ── Staircase (Ontario's levels) ───────────────────────────────────────── */
.t1 .t1s-scale__list { display: grid; grid-template-columns: repeat(var(--t1s-n), minmax(0, 1fr)); gap: 14px; align-items: start; }
.t1 .t1s-scale__step { display: grid; gap: 10px; grid-template-rows: calc(64px + (var(--t1s-n) - 1) * 44px) auto auto; align-content: start; }
.t1 .t1s-scale__step .t1s-scale__bar { align-self: end; }
.t1 .t1s-scale__bar {
	display: flex; align-items: flex-start; justify-content: center; padding-top: 14px;
	height: calc(64px + var(--t1s-i) * 44px); border-radius: 14px 14px 4px 4px;
	background: linear-gradient(to top, var(--t1-rose-wash), color-mix(in srgb, var(--t1-rose) calc(12% + var(--t1s-i) * 14%), var(--t1-surface)));
	border: 1px solid var(--t1-line);
	transform-origin: bottom;
}
.t1 .t1s-scale__bar span { font-family: var(--t1-font-head); font-weight: 700; font-size: 1.375rem; color: var(--t1-ink); }
.t1 .t1s-scale__step:last-child .t1s-scale__bar { border-color: var(--t1-gold); box-shadow: 0 0 0 1px var(--t1-gold) inset; }
.t1 .t1s-scale__label { font-size: 1rem; font-weight: 600; }
.t1 .t1s-scale__step p { font-size: .875rem; color: var(--t1-ink-2); line-height: 1.5; }
.t1 .t1s-scale__after { margin-top: clamp(28px, 4vw, 48px); }
@media (max-width: 860px) {
	.t1 .t1s-scale__list { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 12px; }
	.t1 .t1s-scale__step { grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; row-gap: 2px; align-items: center; }
	.t1 .t1s-scale__step .t1s-scale__bar { grid-row: span 2; align-self: center; height: 52px; width: calc(48px + var(--t1s-i) * 16px); padding: 0; align-items: center; border-radius: 4px 14px 14px 4px; transform-origin: left; }
	.t1 .t1s-scale__bar span { font-size: 1.125rem; }
	.t1 .t1s-scale__label { align-self: end; }
	.t1 .t1s-scale__step p { align-self: start; }
}

/* ── Quote ──────────────────────────────────────────────────────────────── */
.t1 .t1s-quote__fig { display: grid; justify-items: center; gap: 22px; max-width: 880px; margin: 0 auto; text-align: center; }
.t1 .t1s-quote__mark {
	width: 64px; fill: none; stroke: var(--t1-gold); stroke-width: 2.4; stroke-linecap: round;
	stroke-dasharray: 1; stroke-dashoffset: 0;
}
.t1 .t1s-quote blockquote p {
	font-family: var(--t1-font-head); font-weight: 600; letter-spacing: -.02em; line-height: 1.3;
	font-size: clamp(1.375rem, 1rem + 1.6vw, 2.125rem); color: var(--t1-ink); text-wrap: balance;
}
.t1 .t1s-quote figcaption { font-weight: 600; color: var(--t1-ink-2); }

/* ── Story: text beside pictures ────────────────────────────────────────── */
.t1 .t1s-story__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.t1 .t1s-story--flip .t1s-story__text { order: 2; }
.t1 .t1s-story__text { display: grid; gap: 20px; justify-items: start; }
.t1 .t1s-story__text .t1-head { margin-bottom: 0; }
.t1 .t1s-story__body { display: grid; gap: .9em; color: var(--t1-ink-2); font-size: var(--t1-fs-lead); max-width: 56ch; }
.t1 .t1s-story__text .t1s-more { max-width: 60ch; }
.t1 .t1s-story__pics { position: relative; display: grid; gap: 16px; }
.t1 .t1s-pic { margin: 0; border-radius: var(--t1-radius-lg); overflow: hidden; box-shadow: var(--t1-shadow-lift); background: var(--t1-bg-alt); }
.t1 .t1s-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--t1-ease); }
.t1 .t1s-pic:hover img { transform: scale(1.04); }
.t1 .t1s-story__pics--1 .t1s-pic { aspect-ratio: 4 / 3; }
.t1 .t1s-story__pics--2 { grid-template-columns: 1fr 1fr; align-items: start; }
.t1 .t1s-story__pics--2 .t1s-pic { aspect-ratio: 3 / 4; }
.t1 .t1s-story__pics--2 .t1s-pic:nth-child(2) { margin-top: 48px; }
.t1 .t1s-story__pics--3 { grid-template-columns: 1.2fr 1fr; grid-template-rows: auto auto; }
.t1 .t1s-story__pics--3 .t1s-pic:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.t1 .t1s-story__pics--3 .t1s-pic:not(:first-child) { aspect-ratio: 3 / 4; }
@media (max-width: 860px) {
	.t1 .t1s-story__grid { grid-template-columns: minmax(0, 1fr); }
	.t1 .t1s-story--flip .t1s-story__text { order: 0; }
	.t1 .t1s-story__pics--2 .t1s-pic:nth-child(2) { margin-top: 28px; }
}

/* ── Tutor profile ──────────────────────────────────────────────────────── */
.t1 .t1s-profile__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.t1 .t1s-profile__media { position: relative; max-width: 420px; }
.t1 .t1s-profile__face { width: 100%; }
.t1 .t1s-profile__face .t1-face__media { aspect-ratio: 4 / 5; border-radius: var(--t1-radius-lg); box-shadow: var(--t1-shadow-lift); }
.t1 .t1s-profile__face .t1-face__play { opacity: 1; transform: none; width: 64px; height: 64px; }
.t1 .t1s-profile__photo { width: 100%; border-radius: var(--t1-radius-lg); box-shadow: var(--t1-shadow-lift); aspect-ratio: 4 / 5; object-fit: cover; }
.t1 .t1s-profile__photo--small {
	position: absolute; right: -28px; bottom: -28px; width: 46%; aspect-ratio: 1;
	border: 4px solid var(--t1-bg); border-radius: 50%;
}
.t1 .t1-band--alt .t1s-profile__photo--small { border-color: var(--t1-bg-alt); }
.t1 .t1s-profile__text { display: grid; gap: 18px; justify-items: start; }
.t1 .t1s-profile__text .t1-head { margin-bottom: 0; }
.t1 .t1s-profile__name { color: var(--t1-ink-2); font-weight: 500; }
.t1 .t1s-profile__name strong { color: var(--t1-ink); font-family: var(--t1-font-head); font-weight: 600; }
.t1 .t1s-profile__text .t1s-more { width: 100%; max-width: 64ch; }
@media (max-width: 860px) {
	.t1 .t1s-profile__grid { grid-template-columns: minmax(0, 1fr); }
	.t1 .t1s-profile__media { max-width: 300px; }
	.t1 .t1s-profile__photo--small { right: -16px; bottom: -16px; }
}

/* ── Ticked list beside a heading ───────────────────────────────────────── */
.t1 .t1s-checks__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.t1 .t1s-checks__grid .t1-head { margin-bottom: 0; }
.t1 .t1s-checks__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.t1 .t1s-checks__list li {
	display: flex; align-items: center; gap: 14px; padding: 16px 18px;
	border-radius: var(--t1-radius); background: var(--t1-surface); border: 1px solid var(--t1-line);
	font-family: var(--t1-font-head); font-weight: 600; font-size: .9688rem; line-height: 1.35;
}
.t1 .t1s-checks__list svg {
	flex: none; width: 30px; height: 30px; padding: 6px; border-radius: 50%;
	background: var(--t1-rose-wash); fill: none; stroke: var(--t1-rose-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.t1 .t1s-checks__text { margin-top: 24px; color: var(--t1-ink-2); display: grid; gap: .8em; }
@media (max-width: 860px) { .t1 .t1s-checks__grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Logos ──────────────────────────────────────────────────────────────── */
.t1 .t1s-logos__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.t1 .t1s-logos__list li {
	display: grid; place-items: center; height: 104px; padding: 18px 22px; overflow: hidden;
	border-radius: var(--t1-radius); background: #fff; border: 1px solid var(--t1-line);
	transition: transform .4s var(--t1-ease), box-shadow .4s var(--t1-ease);
}
.t1 .t1s-logos__list li:hover { transform: translateY(-4px); box-shadow: var(--t1-shadow); }
.t1 .t1s-logos__list img { max-height: 60px; width: auto; object-fit: contain; filter: grayscale(1); opacity: .85; transition: filter .4s, opacity .4s; }
.t1 .t1s-logos__list li:hover img { filter: none; opacity: 1; }
/* Some logo files carry wide blank margins: "--t1s-z" zooms the mark to match the rest (the tile clips the margin). */
.t1 .t1s-logos__list img { transform: scale(var(--t1s-z, 1)); }

/* ── Places ─────────────────────────────────────────────────────────────── */
.t1 .t1s-places__cities { margin-bottom: 22px; }
.t1 .t1s-places__more summary { font-size: 1rem; }
.t1 .t1s-places__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 24px; margin-top: 18px; }
.t1 .t1s-places__list a { display: block; padding: 6px 0; font-size: .9063rem; color: var(--t1-ink-2); border-bottom: 1px solid var(--t1-line); }
.t1 .t1s-places__list a:hover { color: var(--t1-rose-text); border-color: var(--t1-rose); }

/* ── Prose section ──────────────────────────────────────────────────────── */
.t1 .t1s-prose .t1-head { max-width: 72ch; }
.t1 .t1s-prose .t1-prose > :first-child { margin-top: 0; }

/* ── Search (hub) ───────────────────────────────────────────────────────── */
.t1 .t1s-search { display: flex; gap: 8px; width: min(100%, 520px); padding: 6px; border-radius: 999px; background: var(--t1-surface); border: 1px solid var(--t1-line); box-shadow: var(--t1-shadow); }
.t1 .t1s-search input {
	flex: 1; min-width: 0; border: 0; background: transparent; color: var(--t1-ink);
	font: inherit; font-size: 1rem; padding: 10px 16px; border-radius: 999px;
}
.t1 .t1s-search input:focus { outline: none; }
.t1 .t1s-search:focus-within { border-color: var(--t1-rose); }
.t1 .t1s-search input::placeholder { color: var(--t1-ink-2); opacity: .8; }
.t1 .t1s-search .t1-btn { min-height: 44px; padding: 10px 20px; }

/* ── Motion ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
	/* The badge draws its icon, then floats. */
	.t1 .t1s-badge { animation: t1-rise .9s .35s var(--t1-ease) both, t1s-float 7s 1.3s ease-in-out infinite; }
	.t1 .t1s-badge__icon * { stroke-dasharray: 200; stroke-dashoffset: 200; animation: t1-draw 1.8s .6s var(--t1-ease) forwards; }

	/* The staircase grows from the floor. */
	.t1-js .t1 .t1s-scale__step .t1s-scale__bar { transform: scaleY(.2); transition: transform 1s var(--t1-ease); transition-delay: calc(var(--t1s-i) * 110ms); }
	.t1-js .t1 .t1s-scale__step.is-in .t1s-scale__bar { transform: none; }
	@media (max-width: 860px) { .t1-js .t1 .t1s-scale__step .t1s-scale__bar { transform: scaleX(.3); } }

	/* The quote marks draw themselves. */
	.t1-js .t1 .t1s-quote__mark { stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--t1-ease) .2s; }
	.t1-js .t1 .t1s-quote__fig.is-in .t1s-quote__mark { stroke-dashoffset: 0; }

	/* Pictures slide in on the slant. */
	.t1-js .t1 .t1s-pic[data-reveal] { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); transition: clip-path 1.1s var(--t1-ease), opacity .8s var(--t1-ease), transform .8s var(--t1-ease); transition-delay: calc(var(--t1s-i, 0) * 120ms); }
	.t1-js .t1 .t1s-pic[data-reveal].is-in { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}
@keyframes t1s-float { 50% { transform: translateY(-8px); } }
.t1 .t1s-stats.t1-band--rise { padding-top: calc(clamp(36px, 4vw, 56px) + var(--t1-slant)); }

/* ── Hub: find a center, topics A–Z ─────────────────────────────────────── */
.t1 .t1s-find .t1-head { margin-bottom: 24px; }
.t1 .t1s-find__cities { margin-top: 24px; }
.t1 .t1s-az__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 32px; }
.t1 .t1s-az__group { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; padding-top: 18px; border-top: 1px solid var(--t1-line); }
.t1 .t1s-az__letter {
	font-family: var(--t1-font-head); font-weight: 600; font-size: 2.25rem; line-height: 1;
	color: transparent; -webkit-text-stroke: 1.2px var(--t1-gold);
}
.t1 .t1s-az .t1-pills { gap: 8px; }
/* Icons, outline marks and numbers share one height, so card titles line up. */
.t1 .t1s-card__icon { width: auto; height: 52px; }
.t1 .t1s-card__mark, .t1 .t1s-card__n { height: 56px; line-height: 56px; }
