/*
 * ezySEO archive pages: tag, category, taxonomy, author, date, search.
 *
 * Scoped entirely under .ezyseo-archive so it cannot reach the Divi header and
 * footer above and below it, or any of the 239 built pages. Colours and the
 * type family are taken from the site's own custom CSS rather than invented:
 * Jost for headings, #121948 navy, #FF5A28 orange, #2b4758 body text.
 *
 * No Tailwind here. That build is compiled and purged for the academy section
 * only, so a utility class this side of the site is not guaranteed to exist.
 */

.ezyseo-archive {
	--ezy-navy: #121948;
	--ezy-navy-soft: #1F2B7A;
	--ezy-orange: #FF5A28;
	--ezy-ink: #2b4758;
	--ezy-muted: #6b7f8c;
	--ezy-line: #e4e9ee;
	--ezy-surface: #ffffff;
	--ezy-ground: #f6f8fa;

	background: var(--ezy-ground);
	padding-bottom: 72px;
	font-family: 'Jost', Helvetica, Arial, Lucida, sans-serif;
	color: var(--ezy-ink);
}

.ezyseo-archive__inner {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
}

/* ---------- heading ---------- */

.ezyseo-archive__head {
	padding: 48px 0 32px;
}

.ezyseo-archive__eyebrow {
	margin: 0 0 8px;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--ezy-orange);
}

.ezyseo-archive__title {
	margin: 0;
	padding: 0;
	font-size: clamp(32px, 5vw, 52px);
	line-height: 1.1;
	letter-spacing: -0.02em;
	font-weight: 700;
	color: var(--ezy-navy);
	text-wrap: balance;
}

.ezyseo-archive__intro {
	margin: 16px 0 0;
	max-width: 62ch;
	font-size: 17px;
	line-height: 1.6;
	color: var(--ezy-ink);
}

.ezyseo-archive__intro p:last-child {
	padding-bottom: 0;
}

.ezyseo-archive__count {
	margin: 14px 0 0;
	padding: 0;
	font-size: 14px;
	color: var(--ezy-muted);
	font-variant-numeric: tabular-nums;
}

/* ---------- grid ---------- */

.ezyseo-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ezyseo-card {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
}

/*
 * The card is one anchor, so the whole surface is clickable and there is a
 * single tab stop and a single accessible name per card.
 *
 * `grid-template-rows: auto 1fr` is what lines the cards up: every media slot
 * is the same height, so every title starts on the same line across a row,
 * and the body takes the remaining height whatever the excerpt length.
 */
.ezyseo-card__link {
	display: grid;
	grid-template-rows: auto 1fr;
	width: 100%;
	background: var(--ezy-surface);
	border: 1px solid var(--ezy-line);
	border-radius: 14px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ezyseo-card__link:hover,
.ezyseo-card__link:focus-visible {
	border-color: #cfd8e0;
	box-shadow: 0 10px 28px rgba(18, 25, 72, 0.09);
	transform: translateY(-2px);
}

.ezyseo-card__link:focus-visible {
	outline: 2px solid var(--ezy-orange);
	outline-offset: 3px;
}

.ezyseo-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	background: #eef2f6;
	overflow: hidden;
}

.ezyseo-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
}

/*
 * A card with no featured image still reserves the slot, so a mixed set stays
 * aligned rather than one card riding 200px higher than its neighbours. The
 * placeholder is deliberately plain: no invented cover art.
 */
.ezyseo-card__media--empty {
	background:
		linear-gradient(135deg, #eef2f6 0%, #e5ebf1 100%);
}

.ezyseo-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 20px;
}

.ezyseo-card__type {
	align-self: flex-start;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(31, 43, 122, 0.08);
	color: var(--ezy-navy-soft);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ezyseo-card__title {
	display: block;
	font-size: 19px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--ezy-navy);
	text-wrap: pretty;
}

.ezyseo-card__link:hover .ezyseo-card__title {
	color: var(--ezy-orange);
}

.ezyseo-card__date {
	display: block;
	font-size: 13px;
	color: var(--ezy-muted);
}

.ezyseo-card__excerpt {
	display: block;
	margin-top: 2px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--ezy-ink);
}

/* ---------- pagination ---------- */

.ezyseo-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-top: 48px;
}

.ezyseo-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--ezy-line);
	border-radius: 8px;
	background: var(--ezy-surface);
	color: var(--ezy-navy);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

.ezyseo-pagination .page-numbers:hover {
	border-color: var(--ezy-orange);
	color: var(--ezy-orange);
}

.ezyseo-pagination .page-numbers.current {
	background: var(--ezy-navy);
	border-color: var(--ezy-navy);
	color: #ffffff;
}

.ezyseo-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	color: var(--ezy-muted);
}

/* ---------- empty state ---------- */

.ezyseo-archive__empty {
	padding: 56px 0 24px;
}

.ezyseo-archive__empty-text {
	margin: 0 0 20px;
	padding: 0;
	font-size: 18px;
	color: var(--ezy-ink);
}

.ezyseo-archive__search {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	max-width: 480px;
}

.ezyseo-archive__search input[type="search"] {
	flex: 1 1 220px;
	min-width: 0;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--ezy-line);
	border-radius: 8px;
	background: var(--ezy-surface);
	font: inherit;
	font-size: 15px;
	color: var(--ezy-ink);
}

.ezyseo-archive__search input[type="search"]:focus {
	outline: 2px solid var(--ezy-orange);
	outline-offset: 1px;
	border-color: var(--ezy-orange);
}

.ezyseo-archive__search button {
	height: 46px;
	padding: 0 22px;
	border: 0;
	border-radius: 8px;
	background: var(--ezy-orange);
	color: #ffffff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.ezyseo-archive__search button:hover {
	background: #e6461a;
}

/* ---------- responsive ---------- */

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

@media (max-width: 640px) {
	.ezyseo-archive__head {
		padding: 32px 0 24px;
	}

	.ezyseo-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ezyseo-card__link {
		transition: none;
	}

	.ezyseo-card__link:hover,
	.ezyseo-card__link:focus-visible {
		transform: none;
	}
}
