/* ===== RESEARCH_BADGE_V1: research status badge (Selection / In progress / Concluded / Soon) =====
   Markup: templates/research_badge.html. Used in block_blog_cat.html (cards), blog.html (list), blog_post.html (article).
   Design 2026-10-19:
   - badge: cyan text, thick cyan bar on the left that is taller than the text; in cards the bar is flush
     with the card's left edge and the text + the date below are indented;
   - tooltip: purple box over the badge + date, as wide as the card, generous padding, curved tail at the top-left.
   Shown on hover / keyboard focus / tap. */

.research_badge_wrap {
	position: relative;          /* tooltip is positioned against the wrap so it can span the whole card */
	display: block;
	margin: 14px 0 6px;
	text-align: left;
}
.research_badge {
	position: static;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-left: 20px;          /* 8px bar + 12px gap */
	color: #20C4F4;
	font-family: 'OpenSans_semibold', 'OpenSans_Bold', Arial, sans-serif;
	font-weight: bold;
	font-size: 20px;
	line-height: 26px;
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}
/* the bar (wrap is the positioning context, so the bar follows the wrap's left edge) */
.research_badge:before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 8px;
	height: 44px;
	background: #20C4F4;
}
.research_badge.research_badge_no_tip {
	cursor: default;
}
.research_badge:focus-visible {
	outline: 2px solid #149abb;
	outline-offset: 3px;
}

/* Cards (block_blog_cat): wrap spans the full card width, bar flush with the card edge,
   date aligned with the badge text */
.blog_cat_post_box .research_badge_wrap {
	margin-left: -10px;
	margin-right: -10px;
}
.blog_cat_post_box .research_badge_wrap + .date {
	padding-left: 10px;
}

.research_badge_tooltip {
	position: absolute;
	z-index: 30;
	top: 0;                      /* covers the bar completely */
	left: 0;
	right: 0;
	box-sizing: border-box;
	padding: 26px 18px;
	background: #6600CC;
	color: #fff;
	font-family: 'OpenSans_semibold', 'OpenSans_Bold', Arial, sans-serif;
	font-weight: bold;
	font-size: 15px;
	line-height: 28px;
	text-align: left;
	white-space: normal;
	visibility: hidden;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
	pointer-events: none;
}
/* Curved tail at the top-left: vertical left side, concave curve down to the box */
.research_badge_tooltip:before {
	content: "";
	position: absolute;
	left: 28px;
	bottom: 100%;
	width: 48px;
	height: 13px;
	background: no-repeat left bottom / 100% 100% url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 14" preserveAspectRatio="none"><path fill="%236600CC" d="M0 0 Q0 14 48 14 L0 14 Z"/></svg>');
}
.research_badge:hover .research_badge_tooltip,
.research_badge:focus .research_badge_tooltip {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
	transition: opacity .15s ease, transform .15s ease, visibility 0s;
	pointer-events: auto;
}

/* Blog list cards */
#posts_block .research_badge_wrap {
	margin-top: 12px;
}
#posts_block .research_badge_wrap + .date {
	padding-left: 20px;
}

/* Article page: badge under the title; tooltip not stretched over the whole column */
.research_badge_wrap.research_badge_inline {
	display: inline-block;
	min-width: 280px;
	max-width: 400px;
	margin-top: 18px;
	margin-bottom: 0;
}
.post_block.single_post .research_badge_wrap.research_badge_inline + .date {
	padding-top: 8px;
}

@media screen and (max-width: 480px) {
	.research_badge {
		font-size: 18px;
		line-height: 24px;
	}
	.research_badge_tooltip {
		padding: 20px 16px;
		font-size: 14px;
		line-height: 24px;
	}
	.research_badge_wrap.research_badge_inline {
		display: block;
		min-width: 0;
		max-width: none;
	}
}

/* Research cards block (block_blog_cat.html adds .has_research_badges when a post has a badge):
   bordered, equal-height cards, badge + date pinned to the bottom of the card (design 2026-10-19). */
.blog_cat_block.has_research_badges .blog_cat_posts_block {
	display: flex;
	flex-wrap: wrap;
}
.blog_cat_block.has_research_badges .blog_cat_posts_block:after {
	display: none;
}
.blog_cat_block.has_research_badges .blog_cat_post_block {
	float: none;
	display: flex;
	min-height: 0;
	margin-bottom: 30px;
}
.blog_cat_block.has_research_badges .blog_cat_post_box {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	padding-bottom: 20px;
	border: 1px solid #d6d6d6;
	background: #fff;
}
.blog_cat_block.has_research_badges .blog_cat_post_box .research_badge_wrap {
	margin-top: auto;            /* push badge + date to the bottom */
	padding-top: 14px;
	margin-bottom: 6px;
}
.blog_cat_block.has_research_badges .blog_cat_post_box .research_badge_wrap .research_badge:before {
	top: 14px;                   /* follow the padding-top above */
}
.blog_cat_block.has_research_badges .blog_cat_post_box .research_badge_wrap .research_badge_tooltip {
	top: 14px;
}
