/* eComCPA blog archive
   -------------------------------------------------- */

html body .site-main.ecc-blog {
	/* Beat Hello Elementor's `body:not(...) .site-main { max-width: 1140px }`. */
	max-width: none;
	width: 100%;
	margin: 0;
	padding-inline: 0;
}

/* Shared design tokens: the blog grid and the single post both draw on these. */
:root {
	--ecc-navy: #062D60;
	--ecc-green: #3FA684;
	--ecc-green-dark: #2f8468;
	--ecc-ink: #0d1b2a;
	--ecc-black: #000000;
	--ecc-muted: #5b6672;
	--ecc-faint: #7b8794;
	--ecc-line: #e8ecf2;
	--ecc-bg: #f6f8fb;
}

/* A thin archive (one or two posts) would otherwise end well above the fold and
   leave a white band under the footer, so the listing keeps a minimum height and
   the container takes up whatever slack is left. */
.ecc-blog {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - 180px);
	background-color: #fff;
	font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ecc-blog * {
	box-sizing: border-box;
}

/* Hero
   -------------------------------------------------- */

.ecc-blog__hero {
	flex: 0 0 auto;
	background: linear-gradient(135deg, #062D60 0%, #0a3f80 100%);
	padding: 86px 24px 96px;
	text-align: center;
}

.ecc-blog__hero-inner {
	max-width: 760px;
	margin: 0 auto;
}

.ecc-blog__hero-title {
	margin: 0;
	color: #fff;
	font-family: "Circular Std", "Roboto", sans-serif;
	font-weight: 600;
	font-size: clamp(32px, 4.4vw, 52px);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.ecc-blog__hero-text {
	margin: 18px auto 0;
	max-width: 620px;
	color: rgba(255, 255, 255, 0.78);
	font-size: 18px;
	line-height: 1.65;
}

/* Grid
   -------------------------------------------------- */

.ecc-blog__container {
	flex: 1 0 auto;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px 104px;
}

/* No-JS fallback: an even grid. Masonry takes over once the script runs. */
.ecc-blog__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 34px 30px;
	margin-top: -52px;
}

.ecc-blog__grid.is-masonry {
	display: block;
	gap: 0;
}

/* Without the hero there is nothing to overlap, so the grid sits on its own
   breathing room instead of pulling upwards. */
.ecc-blog--no-hero .ecc-blog__container {
	padding-top: 72px;
}

.ecc-blog--no-hero .ecc-blog__grid {
	margin-top: 0;
}

/* Sizers only exist to give Masonry its column and gutter widths. */
.ecc-grid__sizer,
.ecc-grid__gutter {
	display: none;
	height: 0;
}

.ecc-blog__grid.is-masonry .ecc-grid__sizer,
.ecc-blog__grid.is-masonry .ecc-grid__gutter {
	display: block;
}

.ecc-grid__sizer {
	width: calc((100% - 60px) / 3);
}

.ecc-grid__gutter {
	width: 30px;
}

.ecc-blog__grid.is-masonry .ecc-card {
	width: calc((100% - 60px) / 3);
	margin-bottom: 30px;
}

/* Card
   -------------------------------------------------- */

.ecc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--ecc-line);
	border-radius: 0;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
	box-shadow: 0 12px 30px rgba(6, 45, 96, 0.07);
}

.ecc-card:hover {
	transform: translateY(-6px);
	border-color: transparent;
	box-shadow: 0 22px 48px rgba(6, 45, 96, 0.14);
}

.ecc-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 0;
	background: var(--ecc-bg);
}

/* Posts with no featured image still need a box, so that one keeps a fixed ratio. */
.ecc-card__media--empty {
	aspect-ratio: 16 / 10;
}

.ecc-card__media img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 0;
	transition: transform 0.6s ease;
}

.ecc-card:hover .ecc-card__media img {
	transform: scale(1.06);
}

.ecc-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #062D60 0%, #0a4a9e 100%);
	color: rgba(255, 255, 255, 0.72);
	font-family: "Circular Std", "Roboto", sans-serif;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ecc-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 26px 26px 28px;
}

.ecc-card__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 14px;
}

.ecc-card__cat {
	background: rgba(63, 166, 132, 0.12);
	color: var(--ecc-green-dark);
	border-radius: 0;
	padding: 5px 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
}

.ecc-card__date {
	color: var(--ecc-faint);
	font-size: 13px;
}

