/*
Theme Name: TeachCraft Blog
Theme URI: https://blog.teachcraft.io
Author: TeachCraft
Author URI: https://teachcraft.io
Description: The Inside TeachCraft blog template, built from the TeachCraft design system. A wide-container editorial layout with a night-sky featured hero, card grids, a sticky in-article table of contents and a community CTA band.
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: teachcraft-blog
Tags: blog, full-site-editing, block-patterns, custom-colors, custom-logo, editor-style, featured-images, wide-blocks, one-column, two-columns, news
*/

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

/* ---------------------------------------------------------------------------
   Design system tokens (mirrors _ds/teachcraft-design-system tokens/*.css)
   theme.json owns the WordPress presets; these carry the rest.
--------------------------------------------------------------------------- */
:root {
	--tc-container: 1200px;
	--tc-narrow: 820px;
	--tc-mid: 1120px;
	--tc-gutter: 24px;
	--tc-header-h: 76px;

	--surface-page: var(--wp--preset--color--paper);
	--surface-card: var(--wp--preset--color--card);
	--surface-sunken: var(--wp--preset--color--sunken);
	--text-primary: var(--wp--preset--color--ink);
	--text-secondary: var(--wp--preset--color--secondary);
	--text-muted: var(--wp--preset--color--muted);
	--border-default: var(--wp--preset--color--border);
	--border-strong: var(--wp--preset--color--border-strong);

	--radius-sm: 6px;
	--radius-md: 8px;
	--radius-lg: 12px;
	--radius-xl: 20px;
	--radius-pill: 999px;

	--shadow-sm: 0 1px 2px rgba(23, 31, 32, 0.06);
	--shadow-md: 0 4px 12px rgba(23, 31, 32, 0.08);
	--shadow-lg: 0 12px 32px rgba(23, 31, 32, 0.12);
	--shadow-focus: 0 0 0 3px rgba(63, 93, 249, 0.25);
}

* { box-sizing: border-box; }

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Shared width containers ------------------------------------------------ */
.tc-container > :where(:not(.alignfull)),
.tc-container { }

.tc-wrap {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding-inline: var(--tc-gutter);
}

.tc-wrap--narrow { max-width: var(--tc-narrow); }
.tc-wrap--mid { max-width: var(--tc-mid); }

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
.tc-header {
	background: var(--surface-card);
	border-bottom: 1px solid var(--border-default);
}

.tc-header__inner {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding-inline: var(--tc-gutter);
	min-height: var(--tc-header-h);
	gap: var(--wp--preset--spacing--50);
}

.tc-header .wp-block-site-logo img {
	height: 30px;
	width: auto;
	display: block;
}

.tc-header .wp-block-navigation {
	min-width: 0;
	flex-wrap: nowrap;
	white-space: nowrap;
	overflow: hidden;
}

.tc-header .wp-block-navigation .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	font-weight: 500;
	color: var(--text-primary);
	padding: 8px 12px;
	border-radius: var(--radius-md);
	text-decoration: none;
	transition: background-color 120ms ease;
}

.tc-header .wp-block-navigation .wp-block-navigation-item__content:hover {
	background: var(--surface-sunken);
	color: var(--text-primary);
	text-decoration: none;
}

.tc-header__actions {
	margin-inline-start: auto;
	flex-shrink: 0;
	white-space: nowrap;
}

/* Icon-only search toggle */
.tc-header .wp-block-search__button,
.tc-icon-button {
	width: 40px;
	height: 40px;
	border: none;
	background: transparent;
	border-radius: var(--radius-md);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}

.tc-header .wp-block-search__button:hover,
.tc-icon-button:hover { background: var(--surface-sunken); }

.tc-header .wp-block-search__input {
	border: 1.5px solid var(--text-primary);
	border-radius: var(--radius-md);
	height: 40px;
	padding: 0 12px;
	font-size: 15px;
	background: var(--surface-card);
}

