/*
Theme Name: Synthai Child
Theme URI: https://energi.ai
Description: Child theme for the inherited Synthai parent. All Frontkom-authored overrides, templates, and custom code for energi.ai live here. Do not modify the parent theme directly.
Author: Frontkom
Author URI: https://frontkom.com
Template: synthai
Version: 1.0.0
Text Domain: energi-ai
*/

/*
 * tp-blog (blog--style9) grids: force a uniform 16:10 thumbnail aspect so every
 * card has the same height regardless of the source image's native ratio. Without
 * this, square portraits (e.g. 1000x1000) render taller than landscape images in
 * the same row, giving the "some cards bigger, some smaller" look on /insights/.
 */
/* -------------------------------------------------------------------------
 * tp-blog `blog--style9` card enhancements
 *
 * Two layouts share this widget's markup:
 *
 * 1. OVERLAY (used on the Insights page "Latest" grid) — the parent
 *    theme's default: image fills the card, title + category sit on top
 *    of a dark gradient. We keep this look on the Insights page and only
 *    add: rounded card corners, consistent 1:1 aspect, hover zoom on the
 *    image, and a stretched link so the whole card is clickable.
 *
 * 2. STACKED (used on archives and single-post "More insights") — image
 *    on top, white body below with small uppercase category label + dark
 *    title. Scoped under `.energi-archive__body` and
 *    `.energi-article__related` so these rules never touch the Insights
 *    widget.
 * ------------------------------------------------------------------------- */

/* === Shared: rounded corners, hover zoom, click target === */
.themephi-blog-grid.blog--style9 .blog-item {
	position: relative;
	cursor: pointer;
	border-radius: 16px;
	overflow: hidden;
}

.themephi-blog-grid.blog--style9 .image-part {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	position: relative;
	isolation: isolate;
}

/* Parent theme's gradient overlay renders below the transformed img by
 * default; lift it above the zooming image so the title stays legible. */
.themephi-blog-grid.blog--style9 .grid-image-part-wrapper .image-part::before {
	z-index: 2;
}

.themephi-blog-grid.blog--style9 .image-part img {
	width: 100%;
	height: 100%;
	min-height: 0 !important;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.themephi-blog-grid.blog--style9 .blog-item:hover .image-part img {
	transform: scale(1.06);
}

/* Stretch the title link so every click lands on the post. */
.themephi-blog-grid.blog--style9 .blog-item .title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
}

/* === Stacked layout: archives + single-post related only === */
.energi-archive__body .themephi-blog-grid.blog--style9 .blog-item,
.energi-article__related .themephi-blog-grid.blog--style9 .blog-item {
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 17, 21, 0.06);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .blog-item:hover,
.energi-article__related .themephi-blog-grid.blog--style9 .blog-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgba(15, 17, 21, 0.08);
}

.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .image-part,
.energi-article__related .themephi-blog-grid.blog--style9 .image-part {
	aspect-ratio: 16 / 10;
	background: #e6e7eb;
	flex: 0 0 auto;
	border-radius: 0;
}

/* Hide the parent's dark gradient overlay in the stacked layout — the
 * title now lives below the image on a white body. */
.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .image-part::before,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .image-part::before {
	display: none;
}

/* Stacked content block — override parent's absolute-positioned overlay
 * by matching its 4-class selector depth. */
