/*
Theme Name: Brazil Stock Guide
Theme URI: https://brazilstockguide.com
Author: Brazil Stock Guide
Author URI: https://brazilstockguide.com
Description: Block theme for Brazil Stock Guide — clear insights on Brazilian equities. A clean, editorial financial-news theme with a navy/gold palette, Albert Sans + Barlow typography, a gradient hero and a curated Insights homepage. Pairs with the Brazil Stock Guide News Manager plugin.
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Version: 0.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bsg
Tags: news, blog, block-patterns, full-site-editing, block-styles, editor-style, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks
*/

/* =====================================================================
 * Brazil Stock Guide — block theme styles
 * Most theming lives in theme.json; this file covers the curated homepage
 * (rendered as raw HTML by patterns/homepage.php) and a few editor-inexpressible
 * details. Colors come from the theme.json palette CSS variables.
 * ===================================================================== */

/* ── Header (dark, JS-free) ─────────────────────────────────────────── */
.bsg-header { margin-bottom: 0; }
.bsg-header-inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	width: 100%;
	position: relative;
}
.bsg-logo {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	flex: 0 0 auto;
}
.bsg-logo img { max-width: 220px; height: auto; display: block; }

/* Right-hand control cluster (nav + socials + search), pushed to the edge. */
.bsg-header-right {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin-left: auto;
}
.bsg-mainnav { display: flex; align-items: center; }
.bsg-nav-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
/* Mobile search toggle: control hidden; magnifier trigger desktop-hidden. */
.bsg-search-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.bsg-search-trigger { display: none; }
.bsg-menu {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 1.4rem;
	margin: 0;
	padding: 0;
}
.bsg-menu a {
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 500;
	font-size: 0.92rem;
	text-decoration: none;
	white-space: nowrap;
}
.bsg-menu a:hover { color: rgba(255, 255, 255, 0.7); }
.bsg-burger { display: none; }

.bsg-header-social { display: flex; align-items: center; gap: 0.65rem; }
.bsg-header-social a {
	color: var(--wp--preset--color--white);
	display: inline-flex;
	align-items: center;
}
.bsg-header-social svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* Search: icon by default, input slides open on hover/focus (no JS). */
.bsg-search { display: flex; align-items: center; }
.bsg-search-field {
	width: 0;
	min-width: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	height: 34px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.12);
	color: var(--wp--preset--color--white);
	transition: width 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}
.bsg-search-field::placeholder { color: rgba(255, 255, 255, 0.6); }
.bsg-search:hover .bsg-search-field,
.bsg-search:focus-within .bsg-search-field {
	width: 180px;
	padding: 0 0.65rem;
	opacity: 1;
}
/* Fixed, centered icon box so the magnifier lines up with the social row. */
.bsg-search-btn {
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	color: var(--wp--preset--color--white);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.bsg-search-btn svg { width: 20px; height: 20px; display: block; }

/* ── Mobile header ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
	.bsg-header-social { display: none; }
	.bsg-header-right { gap: 0.35rem; }
	.bsg-logo img { max-width: 180px; }

	/* Magnifier toggle next to the hamburger. */
	.bsg-search-trigger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 38px;
		height: 38px;
		color: var(--wp--preset--color--white);
		cursor: pointer;
	}
	.bsg-search-trigger svg { width: 20px; height: 20px; }

	/* Inline search hidden; opens as a full-width bar under the header. */
	.bsg-search { display: none; }
	.bsg-search-toggle:checked ~ .bsg-search {
		display: flex;
		position: absolute;
		left: 0;
		right: 0;
		top: calc(100% + 12px);
		width: 100%;
		padding: 0.55rem 0.7rem;
		gap: 0.4rem;
		background: var(--wp--preset--color--secondary);
		border: 1px solid rgba(255, 255, 255, 0.1);
		border-radius: 10px;
		box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
		z-index: 60;
	}
	.bsg-search-toggle:checked ~ .bsg-search .bsg-search-field {
		flex: 1;
		width: auto;
		opacity: 1;
		padding: 0.35rem 0.6rem;
		height: 38px;
	}
	.bsg-burger {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 4px;
		padding: 8px;
		cursor: pointer;
	}
	.bsg-burger span {
		display: block;
		width: 22px;
		height: 2px;
		background: var(--wp--preset--color--white);
		border-radius: 2px;
		transition: transform 0.2s ease, opacity 0.2s ease;
	}
	.bsg-mainnav { position: relative; }
	.bsg-menu {
		display: none;
		position: absolute;
		right: 0;
		top: calc(100% + 12px);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		min-width: 230px;
		padding: 0.4rem 0;
		background: var(--wp--preset--color--secondary);
		border: 1px solid rgba(255, 255, 255, 0.08);
		border-radius: 10px;
		box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
		z-index: 60;
	}
	.bsg-nav-toggle:checked ~ .bsg-menu { display: flex; }
	.bsg-menu li { width: 100%; }
	.bsg-menu a {
		display: block;
		padding: 0.8rem 1.25rem;
		font-size: 1rem;
	}
	.bsg-menu li + li a { border-top: 1px solid rgba(255, 255, 255, 0.06); }
	/* Burger → X when open. */
	.bsg-nav-toggle:checked ~ .bsg-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
	.bsg-nav-toggle:checked ~ .bsg-burger span:nth-child(2) { opacity: 0; }
	.bsg-nav-toggle:checked ~ .bsg-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}
@media (max-width: 600px) {
	.bsg-header { padding-left: 1.1rem !important; padding-right: 1.1rem !important; }
	.bsg-logo img { max-width: 150px; }
}

/* ── Shared layout shell ────────────────────────────────────────────── */
.bsg-home {
	overflow-x: clip;
	/* Remove the root block-gap strip between the dark header and the hero. */
	margin-top: 0 !important;
}
.bsg-shell {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 2rem;
}
@media (max-width: 600px) {
	.bsg-shell { padding: 0 1.1rem; }
}

/* Generic eyebrow (uppercase category label). */
.bsg-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 600;
	font-size: 0.72rem;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}
.bsg-eyebrow:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Section heading with navy underline. */
.bsg-section-head {
	border-bottom: 2px solid var(--wp--preset--color--primary);
	padding-bottom: 0.4rem;
	margin-bottom: 1.4rem;
	font-family: var(--wp--preset--font-family--albert-sans);
	font-weight: 600;
}

