/*
 * Freshwave 2026 – Insights Archive Page
 * Based on Figma: "News and Insights Listing / Desktop" (node 12050:31954)
 */

/* =========================================================================
   Page wrapper — constrains all content to site max-width
   ========================================================================= */
.insights-archive__page-header,
.insights-archive__filter-bar,
.insights-archive__featured,
.insights-archive__grid,
.insights-archive__pagination {
	max-width: var(--wp--style--global--content-size);
	margin-left: auto;
	margin-right: auto;
	padding-right: 32px;
	padding-left: 32px;
	box-sizing: border-box;
}

/* =========================================================================
   Page header
   ========================================================================= */
.insights-archive__page-header {
	padding-top: 64px;
	padding-bottom: 16px;
	background-color: var(--wp--preset--color--white);
}

.insights-archive__page-title {
	font-size: clamp(2.5rem, 4.3vw, 3.875rem); /* ~62px at 1440px */
	font-weight: 600;
	line-height: 1.06;
	color: var(--wp--preset--color--dark-green);
	max-width: 700px;
	margin: 0;
}

/* =========================================================================
   Category filter bar
   ========================================================================= */
.insights-archive__filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: var(--wp--preset--color--white);
	flex-wrap: wrap;
	gap: 8px;
}

.insights-archive__filter-tabs {
	display: flex;
	align-items: center;
	gap: 0;
	overflow-x: auto;
	scrollbar-width: none;
}
.insights-archive__filter-tabs::-webkit-scrollbar { display: none; }

.insights-archive__filter-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	font-family: var(--wp--preset--font-family--body, fieldwork, sans-serif);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--wp--preset--color--neutral-dark);
	text-decoration: none;
	border-bottom: 4px solid transparent;
	white-space: nowrap;
	transition: color 0.15s, border-color 0.15s;
}