/* ---------------------------------------------------------------------------
   Night-sky hero (home featured post, 404)
--------------------------------------------------------------------------- */
.tc-hero-night {
	/*
	 * The design layers a photographic night sky over a navy base. Set
	 * --tc-hero-night-image to a url() to switch the photo on; the gradient
	 * stays underneath as the fallback if the image is missing or still
	 * loading, so the hero is never unstyled. See README.md.
	 */
	--tc-hero-night-image: none;

	background-color: #0c1f4d;
	background-image:
		var(--tc-hero-night-image),
		linear-gradient(180deg, #050b24 0%, #0c1f4d 45%, #1c4a86 80%, #2f6ea8 100%);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	color: var(--wp--preset--color--paper);
}

.tc-hero-night :where(h1, h2, h3, p, span, cite, .wp-block-post-title, .wp-block-post-title a) {
	color: var(--wp--preset--color--paper);
}

.tc-hero-night .tc-eyebrow { color: var(--wp--preset--color--sunny); }
.tc-hero-night .tc-hero__excerpt,
.tc-hero-night .wp-block-post-excerpt__excerpt { color: #DCE3F5; }
.tc-hero-night .tc-meta,
.tc-hero-night .wp-block-post-author,
.tc-hero-night .wp-block-post-date,
.tc-hero-night .wp-block-post-date a { color: #C9D3EE; }
.tc-hero-night .wp-block-post-author__name { color: var(--wp--preset--color--paper); font-weight: 500; }

.tc-hero__inner {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding: 80px var(--tc-gutter);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: 48px;
	align-items: center;
}

.tc-hero__title,
.tc-hero .wp-block-post-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: clamp(36px, 5vw, 56px);
	line-height: 1.12;
	text-wrap: pretty;
}

.tc-hero__media .wp-block-post-featured-image,
.tc-hero__media .wp-block-post-featured-image img {
	border-radius: 16px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	margin: 0;
}

.tc-hero__media .wp-block-post-featured-image {
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 12px, rgba(255, 255, 255, 0.03) 12px 24px);
}

/* Cloud-gradient hero (category archive) */
.tc-hero-cloud {
	background: linear-gradient(180deg, #C4E6ED 0%, #F0FCF7 100%);
	border-bottom: 1px solid var(--border-default);
}

.tc-hero-cloud .tc-eyebrow { color: var(--wp--preset--color--cobalt); }

/* ---------------------------------------------------------------------------
   Shared editorial atoms
--------------------------------------------------------------------------- */
.tc-eyebrow {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.4;
	margin: 0;
}

.tc-meta,
.tc-meta * {
	font-size: 13px;
	line-height: 1.5;
	color: var(--text-muted);
}

.tc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-meta .wp-block-post-date a { color: inherit; text-decoration: none; }
.tc-meta .wp-block-post-date a:hover { text-decoration: underline; }

.tc-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
}

.tc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Category pill row */
.tc-pills { gap: 8px; flex-wrap: wrap; }

.tc-pills .wp-block-categories,
.tc-pills ul {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tc-pills li a,
.tc-pill {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 16px;
	border-radius: var(--radius-pill);
	border: 1px solid var(--border-strong);
	background: var(--surface-card);
	color: var(--text-primary);
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.tc-pills li a:hover,
.tc-pill:hover {
	background: var(--surface-sunken);
	color: var(--text-primary);
	text-decoration: none;
}

.tc-pill--solid,
.tc-pills li.current-cat a {
	background: var(--text-primary);
	border-color: var(--text-primary);
	color: var(--wp--preset--color--paper);
}

.tc-pill--solid:hover { background: #000; color: var(--wp--preset--color--paper); }

/* Pills on a dark surface (404) */
.tc-hero-night .tc-pill {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.4);
	color: var(--wp--preset--color--paper);
}

.tc-hero-night .tc-pill:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------------------------------------------------------------------------
   Card grid (home latest, author posts, related)
--------------------------------------------------------------------------- */
.tc-card-grid .wp-block-post-template,
.tc-card-grid.wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 32px 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/*
 * WordPress applies the theme's blockGap as a top margin to every
 * post-template item after the first. Inside a grid, or a flex column whose
 * spacing already comes from `gap`, that margin pushes the item down within
 * its row: the tallest card defines the row, the rest sink 24px and their
 * images stop lining up. Spacing here comes from `gap` alone.
 */
.tc-card-grid .wp-block-post-template > li,
.tc-card-grid.wp-block-post-template > li,
.tc-rows .wp-block-post-template > li,
.tc-rows.wp-block-post-template > li {
	margin: 0;
}

.tc-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	height: 100%;
}

.tc-card .wp-block-post-featured-image {
	margin: 0;
	border-radius: var(--radius-lg);
	border: 1px solid var(--border-default);
	overflow: hidden;
	background: var(--wp--preset--color--cloud-haze);
}

.tc-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	width: 100%;
	display: block;
	transition: transform 300ms ease;
}

.tc-card:hover .wp-block-post-featured-image img { transform: scale(1.02); }

.tc-card__body { display: flex; flex-direction: column; gap: 8px; }

.tc-card .wp-block-post-terms,
.tc-card .tc-eyebrow {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4;
	color: var(--wp--preset--color--cobalt);
}

.tc-card .wp-block-post-terms a { color: var(--wp--preset--color--cobalt); text-decoration: none; }

.tc-card .wp-block-post-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 21px;
	line-height: 28px;
	text-wrap: pretty;
}