/* ── Gradient hero (full bleed) ─────────────────────────────────────── */
.bsg-hero-full {
	width: 100vw;
	margin-left: calc(50% - 50vw);
}
.bsg-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
	gap: 3rem;
	align-items: center;
	padding: 2.75rem 2rem;
}
/* Wide, horizontal banner image (overrides any width/height img attributes). */
.bsg-hero-media { display: block; }
.bsg-hero-media img {
	width: 100%;
	height: clamp(260px, 28vw, 400px);
	aspect-ratio: auto;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}
.bsg-hero-title {
	display: block;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	font-size: clamp(2rem, 3.4vw, 3.1rem);
	line-height: 1.04;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--wp--preset--color--white);
	text-decoration: none;
}
.bsg-hero-title:hover { color: var(--wp--preset--color--white); text-decoration: underline; text-underline-offset: 5px; }
.bsg-hero-excerpt {
	margin-top: 1rem;
	color: color-mix(in srgb, #ffffff 82%, transparent);
	font-size: 1.05rem;
	line-height: 1.6;
}

/* ── Feature grid: cards + chart (left) / columnists (right) ─────────── */
.bsg-feature-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: 2.5rem;
	padding-top: 3rem;
}
.bsg-feature-main {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}
.bsg-card-duo {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.75rem;
}
.bsg-feature-side {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* ── Article cards ──────────────────────────────────────────────────── */
.bsg-card { display: flex; flex-direction: column; }
.bsg-card-media {
	display: block;
	margin-bottom: 0.85rem;
}
.bsg-card-media img {
	width: 100%;
	height: var(--bsg-img-h, 190px);
	object-fit: cover;
	border-radius: 4px;
	display: block;
}
.bsg-card-title {
	font-family: var(--wp--preset--font-family--albert-sans);
	font-weight: 600;
	font-size: 1.35rem;
	line-height: 1.2;
	margin: 0 0 0.45rem;
}
.bsg-card-title a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}
.bsg-card-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--primary);
	text-underline-offset: 2px;
}
.bsg-card-excerpt {
	color: color-mix(in srgb, var(--wp--preset--color--primary) 78%, transparent);
	font-size: 0.95rem;
	line-height: 1.55;
	margin: 0 0 0.7rem;
}
.bsg-card-meta {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex-wrap: wrap;
	margin-top: auto;
}
.bsg-card-date {
	font-size: 0.8rem;
	color: var(--wp--preset--color--tertiary);
}

/* ── Dark TradingView chart ─────────────────────────────────────────── */
.bsg-chart {
	min-height: 420px;
	border-radius: 6px;
	overflow: hidden;
}

/* ── Navy columnist cards ───────────────────────────────────────────── */
.bsg-columnist-card {
	background: linear-gradient(180deg, #13406c 0%, #0c2327 100%);
	color: var(--wp--preset--color--white);
	border-radius: 8px;
	padding: 1.75rem;
}
.bsg-columnist-eyebrow {
	display: inline-block;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	font-size: 1.3rem;
	border-bottom: 3px solid rgba(255, 255, 255, 0.5);
	padding-bottom: 0.25rem;
	margin: 0 0 0.9rem;
}
.bsg-columnist-eyebrow a { color: var(--wp--preset--color--white); text-decoration: none; }
.bsg-columnist-title {
	font-family: var(--wp--preset--font-family--albert-sans);
	font-weight: 600;
	font-size: 1.4rem;
	line-height: 1.2;
	margin: 0 0 0.6rem;
}
.bsg-columnist-title a { color: var(--wp--preset--color--white); text-decoration: none; }
.bsg-columnist-title a:hover { color: var(--wp--preset--color--white); text-decoration: underline; text-underline-offset: 3px; }
.bsg-columnist-excerpt {
	color: color-mix(in srgb, #ffffff 78%, transparent);
	font-size: 0.95rem;
	line-height: 1.55;
	margin: 0 0 0.4rem;
}
.bsg-readmore {
	display: inline-block;
	color: var(--wp--preset--color--white);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	margin: 0.4rem 0 1rem;
}
.bsg-readmore:hover { color: rgba(255, 255, 255, 0.75); }
.bsg-byline {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.bsg-byline-avatar,
.bsg-byline img {
	border-radius: 50%;
	width: 34px;
	height: 34px;
}
.bsg-byline-name {
	font-size: 0.85rem;
	font-weight: 600;
}

/* ── Ad slot ────────────────────────────────────────────────────────── */
.bsg-ad-slot { margin: 2.5rem 0; }
.bsg-ad-leaderboard {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 96px;
	background: color-mix(in srgb, var(--wp--preset--color--tertiary) 18%, transparent);
	border: 1px dashed color-mix(in srgb, var(--wp--preset--color--tertiary) 60%, transparent);
	border-radius: 4px;
	text-align: center;
}
.bsg-ad-leaderboard .bsg-ad-label {
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.72rem;
	color: var(--wp--preset--color--tertiary);
}
.bsg-ad-unit { width: 100%; }

/* ── More stories grid ──────────────────────────────────────────────── */
.bsg-more-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
	padding-bottom: 1rem;
}

/* ── Archive / single shared cards (block-based templates) ──────────── */
.bsg-card-h { align-items: flex-start; gap: 1rem; }
.bsg-card-h .wp-block-post-featured-image { flex: 0 0 auto; margin: 0; }
.bsg-card-h .wp-block-post-featured-image img { border-radius: 4px; object-fit: cover; }

/* Block-markup cards (archive/index/search) reuse the .bsg-card class on a
   group block; map the gold eyebrow onto post-terms links and crop images. */
.wp-block-post-terms.bsg-eyebrow a {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 600;
	font-size: 0.72rem;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}
.wp-block-group.bsg-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
	border-radius: 4px;
}
.wp-block-group.bsg-card .wp-block-post-title a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}
.wp-block-group.bsg-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--primary);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	.bsg-feature-grid { grid-template-columns: 1fr; }
	.bsg-more-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.bsg-hero-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 2.25rem 1.1rem; }
	.bsg-card-duo { grid-template-columns: 1fr; }
	.bsg-more-grid { grid-template-columns: 1fr; }
}

