/**
 * Tankar: archive interaction and small responsive safeguards.
 * Typography and colors intentionally continue to come from Blocksy.
 */

.ag-thoughts {
	--ag-main-title-size: clamp(2rem, 3.125vw, 2.5rem);
}

/* Match the established 1200 px main-page content line. */
.ag-thoughts-archive #main > .ct-container {
	width: min(1200px, calc(100% - 30px));
}

.ag-thoughts-archive .ag-thoughts-archive__header {
	margin: 0 0 clamp(1.75rem, 4vw, 3rem);
}

.ag-thoughts-archive .ag-thoughts-archive__header h1 {
	margin: 0;
	font-size: var(--ag-main-title-size);
	line-height: 1.5;
}

.ag-thoughts-archive .ct-pagination :is(.prev, .next) {
	text-transform: none;
}

.ag-thoughts-archive .entry-card {
	position: relative;
	transform-origin: center;
	transition: box-shadow 180ms ease, transform 180ms ease;
}

/* A small excerpt thumbnail replaces Blocksy's large card media. */
.ag-thoughts-archive .entry-card > .ct-media-container {
	display: none;
}

.ag-thoughts-archive .entry-card .ag-thoughts-archive__thumbnail {
	display: block;
	float: left;
	width: 80px;
	height: 80px;
	margin: .22rem 1rem .35rem 0;
	overflow: hidden;
}

.ag-thoughts-archive .entry-card .ag-thoughts-archive__thumbnail-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Stretch the existing semantic title link across the card without nesting links. */
.ag-thoughts-archive .entry-card .entry-title a {
	position: static;
}

.ag-thoughts-archive .entry-card .entry-title a::after {
	position: absolute;
	z-index: 1;
	inset: 0;
	content: '';
}

/* Preserve direct access to any secondary links inside a card. */
.ag-thoughts-archive .entry-card a:not(.entry-title a) {
	position: relative;
	z-index: 2;
}

.ag-thoughts-archive .entry-card:focus-within {
	box-shadow: 0 .7rem 1.5rem color-mix(in srgb, currentColor 20%, transparent);
	transform: translateY(-3px) scale(1.012);
}

.ag-thoughts-archive .entry-card:has(.entry-title a:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.ag-thoughts-archive .entry-card .entry-title a:focus-visible {
	outline: none;
}

@media (hover: hover) and (pointer: fine) {
	.ag-thoughts-archive .entry-card:hover {
		box-shadow: 0 .7rem 1.5rem color-mix(in srgb, currentColor 20%, transparent);
		transform: translateY(-3px) scale(1.012);
	}
}

.ag-thoughts-single .hero-section .page-title {
	font-size: var(--ag-main-title-size);
	line-height: 1.5;
}

/* Keep the author name, but omit Blocksy's small default avatar treatment. */
.ag-thoughts-single .hero-section .entry-meta .meta-author > .ct-media-container-static {
	display: none;
}

/* Keep legacy inline images in place while preventing narrow-screen overflow. */
.ag-thoughts-single .entry-content img {
	max-width: 100%;
	height: auto;
}

.ag-thoughts-single .ag-thoughts-featured-image {
	width: min(480px, 100%);
	margin: clamp(2rem, 5vw, 3rem) auto 0;
}

.ag-thoughts-single .ag-thoughts-featured-image__image {
	display: block;
	width: 100%;
	height: auto;
}

.ag-thoughts-single .ag-thoughts-featured-image figcaption {
	margin-top: .5rem;
	color: color-mix(in srgb, currentColor 62%, transparent);
	font-size: .875em;
	line-height: 1.4;
	text-align: center;
}

/* The visible comment thread is the end of the section; no system notice follows it. */
.ag-thoughts-single .ct-comments .no-comments {
	display: none;
}

.ag-thoughts-post-navigation {
	clear: both;
	display: flow-root;
	box-sizing: border-box;
	margin-block: 0;
	padding-top: clamp(2.5rem, 6vw, 4rem);
}

.ag-thoughts-post-navigation::before {
	display: block;
	margin-bottom: 1.25rem;
	border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	content: '';
}

.ag-thoughts-post-navigation__links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(.75rem, 3vw, 2rem);
}

.ag-thoughts-post-navigation__item {
	min-width: 0;
}

.ag-thoughts-post-navigation__item--next {
	text-align: right;
}

.ag-thoughts-post-navigation__link {
	display: inline-flex;
	max-width: 100%;
	padding-block: .35rem;
	flex-direction: column;
	gap: .2rem;
	color: inherit;
	text-decoration: none;
}

.ag-thoughts-post-navigation__direction {
	font-size: .82rem;
	line-height: 1.35;
	opacity: .72;
}

.ag-thoughts-post-navigation__title {
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.ag-thoughts-post-navigation__link:hover .ag-thoughts-post-navigation__title,
.ag-thoughts-post-navigation__link:focus-visible .ag-thoughts-post-navigation__title,
.ag-thoughts-post-navigation__all:hover,
.ag-thoughts-post-navigation__all:focus-visible {
	text-decoration: underline;
	text-underline-offset: .18em;
}

.ag-thoughts-post-navigation__link:focus-visible,
.ag-thoughts-post-navigation__all:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.ag-thoughts-post-navigation__all {
	display: table;
	margin: 1.25rem auto 0;
	color: inherit;
	font-size: .92rem;
	text-decoration: none;
}

@media (max-width: 479px) {
	.ag-thoughts-post-navigation__links {
		gap: .75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ag-thoughts-archive .entry-card {
		transition: none;
	}
}