.tc-card .wp-block-post-title a { color: var(--text-primary); text-decoration: none; }
.tc-card .wp-block-post-title a:hover { color: var(--wp--preset--color--cobalt); text-decoration: none; }

.tc-card .wp-block-post-excerpt {
	margin: 0;
	font-size: 15px;
	line-height: 24px;
	color: var(--text-secondary);
	text-wrap: pretty;
}

.tc-card .wp-block-post-excerpt__more-text { margin-top: 8px; }

.tc-card .wp-block-post-excerpt__more-link {
	font-size: 14px;
	font-weight: 600;
	color: var(--wp--preset--color--cobalt);
}

/* Boxed card variant (Related posts) */
.tc-card--boxed {
	background: var(--surface-card);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	padding: 12px 12px 20px;
	gap: 12px;
}

.tc-card--boxed .wp-block-post-featured-image { border-radius: var(--radius-md); border: none; }
.tc-card--boxed .wp-block-post-featured-image img { aspect-ratio: 16 / 9; }
.tc-card--boxed .tc-card__body { padding: 0 4px; gap: 6px; }
.tc-card--boxed .wp-block-post-title { font-size: 19px; line-height: 26px; }

/* ---------------------------------------------------------------------------
   Archive rows (category, author list, search results)
--------------------------------------------------------------------------- */
.tc-rows .wp-block-post-template,
.tc-rows.wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tc-row {
	display: grid;
	grid-template-columns: minmax(0, 360px) minmax(0, 2fr);
	gap: 28px;
	padding: 28px 0;
	border-bottom: 1px solid var(--border-default);
	align-items: center;
}

.tc-row .wp-block-post-featured-image {
	margin: 0;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: var(--wp--preset--color--cloud-haze);
	max-width: 360px;
}

.tc-row .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	width: 100%;
	display: block;
}

.tc-row__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.tc-row .wp-block-post-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 26px;
	line-height: 34px;
	text-wrap: pretty;
}

.tc-row .wp-block-post-title a { color: var(--text-primary); text-decoration: none; }
.tc-row .wp-block-post-title a:hover { color: var(--wp--preset--color--cobalt); }

.tc-row .wp-block-post-excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 26px;
	color: var(--text-secondary);
	text-wrap: pretty;
}

/* Compact rows (search results: no thumbnail) */
.tc-rows--compact .tc-row {
	grid-template-columns: 1fr;
	gap: 8px;
	padding: 24px 0;
}

.tc-rows--compact .tc-row .wp-block-post-title { font-size: 22px; line-height: 30px; }

.tc-rows--compact .tc-row .wp-block-post-excerpt {
	font-size: 15px;
	line-height: 24px;
}

@media (max-width: 781px) {
	.tc-row { grid-template-columns: 1fr; gap: 16px; }
	.tc-row .wp-block-post-featured-image { max-width: none; }
}

/* ---------------------------------------------------------------------------
   Single post
--------------------------------------------------------------------------- */
.tc-single-header {
	max-width: var(--tc-narrow);
	margin-inline: auto;
	padding: 56px var(--tc-gutter) 32px;
}

.tc-breadcrumb {
	display: flex;
	gap: 8px;
	font-size: 14px;
	color: var(--text-muted);
	flex-wrap: wrap;
	margin: 0;
}

.tc-breadcrumb a { color: var(--wp--preset--color--cobalt); text-decoration: none; }

.tc-single-header .wp-block-post-title {
	margin: 0;
	font-size: clamp(34px, 5vw, 54px);
	line-height: 1.12;
	text-wrap: pretty;
}

.tc-deck,
.tc-single-header .wp-block-post-excerpt {
	margin: 0;
	font-size: 20px;
	line-height: 30px;
	color: var(--text-secondary);
	text-wrap: pretty;
}

.tc-byline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 12px;
	border-top: 1px solid var(--border-default);
	flex-wrap: wrap;
}

.tc-byline .wp-block-post-author {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	color: var(--text-secondary);
}

