/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Variables
# Header
# Navigation
# Archive: category / tag / author
# Homepage: magazine top 5 + archive grid
# Article-list spacing reset
# Row separators
# Tablet
# Mobile
# GP Overrides
# Single post: title → meta → image → content
# Card-level click overlay (article list pages)
# Inside-article (sitewide)
# Widget Areas
# Footer
--------------------------------------------------------------*/

/* === gp-builder (managed) === */

/*--------------------------------------------------------------
# Variables
--------------------------------------------------------------*/
:root {
	/* GP legacy slug aliases (defaults.php / search-modal still reference --contrast, --base-N) */
	--contrast:   var(--contrast-20);
	--contrast-2: var(--contrast-30);
	--contrast-3: var(--base-10);
	--base:       var(--base-10);
	--base-2:     var(--base-20);
	--base-3:     var(--base-30);
	/* Layout */
	--grid-gap: 24px;
	--grid-margin: 24px;
}

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
.site-header {
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	padding: 20px 0;
}

body.home.blog #primary {
	padding-top: 0;
	margin-top: 0;
}

body.home.blog .paging-navigation {
	display: none;
}

.site-branding-container {
	flex-direction: column;
}

.site-branding-container .site-logo {
	margin-right: 0;
}

.site-description {
	margin-top: 6px;
}

/*--------------------------------------------------------------
# Navigation
--------------------------------------------------------------*/
.main-navigation {
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	margin-bottom: 0;
}

.nav-primary > li > a {
	padding-top: 14px;
	padding-bottom: 14px;
}

/*--------------------------------------------------------------
# Archive: category / tag / author
--------------------------------------------------------------*/
body:is(.category, .tag, .author, .search) .site-main {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px 24px;
	align-items: start;
}

body:is(.category, .tag, .author, .search) .site-main > *:not(article) {
	grid-column: 1 / -1;
}

body:is(.category, .tag, .author, .search) article .inside-article {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	padding: 0;
	background: none;
}

body:is(.category, .tag, .author, .search) article .post-image {
	order: 1;
	margin-bottom: 14px;
}

body:is(.category, .tag, .author, .search) article .post-image a {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
}

body:is(.category, .tag, .author, .search) article .post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

body:is(.category, .tag, .author, .search) article .post-image a:hover img {
	transform: scale(1.04);
}

body:is(.category, .tag, .author, .search) article footer.entry-meta {
	order: 2;
	margin-bottom: 8px;
}

body:is(.category, .tag, .author, .search) article footer.entry-meta .tags-links,
body:is(.category, .tag, .author, .search) article footer.entry-meta .comments-link,
body:is(.category, .tag, .author, .search) article footer.entry-meta .gp-icon {
	display: none;
}

body:is(.category, .tag, .author, .search) article footer.entry-meta .cat-links a {
	font-size: 0.688rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--contrast-10);
	text-decoration: none;
}

body:is(.category, .tag, .author, .search) article footer.entry-meta .cat-links a:hover {
	color: var(--contrast-30);
}

body:is(.category, .tag, .author, .search) article header.entry-header {
	order: 3;
	padding: 0;
}

body:is(.category, .tag, .author, .search) article .entry-title a {
	color: var(--contrast-10);
	text-decoration: none;
}

body:is(.category, .tag, .author, .search) article .inside-article:hover .entry-title a {
	text-decoration: underline;
}

body:is(.category, .tag, .author, .search) article header.entry-header .posted-on {
	font-size: 0.75rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	color: var(--contrast-10);
}

body:is(.category, .tag, .author, .search) article header.entry-header .posted-on time {
	font-size: 0.75rem;
}

body:is(.category, .tag, .author, .search) article .byline {
	font-size: 0;
}

body:is(.category, .tag, .author, .search) article .byline a {
	font-size: 0.75rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	color: var(--contrast-10);
	text-decoration: none;
}

body:is(.category, .tag, .author, .search) article .byline a:hover {
	color: var(--contrast-10);
}

body:is(.category, .tag, .author, .search) article .entry-summary {
	display: none;
}

