/**
 * Category + region (tag) archives — unboxed feed + Popular Stories rail.
 * Continues homepage type/spacing language; not a clone of TC/TNW.
 */

/* --------------------------------------------------------------------------
   Shell: open page, hide ColorMag sidebar (we render our own rail)
   -------------------------------------------------------------------------- */

.category .cm-content,
.tag .cm-content {
	padding-top: 0;
	overflow: visible;
}

/* Sticky rail needs a non-clipping scroll ancestor (ColorMag sets body overflow:hidden). */
.category,
.tag {
	overflow: visible !important;
	overflow-x: clip;
}

.category .gnn-cat-row,
.tag .gnn-cat-row {
	display: block;
}

.category .cm-primary.gnn-cat-layout,
.category .gnn-cat-layout,
.tag .cm-primary.gnn-cat-layout,
.tag .gnn-cat-layout {
	display: block;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 16px 56px;
	box-sizing: border-box;
}

.category .cm-secondary,
.tag .cm-secondary {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Category header — matches homepage section titles
   -------------------------------------------------------------------------- */

.gnn-cat-header {
	margin: 28px 0 28px;
	padding: 0 0 16px;
	border-bottom: 2px solid #18181b;
}

.gnn-cat-kicker {
	margin: 0 0 6px;
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--cm-color-1, #257bc1);
}

.gnn-cat-title {
	margin: 0;
	font-size: 3.2rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: #18181b;
	text-transform: none;
}

.gnn-cat-desc {
	margin: 12px 0 0;
	max-width: 42em;
	font-size: 1.5rem;
	line-height: 1.5;
	color: #52525b;
}

.gnn-cat-desc p {
	margin: 0 0 0.6em;
}

.gnn-cat-desc p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Lead story
   -------------------------------------------------------------------------- */

.gnn-cat-feed {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.gnn-cat-lead {
	margin: 0 0 8px;
	overflow: visible;
	box-shadow: none !important;
	border-radius: 0 !important;
	background: transparent;
}

.gnn-cat-lead__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.gnn-cat-lead__media {
	overflow: hidden;
	margin-bottom: 16px;
	background: #f4f4f5;
	aspect-ratio: 16 / 9;
}

.gnn-cat-lead__img,
.gnn-cat-lead__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.gnn-cat-lead__link:hover .gnn-cat-lead__img,
.gnn-cat-lead__link:focus .gnn-cat-lead__img {
	transform: scale(1.03);
}

.gnn-cat-lead__category {
	display: inline-block;
	margin-bottom: 8px;
	padding: 0;
	background: none !important;
	color: var(--cm-color-1, #257bc1);
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.gnn-cat-lead__title {
	margin: 0 0 10px;
	font-size: 2.6rem;
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.2;
	color: #18181b;
}

.gnn-cat-lead__link:hover .gnn-cat-lead__title,
.gnn-cat-lead__link:focus .gnn-cat-lead__title {
	color: var(--cm-color-1, #257bc1);
}

.gnn-cat-lead__excerpt {
	margin: 0 0 12px;
	font-size: 1.6rem;
	line-height: 1.55;
	color: #52525b;
}

.gnn-cat-lead__meta,
.gnn-cat-item__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 1.2rem;
	line-height: 1.4;
	color: #71717a;
}

.gnn-cat-lead__sep,
.gnn-cat-item__sep {
	opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Feed rows — hairline dividers, no cards
   -------------------------------------------------------------------------- */

.gnn-cat-item {
	margin: 0;
	padding: 22px 0;
	overflow: visible;
	box-shadow: none !important;
	border-radius: 0 !important;
	background: transparent;
	border-top: 1px solid #e4e4e7;
}

.gnn-cat-item__link {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	color: inherit;
	text-decoration: none;
}

.gnn-cat-item__media {
	overflow: hidden;
	background: #f4f4f5;
	aspect-ratio: 16 / 10;
}

.gnn-cat-item__img,
.gnn-cat-item__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.gnn-cat-item__link:hover .gnn-cat-item__img,
.gnn-cat-item__link:focus .gnn-cat-item__img {
	transform: scale(1.03);
}

.gnn-cat-item__title {
	margin: 0 0 8px;
	font-size: 1.9rem;
	font-weight: 600;
	line-height: 1.25;
	color: #18181b;
}

.gnn-cat-item__link:hover .gnn-cat-item__title,
.gnn-cat-item__link:focus .gnn-cat-item__title {
	color: var(--cm-color-1, #257bc1);
}

.gnn-cat-item__excerpt {
	margin: 0 0 10px;
	font-size: 1.4rem;
	line-height: 1.5;
	color: #52525b;
}

/* --------------------------------------------------------------------------
   Popular Stories rail
   -------------------------------------------------------------------------- */

.gnn-cat-body {
	display: block;
}

.gnn-cat-aside {
	margin-top: 40px;
}

.gnn-cat-aside__sticky {
	width: 100%;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.category .cm-primary .default-wp-page,
.category .tg-pagination,
.tag .cm-primary .default-wp-page,
.tag .tg-pagination {
	margin-top: 36px;
	box-shadow: none;
}

/* --------------------------------------------------------------------------
   Tablet+
   -------------------------------------------------------------------------- */

@media screen and (min-width: 640px) {
	.gnn-cat-item__link {
		grid-template-columns: 200px 1fr;
		gap: 20px;
		align-items: start;
	}

	.gnn-cat-item__media {
		aspect-ratio: 4 / 3;
	}

	.gnn-cat-lead__title {
		font-size: 3rem;
	}

	.gnn-cat-title {
		font-size: 3.6rem;
	}
}

@media screen and (min-width: 960px) {
	.category .cm-primary.gnn-cat-layout,
	.category .gnn-cat-layout,
	.tag .cm-primary.gnn-cat-layout,
	.tag .gnn-cat-layout {
		display: block;
		padding: 0 24px 72px;
	}

	.gnn-cat-header {
		margin-top: 36px;
		margin-bottom: 28px;
	}

	/* Title full-width; rail starts beside the first story (TNW-style). */
	.gnn-cat-body {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 40px;
		align-items: stretch;
	}

	.gnn-cat-title {
		font-size: 4.2rem;
	}

	.gnn-cat-lead__title {
		font-size: 3.4rem;
	}

	.gnn-cat-item__link {
		grid-template-columns: 220px 1fr;
		gap: 24px;
	}

	.gnn-cat-aside {
		margin-top: 0;
		min-height: 100%;
	}

	.gnn-cat-aside__sticky {
		position: sticky;
		top: 96px;
	}
}