.tc-byline .wp-block-post-author__avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
}

.tc-byline .wp-block-post-author__name,
.tc-byline .wp-block-post-author__name a {
	color: var(--text-primary);
	font-weight: 600;
	text-decoration: none;
}

.tc-byline .wp-block-post-date,
.tc-byline .wp-block-post-date a {
	font-size: 14px;
	color: var(--text-secondary);
	text-decoration: none;
}

/* Full-width featured image band */
.tc-single-figure {
	max-width: var(--tc-mid);
	margin-inline: auto;
	padding-inline: var(--tc-gutter);
}

.tc-single-figure .wp-block-post-featured-image {
	margin: 0;
	border-radius: 16px;
	overflow: hidden;
	background: var(--wp--preset--color--cloud-haze);
}

.tc-single-figure .wp-block-post-featured-image img {
	aspect-ratio: 21 / 9;
	object-fit: cover;
	width: 100%;
	display: block;
}

/* Article body + sticky table of contents */
.tc-single-main {
	max-width: var(--tc-mid);
	margin-inline: auto;
	padding: 56px var(--tc-gutter);
	display: flex;
	flex-wrap: wrap;
	gap: 48px;
	align-items: flex-start;
}

.tc-toc {
	position: sticky;
	top: 64px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 0 0 220px;
}

.tc-toc__label {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 14px;
	color: var(--text-muted);
	margin: 0;
}

.tc-toc__list {
	display: flex;
	flex-direction: column;
	border-left: 1px solid var(--border-default);
	margin: 0;
	padding: 0;
	list-style: none;
}

.tc-toc__list a {
	display: block;
	padding: 6px 0 6px 15px;
	font-size: 14px;
	line-height: 20px;
	color: var(--text-secondary);
	text-decoration: none;
}

.tc-toc__list a:hover { color: var(--text-primary); text-decoration: none; }

.tc-toc__list a.is-active {
	padding-left: 14px;
	margin-left: -1px;
	border-left: 2px solid var(--wp--preset--color--cobalt);
	font-weight: 600;
	color: var(--wp--preset--color--cobalt);
}

.tc-toc:empty,
.tc-toc[hidden] { display: none; }

.tc-article {
	flex: 1 1 480px;
	min-width: 0;
	max-width: 700px;
}

.tc-article .wp-block-post-content > * { margin-block: 24px; }
.tc-article .wp-block-post-content > *:first-child { margin-block-start: 0; }

.tc-article .wp-block-post-content p {
	font-size: 18px;
	line-height: 30px;
	text-wrap: pretty;
}

.tc-article .wp-block-post-content h2 {
	font-size: 28px;
	line-height: 36px;
	margin-block: 40px 0;
	scroll-margin-top: 96px;
}

.tc-article .wp-block-post-content h3 {
	font-size: 21px;
	line-height: 28px;
	margin-block: 32px 0;
	scroll-margin-top: 96px;
}

.tc-article .wp-block-post-content img,
.tc-article .wp-block-post-content .wp-block-image img { border-radius: var(--radius-lg); }

/* Pull quote styling from the design */
.tc-article blockquote,
.tc-article .wp-block-quote {
	margin: 40px 0;
	padding: 0;
	border: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tc-article .wp-block-quote::before {
	content: "";
	display: block;
	width: 48px;
	height: 4px;
	border-radius: 2px;
	background: var(--wp--preset--color--cobalt);
}

.tc-article .wp-block-quote p {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: 30px;
	line-height: 40px;
	color: var(--wp--preset--color--night-navy);
	text-wrap: pretty;
}

.tc-article .wp-block-quote cite {
	font-style: normal;
	font-size: 15px;
	color: var(--text-secondary);
	font-weight: 400;
}

/* Share row */
.tc-share {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 24px;
	margin-top: 8px;
	border-top: 1px solid var(--border-default);
	flex-wrap: wrap;
}

.tc-share__label { font-size: 14px; font-weight: 600; margin: 0; }

.tc-share .wp-block-social-links .wp-social-link {
	width: 36px;
	height: 36px;
	border: 1px solid var(--border-default);
	background: var(--surface-card);
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
}

.tc-share .wp-block-social-links .wp-social-link:hover { background: var(--surface-sunken); }
.tc-share .wp-block-social-links .wp-social-link a { color: var(--text-primary); padding: 0; }
.tc-share .wp-block-social-links .wp-social-link svg { width: 16px; height: 16px; }

@media (max-width: 1023px) {
	.tc-toc { flex: 0 0 180px; top: 32px; }
}

@media (max-width: 781px) {
	.tc-single-main { flex-direction: column; gap: 32px; padding-block: 32px; }
	.tc-toc { position: static; flex: 1 1 auto; width: 100%; order: -1; }
	.tc-article { max-width: none; }
}

/* ---------------------------------------------------------------------------
   Related posts band
--------------------------------------------------------------------------- */
.tc-related {
	background: var(--surface-sunken);
	border-top: 1px solid var(--border-default);
}

.tc-related__inner {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding: 56px var(--tc-gutter);
}

.tc-section-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 28px;
	line-height: 36px;
}

