/* ===========================================
   MetaBlogue – Category Archive (Landing Page)
   Mobile-first. Three zones: hero → featured → grid → rows.
   =========================================== */

/* ── Custom properties ──────────────────────────────────────────────── */
.mb-cat-hero,
.mb-cat-feed {
	--mb-accent: var(--wp--preset--color--orange, #d64f15);
	--mb-navy:   var(--wp--preset--color--navyblue, #1f2641);
	--mb-ink:    #1a1715;
	--mb-muted:  #6b6660;
	--mb-line:   #e8e2da;
	--mb-radius: 8px;
	--mb-bg-warm: #faf8f5;
}

/* ══════════════════════════════════════════════════════════════════════
   HERO HEADER
   ══════════════════════════════════════════════════════════════════════ */
.mb-cat-hero {
	background: var(--mb-navy);
	color: #fff;
	padding: 2.5rem 1.25rem 2rem;
	width: 100vw;
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	margin: 0 0 2rem;
	text-align: center;
}

.mb-cat-hero__title {
	margin: 0 0 .5rem;
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.02em;
	color: #fff;
}

.mb-cat-hero__desc,
.mb-cat-hero__desc p {
	margin: 0 auto .75rem;
	max-width: 600px;
	font-size: .95rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, .78);
}

.mb-cat-hero__count {
	display: inline-block;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--mb-accent);
	border: 1.5px solid var(--mb-accent);
	border-radius: 20px;
	padding: .3rem .9rem;
	margin-top: .25rem;
}

/* ══════════════════════════════════════════════════════════════════════
   FEATURED POST (post #1)
   ══════════════════════════════════════════════════════════════════════ */
.mb-cat-featured {
	width: 100% !important;
	float: none !important;
	clear: both !important;
	padding: 0 !important;
	margin: 0 0 2.5rem !important;
	background: none !important;
	box-shadow: none !important;
}

.mb-cat-featured__link {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: var(--mb-radius);
	overflow: hidden;
	position: relative;
}

.mb-cat-featured__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--mb-radius);
}

.mb-cat-featured__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 500ms ease;
}

.mb-cat-featured__link:hover .mb-cat-featured__img {
	transform: scale(1.04);
}

.mb-cat-featured__placeholder {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	background: var(--mb-navy);
	font-size: 4rem;
	font-weight: 700;
	color: rgba(255, 255, 255, .15);
}

.mb-cat-featured__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, transparent 60%);
	pointer-events: none;
	border-radius: var(--mb-radius);
}

.mb-cat-featured__body {
	padding: 1.25rem 0 0;
}

.mb-cat-featured__label {
	display: inline-block;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--mb-accent);
	margin-bottom: .5rem;
}

.mb-cat-featured__title {
	margin: 0 0 .5rem;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.015em;
	color: var(--mb-ink);
}

.mb-cat-featured__link:hover .mb-cat-featured__title {
	color: var(--mb-accent);
}

.mb-cat-featured__excerpt {
	margin: 0 0 .5rem;
	font-size: .95rem;
	line-height: 1.6;
	color: var(--mb-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mb-cat-featured__meta {
	display: flex;
	align-items: center;
	gap: .4rem;
	font-size: .8rem;
	color: var(--mb-muted);
}

.mb-cat-featured__sep { opacity: .4; }

/* ══════════════════════════════════════════════════════════════════════
   CARD GRID (posts 2–7)
   ══════════════════════════════════════════════════════════════════════ */
.mb-cat-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin: 0 0 2.5rem;
	padding: 2rem 0;
	border-top: 1px solid var(--mb-line);
	border-bottom: 1px solid var(--mb-line);
}

.mb-cat-card {
	width: 100% !important;
	float: none !important;
	clear: both !important;
	padding: 0 !important;
	margin: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

.mb-cat-card__link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
	border-radius: var(--mb-radius);
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--mb-line);
	transition: border-color 200ms ease;
}

.mb-cat-card__link:hover {
	border-color: var(--mb-accent);
}

.mb-cat-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	flex-shrink: 0;
}

.mb-cat-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 400ms ease;
}

.mb-cat-card__link:hover .mb-cat-card__img {
	transform: scale(1.04);
}

.mb-cat-card__placeholder {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	background: var(--mb-bg-warm);
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--mb-accent);
	opacity: .3;
}

.mb-cat-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1rem 1.1rem 1.1rem;
	gap: .4rem;
}

.mb-cat-card__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--mb-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mb-cat-card__link:hover .mb-cat-card__title {
	color: var(--mb-accent);
}