/*--------------------------------------------------------------
# Homepage: magazine top 5 + archive grid
--------------------------------------------------------------*/
body.home.blog .site-main {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	column-gap: var(--grid-gap);
	row-gap: var(--grid-gap);
	margin: 0 auto;
	width: 100%;
	max-width: 1600px;
	padding-right: calc(1 * var(--grid-margin));
	padding-left: calc(1 * var(--grid-margin));
	padding-bottom: 20px;
}

body.home.blog .site-main > *:not(article) {
	grid-column: 1 / -1;
}

/* Magazine top-5 placement (12-col coordinates) */
body.home.blog .site-main article:nth-child(1) { grid-column: 4 / 10;  grid-row: 1 / 3; }
body.home.blog .site-main article:nth-child(2) { grid-column: 1 / 4;   grid-row: 1; }
body.home.blog .site-main article:nth-child(3) { grid-column: 10 / 13; grid-row: 1; }
body.home.blog .site-main article:nth-child(4) { grid-column: 1 / 4;   grid-row: 2; }
body.home.blog .site-main article:nth-child(5) { grid-column: 10 / 13; grid-row: 2; }

/* Archive cards (6+) inside 12-col grid */
body.home.blog .site-main article:nth-child(n+6) {
	grid-column: span 3;
}

body.home.blog .site-main article .inside-article {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	padding: 0;
}

/* Side cards: landscape 4:3 image, align start */
body.home.blog .site-main article:not(:nth-child(1)) {
	align-self: start;
}

body.home.blog .site-main article:not(:nth-child(1)) .post-image {
	order: 1;
	width: 100%;
	margin-bottom: 14px;
}

body.home.blog .site-main article:not(:nth-child(1)) .post-image a {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

body.home.blog .site-main article:not(:nth-child(1)) .post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

body.home.blog .site-main article:not(:nth-child(1)) .post-image a:hover img {
	transform: scale(1.04);
}

/* Hero: portrait image, fills available height */
body.home.blog .site-main article:nth-child(1) .post-image {
	order: 1;
	width: 100%;
	flex: 1;
	min-height: 0;
	margin-bottom: 20px;
}

body.home.blog .site-main article:nth-child(1) .post-image a {
	display: block;
	height: 100%;
	overflow: hidden;
}

body.home.blog .site-main article:nth-child(1) .post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
	transition: transform 0.4s ease;
}

body.home.blog .site-main article:nth-child(1) .post-image a:hover img {
	transform: scale(1.04);
}

/* Card meta: category */
body.home.blog .site-main article footer.entry-meta {
	order: 2;
	margin-bottom: 8px;
}

body.home.blog .site-main article footer.entry-meta .tags-links,
body.home.blog .site-main article footer.entry-meta .comments-link,
body.home.blog .site-main article footer.entry-meta .gp-icon {
	display: none;
}

body.home.blog .site-main article footer.entry-meta .cat-links a {
	font-size: 0.688rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--contrast-10);
	text-decoration: none;
}

body.home.blog .site-main article footer.entry-meta .cat-links a:hover {
	color: var(--contrast-30);
}

/* Card meta: title + byline */
body.home.blog .site-main article header.entry-header {
	order: 3;
	padding: 0;
}

body.home.blog .site-main article .entry-title a {
	color: var(--contrast-10);
	text-decoration: none;
}

body.home.blog .site-main article .inside-article:hover .entry-title a {
	text-decoration: underline;
}

body.home.blog .site-main article header.entry-header .posted-on {
	font-size: 0.75rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	color: var(--contrast-10);
}

body.home.blog .site-main article header.entry-header .posted-on time {
	font-size: 0.75rem;
}

body.home.blog .site-main article .byline {
	font-size: 0;
}

body.home.blog .site-main article .byline a {
	font-size: 0.75rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	color: var(--contrast-10);
	text-decoration: none;
}

body.home.blog .site-main article .byline a:hover {
	color: var(--contrast-30);
}

/* Posted-on + byline: same line with pipe separator */
body:is(.home.blog, .category, .tag, .author, .search) .site-main article .entry-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

body:is(.home.blog, .category, .tag, .author, .search) .site-main article .posted-on::after {
	content: '|';
	margin: 0 6px;
	color: var(--contrast-30);
	font-size: 0.75rem;
}

body.home.blog .site-main article .entry-summary {
	display: none;
}

/* Hero: larger title + stretch */
body.home.blog .site-main article:nth-child(1) .entry-title {
	font-size: 2rem;
	line-height: 1.2;
}