/* ---------------------------------------------------------------------------
   Author header
--------------------------------------------------------------------------- */
.tc-author-header { border-bottom: 1px solid var(--border-default); }

.tc-author-header__inner {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding: 64px var(--tc-gutter) 48px;
	display: flex;
	gap: 32px;
	align-items: center;
	flex-wrap: wrap;
}

.tc-author-header .wp-block-avatar img {
	width: 128px;
	height: 128px;
	border-radius: 50%;
	display: block;
}

.tc-author-header__body {
	flex: 1;
	min-width: 280px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tc-author-header .wp-block-post-author-name {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 48px;
	line-height: 1.1;
}

.tc-author-header .wp-block-post-author-biography {
	margin: 0;
	font-size: 17px;
	line-height: 28px;
	color: var(--text-secondary);
	max-width: 640px;
	text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   Search header
--------------------------------------------------------------------------- */
.tc-search-header {
	background: var(--surface-sunken);
	border-bottom: 1px solid var(--border-default);
}

.tc-search-header__inner {
	max-width: var(--tc-narrow);
	margin-inline: auto;
	padding: 56px var(--tc-gutter) 40px;
}

.tc-searchbox .wp-block-search__inside-wrapper {
	border: 1.5px solid var(--text-primary);
	border-radius: var(--radius-md);
	background: var(--surface-card);
	padding: 0 6px 0 14px;
	height: 48px;
	align-items: center;
}

.tc-searchbox .wp-block-search__input {
	border: none;
	background: transparent;
	font-size: 16px;
	height: 100%;
	padding: 0;
}

.tc-searchbox .wp-block-search__input:focus { outline: none; }

.tc-searchbox .wp-block-search__button {
	background: var(--wp--preset--color--cobalt);
	color: var(--wp--preset--color--paper);
	border: none;
	border-radius: var(--radius-sm);
	height: 36px;
	padding: 0 18px;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
}

.tc-searchbox .wp-block-search__button:hover { background: var(--wp--preset--color--cobalt-hover); }

/* ---------------------------------------------------------------------------
   Pagination
--------------------------------------------------------------------------- */
.tc-pagination .wp-block-query-pagination {
	justify-content: center;
	gap: 6px;
	padding-top: 32px;
}

.tc-pagination .wp-block-query-pagination-numbers .page-numbers,
.tc-pagination .wp-block-query-pagination-previous,
.tc-pagination .wp-block-query-pagination-next {
	min-width: 40px;
	height: 40px;
	border-radius: var(--radius-md);
	border: 1px solid var(--border-default);
	color: var(--text-primary);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	text-decoration: none;
	padding: 0 12px;
}

.tc-pagination .wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--cobalt);
	border-color: var(--wp--preset--color--cobalt);
	color: var(--wp--preset--color--paper);
	font-weight: 600;
}

.tc-pagination a:hover { background: var(--surface-sunken); text-decoration: none; }

/* ---------------------------------------------------------------------------
   Community CTA band
--------------------------------------------------------------------------- */
.tc-cta {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding: 64px var(--tc-gutter);
}