/* Titles stay bold black at rest, so no card reads differently from the rest
   of the grid, and turn brand blue on hover. */
.ecc-card__title {
	margin: 0 0 12px;
	font-family: "Circular Std", "Roboto", sans-serif;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.38;
	letter-spacing: -0.005em;
	color: var(--ecc-black);
}

.ecc-card__title a,
.ecc-card__title a:link,
.ecc-card__title a:visited,
.ecc-card__title a:active {
	color: var(--ecc-black);
	font-weight: 700;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ecc-card:hover .ecc-card__title a,
.ecc-card__title a:hover,
.ecc-card__title a:focus,
.ecc-card__title a:focus-visible {
	color: var(--ecc-navy);
	text-decoration: none;
}

/* Make the whole card clickable from the title link. */
.ecc-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.ecc-card__excerpt {
	margin: 0 0 22px;
	color: var(--ecc-muted);
	font-size: 15px;
	line-height: 1.7;
}

.ecc-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	color: var(--ecc-black);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.ecc-card__more svg {
	transition: transform 0.25s ease;
}

.ecc-card:hover .ecc-card__more {
	color: var(--ecc-black);
}

.ecc-card:hover .ecc-card__more svg {
	transform: translateX(4px);
}

.ecc-card__link:focus-visible {
	outline: 2px solid var(--ecc-black);
	outline-offset: 3px;
}

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

.ecc-blog .ecc-blog__pagination {
	margin-top: 64px;
}

.ecc-blog .ecc-blog__pagination .nav-links {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
}

.ecc-blog .ecc-blog__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--ecc-line);
	border-radius: 0;
	background: #fff;
	color: var(--ecc-black);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.25s ease;
}

.ecc-blog .ecc-blog__pagination .page-numbers:hover {
	border-color: var(--ecc-black);
	color: var(--ecc-black);
}

.ecc-blog .ecc-blog__pagination .page-numbers.current {
	background: var(--ecc-black);
	border-color: var(--ecc-black);
	color: #fff;
}

.ecc-blog .ecc-blog__pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* Empty state
   -------------------------------------------------- */

.ecc-blog__empty {
	max-width: 560px;
	margin: -52px auto 0;
	padding: 58px 40px;
	background: #fff;
	border: 1px solid var(--ecc-line);
	border-radius: 0;
	box-shadow: 0 12px 30px rgba(6, 45, 96, 0.07);
	text-align: center;
}

.ecc-blog__empty h2 {
	margin: 0 0 10px;
	font-family: "Circular Std", "Roboto", sans-serif;
	font-weight: 700;
	font-size: 24px;
	color: var(--ecc-black);
}

.ecc-blog__empty p {
	margin: 0 0 26px;
	color: var(--ecc-muted);
	font-size: 16px;
	line-height: 1.7;
}

.ecc-blog__empty-btn {
	display: inline-block;
	padding: 14px 30px;
	border-radius: 0;
	background: var(--ecc-black);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.25s ease;
}

.ecc-blog__empty-btn:hover {
	background: #222;
	color: #fff;
}

/* Responsive
   -------------------------------------------------- */

@media (max-width: 1024px) {
	.ecc-blog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px 24px;
	}

	.ecc-grid__sizer,
	.ecc-blog__grid.is-masonry .ecc-card {
		width: calc((100% - 24px) / 2);
	}

	.ecc-grid__gutter {
		width: 24px;
	}

	.ecc-blog__grid.is-masonry .ecc-card {
		margin-bottom: 24px;
	}
}

@media (max-width: 767px) {
	.ecc-blog__hero {
		padding: 62px 20px 78px;
	}

	.ecc-blog__hero-text {
		font-size: 16px;
	}

	.ecc-blog {
		min-height: 0;
	}

	.ecc-blog__container {
		padding: 0 20px 72px;
	}

	.ecc-blog--no-hero .ecc-blog__container {
		padding-top: 48px;
	}

	.ecc-blog__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
		margin-top: -44px;
	}

	.ecc-grid__sizer,
	.ecc-blog__grid.is-masonry .ecc-card {
		width: 100%;
	}

	.ecc-grid__gutter {
		width: 0;
	}

	.ecc-card__body {
		padding: 22px 22px 24px;
	}

	.ecc-blog .ecc-blog__pagination {
		margin-top: 44px;
	}
}