.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content,
.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content.blog-content-absolute,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content.blog-content-absolute {
	position: static;
	inset: auto;
	margin: 0;
	padding: 24px 28px 28px;
	background: #fff;
	color: #0f1115;
	flex: 1 1 auto;
	z-index: auto;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .blog-meta,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .blog-meta {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	display: flex;
	gap: 8px;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .blog-meta li,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .blog-meta li {
	margin: 0;
	padding: 0;
	display: inline-block;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .blog-meta li span,
.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .meta_category,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .blog-meta li span,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .meta_category {
	display: inline-block;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5a5d63;
	background: transparent;
	padding: 0;
	border-radius: 0;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .title,
.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .title.dd,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .title,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .title.dd {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
	color: #0f1115;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .title a,
.energi-article__related .themephi-blog-grid.blog--style9 .grid-image-part-wrapper .blog-content .title a {
	color: #0f1115;
	text-decoration: none;
	font-weight: 600;
}

.energi-archive__body .themephi-blog-grid.blog--style9 .blog-item:hover .title,
.energi-archive__body .themephi-blog-grid.blog--style9 .blog-item:hover .title a,
.energi-article__related .themephi-blog-grid.blog--style9 .blog-item:hover .title,
.energi-article__related .themephi-blog-grid.blog--style9 .blog-item:hover .title a {
	font-weight: 600;
	text-shadow: none;
}

/* Hide the tp-blog arrow widget in the stacked layout (it doesn't fit
 * the cleaner design). Kept on the Insights overlay cards. */
.energi-archive__body .themephi-blog-grid.blog--style9 .tp_elements-icon-widget,
.energi-article__related .themephi-blog-grid.blog--style9 .tp_elements-icon-widget {
	display: none;
}

/* Homepage "ZEROusly good news" cards (tp-blog style1): hide the author/date bar overlay on the image. */
body.home .themephi-blog-grid.blog--style1 .blog-item .image-part .blog-meta-abs,
body.home .themephi-blog-grid .blog-item .image-part .blog-meta-abs {
	display: none !important;
}

/* Sticky nav: parent theme sets menu links to --commonWhite when `.sticky-menu`
 * is active, and the active item to --primaryColor (faded pink). Both look
 * unreadable over the light body — force solid black. */
.menu-area.sticky-menu .navbar ul li > a,
.menu-area.sticky-menu .navbar ul li.menu-item-has-children > a,
.menu-area.sticky-menu .navbar ul li.current-menu-item > a,
.menu-area.sticky-menu .navbar ul li.current-menu-ancestor > a,
.menu-area.sticky-menu .navbar ul li.current-menu-ancestor.menu-item-has-children > a,
.menu-area.sticky-menu .navbar ul > li.menu-item-has-children:hover > a,
.menu-area.sticky-menu .navbar ul > li.menu-item-has-children:hover > a:before {
	color: #0f1115;
}

/*
 * Editorial archive layout (category + tag pages).
 * Reuses the single-post hero styling and the tp-blog style9 grid CSS
 * already defined above — only archive-specific overrides live here.
 */
.energi-archive__hero {
	background: #f7f8fa;
	padding: 72px 24px 48px;
	border-bottom: 1px solid #e6e7eb;
}

.energi-archive__hero-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 48px;
	flex-wrap: wrap;
}

.energi-archive__hero-main {
	flex: 1 1 auto;
	min-width: 0;
	position: relative;
	padding-top: 16px;
}

.energi-archive__hero-main::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 48px;
	height: 3px;
	background: var(--primaryColor, #b7e892);
	border-radius: 2px;
}

.energi-archive__eyebrow {
	display: inline-block;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #5a5d63;
	margin-bottom: 12px;
}

.energi-archive__title {
	font-size: clamp(36px, 5vw, 60px);
	line-height: 1.05;
	font-weight: 600;
	color: #0f1115;
	margin: 0;
	letter-spacing: -0.01em;
}

.energi-archive__description {
	max-width: 640px;
	color: #5a5d63;
	font-size: 17px;
	line-height: 1.6;
	margin-top: 16px;
}

.energi-archive__hero-meta {
	flex: 0 0 auto;
	text-align: right;
	line-height: 1;
	padding-bottom: 8px;
}

.energi-archive__count {
	display: block;
	font-size: clamp(48px, 6vw, 72px);
	font-weight: 600;
	color: #0f1115;
	line-height: 0.9;
	letter-spacing: -0.02em;
}

.energi-archive__count-label {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5a5d63;
}

.energi-archive__body {
	background: #f7f8fa;
	padding: 64px 24px 80px;
}

.energi-archive__container {
	max-width: 1200px;
	margin: 0 auto;
}

.energi-archive__empty {
	text-align: center;
	padding: 80px 0;
	color: #5a5d63;
	font-size: 18px;
}

@media (max-width: 680px) {
	.energi-archive__hero {
		padding: 48px 20px 32px;
	}

	.energi-archive__hero-inner {
		gap: 24px;
	}

	.energi-archive__hero-meta {
		text-align: left;
	}
}

/*
 * Scroll-target for pagination links to the "Latest" grid. Offset by the
 * site header height so the grid isn't hidden under the sticky nav.
 */
.energi-latest-anchor {
	display: block;
	position: relative;
	top: -120px;
	visibility: hidden;
	height: 0;
}

/* tp-blog pagination (enabled on the Insights page "Latest" section) */
.themephi-blog-grid .themephi-pagination-area {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}

.themephi-blog-grid .themephi-pagination-area .nav-links {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.themephi-blog-grid .themephi-pagination-area .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 500;
	color: #0f1115;
	background: transparent;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.themephi-blog-grid .themephi-pagination-area .page-numbers:hover {
	background: #0f1115;
	color: #fff;
}

.themephi-blog-grid .themephi-pagination-area .page-numbers.current {
	background: #0f1115;
	color: #fff;
}

.themephi-blog-grid .themephi-pagination-area .page-numbers.dots {
	cursor: default;
}

.themephi-blog-grid .themephi-pagination-area .page-numbers.dots:hover {
	background: transparent;
	color: #0f1115;
}

/* -------------------------------------------------------------------------
 * Editorial single-post layout
 *
 * Applies to `synthai-child/single.php`. The parent's generic page banner is
 * suppressed via the child's empty `inc/page-header/breadcrumbs-single.php`.
 * Layout: dark featured-image hero → centered readable body column →
 * related-posts grid → dark CTA panel.
 * ------------------------------------------------------------------------- */
/*
 * Tighten the parent-theme's `.main-contain #content` padding-top (120px)
 * on single-post pages so the editorial hero sits closer to the site header.
 */
body.single-post .main-contain #content,
body.archive .main-contain #content {
	padding-top: 30px;
}

.energi-single-wrap {
	background: #ffffff;
}

.energi-article {
	--energi-body-width: 760px;
	--energi-wide-width: 1140px;
	color: #0f1115;
}

/* Hero */
.energi-article__hero {
	position: relative;
	min-height: 520px;
	padding: 120px 24px 72px;
	background-color: #0f1115;
	background-position: center 20%;
	background-size: cover;
	color: #fff;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
}

.energi-article__hero.has-image {
	min-height: 700px;
}

.energi-article__hero-overlay {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(15, 17, 21, 0.35) 0%, rgba(15, 17, 21, 0.5) 40%, rgba(15, 17, 21, 0.9) 100%),
		linear-gradient(90deg, rgba(15, 17, 21, 0.6) 0%, rgba(15, 17, 21, 0.2) 60%);
	pointer-events: none;
}

.energi-article__hero-inner {
	position: relative;
	max-width: var(--energi-wide-width);
	margin: 0 auto;
	width: 100%;
}

.energi-article__category {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	backdrop-filter: blur(6px);
	margin-bottom: 20px;
	transition: background 0.2s ease;
}

.energi-article__category:hover {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

.energi-article__title {
	font-size: clamp(32px, 4.4vw, 56px);
	line-height: 1.1;
	font-weight: 600;
	color: #fff;
	margin: 0 0 28px;
	max-width: 20ch;
}

.energi-article__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	color: rgba(255, 255, 255, 0.85);
	font-size: 15px;
}

.energi-article__author {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	text-decoration: none;
	font-weight: 500;
}

.energi-article__author:hover {
	color: #fff;
}

.energi-article__avatar {
	border-radius: 50%;
	width: 36px;
	height: 36px;
	object-fit: cover;
}

.energi-article__dot {
	opacity: 0.5;
}

/* Body column */
.energi-article__body {
	max-width: var(--energi-body-width);
	margin: 72px auto;
	padding: 0 24px;
	font-size: 18px;
	line-height: 1.75;
	color: #2a2d33;
}

.energi-article__body span {
	display: inline;
}

.energi-article__body ul,
.energi-article__body ol {
	margin: 1.2em 0 1.4em;
	padding-left: 1.6em;
}

.energi-article__body ul {
	list-style: disc outside;
}

.energi-article__body ol {
	list-style: decimal outside;
}

.energi-article__body ul ul {
	list-style-type: circle;
}

.energi-article__body li {
	margin-bottom: 0.5em;
}

.energi-article__body li > ul,
.energi-article__body li > ol {
	margin: 0.5em 0 0.5em;
}

.energi-article__body > p {
	margin: 0 0 1.4em;
}

.energi-article__body > p:first-of-type {
	font-size: 22px;
	line-height: 1.5;
	color: #0f1115;
	margin-bottom: 2em;
}

.energi-article__body h2 {
	font-size: clamp(26px, 2.6vw, 34px);
	line-height: 1.2;
	font-weight: 600;
	color: #0f1115;
	margin: 2.4em 0 0.8em;
}

.energi-article__body h3 {
	font-size: clamp(20px, 2vw, 24px);
	line-height: 1.3;
	font-weight: 600;
	color: #0f1115;
	margin: 2em 0 0.6em;
}

.energi-article__body ul,
.energi-article__body ol {
	margin: 0 0 1.4em;
	padding-left: 1.4em;
}

.energi-article__body li + li {
	margin-top: 0.4em;
}

.energi-article__body a {
	color: #0f1115;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.energi-article__body a:hover {
	color: var(--primaryColor, #b7e892);
}

.energi-article__body img,
.energi-article__body figure {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 1.6em 0;
}

.energi-article__body blockquote,
.energi-article__body .wp-block-quote,
.energi-article__body .wp-block-quote.is-style-large {
	background: transparent;
	border: 0;
	border-left: 3px solid var(--primaryColor, #b7e892);
	border-radius: 0;
	margin: 2em 0;
	padding: 0.2em 0 0.2em 1.6em;
	text-align: left;
	position: relative;
}

.energi-article__body blockquote::before,
.energi-article__body .wp-block-quote::before,
.energi-article__body .wp-block-quote.is-style-large::before {
	content: none;
	display: none;
}

.energi-article__body blockquote p,
.energi-article__body .wp-block-quote p {
	font-family: inherit;
	font-size: 22px;
	line-height: 1.5;
	font-weight: 400;
	font-style: italic;
	color: #0f1115;
	margin: 0 0 0.6em;
}

.energi-article__body blockquote cite,
.energi-article__body .wp-block-quote cite {
	display: block;
	font-style: normal;
	font-size: 15px;
	font-weight: 500;
	color: #5a5d63;
}

.energi-article__tags {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid #e6e7eb;
	font-size: 14px;
	color: #5a5d63;
}

.energi-article__tags a {
	color: inherit;
	text-decoration: none;
	margin-right: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	background: #f2f3f5;
}

.energi-article__tags a:hover {
	background: #0f1115;
	color: #fff;
}

.energi-article__tags-label {
	font-weight: 600;
	color: #0f1115;
	margin-right: 6px;
}

/* Related posts */
.energi-article__related {
	background: #f7f8fa;
	padding: 80px 24px;
}

.energi-article__related-header {
	max-width: var(--energi-wide-width);
	margin: 0 auto 40px;
	text-align: center;
}

.energi-article__eyebrow {
	display: inline-block;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5a5d63;
	margin-bottom: 12px;
}

.energi-article__eyebrow--light {
	color: rgba(255, 255, 255, 0.7);
}

.energi-article__related-title {
	font-size: clamp(28px, 3vw, 40px);
	font-weight: 600;
	color: #0f1115;
	margin: 0;
}

/* Related-posts grid uses the unified tp-blog style9 card styling
 * defined above — only the outer section layout lives here. */
.energi-article__related .themephi-blog-grid {
	max-width: var(--energi-wide-width);
	margin: 0 auto;
}

.energi-article__related .blog-gird-item {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.energi-article__related .grid-item {
	width: auto;
	max-width: none;
	flex: 0 0 auto;
	padding: 0;
}

@media (max-width: 900px) {
	.energi-article__related .blog-gird-item {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

/* CTA panel */
.energi-article__cta {
	background: #0f1115;
	color: #fff;
	padding: 96px 24px;
	text-align: center;
}

.energi-article__cta-inner {
	max-width: 720px;
	margin: 0 auto;
}

.energi-article__cta-title {
	font-size: clamp(28px, 3.4vw, 44px);
	line-height: 1.15;
	font-weight: 600;
	color: #fff;
	margin: 0 0 16px;
}

.energi-article__cta-text {
	font-size: 18px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.8);
	margin: 0 0 32px;
}

.energi-article__cta-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 32px;
	border-radius: 999px;
	background: var(--primaryColor, #b7e892);
	color: #0f1115;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	transition: transform 0.2s ease, background 0.2s ease;
}

.energi-article__cta-button:hover {
	transform: translateY(-2px);
	background: #fff;
	color: #0f1115;
}

/* Responsive */
@media (max-width: 900px) {
	.energi-article__hero {
		min-height: 420px;
		padding: 100px 20px 56px;
	}

	.energi-article__hero.has-image {
		min-height: 460px;
	}

	.energi-article__body {
		margin: 56px auto;
		font-size: 17px;
	}

	.energi-article__body > p:first-of-type {
		font-size: 19px;
	}

	.energi-article__related,
	.energi-article__cta {
		padding: 64px 20px;
	}

	.energi-article__related-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}