.insights-archive__filter-tab.is-active {
	color: var(--wp--preset--color--neutral-darker, #222);
	border-bottom-color: var(--wp--preset--color--neutral-darker, #222);
	font-weight: 400;
}

.insights-archive__filter-tab:hover {
	color: var(--wp--preset--color--neutral-darker, #222);
}

.insights-archive__filter-link {
	font-family: var(--wp--preset--font-family--body, fieldwork, sans-serif);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--wp--preset--color--dark-green);
	text-decoration: underline;
	white-space: nowrap;
	flex-shrink: 0;
}

.insights-archive__filter-link:hover {
	opacity: 0.8;
}

/* =========================================================================
   Featured section: 1 large card + 2×2 small cards
   ========================================================================= */
.insights-archive__featured {
	padding: 48px 32px;
	background-color: var(--wp--preset--color--white);
}

.insights-archive__featured .wp-block-query {
	width: 100%;
}

/* Override WP default ul list styles */
.insights-archive__featured .wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	column-gap: 24px;
	row-gap: 20px;
}

.insights-archive__featured .wp-block-post-template > li {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Featured card: spans 2 of 4 columns */
.insights-archive__featured .wp-block-post-template > li:first-child {
	grid-column: 1 / 3;
	grid-row: 1;
}

/* Cards 2 & 3: each take one column */
.insights-archive__featured .wp-block-post-template > li:nth-child(2) {
	grid-column: 3;
	grid-row: 1;
}
.insights-archive__featured .wp-block-post-template > li:nth-child(3) {
	grid-column: 4;
	grid-row: 1;
}

/* =========================================================================
   Regular grid section (rows of 4)
   ========================================================================= */
.insights-archive__grid {
	padding: 0 32px 75px;
	background-color: var(--wp--preset--color--white);
}

.insights-archive__grid .wp-block-query {
	width: 100%;
}

.insights-archive__grid .wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 22px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.insights-archive__grid .wp-block-post-template > li {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* =========================================================================
   ni-card — shared card component
   ========================================================================= */
.ni-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
}

/* --- featured image wrapper --- */
.ni-card .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
	background-color: var(--wp--preset--color--neutral-darker, #222);
	flex-shrink: 0;
}

.ni-card .wp-block-post-featured-image a {
	display: block;
	width: 100%;
	height: 100%;
}

/* Small-card image: 3:2 */
.ni-card .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	height: auto;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.ni-card:hover .wp-block-post-featured-image img {
	transform: scale(1.05);
}

/* Featured (first child) card — wider image */
.insights-archive__featured .wp-block-post-template > li:first-child .ni-card {
	height: 100%;
}

/* --- category tag --- */
.ni-card__category .wp-block-post-terms {
	font-size: 16px !important;
	font-weight: 400;
	line-height: 1.2;
	color: var(--wp--preset--color--neutral-darker, #222) !important;
	text-decoration: none;
}

.ni-card__category.wp-block-post-terms a {
	color: inherit !important;
	text-decoration: none;
	pointer-events: none;
	cursor: default;
}

/* --- title --- */
.ni-card__title {
	margin: 0;
	line-height: 1.3 !important;
	color: var(--wp--preset--color--neutral-darker, #222) !important;
}

.ni-card__title a {
	color: inherit !important;
	text-decoration: none;
}

.ni-card__title a:hover {
	text-decoration: underline;
}

/* Featured card title: H4 size */
.insights-archive__featured .wp-block-post-template > li:first-child .ni-card__title {
	font-size: var(--wp--preset--font-size--h4, 2rem) !important;
}

/* Small (grid) card titles: H5 size */
.insights-archive__featured .wp-block-post-template > li:not(:first-child) .ni-card__title,
.insights-archive__grid .ni-card__title {
	font-size: var(--wp--preset--font-size--h5, 1.5rem) !important;
}

/* --- excerpt --- */
.ni-card__excerpt {
	font-size: 16px !important;
	line-height: 1.2 !important;
	color: var(--wp--preset--color--neutral-dark, #444) !important;
	margin: 0;
}

.ni-card__excerpt p {
	margin: 0;
}

/* --- read-more link --- */
.ni-card__read-more {
	padding-top: 12px;
	/*margin-top: auto;*/
}

.ni-card__link,
.ni-card__read-more a {
	font-size: 16px !important;
	font-weight: 400;
	line-height: 1.2;
	color: var(--wp--preset--color--dark-green) !important;
	text-decoration: underline !important;
	display: inline-block;
}

.ni-card__link:hover,
.ni-card__read-more a:hover {
	opacity: 0.8;
}

/* =========================================================================
   Pagination
   ========================================================================= */
.insights-archive__pagination {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}

.insights-archive__pagination .wp-block-query-pagination {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
	justify-content: center;
}

/* Page number links and Previous/Next links */
.insights-archive__pagination .page-numbers,
.insights-archive__pagination .wp-block-query-pagination-previous,
.insights-archive__pagination .wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	font-size: var(--wp--preset--font-size--regular, 16px);
	font-weight: 400;
	line-height: 1;
	color: var(--wp--preset--color--dark-green);
	text-decoration: none;
	border-radius: 4px;
	transition: background-color 0.15s, color 0.15s;
}

.insights-archive__pagination .page-numbers:hover,
.insights-archive__pagination .wp-block-query-pagination-previous:hover,
.insights-archive__pagination .wp-block-query-pagination-next:hover {
	background-color: var(--wp--preset--color--pale-green);
}

.insights-archive__pagination .page-numbers.current {
	background-color: var(--wp--preset--color--dark-green);
	color: var(--wp--preset--color--white);
	font-weight: 600;
}

.insights-archive__pagination .page-numbers.dots {
	pointer-events: none;
	background-color: transparent;
}

/* =========================================================================
   Responsive – Tablet (≤ 1024px)
   ========================================================================= */
@media (max-width: 1024px) {
	.insights-archive__page-header,
	.insights-archive__filter-bar,
	.insights-archive__featured,
	.insights-archive__grid {
		padding-left: 32px;
		padding-right: 32px;
	}

	.insights-archive__featured .wp-block-post-template {
		grid-template-columns: 1fr 1fr;
	}

	/* Stack featured card full-width on tablet */
	.insights-archive__featured .wp-block-post-template > li:first-child {
		grid-column: 1 / 3;
		grid-row: 1;
	}
	.insights-archive__featured .wp-block-post-template > li:nth-child(2) {
		grid-column: 1; grid-row: 2;
	}
	.insights-archive__featured .wp-block-post-template > li:nth-child(3) {
		grid-column: 2; grid-row: 2;
	}


	.insights-archive__grid .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* =========================================================================
   Responsive – Mobile (≤ 640px)
   ========================================================================= */
@media (max-width: 640px) {
	.insights-archive__page-header,
	.insights-archive__filter-bar,
	.insights-archive__featured,
	.insights-archive__grid {
		padding-left: 16px;
		padding-right: 16px;
	}

	.insights-archive__page-title {
		font-size: 2.25rem;
	}

	.insights-archive__featured .wp-block-post-template {
		grid-template-columns: 1fr;
	}

	.insights-archive__featured .wp-block-post-template > li:first-child { grid-column: 1; grid-row: 1; }
	.insights-archive__featured .wp-block-post-template > li:nth-child(2) { grid-column: 1; grid-row: 2; }
	.insights-archive__featured .wp-block-post-template > li:nth-child(3) { grid-column: 1; grid-row: 3; }


	.insights-archive__grid .wp-block-post-template {
		grid-template-columns: 1fr;
	}
}

