/*
Theme Name: True Impact Ai
Theme URI: https://true-impact.ai
Author: True Impact Ai
Author URI: https://true-impact.ai
Description: Custom block theme for True Impact Ai — dark industrial brand with orange accent, Poppins typography, and block patterns tuned to the True Impact Ai offer stack.
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
Version: 0.2.0
License: GPL-2.0-or-later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: true-impact-ai
Tags: block-theme, full-site-editing, dark, one-column, custom-colors, custom-logo, editor-style
*/

/* theme.json drives the visual system. Use this file only for CSS that theme.json can't express. */

/* Body base — ensures dark background even before theme.json loads */
body {
	background-color: #040C18;
	color: rgba(255, 255, 255, 0.72);
}

/* Smooth scroll for in-page anchors */
html {
	scroll-behavior: smooth;
}

/* Grain texture overlay — industrial feel, matches the static site */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	opacity: 0.04;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
	mix-blend-mode: overlay;
}

/* Radial glow utility — add class "has-glow" to any cover/group block */
.has-glow {
	position: relative;
	isolation: isolate;
}
.has-glow::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(ellipse at 50% 20%, rgba(255, 92, 26, 0.18), transparent 60%);
	pointer-events: none;
}

/* Button polish — theme.json sets the base, this adds hover lift */
.wp-block-button__link {
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 30px rgba(255, 92, 26, 0.3);
}

/* Stat/number cards — large orange numerals */
.tia-stat-number {
	font-size: clamp(2.5rem, 5vw, 4rem);
	font-weight: 800;
	color: #FF5C1A;
	line-height: 1;
	letter-spacing: -0.02em;
}

/* Accent border for cards */
.tia-card-accent {
	border-left: 3px solid #FF5C1A;
}

/* FAQ details/summary native polish */
details.tia-faq {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	padding: 1.25rem 0;
}
details.tia-faq summary {
	cursor: pointer;
	font-weight: 600;
	color: #FFFFFF;
	font-size: 1.125rem;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
details.tia-faq summary::-webkit-details-marker {
	display: none;
}
details.tia-faq summary::after {
	content: "+";
	color: #FF5C1A;
	font-size: 1.5rem;
	transition: transform 0.2s ease;
}
details.tia-faq[open] summary::after {
	transform: rotate(45deg);
}
details.tia-faq > *:not(summary) {
	margin-top: 0.75rem;
	color: rgba(255, 255, 255, 0.72);
}

/* Process step number — used in process section */
.tia-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #FF5C1A;
	color: #FFFFFF;
	font-weight: 800;
	font-size: 1.25rem;
}

/* Checkmark list — why us section */
ul.tia-check-list {
	list-style: none;
	padding: 0;
}
ul.tia-check-list li {
	position: relative;
	padding-left: 2rem;
	margin-bottom: 0.75rem;
	color: rgba(255, 255, 255, 0.85);
}
ul.tia-check-list li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: #FF5C1A;
	font-weight: 800;
	font-size: 1.25rem;
}

/* Ensure page content sits above the grain overlay */
.wp-site-blocks {
	position: relative;
	z-index: 2;
}

/* ---------------------------------------------------------------------
   Blog / category card grid — equal-height cards
   The Query Loop in templates/home.html and templates/category.html
   renders each post as a wp:group inside a flex post-template. Without
   this, cards size to their own content (variable title/excerpt length)
   and the grid looks ragged. Stretch every card to match its row, clamp
   title to 3 lines and excerpt to 4, and pin the date to the bottom.
   --------------------------------------------------------------------- */
.wp-block-query .wp-block-post-template.is-flex-container {
	align-items: stretch;
}
.wp-block-query .wp-block-post-template.is-flex-container > li.wp-block-post {
	display: flex;
}
.wp-block-query .wp-block-post-template.is-flex-container > li.wp-block-post > .wp-block-group {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
}
.wp-block-query .wp-block-post-template.is-flex-container .wp-block-post-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.wp-block-query .wp-block-post-template.is-flex-container .wp-block-post-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.wp-block-query .wp-block-post-template.is-flex-container .wp-block-post-date {
	margin-top: auto;
}

