/*
 * Post cards: the "media object" (parts/postThumb*.php, athletic_post_card(), athletic-core
 * cards). Variants: --big, --small, --vertical, --reverse, --compactMobile.
 * Also here: section headers (.sectionHead*, shared by the home blocks and single posts), «Περισσότερα
 * άρθρα» and the page-number navigation. Loaded wherever cards or listings render (includes/enqueue.php).
 *
 * Every card image sits in a fixed-ratio box (3:2, square for small thumbnails) and is cropped
 * with object-fit, so cards in a row line up whatever file the attachment has (IMG-03).
 */

.media {
	display: flex;
	align-items: flex-start;
	column-gap: 1.6rem;
	row-gap: 0.8rem;
}

.media__photo {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background-color: rgba(0, 0, 0, 0.06);
}

.media__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: translateZ(0) scale(1);
	transition: .25s;
}

.media__photo:hover img {
	transform: translateZ(0) scale(1.1);
}

/* ▶ mark on the image of a post with a lead video (athletic_card_has_video()): centred, in the
   article page's play-button orange (.leadVideo__icon, article.css). */
.media__video {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	background: var(--accent) no-repeat 56% center / 44%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.media--big .media__video {
	width: 6.4rem;
	height: 6.4rem;
}

.media--small .media__video {
	width: 2.8rem;
	height: 2.8rem;
}

/* Original narrower than the slot: shown at its own width, centred, instead of upscaled (IMG-04). */
.media__photo--narrow {
	margin-inline: auto;
}

.media__body {
	flex: 1;
	min-width: 0;
}

.media__body.grid {
	row-gap: 0.8rem;
}

.media__excerpt {
	margin: 0;
}

.media .title      { font-size: 2.4rem; }
.media--big .title { font-size: 3.6rem; }
.media--small .title { font-size: 1.8rem; }

.media--small.borderBottom {
	margin-bottom: 1.6rem;
	padding-bottom: 1.6rem;
}

.media--small .media__photo {
	aspect-ratio: 1;
}

.media--vertical {
	flex-direction: column;
	align-items: stretch;
}

.media--vertical > .postThumbImage {
	width: 100%;
}

/* Vertical cards in a grid row: the date sits at the bottom, so dates line up across the row. */
.media--vertical > .media__body {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

.media--vertical > .media__body > .meta {
	margin-top: auto;
}

.media--reverse {
	flex-direction: row-reverse;
}

.meta,
.meta > a {
	font-size: 1.2rem;
	color: var(--ink-muted);
}

.postThumbImage {
	flex: 0 0 auto;
	display: block;
}

.media--small .postThumbImage {
	width: 75px;
}

.media--big > a {
	margin: 0 auto;
}

@media screen and (max-width: 1023px) {
	.media .title      { font-size: 2rem; }
	.media--big .title { font-size: 3rem; }
	.media--small .title { font-size: 1.6rem; }

	.media--big {
		flex-wrap: wrap-reverse;
		row-gap: 1.6rem;
	}

	.media--small .postThumbImage {
		width: 115px;
	}
}

/* Phones: grid cards after the first become compact rows (thumbnail + title), UX-08. */
@media screen and (max-width: 599px) {
	.media--vertical.media--compactMobile {
		flex-direction: row;
		align-items: flex-start;
		padding-bottom: 1.6rem;
		border-bottom: 1px solid var(--line);
	}

	.media--vertical.media--compactMobile > .postThumbImage {
		width: 115px;
	}

	.media--vertical.media--compactMobile .media__photo {
		aspect-ratio: 1;
	}

	.media--vertical.media--compactMobile .title {
		font-size: 1.6rem;
	}
}

/* Archive list (athletic_post_list): a big lead on page 1, then rows. ------------------------ */
.postList {
	display: grid;
	gap: 2rem;
}

.postList__lead {
	padding-bottom: 2.4rem;
	border-bottom: 1px solid var(--line);
}

.postList__lead .title {
	font-size: clamp(2.4rem, 1.8rem + 1vw, 3.2rem);
}

/* Row: thumbnail | title, first line of the summary, date. */
.media--row {
	display: grid;
	grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--line);
}

.media--row .media__body {
	align-content: start;
	gap: 0.6rem;
}

.media--row .title {
	font-size: 2rem;
	line-height: 1.25;
}

.media--row .media__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	color: var(--ink-muted);
	font-size: 1.5rem;
	line-height: 1.45;
}