body.home.blog .site-main article:nth-child(1) {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	padding-top: 0;
	padding-left: 32px;
	padding-right: 32px;
}

body.home.blog .site-main article:nth-child(1) .inside-article {
	flex: 1;
	min-height: 0;
}

/*--------------------------------------------------------------
# Homepage: top-5 image bottoms on one grid line (subgrid)
--------------------------------------------------------------*/
@media (min-width: 901px) {
	body.home.blog .site-main {
		grid-template-rows: repeat(6, auto);
		row-gap: 0;
	}

	/* Top-5 cards share the 6 magazine rows: image / category / title x2 */
	body.home.blog .site-main article:nth-child(-n+5) {
		display: grid;
		grid-template-columns: 1fr;
		grid-template-rows: subgrid;
	}

	body.home.blog .site-main article:nth-child(-n+5) .inside-article {
		display: contents;
	}

	body.home.blog .site-main article:nth-child(2),
	body.home.blog .site-main article:nth-child(3) {
		grid-row: 1 / 4;
	}

	body.home.blog .site-main article:nth-child(4),
	body.home.blog .site-main article:nth-child(5) {
		grid-row: 4 / 7;
	}

	body.home.blog .site-main article:nth-child(1) {
		grid-row: 1 / 7;
	}

	/* Side cards: image / category / title tracks */
	body.home.blog .site-main article:nth-child(-n+5):not(:nth-child(1)) .post-image {
		grid-row: 1;
	}

	body.home.blog .site-main article:nth-child(-n+5):not(:nth-child(1)) footer.entry-meta {
		grid-row: 2;
	}

	body.home.blog .site-main article:nth-child(-n+5):not(:nth-child(1)) header.entry-header {
		grid-row: 3;
	}

	/* Row-1 cards carry the row-2 gap themselves (grid row-gap is 0) */
	body.home.blog .site-main article:nth-child(2) header.entry-header,
	body.home.blog .site-main article:nth-child(3) header.entry-header {
		margin-bottom: var(--grid-gap);
	}

	/* Hero: image spans tracks 1-4 so its bottom locks to the row-2 image bottoms */
	body.home.blog .site-main article:nth-child(1) .post-image {
		grid-row: 1 / 5;
		contain: size;
		margin-bottom: 14px;
	}

	body.home.blog .site-main article:nth-child(1) footer.entry-meta {
		grid-row: 5;
	}

	body.home.blog .site-main article:nth-child(1) header.entry-header {
		grid-row: 6;
	}

	/* Archive rows: replace the removed grid row-gap */
	body.home.blog .site-main article:nth-child(n+6) {
		margin-top: var(--grid-gap);
	}
}

/*--------------------------------------------------------------
# Article-list spacing reset
--------------------------------------------------------------*/
body:is(.home.blog, .archive, .search) .site-main article {
	position: relative;
	padding-top: 0;
	padding-bottom: 14px;
	margin-top: 0;
}

body:is(.home.blog, .archive, .search) .site-main article > .inside-article {
	margin-top: 0;
	padding-top: 0;
}

body:is(.home.blog, .archive, .search) .site-main article > .inside-article > *:first-child,
body:is(.home.blog, .archive, .search) .site-main article > .inside-article > *:first-child > *:first-child {
	margin-top: 0;
	padding-top: 0;
}

body:is(.home.blog, .archive, .search) .site-main article :is(h1, h2, h3, h4, h5, h6) {
	margin-top: 0;
}

.inside-article > .post-image {
	margin-top: 0;
}

/*--------------------------------------------------------------
# Row separators
--------------------------------------------------------------*/
body:is(.category, .tag, .author, .search) .site-main article:nth-child(4n+1)::before,
body.home.blog .site-main article:nth-child(4n+6)::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: calc(400% + 72px);
	height: 1px;
	background: rgba(0, 0, 0, 0.1);
}



/*--------------------------------------------------------------
# Search results: single-column horizontal list
--------------------------------------------------------------*/
body.search .page-header {
	padding-bottom: 28px;
	border-bottom: 1px solid var(--base-10);
	margin-bottom: 0;
}

body.search .page-header .page-title {
	font-size: 0.813rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--contrast-30);
}

body.search .page-header .page-title span {
	color: var(--contrast-10);
}