/* Newsletter form (footer) */
.tia-newsletter-form {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin: 0 0 0.75rem;
}
.tia-newsletter-form input {
	padding: 0.75rem 1rem;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	color: #fff;
	font-family: inherit;
	font-size: 0.9375rem;
}
.tia-newsletter-form input:focus {
	outline: none;
	border-color: #FF5C1A;
}
.tia-newsletter-form input::placeholder {
	color: rgba(255, 255, 255, 0.4);
}
.tia-newsletter-form button {
	padding: 0.85rem 1.25rem;
	background: #FF5C1A;
	color: #fff;
	border: 0;
	border-radius: 999px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.tia-newsletter-form button:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px rgba(255, 92, 26, 0.3);
	background: #E64A0A;
}
.tia-newsletter-form button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.tia-newsletter-msg {
	font-size: 0.8125rem;
	margin: 0 0 0.5rem;
	min-height: 1em;
}
.tia-newsletter-msg.tia-ok-msg {
	color: #4ade80;
}
.tia-newsletter-msg.tia-err-msg {
	color: #f87171;
}
.tia-newsletter-privacy {
	color: rgba(255, 255, 255, 0.4);
	font-size: 0.75rem;
	margin: 0;
	line-height: 1.5;
}

/* Easy Table of Contents plugin — restyle to match dark theme */
div#ez-toc-container {
	background: rgba(255, 255, 255, 0.02) !important;
	border: 1px solid var(--wp--preset--color--hairline, rgba(255, 255, 255, 0.12)) !important;
	border-radius: 12px !important;
	padding: 1.25rem 1.5rem !important;
	margin: 2rem 0 !important;
	box-shadow: none !important;
}
div#ez-toc-container p.ez-toc-title,
div#ez-toc-container .ez-toc-title {
	color: #FF5C1A !important;
	font-size: 0.75rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	margin: 0 0 0.75rem !important;
	background: transparent !important;
}
div#ez-toc-container ul,
div#ez-toc-container nav ul {
	margin: 0 !important;
	padding-left: 1.25rem !important;
	list-style: decimal !important;
}
div#ez-toc-container ul li,
div#ez-toc-container ul li a,
div#ez-toc-container nav ul li a {
	color: rgba(255, 255, 255, 0.72) !important;
	font-size: 0.9375rem !important;
	font-weight: 500 !important;
	line-height: 1.6 !important;
	text-decoration: none !important;
}
div#ez-toc-container ul li a:hover,
div#ez-toc-container nav ul li a:hover {
	color: #FF5C1A !important;
	text-decoration: none !important;
}
/* Hide the plugin's collapse toggle + counters — we want a clean list */
div#ez-toc-container a.ez-toc-toggle,
div#ez-toc-container .ez-toc-btn {
	display: none !important;
}

/* Blog post body: widen content column + tighten H3 scale
   (theme.json sets H3 to xx-large / 3rem, which is too close to H2 and
   reads as "massive" inside post body.) */
.single-post .wp-block-post-content.is-layout-constrained,
.single-post .wp-block-post-content {
	max-width: 820px;
	margin-left: auto;
	margin-right: auto;
}
.single-post .wp-block-post-content h3.wp-block-heading,
.single-post .entry-content h3.wp-block-heading,
.single-post .wp-block-post-content h3,
.single-post .entry-content h3 {
	font-size: 1.375rem !important;
	font-weight: 700 !important;
	line-height: 1.35 !important;
	letter-spacing: -0.01em !important;
	margin-top: 2rem !important;
	margin-bottom: 0.75rem !important;
	color: #ffffff;
}

/* Belt-and-braces: also kill any Sharedaddy block if CSS paint happens
   before the PHP filter short-circuits the render (safe no-op otherwise). */
.sharedaddy,
.sd-sharing-enabled,
#jp-post-flair,
.jp-relatedposts {
	display: none !important;
}