.mb-cat-card__excerpt {
	margin: 0;
	font-size: .85rem;
	line-height: 1.55;
	color: var(--mb-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mb-cat-card__meta {
	display: flex;
	align-items: center;
	gap: .35rem;
	font-size: .75rem;
	color: var(--mb-muted);
	margin-top: auto;
	padding-top: .3rem;
}

/* ══════════════════════════════════════════════════════════════════════
   ALTERNATING ROWS (posts 8+)
   ══════════════════════════════════════════════════════════════════════ */
.mb-cat-row {
	display: block;
	width: 100% !important;
	float: none !important;
	clear: both !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-top: 1.75rem;
	padding-bottom: 1.75rem;
	border-bottom: 1px solid var(--mb-line);
	background: none !important;
	box-shadow: none !important;
	margin: 0 !important;
}

.mb-cat-row:first-of-type { padding-top: .5rem; }
.mb-cat-row:last-of-type  { border-bottom: none; padding-bottom: .5rem; }

.mb-cat-row__inner {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.mb-cat-row__media {
	display: block;
	width: 100%;
	overflow: hidden;
	border-radius: var(--mb-radius);
	aspect-ratio: 16 / 9;
	text-decoration: none;
	flex-shrink: 0;
	transform: translateZ(0);
}

.mb-cat-row__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 420ms ease;
}

.mb-cat-row__media:hover .mb-cat-row__img { transform: scale(1.06); }

.mb-cat-row__placeholder {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	background: var(--mb-bg-warm);
	font-size: 3.5rem;
	font-weight: 700;
	color: var(--mb-accent);
	opacity: .3;
}

.mb-cat-row__body {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	min-width: 0;
}

.mb-cat-row__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -.015em;
}

.mb-cat-row__title a {
	color: var(--mb-ink);
	text-decoration: none;
	transition: color 180ms ease;
}

.mb-cat-row__title a:hover { color: var(--mb-accent); }

.mb-cat-row__excerpt {
	margin: 0;
	font-size: .95rem;
	line-height: 1.65;
	color: var(--mb-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mb-cat-row__meta {
	display: flex;
	align-items: center;
	gap: .35rem;
	font-size: .8rem;
	color: var(--mb-muted);
}

.mb-cat-row__sep { opacity: .4; }

/* ══════════════════════════════════════════════════════════════════════
   TABLET  ≥ 600px
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {

	/* Hero */
	.mb-cat-hero {
		padding: 3rem 2rem 2.5rem;
	}
	.mb-cat-hero__title { font-size: 2.5rem; }
	.mb-cat-hero__desc,
	.mb-cat-hero__desc p { font-size: 1rem; }

	/* Featured */
	.mb-cat-featured__body { padding-top: 1.5rem; }
	.mb-cat-featured__title { font-size: 1.75rem; }
	.mb-cat-featured__excerpt {
		font-size: 1rem;
		-webkit-line-clamp: 3;
	}

	/* Grid — 2 columns */
	.mb-cat-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.5rem;
	}

	/* Rows — side by side */
	.mb-cat-row { padding: 2.5rem 0; }

	.mb-cat-row__inner {
		flex-direction: row;
		align-items: center;
		gap: 5%;
	}

	.mb-cat-row--reverse .mb-cat-row__inner {
		flex-direction: row-reverse;
	}

	.mb-cat-row__media {
		flex: 0 0 42%;
		width: auto;
		aspect-ratio: 3 / 2;
	}

	.mb-cat-row__body  { gap: .75rem; }
	.mb-cat-row__title { font-size: 1.45rem; }

	.mb-cat-row__excerpt {
		display: block;
		-webkit-line-clamp: unset;
		overflow: visible;
	}
}

/* ══════════════════════════════════════════════════════════════════════
   DESKTOP  ≥ 960px
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {

	/* Hero */
	.mb-cat-hero {
		padding: 3.5rem 2.5rem 3rem;
		margin-bottom: 2.5rem;
	}
	.mb-cat-hero__title { font-size: 3rem; }
	.mb-cat-hero__desc,
	.mb-cat-hero__desc p {
		font-size: 1.05rem;
		max-width: 650px;
	}

	/* Featured — overlay text on image */
	.mb-cat-featured__link { position: relative; }
	.mb-cat-featured__media { aspect-ratio: 21 / 9; }

	.mb-cat-featured__body {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		padding: 2rem 2.5rem;
		z-index: 1;
		color: #fff;
	}

	.mb-cat-featured__label { color: #fff; opacity: .85; }
	.mb-cat-featured__title {
		font-size: 2.2rem;
		color: #fff;
		line-height: 1.2;
	}
	.mb-cat-featured__link:hover .mb-cat-featured__title { color: #fff; }
	.mb-cat-featured__excerpt {
		color: rgba(255, 255, 255, .85);
		font-size: 1.05rem;
		-webkit-line-clamp: 2;
	}
	.mb-cat-featured__meta { color: rgba(255, 255, 255, .7); }

	/* Grid — 3 columns */
	.mb-cat-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 1.75rem;
	}

	.mb-cat-card__title { font-size: 1.1rem; }
	.mb-cat-card__excerpt { font-size: .875rem; }

	/* Rows */
	.mb-cat-row { padding: 3rem 0; }

	.mb-cat-row__inner {
		gap: 6%;
		align-items: center;
	}

	.mb-cat-row__media { flex: 0 0 45%; }
	.mb-cat-row__body  { gap: .85rem; }

	.mb-cat-row__title {
		font-size: 1.8rem;
		line-height: 1.2;
		letter-spacing: -.025em;
	}

	.mb-cat-row__excerpt {
		font-size: 1.05rem;
		line-height: 1.75;
	}

	.mb-cat-row__meta { font-size: .85rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   WIDE  ≥ 1200px
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 1200px) {

	.mb-cat-hero__title { font-size: 3.25rem; }

	.mb-cat-featured__title { font-size: 2.5rem; }
	.mb-cat-featured__body { padding: 2.5rem 3rem; }

	.mb-cat-grid { gap: 2rem; }

	.mb-cat-row { padding: 3.5rem 0; }
	.mb-cat-row__inner { gap: 7%; }
	.mb-cat-row__title { font-size: 2rem; }
	.mb-cat-row__excerpt { font-size: 1.075rem; }
}

/* ── Pagination spacing ────────────────────────────────────────────── */
.mb-cat-feed ~ .pagination,
.mb-cat-feed ~ nav.navigation,
.mb-cat-feed + nav.navigation {
	margin-top: 2.5rem;
	width: 100%;
	clear: both;
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.mb-cat-featured__img,
	.mb-cat-card__img,
	.mb-cat-row__img {
		transition: none;
	}
	.mb-cat-featured__link:hover .mb-cat-featured__img,
	.mb-cat-card__link:hover .mb-cat-card__img,
	.mb-cat-row__media:hover .mb-cat-row__img {
		transform: none;
	}
}
