/*
Theme Name: The Green Techpreneur
Theme URI: https://thegreentechpreneur.com
Author: The Green Techpreneur Ltd
Author URI: https://thegreentechpreneur.com
Description: Magazine-first block theme for The Green Techpreneur: founder stories, investor voices and sector briefings, connected to Climate Marketplace. Edit everything in the Site Editor.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: greentechpreneur
Tags: blog, news, block-patterns, full-site-editing, wide-blocks, custom-colors
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
img { max-width: 100%; height: auto; }

/* Highlighter: use the "Highlight" text format inside headings for the lime underline */
:where(h1, h2, h3, .wp-block-heading) mark {
	background: none !important;
	color: inherit !important;
	box-shadow: inset 0 -0.3em 0 var(--wp--preset--color--lime);
	padding: 0 0.04em;
}

/* ---------- Header ---------- */
.gt-brandband { line-height: 1; }
.gt-lockup { gap: 16px; }
.gt-lockup .wp-block-image { margin: 0; }
.gt-lockup .wp-block-image img { height: 46px; width: auto; border-radius: 0; }
.gt-lockup-words {
	border-left: 1px solid rgba(255, 255, 255, 0.5);
	padding-left: 16px;
}
.gt-lockup-words p { margin: 0; }
.gt-lockup-words a { color: inherit !important; text-decoration: none; }

.gt-menubar .wp-block-navigation__container { flex-wrap: nowrap; gap: 0 32px; }
.gt-menubar .wp-block-navigation-item { white-space: nowrap; }
.gt-menubar .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: 54px;
	padding: 0 2px;
	color: var(--wp--preset--color--brand);
}
.gt-menubar .current-menu-item > .wp-block-navigation-item__content,
.gt-menubar .wp-block-navigation-item__content[aria-current="page"],
.gt-menubar .wp-block-navigation-item__content:hover {
	box-shadow: inset 0 -4px 0 var(--wp--preset--color--lime);
}
/* Sections dropdown: two-column panel */
.gt-menubar .gt-sections > .wp-block-navigation__submenu-container {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(240px, 1fr));
	padding: 16px !important;
	gap: 2px 16px;
	border: none !important;
	border-top: 4px solid var(--wp--preset--color--lime) !important;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 24px 48px rgba(45, 46, 45, 0.14);
	text-transform: none;
	letter-spacing: 0;
	font-size: 16px;
}
.gt-menubar .gt-sections .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	min-height: 0;
	padding: 10px 12px;
	border-radius: 6px;
	color: var(--wp--preset--color--charcoal);
	box-shadow: none;
}
.gt-menubar .gt-sections .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--off-white);
	box-shadow: inset 4px 0 0 var(--wp--preset--color--lime);
}
@media (max-width: 600px) {
	.gt-lockup .wp-block-image img { height: 36px; }
	.gt-lockup-words .gt-wordmark { font-size: 16px !important; letter-spacing: 0.18em !important; }
}

/* ---------- Block styles ---------- */

/* Card */
.is-style-gt-card {
	background: var(--wp--preset--color--white);
	border-top: 8px solid var(--wp--preset--color--lime);
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(45, 46, 45, 0.07);
}
.wp-block-post-template.is-style-gt-cards > li {
	background: var(--wp--preset--color--white);
	border-top: 8px solid var(--wp--preset--color--lime);
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(45, 46, 45, 0.07);
	padding: 24px;
}

/* Telegraph-style column dividers */
@media (min-width: 782px) {
	.wp-block-columns.is-style-gt-dividers { column-gap: 0 !important; }
	.wp-block-columns.is-style-gt-dividers > .wp-block-column { padding: 0 24px; }
	.wp-block-columns.is-style-gt-dividers > .wp-block-column:first-child { padding-left: 0; }
	.wp-block-columns.is-style-gt-dividers > .wp-block-column:last-child { padding-right: 0; }
	.wp-block-columns.is-style-gt-dividers > .wp-block-column + .wp-block-column { border-left: 1px solid var(--wp--preset--color--divider); }
}
.wp-block-query:has(> .wp-block-post-template.is-style-gt-dividers) { overflow: hidden; }
.wp-block-post-template.is-style-gt-dividers {
	column-gap: 0 !important;
	margin-left: -25px !important;
}
.wp-block-post-template.is-style-gt-dividers > li {
	border-left: 1px solid var(--wp--preset--color--divider);
	padding: 0 24px;
}

/* Numbered list of posts */
.wp-block-post-template.is-style-gt-numbered { counter-reset: gtnum; }
.wp-block-post-template.is-style-gt-numbered > li {
	counter-increment: gtnum;
	display: grid;
	grid-template-columns: 52px 1fr;
	align-items: start;
	padding: 16px 0;
	border-bottom: 1px solid var(--wp--preset--color--divider);
	margin: 0 !important;
}
.wp-block-post-template.is-style-gt-numbered > li::before {
	content: counter(gtnum, decimal-leading-zero);
	font-family: var(--wp--preset--font-family--titillium);
	font-weight: 600;
	font-size: 28px;
	line-height: 1;
	color: var(--wp--preset--color--brand);
}
.wp-block-post-template.is-style-gt-numbered > li > * { grid-column: 2; }

/* Eyebrow label */
p.is-style-gt-eyebrow {
	font-family: var(--wp--preset--font-family--titillium);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand);
	margin-bottom: 0;
}