.tc-cta__panel {
	background: linear-gradient(180deg, #C4E6ED 0%, #F0FCF7 100%);
	border-radius: 24px;
	padding: 56px 48px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
	gap: 32px;
	align-items: center;
}

.tc-cta__panel h2 {
	margin: 0;
	font-size: 34px;
	line-height: 42px;
	color: var(--wp--preset--color--night-navy);
	text-wrap: pretty;
}

.tc-cta__panel p {
	margin: 0;
	font-size: 17px;
	line-height: 28px;
	color: var(--text-primary);
	max-width: 520px;
	text-wrap: pretty;
}

.tc-cta__actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 781px) {
	.tc-cta__panel { padding: 40px 24px; }
	.tc-cta__actions { justify-content: flex-start; }
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.tc-footer {
	background: var(--wp--preset--color--ink);
	color: #C9CFD1;
}

.tc-footer__inner {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding: 56px var(--tc-gutter) 32px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 40px;
}

.tc-footer__brand { grid-column: span 2; min-width: 0; }

@media (max-width: 781px) {
	.tc-footer__brand { grid-column: span 1; }
}

/* The site logo is a single asset; render it white on the dark footer. */
.tc-footer .wp-block-site-logo img {
	height: 28px;
	width: auto;
	display: block;
	filter: brightness(0) invert(1);
}

.tc-footer p,
.tc-footer li { font-size: 15px; line-height: 24px; }
.tc-footer a { color: #C9CFD1; text-decoration: none; }
.tc-footer a:hover { color: var(--wp--preset--color--paper); text-decoration: underline; }

.tc-footer__heading {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 15px;
	color: var(--wp--preset--color--paper);
	margin: 0;
}

.tc-footer__col { display: flex; flex-direction: column; gap: 10px; }

.tc-footer__col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tc-footer__bar {
	max-width: var(--tc-container);
	margin-inline: auto;
	padding: 20px var(--tc-gutter) 28px;
	border-top: 1px solid #2C3637;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-size: 13px;
	flex-wrap: wrap;
}

.tc-footer__bar p { font-size: 13px; margin: 0; }
.tc-footer__links { display: flex; gap: 20px; }

/* Footer navigation inherits the muted link colour */
.tc-footer .wp-block-navigation {
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

.tc-footer .wp-block-navigation .wp-block-navigation-item__content { color: #C9CFD1; }
.tc-footer .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--paper); }

/* ---------------------------------------------------------------------------
   Comments
--------------------------------------------------------------------------- */
.tc-comments {
	max-width: 700px;
	margin-inline: auto;
	padding-top: 48px;
	margin-top: 48px;
	border-top: 1px solid var(--border-default);
}

.tc-comments .wp-block-comment-author-name a { color: var(--text-primary); font-weight: 600; }
.tc-comments .wp-block-comment-date { font-size: 14px; color: var(--text-muted); }

/* ---------------------------------------------------------------------------
   Accessibility
--------------------------------------------------------------------------- */
.tc-skip-link:focus {
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 100;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	padding: 10px 16px;
	border-radius: var(--radius-md);
}

:where(a, button, input, .wp-block-navigation-item__content):focus-visible {
	outline: 2px solid var(--wp--preset--color--cobalt);
	outline-offset: 2px;
	box-shadow: var(--shadow-focus);
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
	.tc-card:hover .wp-block-post-featured-image img { transform: none; }
}

/* ---------------------------------------------------------------------------
   Category pills rendered directly by core/categories
--------------------------------------------------------------------------- */
ul.tc-pills {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}

ul.tc-pills li { margin: 0; }

/* "Read more" links styled as the design's primary button */
.tc-button-link,
a.tc-button-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	height: 48px;
	padding: 0 26px;
	border-radius: var(--radius-md);
	background: var(--wp--preset--color--cobalt);
	color: var(--wp--preset--color--paper) !important;
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none !important;
	border: none;
	margin-top: 8px;
	transition: background-color 120ms ease;
}

.tc-button-link:hover { background: var(--wp--preset--color--cobalt-hover); }

/* Outline variant */
.tc-button-outline,
a.tc-button-outline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 0 26px;
	border-radius: var(--radius-md);
	background: transparent;
	border: 1.5px solid var(--text-primary);
	color: var(--text-primary) !important;
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none !important;
}

.tc-button-outline:hover { background: var(--surface-sunken); }

/* ---------------------------------------------------------------------------
   Share row icons
--------------------------------------------------------------------------- */
.tc-share-icons { display: flex; gap: 4px; }

.tc-share-icon {
	width: 36px;
	height: 36px;
	border: 1px solid var(--border-default);
	background: var(--surface-card);
	border-radius: var(--radius-md);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--text-primary);
	padding: 0;
	position: relative;
	transition: background-color 120ms ease;
}

.tc-share-icon:hover { background: var(--surface-sunken); color: var(--text-primary); }
.tc-share-icon svg { display: block; }

.tc-share-icon.is-copied::after {
	content: "Copied";
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	font-size: 12px;
	font-weight: 600;
	padding: 4px 8px;
	border-radius: var(--radius-sm);
	white-space: nowrap;
}