/* ── Claude AI Equity Analysis section ──────────────────────────────── */
.bsg-ai {
	margin: 3rem 0;
	padding: 2.5rem 2rem 2rem;
	border-radius: 14px;
	background: linear-gradient(135deg, #13406c 0%, #0c2327 70%, #1a1230 100%);
	color: var(--wp--preset--color--white);
	text-align: center;
}
.bsg-ai-head { max-width: 640px; margin: 0 auto 1.5rem; }
.bsg-ai-badge {
	display: inline-block;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 600;
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #cfe0f0;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.18);
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
}
.bsg-ai-title {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	font-size: clamp(1.7rem, 3vw, 2.4rem);
	margin: 0.7rem 0 0.4rem;
	color: var(--wp--preset--color--white);
}
.bsg-ai-sub { color: color-mix(in srgb, #ffffff 80%, transparent); margin: 0; }

.bsg-ai-form {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	flex-wrap: wrap;
	max-width: 520px;
	margin: 0 auto 1rem;
}
.bsg-ai-input {
	flex: 1 1 220px;
	min-width: 0;
	padding: 0.75rem 1rem;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.bsg-ai-input::placeholder { color: rgba(255, 255, 255, 0.5); text-transform: none; letter-spacing: 0; }
.bsg-ai-btn {
	padding: 0.75rem 1.4rem;
	border: 0;
	border-radius: 8px;
	background: #fff;
	color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.bsg-ai-btn:hover { transform: translateY(-1px); opacity: 0.92; }

.bsg-ai-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.bsg-ai-chip {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #d7e3f0;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 600;
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	cursor: pointer;
}
.bsg-ai-chip:hover { background: rgba(255, 255, 255, 0.18); }

/* Result card (light card on the dark section). */
.bsg-ai-result { margin-top: 1.5rem; }
.bsg-ai-card {
	background: #fff;
	color: var(--wp--preset--color--primary);
	border-radius: 12px;
	padding: 1.5rem;
	text-align: left;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}
.bsg-ai-card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 1px solid #e6ebee;
	padding-bottom: 0.8rem;
	margin-bottom: 0.9rem;
}
.bsg-ai-tkr { font-family: var(--wp--preset--font-family--barlow); font-weight: 700; font-size: 1.3rem; }
.bsg-ai-co { font-weight: 600; }
.bsg-ai-sector { font-size: 0.8rem; color: var(--wp--preset--color--tertiary); margin-top: 0.15rem; }
.bsg-ai-pill {
	flex: 0 0 auto;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.78rem;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	color: #fff;
}
.bsg-ai-bullish { background: #1a9e63; }
.bsg-ai-neutral { background: #6b7780; }
.bsg-ai-bearish { background: #cf2e2e; }
.bsg-ai-summary { line-height: 1.6; margin: 0 0 1.1rem; }
.bsg-ai-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.bsg-ai-col h4 {
	margin: 0 0 0.5rem;
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.78rem;
	padding-bottom: 0.3rem;
	border-bottom: 2px solid currentColor;
	display: inline-block;
}
.bsg-ai-bull h4 { color: #1a9e63; }
.bsg-ai-bear h4 { color: #cf2e2e; }
.bsg-ai-risk h4 { color: #b8860b; }
.bsg-ai-col ul { margin: 0; padding-left: 1.1rem; }
.bsg-ai-col li { font-size: 0.92rem; line-height: 1.45; margin-bottom: 0.4rem; color: color-mix(in srgb, var(--wp--preset--color--primary) 88%, transparent); }
.bsg-ai-card-foot { margin-top: 1rem; font-size: 0.72rem; color: var(--wp--preset--color--tertiary); }

.bsg-ai-disclaimer { margin: 1.1rem 0 0; font-size: 0.74rem; color: rgba(255, 255, 255, 0.55); }
.bsg-ai-error {
	background: rgba(207, 46, 46, 0.15);
	border: 1px solid rgba(207, 46, 46, 0.4);
	color: #ffd7d7;
	padding: 0.9rem 1.1rem;
	border-radius: 8px;
	display: inline-block;
}
.bsg-ai-loading { color: #d7e3f0; font-size: 0.95rem; }
.bsg-ai-loading span {
	display: inline-block;
	width: 7px; height: 7px;
	margin-right: 2px;
	border-radius: 50%;
	background: #cfe0f0;
	animation: bsg-ai-bounce 1s infinite ease-in-out;
}
.bsg-ai-loading span:nth-child(2) { animation-delay: 0.15s; }
.bsg-ai-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bsg-ai-bounce { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

@media (max-width: 700px) {
	.bsg-ai-cols { grid-template-columns: 1fr; }
	.bsg-ai-card-head { flex-direction: column; }
}

/* AI feature gated (subscribers/paid). */
.bsg-ai-gate {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
	justify-content: center;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #e6eef6;
	padding: 0.9rem 1.2rem;
	border-radius: 10px;
}
.bsg-ai-lock { font-size: 1.1rem; }
.bsg-ai-cta {
	background: #fff;
	color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.78rem;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	text-decoration: none;
}
.bsg-ai-cta:hover { opacity: 0.9; }

/* ── AI Research tools page ─────────────────────────────────────────── */
.bsg-tools-head { text-align: center; max-width: 720px; margin: 0 auto 2rem; }
.bsg-tools-title {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	font-size: clamp(1.9rem, 4vw, 2.8rem);
	margin: 0.7rem 0 0.5rem;
	color: var(--wp--preset--color--primary);
}
.bsg-tools-head .bsg-ai-badge { color: var(--wp--preset--color--primary); background: rgba(19, 64, 108, 0.08); border-color: rgba(19, 64, 108, 0.2); }
.bsg-tools-sub { color: color-mix(in srgb, var(--wp--preset--color--primary) 75%, transparent); margin: 0; }

.bsg-tools-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 1.5rem;
	align-items: start;
}
.bsg-tool {
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 12px;
	padding: 1.4rem;
}
.bsg-tool-name {
	font-family: var(--wp--preset--font-family--albert-sans);
	font-weight: 600;
	font-size: 1.2rem;
	margin: 0 0 0.35rem;
	color: var(--wp--preset--color--primary);
}
.bsg-tool-desc { font-size: 0.9rem; line-height: 1.5; color: color-mix(in srgb, var(--wp--preset--color--primary) 72%, transparent); margin: 0 0 0.9rem; }
.bsg-tool-form { display: flex; gap: 0.5rem; }
.bsg-tool-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.6rem 0.8rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 55%, transparent);
	border-radius: 8px;
	font-size: 0.95rem;
}
.bsg-tool-run {
	flex: 0 0 auto;
	border: 0;
	border-radius: 8px;
	padding: 0.6rem 1.1rem;
	background: var(--wp--preset--color--primary);
	color: #fff;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
}
.bsg-tool-run:hover { background: var(--wp--preset--color--secondary); }
.bsg-tool-result:not(:empty) { margin-top: 1rem; }

.bsg-tool-card { border-top: 1px solid #e6ebee; padding-top: 1rem; }
.bsg-tool-card h3 {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	font-size: 1.1rem;
	margin: 0 0 0.2rem;
	color: var(--wp--preset--color--primary);
}
.bsg-tool-card-sub { font-size: 0.85rem; color: var(--wp--preset--color--tertiary); margin: 0 0 0.8rem; }
.bsg-tool-sec { margin-bottom: 0.8rem; }
.bsg-tool-sec h4 {
	margin: 0 0 0.35rem;
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.74rem;
	color: var(--wp--preset--color--primary);
	border-bottom: 2px solid var(--wp--preset--color--primary);
	display: inline-block;
	padding-bottom: 0.2rem;
}
.bsg-tool-sec ul { margin: 0; padding-left: 1.1rem; }
.bsg-tool-sec li { font-size: 0.9rem; line-height: 1.45; margin-bottom: 0.3rem; color: color-mix(in srgb, var(--wp--preset--color--primary) 86%, transparent); }
.bsg-tool-take { font-size: 0.92rem; background: rgba(19, 64, 108, 0.06); border-left: 3px solid var(--wp--preset--color--primary); padding: 0.6rem 0.8rem; border-radius: 0 6px 6px 0; }
.bsg-tool-foot { font-size: 0.7rem; color: var(--wp--preset--color--tertiary); margin-top: 0.7rem; }

/* On the light tools page the loading dots need a darker tone. */
.bsg-tool-result .bsg-ai-loading { color: var(--wp--preset--color--primary); }
.bsg-tool-result .bsg-ai-loading span { background: var(--wp--preset--color--primary); }
.bsg-tool-result .bsg-ai-error { background: rgba(207, 46, 46, 0.1); color: #a01b1b; border-color: rgba(207, 46, 46, 0.3); }
.bsg-tool-result .bsg-ai-gate { background: rgba(19, 64, 108, 0.06); color: var(--wp--preset--color--primary); border-color: rgba(19, 64, 108, 0.2); }
.bsg-tool-result .bsg-ai-cta { background: var(--wp--preset--color--primary); color: #fff; }

/* ── AI tool card states: hover / generating / done ─────────────────── */
.bsg-tool {
	position: relative;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.bsg-tool:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(12, 35, 39, 0.08); }

/* Accent bar at the top of each card (animated while generating, solid when done). */
.bsg-tool.is-loading::before,
.bsg-tool.is-active::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
}
.bsg-tool.is-loading {
	border-color: color-mix(in srgb, var(--wp--preset--color--primary) 55%, transparent);
	box-shadow: 0 10px 30px rgba(19, 64, 108, 0.12);
}
.bsg-tool.is-loading::before {
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--primary), #4a1d7a, transparent);
	background-size: 220% 100%;
	animation: bsg-tool-bar 1.1s linear infinite;
}
@keyframes bsg-tool-bar { 0% { background-position: 220% 0; } 100% { background-position: -220% 0; } }

.bsg-tool.is-active {
	grid-column: 1 / -1;                 /* expand to full width when it has a result */
	border-color: color-mix(in srgb, var(--wp--preset--color--primary) 45%, transparent);
	box-shadow: 0 18px 44px rgba(12, 35, 39, 0.16);
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.bsg-tool.is-active::before {
	background: linear-gradient(90deg, var(--wp--preset--color--primary), #4a1d7a);
}

/* Result reveals smoothly, and on a wide active card the sections flow into columns. */
.bsg-tool-card { animation: bsg-tool-reveal 0.35s ease both; }
@keyframes bsg-tool-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bsg-tool-secs { margin-bottom: 0.4rem; }
.bsg-tool.is-active .bsg-tool-secs {
	columns: 300px;
	column-gap: 2.2rem;
}
.bsg-tool.is-active .bsg-tool-sec { break-inside: avoid; margin-bottom: 1rem; }
.bsg-tool.is-active .bsg-tool-card h3 { font-size: 1.3rem; }

@media (prefers-reduced-motion: reduce) {
	.bsg-tool, .bsg-tool-card, .bsg-tool.is-loading::before { animation: none; transition: none; }
}

/* ── Single-article linha fina (bsg/post-subtitle) + photo caption ──── */
.bsg-post-subtitle {
	font-family: var(--wp--preset--font-family--albert-sans);
	font-size: clamp(1.15rem, 2.2vw, 1.4rem);
	line-height: 1.45;
	font-weight: 400;
	color: color-mix(in srgb, var(--wp--preset--color--primary) 78%, transparent);
	margin: 0.5rem 0 0.25rem;
}
.bsg-featured-caption {
	font-family: var(--wp--preset--font-family--albert-sans);
	font-size: 0.82rem;
	line-height: 1.4;
	color: var(--wp--preset--color--tertiary);
	margin: 0 0 1.5rem;
	text-align: left;
}
.bsg-featured-caption a { color: var(--wp--preset--color--primary); }

/* ── Single-article byline (bsg/post-byline) ────────────────────────── */
.bsg-byline-block {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin: 1rem 0 0.5rem;
	padding: 0.9rem 0;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 40%, transparent);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 40%, transparent);
}
.bsg-bl-id { display: flex; align-items: center; gap: 0.75rem; }
.bsg-bl-avatar,
.bsg-bl-id img {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}
.bsg-bl-meta { display: flex; flex-direction: column; line-height: 1.3; }
.bsg-bl-author {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	font-size: 1rem;
	color: var(--wp--preset--color--primary);
}
.bsg-bl-sub {
	font-size: 0.82rem;
	color: var(--wp--preset--color--tertiary);
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
}
.bsg-bl-dot { opacity: 0.6; }
.bsg-bl-comments { color: var(--wp--preset--color--primary); font-weight: 600; text-decoration: none; }
.bsg-bl-comments:hover { text-decoration: underline; }

/* Share buttons */
.bsg-bl-share { display: flex; align-items: center; gap: 0.4rem; }
.bsg-bl-share-label {
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.68rem;
	color: var(--wp--preset--color--tertiary);
	margin-right: 0.15rem;
}
.bsg-bl-sbtn {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 45%, transparent);
	background: transparent;
	color: var(--wp--preset--color--primary);
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	position: relative;
}
.bsg-bl-sbtn:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: #fff;
}
.bsg-bl-sbtn svg { width: 17px; height: 17px; fill: currentColor; }
.bsg-bl-copy svg { fill: none; }
.bsg-bl-copied {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--wp--preset--color--secondary);
	color: #fff;
	font-size: 0.66rem;
	padding: 0.2rem 0.45rem;
	border-radius: 4px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}
.bsg-bl-copy.is-copied .bsg-bl-copied { opacity: 1; }

@media (max-width: 600px) {
	.bsg-byline-block { gap: 0.75rem; }
	.bsg-bl-share-label { display: none; }
}

/* ── Rounded images site-wide ───────────────────────────────────────── */
.wp-block-post-featured-image img,
.wp-block-image img,
.wp-block-image .wp-block-image__crop-area,
.wp-block-media-text__media img,
.bsg-hero-media img,
.bsg-card-media img,
.bsg-card-h .wp-block-post-featured-image img,
.wp-block-group.bsg-card .wp-block-post-featured-image img {
	border-radius: 10px;
}
.wp-block-cover,
.wp-block-post-featured-image {
	border-radius: 10px;
	overflow: hidden;
}
/* Tighter radius on small thumbnails so the corners still read. */
.bsg-card-h .wp-block-post-featured-image img,
.bsg-secondary .wp-block-post-featured-image img {
	border-radius: 8px;
}
/* People stay circular. */
.wp-block-avatar img,
.bsg-bl-avatar,
.bsg-byline-avatar,
.bsg-bl-id img,
.is-style-rounded img {
	border-radius: 50%;
}

/* ── AI Research page: colorful treatment (matches the homepage AI band) ── */
.bsg-tools {
	background: linear-gradient(140deg, #13406c 0%, #0c2327 58%, #2a1747 100%);
	border-radius: 16px;
	padding: 2.6rem 2rem 2.4rem;
	color: #fff;
}
.bsg-tools-title { color: #fff; }
.bsg-tools-sub { color: rgba(255, 255, 255, 0.82); }
.bsg-tools-head .bsg-ai-badge {
	color: #cfe0f0;
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
}
.bsg-tools .bsg-tool { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22); }
.bsg-tools .bsg-tool:hover { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28); }

/* Result sections become distinct, color-rotated panels. */
.bsg-tool-sec {
	--acc: #13406c;
	background: color-mix(in srgb, var(--acc) 7%, #ffffff);
	border: 1px solid color-mix(in srgb, var(--acc) 16%, transparent);
	border-left: 4px solid var(--acc);
	border-radius: 6px;
	padding: 0.85rem 1rem;
	margin-bottom: 1rem;
	break-inside: avoid;
}
.bsg-sec-0 { --acc: #13406c; }
.bsg-sec-1 { --acc: #0e8a93; }
.bsg-sec-2 { --acc: #6b3fa0; }
.bsg-sec-3 { --acc: #1a9e63; }
.bsg-sec-4 { --acc: #c98a1b; }
.bsg-tool-sec h4 {
	display: block;
	margin: 0 0 0.45rem;
	padding: 0;
	border-bottom: 0;
	color: var(--acc);
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.76rem;
}
.bsg-tool-sec ul { padding-left: 1.05rem; }
.bsg-tool-sec li::marker { color: var(--acc); }
.bsg-tool-sec li { color: color-mix(in srgb, var(--wp--preset--color--primary) 88%, transparent); }

/* Takeaway is a bold navy→violet callout. */
.bsg-tool-take {
	background: linear-gradient(135deg, #13406c 0%, #2a1747 100%);
	color: #fff;
	border-left: 0;
	border-radius: 8px;
	padding: 0.95rem 1.15rem;
	font-size: 0.95rem;
	margin-top: 0.4rem;
}
.bsg-tool-take strong { color: #cfe0f0; }

@media (max-width: 600px) {
	.bsg-tools { padding: 2rem 1.1rem; }
}

/* ── Stock page (/acao/{ticker}/) ───────────────────────────────────── */
.bsg-stock { display: flex; flex-direction: column; gap: 1.5rem; }
.bsg-stock-top {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}
.bsg-stock-title {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	font-size: clamp(1.8rem, 3.5vw, 2.6rem);
	margin: 0.3rem 0 0;
	color: var(--wp--preset--color--primary);
	line-height: 1.05;
}
.bsg-stock-title span {
	display: block;
	font-family: var(--wp--preset--font-family--albert-sans);
	font-weight: 600;
	text-transform: none;
	font-size: 1.05rem;
	color: var(--wp--preset--color--tertiary);
	margin-top: 0.2rem;
}
.bsg-stock-search { display: flex; gap: 0.5rem; }
.bsg-stock-search input {
	padding: 0.6rem 0.85rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 55%, transparent);
	border-radius: 8px;
	text-transform: uppercase;
	font-size: 0.95rem;
	max-width: 220px;
}
.bsg-stock-search button {
	border: 0;
	border-radius: 8px;
	padding: 0.6rem 1.1rem;
	background: var(--wp--preset--color--primary);
	color: #fff;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
}
.bsg-stock-search button:hover { background: var(--wp--preset--color--secondary); }

.bsg-stock-quote {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 12px;
	/* No padding: the TradingView symbol-info widget fixes its width to the
	   content box, so any padding leaves an empty gap on the right. */
	padding: 0;
	background: #fff;
}
.bsg-stock-grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 1.5rem;
}
.bsg-stock-chart {
	/* Stretch to the taller column (technical + ad) so there's no empty gap
	   under the chart; grid items stretch by default. */
	height: auto;
	min-height: 480px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}
.bsg-stock-chart .tradingview-widget-container,
.bsg-stock-chart .tradingview-widget-container__widget { height: 100%; }
.bsg-stock-side {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	min-height: 480px;
}

.bsg-stock-ai { margin: 0.5rem 0; }
.bsg-stock-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.bsg-stock-panel {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 12px;
	padding: 1.1rem 1.2rem;
	background: #fff;
}
.bsg-stock-panel .bsg-section-head { margin-top: 0; }
.bsg-stock-foot { font-size: 0.74rem; color: var(--wp--preset--color--tertiary); text-align: center; margin: 0.5rem 0 0; }

@media (max-width: 880px) {
	.bsg-stock-grid,
	.bsg-stock-grid2 { grid-template-columns: 1fr; }
	.bsg-stock-side { min-height: 420px; }
}

/* ── AI Portfolio Analysis (/portfolio/) ────────────────────────────── */
.bsg-pf-head { text-align: center; max-width: 720px; margin: 0 auto 1.5rem; }
.bsg-pf-title {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	font-size: clamp(1.9rem, 4vw, 2.7rem);
	margin: 0.6rem 0 0.4rem;
	color: var(--wp--preset--color--primary);
}
.bsg-pf-head .bsg-ai-badge { color: var(--wp--preset--color--primary); background: rgba(19, 64, 108, 0.08); border-color: rgba(19, 64, 108, 0.2); }
.bsg-pf-sub { color: color-mix(in srgb, var(--wp--preset--color--primary) 75%, transparent); margin: 0; }

.bsg-pf-builder {
	max-width: 680px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 14px;
	padding: 1.4rem;
}
.bsg-pf-row {
	display: grid;
	grid-template-columns: 1.2fr 1fr 64px 32px;
	gap: 0.6rem;
	align-items: center;
	margin-bottom: 0.5rem;
}
.bsg-pf-row-head {
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.68rem;
	color: var(--wp--preset--color--tertiary);
	margin-bottom: 0.4rem;
}
.bsg-pf-tkr, .bsg-pf-val {
	padding: 0.55rem 0.7rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 50%, transparent);
	border-radius: 8px;
	font-size: 0.95rem;
}
.bsg-pf-tkr { text-transform: uppercase; }
.bsg-pf-wt { font-weight: 600; color: var(--wp--preset--color--primary); font-size: 0.9rem; text-align: right; }
.bsg-pf-del {
	border: 0; background: transparent; cursor: pointer; font-size: 1.3rem; line-height: 1;
	color: var(--wp--preset--color--tertiary);
}
.bsg-pf-del:hover { color: #cf2e2e; }
.bsg-pf-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.6rem 0 1rem; flex-wrap: wrap; }
.bsg-pf-add {
	border: 1px dashed color-mix(in srgb, var(--wp--preset--color--primary) 45%, transparent);
	background: transparent;
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	border-radius: 8px;
	padding: 0.5rem 0.9rem;
	cursor: pointer;
}
.bsg-pf-total { font-size: 0.85rem; color: var(--wp--preset--color--tertiary); }
.bsg-pf-analyze { width: 100%; }

.bsg-pf-result { margin-top: 1.5rem; }
.bsg-pf-card {
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 14px;
	padding: 1.5rem;
	box-shadow: 0 14px 36px rgba(12, 35, 39, 0.1);
	animation: bsg-tool-reveal 0.35s ease both;
}
.bsg-pf-scorebar { display: flex; gap: 1.25rem; align-items: center; border-bottom: 1px solid #e6ebee; padding-bottom: 1.1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.bsg-pf-score {
	flex: 0 0 auto;
	width: 96px; height: 96px;
	border-radius: 50%;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	color: #fff;
}
.bsg-pf-score-n { font-family: var(--wp--preset--font-family--barlow); font-weight: 700; font-size: 2rem; line-height: 1; }
.bsg-pf-score-l { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; }
.bsg-pf-verdict { flex: 1 1 240px; }
.bsg-pf-verdict p { margin: 0.5rem 0 0; line-height: 1.55; }
.bsg-pf-pill {
	display: inline-block; color: #fff; font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.78rem;
	padding: 0.3rem 0.75rem; border-radius: 999px;
}
.bsg-pf-good { background: #1a9e63; }
.bsg-pf-mid { background: #c98a1b; }
.bsg-pf-low { background: #cf2e2e; }

.bsg-pf-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.2rem; }
.bsg-pf-chart h4 {
	margin: 0 0 0.6rem; font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.74rem; color: var(--wp--preset--color--primary);
}
.bsg-pf-bar { display: grid; grid-template-columns: 64px 1fr 44px; gap: 0.5rem; align-items: center; margin-bottom: 0.45rem; }
.bsg-pf-bar-l { font-size: 0.8rem; font-weight: 600; color: var(--wp--preset--color--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsg-pf-bar-track { height: 9px; background: #eef2f5; border-radius: 999px; overflow: hidden; }
.bsg-pf-bar-fill { display: block; height: 100%; border-radius: 999px; }
.bsg-pf-f-a { background: linear-gradient(90deg, #13406c, #2a6fb0); }
.bsg-pf-f-s { background: linear-gradient(90deg, #1a9e63, #0e8a93); }
.bsg-pf-bar-v { font-size: 0.78rem; color: var(--wp--preset--color--tertiary); text-align: right; }

.bsg-pf-secs { columns: 300px; column-gap: 2.2rem; margin-bottom: 0.5rem; }
.bsg-pf-sugg {
	background: linear-gradient(135deg, #13406c 0%, #2a1747 100%);
	color: #fff; border-radius: 10px; padding: 1.1rem 1.3rem; margin-top: 0.6rem;
}
.bsg-pf-sugg h4 { margin: 0 0 0.5rem; color: #cfe0f0; font-family: var(--wp--preset--font-family--barlow); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.78rem; }
.bsg-pf-sugg ul { margin: 0; padding-left: 1.1rem; }
.bsg-pf-sugg li { margin-bottom: 0.4rem; line-height: 1.5; }

@media (max-width: 640px) {
	.bsg-pf-charts { grid-template-columns: 1fr; }
	.bsg-pf-row { grid-template-columns: 1fr 0.9fr 52px 28px; }
}

/* Portfolio loading: high-contrast, centered, larger (light page bg). */
.bsg-pf-result .bsg-ai-loading {
	color: var(--wp--preset--color--primary);
	font-size: 1.15rem;
	font-weight: 600;
	text-align: center;
	padding: 2.25rem 1rem;
}
.bsg-pf-result .bsg-ai-loading span {
	width: 11px;
	height: 11px;
	background: var(--wp--preset--color--primary);
	margin-right: 4px;
}

/* Force TradingView widgets to fill the container (the symbol-info widget can
   render its iframe at a fixed, narrower width, leaving an empty right gap). */
.bsg-stock .tradingview-widget-container,
.bsg-stock .tradingview-widget-container__widget { width: 100%; }
.bsg-stock .tradingview-widget-container iframe { width: 100% !important; min-width: 100% !important; }
.bsg-stock-quote { overflow: hidden; }

/* Disclaimer shown at the bottom of every AI-generated result card. */
.bsg-gen-disc {
	margin: 0.9rem 0 0;
	padding-top: 0.6rem;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	font-size: 0.7rem;
	line-height: 1.4;
	color: var(--wp--preset--color--tertiary);
	text-align: center;
}

/* ── Ad units (Google Ad Manager — billboard + sidebar) ─────────────── */
.bsg-ad-label {
	display: block;
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.62rem;
	color: var(--wp--preset--color--tertiary);
	margin-bottom: 0.35rem;
	text-align: center;
}
.bsg-gam { display: flex; justify-content: center; width: 100%; }
.bsg-gam.ad-box-970x90 { min-height: 90px; }
.bsg-gam.ad-300x250 { min-height: 250px; }
.bsg-gam.ad-300x250 > div { width: 300px; max-width: 100%; }

/* Homepage leaderboard now holds the real billboard — clean, no placeholder box. */
.bsg-ad-leaderboard {
	flex-direction: column;
	gap: 0.25rem;
	min-height: 90px;
	background: transparent;
	border: 0;
}
.bsg-ad-sidebar { margin-top: 1.5rem; text-align: center; }
.bsg-ad-billboard { text-align: center; }

/* Homepage: show one ad unit per device so the wide billboard and the 300x250
   sidebar box never appear together. The leaderboard is desktop-only; the
   sidebar box is mobile-only. The sidebar rule is scoped to .bsg-feature-side
   so the stock-page sidebar ad (.bsg-stock-side) is untouched. Breakpoint
   matches where .bsg-feature-grid stacks to one column (900px). */
@media (max-width: 900px) {
	.bsg-ad-leaderboard { display: none; }
}
@media (min-width: 901px) {
	.bsg-feature-side .bsg-ad-sidebar { display: none; }
}

/* ── Stocks index (/stocks/) ────────────────────────────────────────── */
.bsg-stocks { display: flex; flex-direction: column; gap: 1.5rem; }
.bsg-stocks-tape {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 12px;
	overflow: hidden;
}
.bsg-stocks-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}
.bsg-stocks-title {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	font-size: clamp(1.8rem, 3.5vw, 2.6rem);
	margin: 0.3rem 0 0.2rem;
	color: var(--wp--preset--color--primary);
}
.bsg-stocks-sub { margin: 0; color: color-mix(in srgb, var(--wp--preset--color--primary) 72%, transparent); max-width: 560px; }
.bsg-stocks-search { display: flex; gap: 0.5rem; }
.bsg-stocks-search input {
	padding: 0.6rem 0.85rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 55%, transparent);
	border-radius: 8px;
	text-transform: uppercase;
	font-size: 0.95rem;
	max-width: 240px;
}
.bsg-stocks-search button {
	border: 0;
	border-radius: 8px;
	padding: 0.6rem 1.1rem;
	background: var(--wp--preset--color--primary);
	color: #fff;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
}
.bsg-stocks-search button:hover { background: var(--wp--preset--color--secondary); }

.bsg-stocks-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 0.85rem;
}
.bsg-stk-card {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--tertiary) 35%, transparent);
	border-radius: 10px;
	padding: 0.9rem 1rem;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.bsg-stk-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(12, 35, 39, 0.1);
	border-color: color-mix(in srgb, var(--wp--preset--color--primary) 40%, transparent);
}
.bsg-stk-tkr {
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 700;
	font-size: 1.15rem;
	color: var(--wp--preset--color--primary);
}
.bsg-stk-name { font-size: 0.85rem; color: color-mix(in srgb, var(--wp--preset--color--primary) 78%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsg-stk-sec {
	margin-top: 0.3rem;
	font-family: var(--wp--preset--font-family--barlow);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.64rem;
	color: var(--wp--preset--color--tertiary);
}

/* ── Homepage rolling ticker tape (full-bleed, above the hero) ───────── */
.bsg-home-tape {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	background: var(--wp--preset--color--secondary);
	line-height: 0;
}
.bsg-home-tape .tradingview-widget-copyright { display: none; }

/* Homepage tag sections (Blue Chips, Infrastructure). */
.bsg-tag-section { margin-top: 2.6rem; }
.bsg-section-head a { color: var(--wp--preset--color--primary); text-decoration: none; }
.bsg-section-head a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--primary); }

/* ── Discreet language switcher (header) ────────────────────────────── */
.bsg-lang { position: relative; display: inline-flex; align-items: center; }
.bsg-lang-cur {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	color: rgba(255, 255, 255, 0.5);
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 600;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	cursor: default;
	transition: color 0.15s ease;
}
.bsg-lang:hover .bsg-lang-cur,
.bsg-lang:focus-within .bsg-lang-cur { color: #fff; }
.bsg-lang-cur svg { width: 15px; height: 15px; }
.bsg-lang-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	display: none;
	flex-direction: column;
	min-width: 60px;
	padding: 0.25rem;
	background: var(--wp--preset--color--secondary);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
	z-index: 70;
}
/* Invisible bridge across the 8px gap so the menu doesn't vanish while the
   cursor travels from the trigger down to the list. */
.bsg-lang-menu::before {
	content: "";
	position: absolute;
	top: -10px;
	left: 0;
	right: 0;
	height: 10px;
}
.bsg-lang:hover .bsg-lang-menu,
.bsg-lang:focus-within .bsg-lang-menu { display: flex; }
.bsg-lang-menu a {
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--barlow);
	font-weight: 600;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	padding: 0.4rem 0.7rem;
	border-radius: 5px;
}
.bsg-lang-menu a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.bsg-lang-menu a.is-current { color: #fff; }
@media (max-width: 980px) { .bsg-lang { display: none; } }

/* ── Stock Guide index (/stocks) — sector-grouped fundamentals ──────── */
.bsg-stocks-filter {
	width: 320px;
	max-width: 100%;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--wp--preset--color--gray, #afb5b6);
	border-radius: 8px;
	font-size: 0.95rem;
}
.bsg-stocks-tabs {
	display: flex;
	gap: 0.5rem;
	margin: 0.5rem 0 1.25rem;
	border-bottom: 1px solid rgba(19, 64, 108, 0.15);
}
.bsg-stk-tab {
	appearance: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.7rem 1rem;
	font-family: var(--wp--preset--font-family--barlow, inherit);
	font-weight: 600;
	font-size: 0.9rem;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--gray, #6b7280);
	border-bottom: 3px solid transparent;
	margin-bottom: -1px;
}
.bsg-stk-tab.is-active {
	color: var(--wp--preset--color--primary, #13406c);
	border-bottom-color: var(--wp--preset--color--primary, #13406c);
}
.bsg-stk-panel { display: none; }
.bsg-stk-panel.is-active { display: block; }
.bsg-sector { margin: 0 0 2rem; }
.bsg-sector-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--barlow, inherit);
	font-size: 1.05rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--primary, #13406c);
	margin: 0 0 0.6rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid rgba(19, 64, 108, 0.12);
}
.bsg-sector-count {
	font-size: 0.72rem;
	font-weight: 600;
	color: #fff;
	background: var(--wp--preset--color--primary, #13406c);
	border-radius: 999px;
	padding: 0.1rem 0.5rem;
}
.bsg-table-wrap { overflow-x: auto; }
.bsg-stk-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88rem;
	min-width: 760px;
}
.bsg-stk-table thead th {
	text-align: left;
	font-family: var(--wp--preset--font-family--barlow, inherit);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--preset--color--gray, #6b7280);
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid rgba(19, 64, 108, 0.15);
	white-space: nowrap;
}
.bsg-stk-table td {
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	white-space: nowrap;
}
.bsg-stk-table tbody tr:hover { background: rgba(19, 64, 108, 0.04); }
.bsg-stk-table .bsg-num { text-align: right; font-variant-numeric: tabular-nums; }
.bsg-stk-table thead .bsg-num { text-align: right; }
.bsg-col-tkr a {
	font-weight: 700;
	color: var(--wp--preset--color--primary, #13406c);
	text-decoration: none;
}
.bsg-col-tkr a:hover { text-decoration: underline; }
.bsg-col-name {
	max-width: 240px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.bsg-col-name a { color: inherit; text-decoration: none; }
.bsg-col-name a:hover { text-decoration: underline; }
.bsg-chg.up { color: #0a7d33; }
.bsg-chg.down { color: #c01e2e; }
.bsg-chg.flat { color: var(--wp--preset--color--gray, #6b7280); }
.bsg-na { color: #c7ccce; }
.bsg-stocks-disc {
	margin-top: 1.5rem;
	font-size: 0.78rem;
	color: var(--wp--preset--color--gray, #6b7280);
}
.bsg-stocks-empty {
	padding: 2rem 0;
	color: var(--wp--preset--color--gray, #6b7280);
}
@media (max-width: 680px) {
	.bsg-stocks-filter { width: 100%; }
}

/* ── Stock Guide: company logos + polish ───────────────────────────── */
.bsg-col-tkr a {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}
.bsg-stk-logo {
	width: 24px;
	height: 24px;
	border-radius: 6px;
	object-fit: contain;
	background: #fff;
	flex: 0 0 auto;
	box-shadow: 0 0 0 1px rgba(19, 64, 108, 0.1);
	padding: 1px;
}
.bsg-stk-logo-ph {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--barlow, inherit);
	font-size: 0.72rem;
	font-weight: 700;
	color: #fff;
	background: var(--wp--preset--color--primary, #13406c);
	box-shadow: none;
}
.bsg-stk-tkr-txt { line-height: 1; }

/* ── Stock Guide: update bar, refresh, sparkline ───────────────────── */
.bsg-stocks-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin: 0.25rem 0 0.5rem;
	font-size: 0.82rem;
	color: var(--wp--preset--color--gray, #6b7280);
}
.bsg-stocks-auto { display: inline-flex; align-items: center; gap: 0.4rem; }
.bsg-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #0a7d33;
	box-shadow: 0 0 0 3px rgba(10, 125, 51, 0.15);
	animation: bsg-pulse 2.4s ease-in-out infinite;
}
@keyframes bsg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.bsg-stocks-last { opacity: 0.85; }
.bsg-stocks-last::before { content: "· "; }
.bsg-stocks-refresh {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	appearance: none;
	cursor: pointer;
	background: #fff;
	border: 1px solid rgba(19, 64, 108, 0.2);
	color: var(--wp--preset--color--primary, #13406c);
	font-family: var(--wp--preset--font-family--barlow, inherit);
	font-weight: 600;
	font-size: 0.78rem;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	transition: background 0.15s ease;
}
.bsg-stocks-refresh:hover { background: rgba(19, 64, 108, 0.06); }
.bsg-stocks-refresh[disabled] { opacity: 0.6; cursor: default; }
.bsg-stocks-refresh.is-busy svg { animation: bsg-spin 0.8s linear infinite; }
@keyframes bsg-spin { to { transform: rotate(360deg); } }
.bsg-spark-col { text-align: center; }
.bsg-spark { text-align: center; vertical-align: middle; }
.bsg-spark-svg { display: inline-block; vertical-align: middle; }

/* ── Language links inside the mobile menu (hidden on desktop) ──────── */
.bsg-menu-lang { display: none; }
@media (max-width: 980px) {
	.bsg-menu-lang {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		padding: 0.85rem 1.1rem;
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		margin-top: 0.35rem;
		/* width:100% (from .bsg-menu li) + own padding would overflow the menu's
		   right edge without border-box, pushing the BR button past the border. */
		box-sizing: border-box;
		width: 100%;
	}
	.bsg-menu-lang-label {
		font-size: 0.72rem;
		text-transform: uppercase;
		letter-spacing: 0.06em;
		opacity: 0.6;
		margin-right: auto;
	}
	.bsg-menu-lang a {
		display: inline-block;
		min-width: 38px;
		text-align: center;
		padding: 0.35rem 0.6rem;
		border: 1px solid rgba(255, 255, 255, 0.2);
		border-radius: 6px;
		font-weight: 700;
		font-size: 0.82rem;
		letter-spacing: 0.04em;
		text-decoration: none;
		color: rgba(255, 255, 255, 0.85);
	}
	.bsg-menu-lang a.is-current {
		background: rgba(255, 255, 255, 0.16);
		color: #fff;
		border-color: transparent;
	}
}
