/*
 * 33Science Resources hub. Scoped under body.s33r-page .s33r; classes use the s33r- prefix.
 *
 * Every rule is prefixed `body.s33r-page` and reaches (0,4,0) or deeper:
 * ruki-child styles `.t33-page-main .entry-content a` and `h1..h6` at (0,3,1),
 * which would otherwise render the card text in the theme's link colour.
 * The shell's lift is `body.s33r-page .t33-page-main .entry-content > .s33r:first-child`
 * at (0,5,1); anything that must override it has to match that selector.
 * No url() anywhere: Autoptimize aggregates this file, where relative paths break.
 * The generated shell block at the end of this file is owned by _shared/sync-shell.js.
 */

.s33r {
	box-sizing: border-box;
	margin: 0 0 2em;
	max-width: 100%;
}

.s33r *,
.s33r *::before,
.s33r *::after { box-sizing: border-box; }

/* The shell lifts the root over the hero band, so it needs a panel of its own. */
body.s33r-page .t33-page-main .entry-content > .s33r:first-child {
	background: var(--t33-paper, #fff);
	border-radius: var(--t33-radius, 14px);
	padding: 22px;
}

body.s33r-page .entry-content .s33r ul,
body.s33r-page .entry-content .s33r li,
body.s33r-page .entry-content .s33r p { margin: 0; padding: 0; list-style: none; }

body.s33r-page .entry-content .s33r .s33r-sr {
	clip: rect(0 0 0 0);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

body.s33r-page .entry-content .s33r a:focus-visible {
	outline: 3px solid var(--t33-cyan, #2bc8e8);
	outline-offset: 3px;
}

/* ------------------------------------------------------------- grid */

body.s33r-page .entry-content .s33r .s33r-grid {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

body.s33r-page .entry-content .s33r .s33r-item { display: flex; min-width: 0; }

body.s33r-page .entry-content .s33r .s33r-card {
	background: var(--t33-paper, #fff);
	border: 1px solid #e3e7ef;
	border-radius: var(--t33-radius, 14px);
	box-shadow: var(--t33-shadow, 0 10px 30px rgba(7, 11, 26, 0.10));
	column-gap: 18px;
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	min-width: 0;
	padding: 16px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	width: 100%;
}

body.s33r-page .entry-content .s33r .s33r-card:hover {
	box-shadow: var(--t33-shadow-lift, 0 18px 44px rgba(7, 11, 26, 0.16));
	transform: translateY(-2px);
}

body.s33r-page .entry-content .s33r .s33r-thumb {
	align-self: start;
	display: block;
}

body.s33r-page .entry-content .s33r .s33r-thumb img {
	background: #f3f4f5;
	border-radius: 4px;
	box-shadow: 0 1px 2px rgba(7, 11, 26, 0.18), 0 6px 14px rgba(7, 11, 26, 0.14);
	display: block;
	height: auto;
	margin: 0;
	max-width: 100%;
	width: 100%;
}

body.s33r-page .entry-content .s33r .s33r-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

body.s33r-page .entry-content .s33r .s33r-title {
	color: var(--t33-ink, #1b2233);
	font-size: 1.22rem;
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 8px;
	padding: 0;
}

body.s33r-page .entry-content .s33r a.s33r-title-link {
	color: var(--t33-ink, #1b2233);
	text-decoration: none;
}

body.s33r-page .entry-content .s33r a.s33r-title-link:hover { text-decoration: underline; }

body.s33r-page .entry-content .s33r .s33r-line {
	color: var(--t33-ink-soft, #5a6378);
	font-size: 0.95rem;
	line-height: 1.5;
	margin: 0 0 8px;
}

body.s33r-page .entry-content .s33r .s33r-meta {
	color: var(--t33-ink, #1b2233);
	font-size: 0.82rem;
	font-weight: 700;
	margin: 0 0 14px;
}

body.s33r-page .entry-content .s33r .s33r-actions { margin-top: auto; }

body.s33r-page .entry-content .s33r a.s33r-btn {
	background: #0d1530;
	border: 2px solid #0d1530;
	border-radius: 10px;
	color: #fff;
	display: inline-block;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
	min-height: 44px;
	padding: 11px 20px;
	text-align: center;
	text-decoration: none;
}

body.s33r-page .entry-content .s33r a.s33r-btn:hover {
	background: #1b2a5c;
	border-color: #1b2a5c;
	color: #fff;
}

@media (max-width: 600px) {
	body.s33r-page .t33-page-main .entry-content > .s33r:first-child { padding: 14px; }

	body.s33r-page .entry-content .s33r .s33r-card {
		column-gap: 14px;
		grid-template-columns: 96px minmax(0, 1fr);
		padding: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.s33r-page .entry-content .s33r .s33r-card { transition: none; }
	body.s33r-page .entry-content .s33r .s33r-card:hover { transform: none; }
}

/* >>> t33 tool-page shell v1 (generated - edit _shared/toolpage-shell.css) */

/*
 * Makes the lift the card's own. Without a block formatting context the card's
 * negative margin collapses out through `.entry-content`, `article` and
 * `.t33-page-main` -- none of which has top padding -- and lands on `.wrap`,
 * moving the entire column instead of the one element. Measured on the live
 * page before this line existed: `.wrap` top and card top were both 300px, so
 * the declared -72px was in effect on the wrong element and no gate could see
 * the difference.
 */
body.s33r-page .t33-page-main .entry-content {
	display: flow-root;
}

/*
 * The prose measure. Enumerated by tag rather than written as
 * `> *:not(.s33r)`, which is what the word search shipped first: a
 * :not() selector also narrows MEDIAVINE'S INJECTED CONTAINERS to 760px,
 * quietly shrinking every in-content unit on the page. Ad units, the tool and
 * the tool strip are divs and navs, so enumerating prose tags leaves them at
 * full column width.
 *
 * `:is()` takes the specificity of its heaviest argument -- a type selector,
 * (0,0,1) -- so this lands at (0,3,2) and beats ruki-child's (0,3,1).
 */
body.s33r-page .t33-page-main .entry-content > :is(p, h2, h3, h4, h5, h6, ul, ol, dl, blockquote, figure, pre) {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

/*
 * Room for the card to land in. The theme ships `padding: 170px 0 90px`; the
 * extra bottom padding here is spent by the lift below, so the title keeps the
 * breathing room it has today and the tool does not move down the page.
 */
body.s33r-page .t33-page-hero {
	padding-bottom: 132px;
}

/*
 * The lift. Mirrors `.t33-article-media`, which is what the theme already does
 * with a featured image on every other page of the site.
 *
 * The hero is a sibling of `.wrap`, not an ancestor, so its `overflow: hidden`
 * cannot clip this; and it carries no `z-index`, so `z-index: 5` here paints
 * over it. Both of those are the theme's own assumptions -- `.t33-article-media`
 * relies on exactly the same two facts.
 *
 * The ring in the first shadow is load-bearing, not decoration. The word
 * search board's background is #070b1a, byte-identical to the band's bottom
 * gradient stop (--t33-navy-1), so without a hairline the lifted panel would
 * dissolve into the band instead of sitting on it.
 *
 * `border-radius` is deliberately NOT set: each tool keeps its own (18px for
 * the board, 10px for the drill card), and the word search flattens it to 0
 * when the board goes full-bleed on a phone.
 *
 * `:first-child` is a safety catch, not tidiness. If Journey ever inserts a
 * unit at the very top of `.entry-content`, the tool stops being the first
 * child and the lift drops -- which is the right failure. Without it the tool
 * would keep its -72px and ride up over the ad unit.
 */
body.s33r-page .t33-page-main .entry-content > .s33r:first-child {
	position: relative;
	z-index: 5;
	margin-top: -72px;
	box-shadow:
		0 0 0 1px rgba(232, 238, 252, 0.18),
		0 26px 60px rgba(7, 11, 26, 0.45);
}

/*
 * The first paragraph after the tool carries the page. It is still a top-level
 * child of `.entry-content` -- only its type scale changed.
 */
body.s33r-page .t33-page-main .entry-content > .s33r + p {
	font-size: 1.18rem;
	line-height: 1.7;
	color: var(--t33-ink-soft, #5a6378);
}

/*
 * Section headings get an accent marker instead of being a bare bold line.
 * `::before` is used rather than a wrapper element precisely because a wrapper
 * would swallow an ad slot.
 */
body.s33r-page .t33-page-main .entry-content > h2 {
	position: relative;
	padding-top: 22px;
	margin-top: 2.4em;
}

body.s33r-page .t33-page-main .entry-content > h2::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 54px;
	height: 4px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--t33-cyan, #2bc8e8), var(--t33-coral, #f67280));
}

/*
 * FAQ pairs, styled through an adjacent-sibling selector. A `<details>` or a
 * wrapper would read better in isolation and cost an ad slot per question.
 */
body.s33r-page .t33-page-main .entry-content > h3 {
	margin-top: 1.8em;
	font-size: 1.22rem;
}

body.s33r-page .t33-page-main .entry-content > h3 + p {
	border-left: 3px solid rgba(43, 200, 232, 0.35);
	padding-left: 16px;
	color: var(--t33-ink-soft, #5a6378);
}

/*
 * Opt-in callout, applied to a top-level <p> in the content/*.html articles.
 * content-check.js balances tags and never inspects attributes, so adding a
 * class to those files is safe.
 */
body.s33r-page .t33-page-main .entry-content > p.t33-callout {
	background: var(--t33-paper-soft, #fff7f3);
	border-left: 4px solid var(--t33-coral, #f67280);
	border-radius: 0 var(--t33-radius, 14px) var(--t33-radius, 14px) 0;
	padding: 18px 22px;
	font-size: 1.02rem;
}

body.s33r-page .t33-page-main .entry-content > ul > li::marker,
body.s33r-page .t33-page-main .entry-content > ol > li::marker {
	color: var(--t33-cyan, #2bc8e8);
}

/* -------------------------------------------------- more science tools --- */

/*
 * Appended by a `the_content` filter, so it is a top-level child of
 * `.entry-content` like any other -- it ADDS an ad boundary rather than
 * removing one, and it reaches pages that do not exist yet.
 */
body.s33r-page .t33-page-main .entry-content > .t33-toolstrip {
	margin-top: 3em;
	padding-top: 1.6em;
	border-top: 1px solid #e3e7ef;
}

body.s33r-page .entry-content .t33-toolstrip-title {
	margin: 0 0 1em;
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--t33-ink-soft, #5a6378);
}

body.s33r-page .entry-content .t33-toolstrip-list {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

body.s33r-page .entry-content .t33-toolstrip-list li {
	margin: 0;
}

body.s33r-page .entry-content .t33-toolstrip-card {
	display: block;
	height: 100%;
	padding: 16px 18px;
	background: var(--t33-paper, #fff);
	border: 1px solid #e3e7ef;
	border-radius: var(--t33-radius, 14px);
	box-shadow: var(--t33-shadow, 0 10px 30px rgba(7, 11, 26, 0.10));
	color: var(--t33-ink, #1b2233);
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.s33r-page .entry-content .t33-toolstrip-card:hover {
	color: var(--t33-ink, #1b2233);
	transform: translateY(-2px);
	box-shadow: var(--t33-shadow-lift, 0 18px 44px rgba(7, 11, 26, 0.16));
}

body.s33r-page .entry-content .t33-toolstrip-name {
	display: block;
	font-weight: 800;
	font-size: 1.02rem;
	margin-bottom: 4px;
}

body.s33r-page .entry-content .t33-toolstrip-what {
	display: block;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--t33-ink-soft, #5a6378);
}

/* ------------------------------------------------------------- phone ---- */

/* 600px is the theme's own hero breakpoint, not a new one. */
@media (max-width: 600px) {

	/*
	 * The phone gutter, reclaimed. The theme gutters this column twice -- the
	 * parent theme's bare `.entry-content { padding: 0 30px }` plus
	 * `.t33-page-main`'s own 18px -- so on a 390px phone the tool had 314px to
	 * work with and lost 76px, a fifth of the screen, to empty margin. Measured,
	 * not guessed.
	 *
	 * 12px rather than 0: the prose inside this column still needs an edge, and
	 * every tool card carries its own padding on top of this. Ad containers are
	 * children of `.entry-content` too, so they get the width back as well.
	 */
	body.s33r-page .t33-page-main {
		padding-left: 8px;
		padding-right: 8px;
	}

	body.s33r-page .t33-page-main .entry-content {
		padding-left: 12px;
		padding-right: 12px;
	}

	body.s33r-page .t33-page-hero {
		padding-bottom: 88px;
	}

	body.s33r-page .t33-page-main .entry-content > .s33r:first-child {
		margin-top: -44px;
	}

	body.s33r-page .t33-page-main .entry-content > .s33r + p {
		font-size: 1.1rem;
	}
}

@media (prefers-reduced-motion: reduce) {

	body.s33r-page .entry-content .t33-toolstrip-card {
		transition: none;
	}

	body.s33r-page .entry-content .t33-toolstrip-card:hover {
		transform: none;
	}
}

/* <<< t33 tool-page shell */