/* Chips (climate themes, tags) */
.wp-block-tag-cloud.is-style-gt-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.wp-block-tag-cloud.is-style-gt-chips a,
.wp-block-post-terms.is-style-gt-chips a {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 16px;
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--titillium);
	font-weight: 600;
	font-size: 15px !important;
	text-transform: none;
	letter-spacing: 0;
	color: var(--wp--preset--color--charcoal);
	text-decoration: none;
	margin: 0 !important;
}
.wp-block-tag-cloud.is-style-gt-chips a:hover,
.wp-block-post-terms.is-style-gt-chips a:hover { background: var(--wp--preset--color--light-green); }
.wp-block-post-terms.is-style-gt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-block-post-terms.is-style-gt-chips .wp-block-post-terms__separator { display: none; }

/* Lime button */
.wp-block-button.is-style-gt-lime .wp-block-button__link {
	background: var(--wp--preset--color--lime);
	color: var(--wp--preset--color--charcoal);
}

/* Founder Wisdom quote */
.wp-block-quote.is-style-gt-wisdom { position: relative; padding-top: 56px; }
.wp-block-quote.is-style-gt-wisdom::before {
	content: "\201C";
	position: absolute;
	top: 0;
	left: 0;
	font-family: var(--wp--preset--font-family--titillium);
	font-weight: 600;
	font-size: 120px;
	line-height: 1;
	color: var(--wp--preset--color--lime);
}
.wp-block-quote.is-style-gt-wisdom p { font-size: clamp(26px, 3.2vw, 42px); line-height: 1.22; }
.wp-block-quote.is-style-gt-wisdom cite { font-family: var(--wp--preset--font-family--open-sans); font-size: 15px; font-style: normal; }

/* Numbered steps */
ol.is-style-gt-steps { list-style: none; counter-reset: gtstep; padding: 0; }
ol.is-style-gt-steps > li {
	counter-increment: gtstep;
	position: relative;
	padding: 18px 0 18px 58px;
	border-top: 1px solid var(--wp--preset--color--divider);
}
ol.is-style-gt-steps > li:last-child { border-bottom: 1px solid var(--wp--preset--color--divider); }
ol.is-style-gt-steps > li::before {
	content: counter(gtstep);
	position: absolute;
	left: 0;
	top: 16px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--wp--preset--color--lime);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--titillium);
	font-weight: 700;
}

/* ---------- Article ---------- */
.gt-standfirst { font-family: var(--wp--preset--font-family--titillium); font-weight: 300; }
.gt-byline { gap: 6px 14px; }
.gt-byline > * { margin: 0 !important; }
.gt-author-box .wp-block-post-author { align-items: flex-start; }
.gt-author-box .wp-block-post-author__avatar img { border-radius: 50%; border: 3px solid var(--wp--preset--color--lime); }
.gt-author-box .wp-block-post-author__name { font-family: var(--wp--preset--font-family--titillium); font-weight: 700; font-size: 19px; }
.gt-author-box .wp-block-post-author__bio { font-size: 15px; }

/* Partner and member labels */
.gt-label {
	display: inline-block;
	padding: 3px 12px;
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: 999px;
	font-size: 12px !important;
	font-weight: 600;
}

/* ---------- Footer values band ---------- */
.gt-values-line { display: flex; justify-content: center; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.gt-values {
	position: relative;
	display: inline-block;
	min-width: 9ch;
	height: 1.25em;
	vertical-align: bottom;
	text-align: left;
}
.gt-values > span {
	position: absolute;
	left: 0;
	top: 0;
	white-space: nowrap;
	opacity: 0;
	animation: gtValue 15s infinite;
}
.gt-values > span:nth-child(2) { animation-delay: 2.5s; }
.gt-values > span:nth-child(3) { animation-delay: 5s; }
.gt-values > span:nth-child(4) { animation-delay: 7.5s; }
.gt-values > span:nth-child(5) { animation-delay: 10s; }
.gt-values > span:nth-child(6) { animation-delay: 12.5s; }
@keyframes gtValue {
	0% { opacity: 0; transform: translateY(8px); }
	2.5% { opacity: 1; transform: none; }
	13.3% { opacity: 1; transform: none; }
	16.6% { opacity: 0; transform: translateY(-8px); }
	100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.gt-values { height: auto; min-width: 0; }
	.gt-values > span { position: static; opacity: 1; animation: none; }
	.gt-values > span:not(:last-child)::after { content: ", "; }
}

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.wp-block-post-template.is-style-gt-dividers > li { border-left: none; padding: 0 0 0 25px; }
}

/* ---------- Links in listings: no underline until hover ---------- */
.wp-block-post-title a,
.wp-block-post-terms a,
.wp-block-navigation a,
.wp-block-categories a,
.gt-lockup a,
.wp-block-heading a { text-decoration: none; }
.wp-block-post-title a:hover,
.wp-block-heading a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--wp--preset--color--lime); text-underline-offset: 4px; }
.wp-block-post-terms:not(.is-style-gt-chips) a:hover { text-decoration: underline; }
.wp-block-quote.is-style-gt-wisdom.gt-small-quote { padding-top: 44px; }
.wp-block-quote.is-style-gt-wisdom.gt-small-quote::before { font-size: 84px; }
.wp-block-quote.is-style-gt-wisdom.gt-small-quote p { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.4; }