.postList__lead .media__excerpt {
	color: var(--ink-muted);
}

@media screen and (max-width: 599px) {
	.media--row {
		grid-template-columns: 11.5rem minmax(0, 1fr);
		gap: 1.2rem;
	}

	.media--row .title {
		font-size: 1.7rem;
	}

	.media--row .media__excerpt {
		display: none; /* phones: title + date only */
	}
}

/* «Περισσότερα άρθρα» (athletic_load_more; js/main.js loads the next page in place). */
.loadMore {
	display: flex;
	justify-content: center;
	margin-top: 3.2rem;
}

.loadMore__button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 2.4rem;
	border: 2px solid var(--ink);
	border-radius: 50px;
	font-family: var(--fontFamilyHeadings);
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s;
}

.loadMore__button:hover,
.loadMore__button:focus-visible {
	background: var(--ink);
	color: var(--surface);
	text-decoration: none;
}

.loadMore__button[aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

/* Section headers ------------------------------------------------------------------------------ */
/* Section header: h2 linked to the archive + sponsor + "see all" link (UX-02, UX-04). Used by the
   home blocks and by «Περισσότερα από» on single posts. */
.sectionHead {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline; /* «Όλα →» sits on the title's baseline */
	gap: 0.8rem 1.6rem;
	margin-bottom: 2rem;
	padding-top: 1.2rem;
	border-top: 4px solid var(--ink);
}

.section__header.sectionHead .headingSmall {
	margin: 0 auto 0 0;
}

.sectionHead__title {
	font-size: 3rem;
	line-height: 1.1;
}

.sectionHead__title > a {
	color: inherit;
	text-decoration: none;
	transition: color .25s;
}

.sectionHead__title > a:hover {
	text-decoration: underline 2px;
	text-underline-offset: 0.18em;
}

.sectionHead__more {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 24px;
	font-family: var(--fontFamilyHeadings);
	font-size: 1.6rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--accent-text);
	text-decoration: none;
	white-space: nowrap;
}

/* The arrow slides on hover instead of an underline (it is a "go" link, not text). */
.sectionHead__arrow {
	transition: transform 0.2s ease;
}

.sectionHead__more:hover,
.sectionHead__more:focus-visible {
	text-decoration: none;
}

.sectionHead__more:hover .sectionHead__arrow,
.sectionHead__more:focus-visible .sectionHead__arrow {
	transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
	.sectionHead__arrow { transition: none; }
}

/* Bottom-of-column variant (narrow columns, e.g. twoColumnsPosts' list). */
.sectionFoot__more {
	margin-top: 0.8rem;
}

/* Phones: the title stays alone on its line; «Δείτε περισσότερα» becomes a round arrow button at
   its right (44px tap target; the accessible name stays in aria-label). */
@media screen and (max-width: 599px) {
	.sectionHead {
		flex-wrap: nowrap;
		align-items: center;
	}

	.sectionHead .sectionHead__moreText {
		display: none;
	}

	.sectionHead .sectionHead__more {
		flex: 0 0 auto;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-left: auto;
		border: 1.5px solid var(--line);
		border-radius: 50%;
	}

	.sectionHead .sectionHead__more:hover .sectionHead__arrow {
		transform: none;
	}
}

@media screen and (max-width: 1023px) {
	.sectionHead__title {
		font-size: 2.6rem;
	}
}

@media screen and (max-width: 599px) {
	.sectionHead__title {
		font-size: 2.4rem;
	}
}

/* Pagination ------------------------------------------------------------------------------------ */
/* Compact pagination (athletic_pagination): «‹ 1 … 4 5 6 … 300 ›» under «Περισσότερα άρθρα». */
.pagingNav ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin: 2.4rem 0 0;
	padding: 0;
	list-style: none;
}

.pagingNav ul.page-numbers > li > a,
.pagingNav ul.page-numbers > li > span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 1rem;
	font-family: var(--fontFamilyHeadings);
	font-size: 1.5rem;
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 4px;
	text-decoration: none;
	background: var(--surface);
}

.pagingNav ul.page-numbers > li > a:hover {
	border-color: var(--ink);
}

.pagingNav ul.page-numbers > li > .current {
	border-color: var(--accent-text);
	background-color: var(--accent-text);
	color: var(--surface);
}

.pagingNav ul.page-numbers > li > .dots {
	min-width: 0;
	padding: 0 0.2rem;
	border-color: transparent;
	background: transparent;
}