body.search .site-main {
	grid-template-columns: 1fr;
	gap: 0;
}

body.search .site-main article {
	padding-top: 40px !important;
	padding-bottom: 40px !important;
}

body.search .site-main article::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 1px;
	background: var(--base-10);
}

body.search .site-main article .inside-article {
	display: grid;
	grid-template-columns: 240px 1fr;
	grid-template-rows: auto auto auto 1fr;
	gap: 0 28px;
	align-items: start;
}

body.search .site-main article .post-image {
	grid-column: 1;
	grid-row: 1 / 5;
	width: 100%;
	margin-bottom: 0;
}

body.search .site-main article .post-image a {
	aspect-ratio: 3 / 2;
}

body.search .site-main article .post-image img {
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body.search .site-main article footer.entry-meta {
	grid-column: 2;
	grid-row: 1;
	margin-bottom: 6px;
}

body.search .site-main article header.entry-header {
	grid-column: 2;
	grid-row: 2;
}

body.search .site-main article header.entry-header .entry-meta {
	margin-top: 4px;
}

body.search .site-main article .entry-title {
	margin-bottom: 6px;
}

body.search .site-main article .posted-on::after {
	content: '·';
}

body.search .site-main article .entry-summary {
	grid-column: 2;
	grid-row: 3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.875rem;
	line-height: 1.65;
	color: var(--contrast-20);
	margin-top: 8px;
}

body.search .site-main article .entry-title a {
	transition: color 0.2s ease;
}

body.search .site-main article:hover .post-image img {
	transform: scale(1.04);
}

body.search .site-main article:hover .entry-title a {
	color: var(--contrast-20);
}

body.search .site-main article:hover footer.entry-meta .cat-links a {
	text-decoration: underline;
	text-underline-offset: 3px;
}



/*--------------------------------------------------------------
# Tablet
--------------------------------------------------------------*/
@media (max-width: 900px) {
	body:is(.category, .tag, .author, .search) .site-main {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px 20px;
	}

	body:is(.category, .tag, .author, .search) .site-main article:nth-child(4n+1)::before {
		width: calc(200% + 20px);
	}

	body:is(.category, .tag, .author, .search) .site-main article:nth-child(4n+3)::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		width: calc(200% + 20px);
		height: 1px;
		background: rgba(0, 0, 0, 0.1);
	}

	body.home.blog .site-main {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px 20px;
	}

	body.home.blog .site-main article:nth-child(1) {
		grid-column: 1 / -1;
		grid-row: 1;
		border: none;
		padding: 0;
	}

	body.home.blog .site-main article:nth-child(1) .post-image a {
		aspect-ratio: 16 / 9;
	}

	body.home.blog .site-main article:nth-child(2) { grid-column: 1; grid-row: 2; }
	body.home.blog .site-main article:nth-child(3) { grid-column: 2; grid-row: 2; }
	body.home.blog .site-main article:nth-child(4) { grid-column: 1; grid-row: 3; }
	body.home.blog .site-main article:nth-child(5) { grid-column: 2; grid-row: 3; }

	body.home.blog .site-main article:nth-child(2)::before,
	body.home.blog .site-main article:nth-child(4n+6)::before {
		width: calc(200% + 20px);
	}

	body.search .site-main {
		grid-template-columns: 1fr;
		gap: 0;
	}

	@media (max-width: 640px) {
		body.search .site-main article .inside-article {
			grid-template-columns: 1fr;
			grid-template-rows: auto;
			gap: 12px 0;
		}

		body.search .site-main article .post-image {
			grid-column: 1;
			grid-row: 1;
		}

		body.search .site-main article footer.entry-meta {
			grid-column: 1;
			grid-row: 2;
		}

		body.search .site-main article header.entry-header {
			grid-column: 1;
			grid-row: 3;
		}

		body.search .site-main article .entry-summary {
			grid-column: 1;
			grid-row: 4;
			-webkit-line-clamp: 3;
		}

		body.search .site-main article .post-image a {
			aspect-ratio: 16 / 9;
		}
	}
}

