/**
 * TGCC Sidebar 1.0.0
 * Scoped to .tgcc-sb / .tgcc-sb-midjoin. Single posts only.
 */

.tgcc-sb{
	display:flex;
	flex-direction:column;
	gap:14px;
	font-family:Montserrat,Arial,Helvetica,sans-serif;
	color:#f3f1f6;
}

.tgcc-sb a{text-decoration:none}
.tgcc-sb p{margin:0}

.tgcc-sb-card{
	background:#150e1f;
	border:1px solid rgba(255,255,255,.09);
	border-radius:18px;
	padding:14px 14px 16px;
	box-shadow:0 10px 28px rgba(0,0,0,.28);
	box-sizing:border-box;
}

.tgcc-sb-kicker{
	display:block;
	margin:0 0 8px;
	font-size:10px;
	font-weight:800;
	letter-spacing:.14em;
	text-transform:uppercase;
	color:#c79bff;
}

.tgcc-sb-title{
	margin:0 0 6px;
	color:#fff;
	font-size:16px;
	font-weight:900;
	letter-spacing:-.3px;
	line-height:1.2;
}

/* Search */
.tgcc-sb-search .tgcc-sb-search-form{display:flex;gap:8px;margin:0}
.tgcc-sb-search .tgcc-sb-search-field{
	flex:1;
	min-width:0;
	height:40px;
	padding:0 12px;
	background:#0b0814;
	color:#f3f1f6;
	border:1px solid rgba(255,255,255,.14);
	border-radius:12px;
	font-family:inherit;
	font-size:16px; /* avoid iOS zoom */
	box-sizing:border-box;
}
.tgcc-sb-search .tgcc-sb-search-field::placeholder{color:#b3aac4}
.tgcc-sb-search .tgcc-sb-search-submit{
	height:40px;
	padding:0 12px;
	border:0;
	border-radius:12px;
	background:linear-gradient(135deg,#8e43f0,#6300e2);
	color:#fff;
	font-family:inherit;
	font-size:13px;
	font-weight:800;
	cursor:pointer;
}

/* Membership */
.tgcc-sb-join{
	padding:16px 16px 18px;
	background:
		radial-gradient(120% 90% at 100% 0%,rgba(142,67,240,.28),transparent 55%),
		linear-gradient(180deg,#1d1430,#150e1f 60%);
	border-color:rgba(142,67,240,.45);
}
.tgcc-sb-join p{color:#ddd6e8;font-size:13px;line-height:1.45;margin:0 0 12px}
.tgcc-sb-price{color:#fff;font-weight:800}
.tgcc-sb-btn{
	display:block;
	text-align:center;
	padding:11px 14px;
	border-radius:12px;
	background:linear-gradient(135deg,#ff6b61,#e53935);
	color:#fff !important;
	font-size:13px;
	font-weight:800;
	letter-spacing:.2px;
	box-shadow:0 10px 24px rgba(229,57,53,.35);
	transition:transform .15s ease;
}
.tgcc-sb-btn:hover,
.tgcc-sb-btn:focus{transform:translateY(-1px);color:#fff !important}

/* Compact donate */
.tgcc-sb-donate{
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap:10px;
	padding:12px 14px;
}
.tgcc-sb-donate-copy{
	font-size:12.5px;
	font-weight:800;
	line-height:1.3;
	color:#fff;
}
.tgcc-sb-donate-btn{
	flex:0 0 auto;
	padding:8px 14px;
	border-radius:12px;
	background:linear-gradient(135deg,#ff6b61,#e53935);
	color:#fff !important;
	font-size:12.5px;
	font-weight:800;
	box-shadow:0 8px 18px rgba(229,57,53,.3);
}
.tgcc-sb-donate:hover .tgcc-sb-donate-btn,
.tgcc-sb-donate:focus .tgcc-sb-donate-btn{color:#fff !important}

/* Latest rows */
.tgcc-sb-list{display:flex;flex-direction:column;gap:10px}
.tgcc-sb-row{
	display:grid;
	grid-template-columns:64px 1fr;
	gap:10px;
	align-items:center;
	color:#ddd6e8;
}
.tgcc-sb-row img{
	width:64px;
	height:42px;
	object-fit:cover;
	border-radius:8px;
	background:#0b0814;
	display:block;
}
.tgcc-sb-row-title{
	font-size:12.5px;
	font-weight:700;
	line-height:1.3;
	color:#f3f1f6;
	display:-webkit-box;
	-webkit-line-clamp:3;
	-webkit-box-orient:vertical;
	overflow:hidden;
}
.tgcc-sb-row:hover .tgcc-sb-row-title,
.tgcc-sb-row:focus .tgcc-sb-row-title{color:#c79bff}
.tgcc-sb-more{
	display:inline-block;
	margin-top:10px;
	color:#00ccff;
	font-size:12px;
	font-weight:800;
}
.tgcc-sb-more:hover,
.tgcc-sb-more:focus{color:#0099cc}

/* Start here */
.tgcc-sb-start{list-style:none;margin:0;padding:0}
.tgcc-sb-start li{margin:0;border-top:1px solid rgba(255,255,255,.08)}
.tgcc-sb-start li:first-child{border-top:0}
.tgcc-sb-start a{
	display:block;
	padding:8px 0;
	color:#f3f1f6;
	font-size:12.5px;
	font-weight:700;
	line-height:1.35;
}
.tgcc-sb-start a:hover,
.tgcc-sb-start a:focus{color:#c79bff}

/* Tools */
.tgcc-sb-tools{display:flex;flex-direction:column;gap:8px}
.tgcc-sb-tool{
	display:flex;
	align-items:center;
	gap:10px;
	padding:9px 10px;
	border-radius:12px;
	background:rgba(11,8,20,.55);
	border:1px solid rgba(255,255,255,.08);
	color:#f3f1f6;
}
.tgcc-sb-tool:hover,
.tgcc-sb-tool:focus{border-color:rgba(142,67,240,.6);color:#fff}
.tgcc-sb-ico{
	flex:0 0 28px;
	width:28px;
	height:28px;
	border-radius:8px;
	display:grid;
	place-items:center;
	background:rgba(142,67,240,.18);
}
.tgcc-sb-ico svg{width:16px;height:16px;display:block}
.tgcc-sb-tool b{display:block;font-size:12.5px;font-weight:800;line-height:1.2;color:#fff}
.tgcc-sb-tool small{display:block;color:#b3aac4;font-size:11px;font-weight:600}

/* Books */
.tgcc-sb-books{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tgcc-sb-book{display:flex;flex-direction:column;align-items:center;text-align:center;color:#f3f1f6}
.tgcc-sb-book img{
	width:100%;
	max-width:110px;
	height:auto;
	aspect-ratio:3/4;
	object-fit:cover;
	border-radius:8px;
	box-shadow:0 8px 18px rgba(0,0,0,.4);
	background:#0b0814;
}
.tgcc-sb-book b{display:block;margin-top:8px;font-size:11.5px;font-weight:800;line-height:1.25;color:#fff}
.tgcc-sb-book em{
	display:block;
	margin-top:3px;
	font-style:normal;
	font-size:10.5px;
	font-weight:700;
	color:#ffb020;
}

/* Podcast */
.tgcc-sb-cast{
	display:grid;
	grid-template-columns:52px 1fr;
	gap:10px;
	align-items:center;
	color:#f3f1f6;
	padding:12px 14px;
}
.tgcc-sb-cast img{width:52px;height:52px;border-radius:10px;object-fit:cover}
.tgcc-sb-cast b{display:block;font-size:13px;font-weight:800;color:#fff}
.tgcc-sb-cast small{color:#b3aac4;font-size:11px;font-weight:600}
.tgcc-sb-cast:hover b,
.tgcc-sb-cast:focus b{color:#c79bff}

/* Newsletter */
.tgcc-sb-news p{color:#ddd6e8;font-size:13px;line-height:1.45;margin:0 0 10px}
.tgcc-sb-news-form{display:flex;flex-direction:column;gap:8px;margin:0}
.tgcc-sb-news-form input[type=email]{
	height:40px;
	padding:0 12px;
	background:#0b0814;
	color:#f3f1f6;
	border:1px solid rgba(255,255,255,.14);
	border-radius:12px;
	font-family:inherit;
	font-size:16px;
	box-sizing:border-box;
}
.tgcc-sb-news-form button[type=submit]{
	height:40px;
	border:0;
	border-radius:12px;
	background:linear-gradient(135deg,#8e43f0,#6300e2);
	color:#fff;
	font-family:inherit;
	font-size:13px;
	font-weight:800;
	cursor:pointer;
	box-shadow:0 10px 24px rgba(142,67,240,.35);
}
.tgcc-sb-news-form button[type=submit]:disabled{opacity:.65;cursor:wait}
.tgcc-sb-hp{
	position:absolute !important;
	left:-9999px !important;
	width:1px !important;
	height:1px !important;
	overflow:hidden !important;
}
.tgcc-sb-fine{display:block;margin-top:8px;color:#b3aac4;font-size:11px}
.tgcc-sb-status{display:none;margin-top:8px;font-size:13px;font-weight:700;line-height:1.4}
.tgcc-sb-status.is-on{display:block}
.tgcc-sb-status.is-ok{color:#3ddc84}
.tgcc-sb-status.is-err{color:#ff6b61}

/* Mid-article membership (phones only). Hidden on desktop. */
.tgcc-sb-midjoin{display:none;margin:16px 0 28px}
.tgcc-sb-midjoin .tgcc-sb-join{margin:0}

@media (max-width:921px){
	.tgcc-sb-midjoin{display:block}
	/* When the mid-article card is present, do not repeat membership in the stacked sidebar.
	   :has() is used because body_class has already been printed by the time the_content runs. */
	body.tgcc-sb-has-midjoin #secondary .tgcc-sb-join,
	body:has(.tgcc-sb-midjoin) #secondary .tgcc-sb-join{display:none}
	/* 1.0.1: footer already shows newsletter and donate on phones */
	#secondary .tgcc-sb-news,
	#secondary .tgcc-sb-donate{display:none !important}
}

/*
 * Sticky on desktop. The column (#secondary) must stretch to the article height,
 * so the sticky inner stack can pin while the article scrolls.
 * overflow:hidden on any ancestor would break position:sticky.
 */
@media (min-width:922px){
	body.single-post.tgcc-sb-on #page,
	body.single-post.tgcc-sb-on #content,
	body.single-post.tgcc-sb-on #content > .ast-container,
	body.single-post.tgcc-sb-on #secondary,
	body.single-post.tgcc-sb-on #secondary .sidebar-main{
		overflow:visible;
	}
	body.single-post.tgcc-sb-on #content > .ast-container{
		display:flex;
		align-items:stretch;
	}
	body.single-post.tgcc-sb-on #secondary{
		display:flex;
		flex-direction:column;
		align-self:stretch;
	}
	body.single-post.tgcc-sb-on #secondary .sidebar-main{
		position:sticky;
		top:20px;
		max-height:calc(100vh - 32px);
		overflow-x:hidden;
		overflow-y:auto;
		padding-right:4px;
		scrollbar-width:thin;
		scrollbar-color:rgba(255,255,255,.2) transparent;
	}
	body.single-post.tgcc-sb-on #secondary .sidebar-main::-webkit-scrollbar{width:6px}
	body.single-post.tgcc-sb-on #secondary .sidebar-main::-webkit-scrollbar-thumb{
		background:rgba(255,255,255,.2);
		border-radius:6px;
	}
}

/* Neutralise Astra widget chrome when our stack is in the sidebar */
body.single-post.tgcc-sb-on #secondary .sidebar-main{padding-left:0;padding-right:0}
body.single-post.tgcc-sb-on.ast-separate-container .ast-container #secondary .tgcc-sb,
body.single-post.tgcc-sb-on #secondary .tgcc-sb{
	background:transparent;
	border:0;
	box-shadow:none;
	padding:0;
	margin:0;
}
body.single-post.tgcc-sb-on #secondary .tgcc-sb img{border-radius:8px}