/* Breadcrumbs — only rendered on single posts and the blog archive.
   Sits as a thin strip directly under the sticky header, above the hero. */
.tia-breadcrumb {
	background: #040C18;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	padding: 0.75rem 0;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	line-height: 1.4;
}
.tia-breadcrumb-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 var(--wp--preset--spacing--50, 1.5rem);
	color: rgba(255, 255, 255, 0.5);
}
.tia-breadcrumb a {
	color: rgba(255, 255, 255, 0.5);
	text-decoration: none;
	transition: color 0.15s ease;
}
.tia-breadcrumb a:hover,
.tia-breadcrumb a:focus {
	color: #FF5C1A;
}
/* Rank Math wraps the current page in <span class="last">; some setups also
   leave the last item as plain text inside .rank-math-breadcrumb. Style both. */
.tia-breadcrumb .last,
.tia-breadcrumb .rank-math-breadcrumb > span:last-child:not(.separator) {
	color: #FFFFFF;
	font-weight: 500;
}
.tia-breadcrumb .separator {
	color: rgba(255, 255, 255, 0.3);
	margin: 0 0.5rem;
}
/* Mobile: truncate the current item (post title) so it never overflows. */
@media (max-width: 600px) {
	.tia-breadcrumb-inner {
		padding: 0 1rem;
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		overflow: hidden;
		white-space: nowrap;
	}
	.tia-breadcrumb .rank-math-breadcrumb {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		min-width: 0;
		width: 100%;
	}
	.tia-breadcrumb .last,
	.tia-breadcrumb .rank-math-breadcrumb > span:last-child:not(.separator) {
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 60vw;
	}
}

/* "Back to all posts" link — sits at the bottom of single posts, between
   the related posts grid and the closing CTA band. Quiet ghost link. */
.tia-back-to-blog {
	max-width: 820px;
	margin: 2rem auto 0;
	padding: 1.5rem 0 0;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	text-align: center;
}
.tia-back-to-blog a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: color 0.15s ease;
}
.tia-back-to-blog a:hover,
.tia-back-to-blog a:focus {
	color: #FF5C1A;
}
.tia-back-to-blog a:hover .arrow {
	transform: translateX(-3px);
}
.tia-back-to-blog .arrow {
	display: inline-block;
	transition: transform 0.15s ease;
	font-size: 1.125rem;
	line-height: 1;
}

/* ---------------------------------------------------------------------
   Mobile responsiveness
   --------------------------------------------------------------------- */

/* Tighten header + footer horizontal padding on mobile. The theme.json
   spacing preset "50" is clamp(1.5rem, 3vw, 2.25rem) — on a 375px screen
   that locks to 24px each side (48px lost). Drop to 1rem on phones and
   1.25rem on small tablets so the nav and footer breathe properly. */
@media (max-width: 600px) {
	header.wp-block-group.alignfull.has-deep-background-color,
	footer.wp-block-group.alignfull.has-deep-background-color {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}
}
@media (min-width: 601px) and (max-width: 900px) {
	header.wp-block-group.alignfull.has-deep-background-color,
	footer.wp-block-group.alignfull.has-deep-background-color {
		padding-left: 1.25rem !important;
		padding-right: 1.25rem !important;
	}
}

/* Footer columns: WP stacks columns under 782px by default. Tighten the
   row-gap and the top/bottom footer padding on mobile so the stacked
   sections don't feel cavernous. */
@media (max-width: 781px) {
	footer.wp-block-group.alignfull.has-deep-background-color {
		padding-top: 3rem !important;
		padding-bottom: 1.5rem !important;
	}
	footer .wp-block-columns.alignwide > .wp-block-column {
		flex-basis: 100% !important;
	}
	footer hr.wp-block-separator {
		margin-top: 2.5rem !important;
	}
}

/* Newsletter form: stretch inputs/button to full column width on mobile. */
@media (max-width: 600px) {
	.tia-newsletter-form input,
	.tia-newsletter-form button {
		width: 100%;
		box-sizing: border-box;
	}
}