/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/
@media (max-width: 480px) {
	body:is(.category, .tag, .author, .search) .site-main {
		grid-template-columns: 1fr;
		gap: 20px 0;
	}

	body:is(.category, .tag, .author, .search) .site-main article::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 1px;
		background: rgba(0, 0, 0, 0.1);
	}

	body.home.blog .site-main {
		grid-template-columns: 1fr;
		gap: 20px 0;
	}

	body.home.blog .site-main article:nth-child(n) {
		grid-column: 1;
		grid-row: auto;
	}

	body.home.blog .site-main article::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 1px;
		background: rgba(0, 0, 0, 0.1);
	}

	body.search .site-main article .inside-article {
		display: flex;
		flex-direction: column;
	}

	body.search .site-main article .post-image {
		width: 100%;
	}
}

/*--------------------------------------------------------------
# GP Overrides
--------------------------------------------------------------*/
body.home.blog .site-content,
body:is(.category, .tag, .author, .search) .site-content {
	padding: 0;
}


body.home.blog .site-main > *,
body:is(.category, .tag, .author, .search) .site-main > * {
	margin-bottom: 0;
}

body.home.blog .site-main article footer.entry-meta,
body:is(.category, .tag, .author, .search) .site-main article footer.entry-meta {
	margin-top: 0;
}

body.home.blog .site-main article .entry-meta,
body:is(.category, .tag, .author, .search) .site-main article .entry-meta {
	margin-top: 0;
}

body.home.blog .site-main article .entry-title,
body:is(.category, .tag, .author, .search) .site-main article .entry-title {
	margin-bottom: 8px;
}

body:is(.category, .tag, .author, .search) .page-header {
	margin-bottom: 20px;
	padding: 0;
}

body.home.blog .site-main article:not(:nth-child(1)) .inside-article > .post-image,
body:is(.category, .tag, .author, .search) .site-main article .inside-article > .post-image {
	order: 1 !important;
}

body.home.blog .site-main article:not(:nth-child(1)) .inside-article > footer.entry-meta,
body:is(.category, .tag, .author, .search) .site-main article .inside-article > footer.entry-meta {
	order: 2 !important;
}

body.home.blog .site-main article:not(:nth-child(1)) .inside-article > header.entry-header,
body:is(.category, .tag, .author, .search) .site-main article .inside-article > header.entry-header {
	order: 3 !important;
}

body.home.blog .site-main article .inside-article:hover .post-image img,
body:is(.category, .tag, .author, .search) .site-main article .inside-article:hover .post-image img {
	transform: scale(1.04);
}

body:is(.home.blog, .archive, .search) main.site-main,
body:is(.home.blog, .archive, .search) div.site-content {
	padding-top: 32px;
	padding-right: 40px;
	padding-bottom: 40px;
	padding-left: 40px;
}

.right-sidebar,
.left-sidebar {
	padding-top: 0;
	padding-right: 40px;
	padding-bottom: 40px;
	padding-left: 40px;
}

/*--------------------------------------------------------------
# Single post: title → meta → image → content
--------------------------------------------------------------*/
body.single-post .site-main article .inside-article {
	display: flex;
	flex-direction: column;
}

body.single-post .site-main article .inside-article > header.entry-header  { order: 1; }
body.single-post .site-main article .inside-article > .featured-image      { order: 2; }
body.single-post .site-main article .inside-article > .entry-content       { order: 3; }
body.single-post .site-main article .inside-article > footer.entry-meta    { order: 4; }

/*--------------------------------------------------------------
# Card-level click overlay (article list pages)
--------------------------------------------------------------*/
body:is(.home.blog, .archive, .search) .site-main article .inside-article {
	position: relative;
}

body:is(.home.blog, .archive, .search) .site-main article .post-image a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

body:is(.home.blog, .archive, .search) .site-main article .cat-links,
body:is(.home.blog, .archive, .search) .site-main article .byline {
	position: relative;
	z-index: 2;
}

/*--------------------------------------------------------------
# Inside-article (sitewide)
--------------------------------------------------------------*/
.inside-article {
	justify-content: flex-start;
	align-content: flex-start;
	align-items: flex-start;
}

/*--------------------------------------------------------------
# Widget Areas
--------------------------------------------------------------*/
.widget-title {
	border-top: 2px solid var(--contrast-10);
	padding-top: 12px;
}
.widget-area aside.widget {
	padding-top: 0;
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.copyright-bar {
	display: none;
}

/* === end gp-builder === */
