/*
 * Sidebars and widget-like blocks: banners, "News feed" (latest news), news tabs,
 * sponsor logos, bloggers list. The athletic/* blocks ship their own CSS in athletic-core;
 * these are the theme-side rules they rely on.
 */

/* Banners / ad widgets */
.banner,
.widget_media_image {
	display: grid;
	justify-content: center;
}

.single .borderLeft:before,
.archive .borderLeft:before,
.blog .borderLeft:before {
	content: none;
}

.latestNewsList {
	margin-bottom: 30px; /* a plain list: no inner scrollbar (D-06) */
}

/* News feed rows (sidebars and the hero feed): a list, not cards: ~28px between stories instead
   of the 48px of the generic .borderBottom (24px padding + 24px margin). */
.latestNewsList > .media.borderBottom {
	padding-bottom: 1.4rem;
	margin-bottom: 1.4rem;
}

.latestNewsList > .media:last-child {
	border-bottom: 0;
	padding-bottom: 0;
	margin-bottom: 0;
}

/* Article / archive sidebar column (D-06): flex column so the last ad can stick for the whole
   length of the sidebar (a sticky grid item can only move inside its own grid area). */
.pageGrid__sidebar.grid {
	display: flex;
	flex-direction: column;
	gap: 3.2rem;
	min-width: 0;
}

.pageGrid__sidebar > .widget-container {
	min-width: 0;
}

/* Ad widgets: label, centred, and nothing left behind when GPT collapses an unfilled slot */
.pageGrid__sidebar > .widget-container:has(> [id^="div-gpt-ad"]) {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.pageGrid__sidebar > .widget-container:has(> [id^="div-gpt-ad"])::before {
	content: "Διαφήμιση";
	margin-bottom: 0.6rem;
	font-size: 1.1rem;
	line-height: 1.2;
	letter-spacing: 0.04em;
	color: var(--ink-muted);
}

.pageGrid__sidebar > .widget-container:has(> [id^="div-gpt-ad"] [style*="display: none"]),
.pageGrid__sidebar > .widget-container:has(> [id^="div-gpt-ad"][style*="display: none"]) {
	display: none;
}

@media screen and (min-width: 1024px) {
	/* The last ad stays in view while the article is read */
	.pageGrid__sidebar > .widget-container:last-child:has(> [id^="div-gpt-ad"]) {
		position: sticky;
		top: 1.6rem;
		align-self: center;
	}

	.admin-bar .pageGrid__sidebar > .widget-container:last-child:has(> [id^="div-gpt-ad"]) {
		top: 4.8rem;
	}
}

/* Sponsor lockup next to section headings (athletic_core_sponsor()): the word «Χορηγός» + the logo,
   one size everywhere. The logo's max-width can still come from the block's sponsor_logo_width field. */
.sponsoredContainer {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	margin: 0;
}

.sponsoredContainer a {
	display: inline-flex;
	align-items: center;
	gap: 0.8rem;
}

.sponsoredContainer a:hover {
	text-decoration: none;
}

.sponsorLabel {
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-muted);
}

.sponsoredContainer .sponsoredImg {
	height: 28px; /* definite height + the width/height attributes' ratio = box reserved before load */
	width: auto;
	max-width: 120px;
	object-fit: contain;
}

/* Square / tall logos (athletic_core_sponsor()): 28px would make their text unreadable. */
.sponsoredContainer .sponsoredImg--compact {
	height: 40px;
}

/* Bloggers list */
ul.blogsList {
	padding-left: 0;
}

ul.blogsList li {
	border-bottom: 1px solid var(--line);
	padding: 20px 0;
	list-style: none;
}

#blogsWidget .authorImg {
	width: 60px;
	height: 90px;
	object-fit: cover;
}

#blogsWidget .blogText {
	overflow: hidden;
	padding: 0 5px;
	font-size: 0.85rem;
	width: 75%;
}

#blogsWidget .blogtitle {
	display: block;
	overflow: hidden;
	padding-top: 5px;
}

.blogArticle {
	grid-template-areas: "img text";
	grid-template-columns: 61px 1fr;
	grid-template-rows: auto;
	gap: 8px;
	display: grid;
}

/* News tabs (athletic/news-tabs): pure-CSS tabs, no jQuery UI */
.widgetTabs,
.widgetTabs li {
	background: transparent;
	color: var(--ink);
	border: none;
	border-radius: 0;
}

.widgetTabs {
	border-radius: 0;
}

#news-tabs.cssTabs .tabState {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

#news-tabs.cssTabs .widgetTabs {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

#news-tabs.cssTabs .widgetTabs li {
	width: 32%;
}

#news-tabs.cssTabs .widgetTabs label {
	display: block;
	position: relative;
	padding: .5em 0;
	color: var(--ink);
	cursor: pointer;
}

#news-tabs.cssTabs .tabPanel {
	display: none;
	padding: 1em 0;
}

#tab-athletic:checked ~ #tabs-athletic,
#tab-politica:checked ~ #tabs-politica {
	display: block;
}

#tab-athletic:checked ~ .widgetTabs label[for="tab-athletic"]::after,
#tab-politica:checked ~ .widgetTabs label[for="tab-politica"]::after {
	content: '';
	display: block;
	height: 3px;
	width: 100%;
	background: var(--accent);
	position: absolute;
	bottom: 0;
	left: 0;
}

#tab-athletic:focus-visible ~ .widgetTabs label[for="tab-athletic"],
#tab-politica:focus-visible ~ .widgetTabs label[for="tab-politica"] {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

/* Section header with a sponsor ("News feed") */
.section__header.latest_news_header .headingSmallLink {
	vertical-align: middle;
}

.section__header.latest_news_header .sponsoredContainer {
	vertical-align: middle;
}

.section__header.latest_news_header {
	font-size: 1.2rem;
	margin-bottom: 1.6rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