.tc-reading-time { font-size: 14px; color: var(--text-secondary); }

.tc-reading-time::before,
.tc-byline .wp-block-post-date::before {
	content: "·";
	margin-inline: 8px;
	color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   404
--------------------------------------------------------------------------- */
.tc-404__inner {
	max-width: 720px;
	margin-inline: auto;
	text-align: center;
	width: 100%;
}

.tc-mono-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 14px;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--sunny) !important;
	margin: 0;
}

.tc-404__search { width: 100%; max-width: 480px; margin-inline: auto; }

.tc-404__search .wp-block-search__inside-wrapper {
	border-color: transparent;
	background: var(--surface-card);
}

.tc-404__pills { justify-content: center; margin-top: 8px; }

.tc-404 ul.tc-pills li a {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.4);
	color: var(--wp--preset--color--paper);
}

.tc-404 ul.tc-pills li a:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------------------------------------------------------------------------
   Post terms rendered as the cobalt eyebrow on cards and rows
--------------------------------------------------------------------------- */
.tc-hero .wp-block-post-terms,
.tc-hero .wp-block-post-terms a {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 16px;
	color: var(--wp--preset--color--sunny);
	text-decoration: none;
}

.tc-row .wp-block-post-terms,
.tc-row .wp-block-post-terms a,
.tc-rows--compact .wp-block-post-terms a {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 14px;
	color: var(--wp--preset--color--cobalt);
	text-decoration: none;
}

.tc-breadcrumb .wp-block-post-terms,
.tc-breadcrumb .wp-block-post-terms a,
.tc-breadcrumb p {
	font-size: 14px;
	margin: 0;
	color: var(--text-muted);
}

/* Featured images fall back to a tinted placeholder when a post has none */
.tc-card .wp-block-post-featured-image:empty,
.tc-row .wp-block-post-featured-image:empty {
	aspect-ratio: 16 / 10;
	background: var(--wp--preset--color--cloud-haze);
}

.tc-single-figure .wp-block-post-featured-image:empty { display: none; }

/* ---------------------------------------------------------------------------
   Header at narrow widths

   The design keeps the header on a single row; below the tablet breakpoint
   there is not enough room for the logo, the nav toggle, search and the
   "Join the community" button, so the actions wrap to their own full-width
   row rather than overflowing the viewport.
--------------------------------------------------------------------------- */
@media (max-width: 781px) {
	.tc-header__inner {
		flex-wrap: wrap;
		row-gap: 12px;
		padding-block: 12px;
		min-height: 0;
	}

	.tc-header .wp-block-navigation { overflow: visible; }
}

@media (max-width: 599px) {
	.tc-header__inner { gap: 12px; }

	.tc-header__actions {
		width: 100%;
		margin-inline-start: 0;
		justify-content: space-between;
		white-space: normal;
	}

	.tc-header__actions .wp-block-buttons { flex: 1; }

	.tc-header__actions .wp-block-button,
	.tc-header__actions .wp-block-button__link {
		width: 100%;
		justify-content: center;
	}

	.tc-header .wp-block-site-logo img { height: 26px; }
}

/* Nothing in the theme may push the page wider than the viewport. */
html, body { max-width: 100%; overflow-x: hidden; }

.tc-hero__inner,
.tc-wrap,
.tc-single-main,
.tc-footer__inner { min-width: 0; }

@media (max-width: 781px) {
	.tc-hero__inner { padding: 48px var(--tc-gutter); gap: 32px; }
	.tc-single-header { padding-block: 32px 24px; }
	.tc-related__inner { padding-block: 40px; }
	.tc-author-header__inner { padding-block: 40px 32px; gap: 24px; }
	.tc-author-header .wp-block-avatar img { width: 96px; height: 96px; }
	.tc-author-header .wp-block-post-author-name { font-size: 34px; }
	.tc-cta { padding-block: 40px; }
}

/* ---------------------------------------------------------------------------
   Research papers

   Long-form academic pages using the page-research template: a paper header,
   an abstract panel, evidence tags, a summary table and a reference list.
   The article column widens slightly, since tables and references need it.
--------------------------------------------------------------------------- */
.tc-research .tc-article { max-width: 760px; }

.tc-research__header {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-bottom: 32px;
	margin-bottom: 40px;
	border-bottom: 1px solid var(--border-default);
}

.tc-research__header .tc-eyebrow {
	color: var(--wp--preset--color--cobalt);
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.tc-research__header h1 {
	margin: 0;
	font-size: clamp(34px, 5vw, 52px);
	line-height: 1.1;
	text-wrap: pretty;
}

.tc-research__deck {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: 22px;
	line-height: 32px;
	color: var(--text-secondary);
	text-wrap: pretty;
}

.tc-research__byline {
	margin: 0;
	font-size: 15px;
	color: var(--text-muted);
}

/* Abstract and front-matter panels */
.tc-research__abstract {
	background: var(--surface-sunken);
	border-left: 3px solid var(--wp--preset--color--cobalt);
	border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
	padding: 28px 32px;
	margin-bottom: 32px;
}

.tc-research__abstract > *:first-child { margin-top: 0; }
.tc-research__abstract > *:last-child { margin-bottom: 0; }

.tc-research__abstract h2 {
	font-size: 15px !important;
	line-height: 1.4 !important;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin: 0 0 12px !important;
}

.tc-research__abstract p { font-size: 16px; line-height: 27px; }

.tc-research__note {
	font-size: 15px;
	line-height: 25px;
	color: var(--text-secondary);
	padding: 20px 0;
	border-top: 1px solid var(--border-default);
	margin: 0;
}

.tc-research__note strong { color: var(--text-primary); }

.tc-research__keywords {
	font-size: 15px;
	line-height: 25px;
	color: var(--text-secondary);
	margin: 16px 0 0;
}

/* Evidence tags: the study design behind a claim, not its strength */
.tc-tag {
	display: inline-block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1;
	padding: 5px 8px;
	border-radius: var(--radius-sm);
	margin-right: 10px;
	vertical-align: 2px;
	white-space: nowrap;
	background: var(--surface-sunken);
	color: var(--text-secondary);
	border: 1px solid var(--border-default);
}

.tc-tag--meta { background: #E6EBFE; color: #1B2F9E; border-color: #C8D4FD; }
.tc-tag--rct { background: #DFF3E4; color: #17603A; border-color: #BFE5CB; }
.tc-tag--quasi { background: #FDF3D3; color: #6B5310; border-color: #F7E4A8; }
.tc-tag--corr { background: #E4F4F8; color: #17555F; border-color: #C4E6ED; }
.tc-tag--qual { background: #FBE7F7; color: #7A2A6C; border-color: #F6BEF0; }
.tc-tag--theory { background: #EDEFF0; color: #3D4749; border-color: #DEE3E5; }
.tc-tag--desc { background: #F2EDFB; color: #47307B; border-color: #E2D8F5; }

.tc-tag-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

/* Summary table */
.tc-research .wp-block-table { margin: 32px 0; }

.tc-research .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 21px;
}

.tc-research .wp-block-table th {
	text-align: left;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-muted);
	border-bottom: 1px solid var(--border-strong);
	padding: 10px 12px 10px 0;
	vertical-align: bottom;
}

.tc-research .wp-block-table td {
	border-bottom: 1px solid var(--border-default);
	padding: 14px 12px 14px 0;
	vertical-align: top;
	color: var(--text-primary);
}

.tc-research .wp-block-table td:last-child,
.tc-research .wp-block-table th:last-child { padding-right: 0; }

.tc-research .wp-block-table figcaption {
	font-size: 14px;
	line-height: 22px;
	color: var(--text-muted);
	margin-top: 12px;
	text-align: left;
}

@media (max-width: 781px) {
	.tc-research .wp-block-table { overflow-x: auto; }
	.tc-research .wp-block-table table { min-width: 560px; }
}

/* Section headings carry more air in a long paper */
.tc-research .wp-block-post-content h2 {
	margin-block: 56px 0;
	padding-top: 8px;
	border-top: 1px solid var(--border-default);
}

.tc-research .wp-block-post-content h2:first-of-type { margin-block-start: 0; }

.tc-research .wp-block-post-content h3 {
	margin-block: 36px 0;
	font-size: 20px;
	line-height: 28px;
	color: var(--text-primary);
}

/* References */
.tc-research__refs { margin: 0; padding: 0; list-style: none; }

.tc-research__refs li {
	font-size: 14px;
	line-height: 23px;
	color: var(--text-secondary);
	padding: 12px 0 12px 28px;
	text-indent: -28px;
	border-bottom: 1px solid var(--border-default);
	overflow-wrap: anywhere;
}

.tc-research__refs li:last-child { border-bottom: none; }
.tc-research__refs a { color: var(--wp--preset--color--cobalt); }
