/*
 * CaryTamura blog index (/blog/, the posts page, rendered by the CT Blog
 * Archive Theme Builder template 5488).
 *
 * SCOPE. Loaded on the blog index only (functions.php, is_home()), after
 * page-hero.css and sections.css. It tunes the template's `.ct-page-hero`
 * band to the live blog hero, lays out the card grid (`.ct-blog-archive`, a
 * Loop Grid of CT Loop – Blog Archive Card 5487, `.ct-blog-entry`) and its
 * pagination, and restores Work With Cary's desktop height in Elementor's
 * tablet range. The Exclusive Listings signup and Work With Cary are the
 * shared global templates and are styled in sections.css / their templates.
 *
 * VALUES. Measured from carytamura.com/blog at 1440, 1024, 768 and 375 wide
 * (FACT) unless marked. Live breakpoints: 768 (one column, cards full width,
 * tighter card padding, smaller page links), 767 (the sections leave the 12px
 * frame), 560 (smaller card titles).
 *
 * MOTION. Live has no entrance animation. What moves is READ MORE: its label
 * turns red and a red rule runs across its grey underline (0.4s) on hover —
 * reproduced below — and the page links fill red on hover (0.3s).
 */

/* ------------------------------------------------------------------ hero --
 * The same intro band as the other inner pages: 600px, framed 12px, one flat
 * 45% black scrim, title centred and lifted by its 24px bottom margin. */
.ct-page-hero.e-con {
	--width: calc(100% - 2 * var(--ct-body-padding));
	margin: var(--ct-body-padding) var(--ct-body-padding) 0;
	min-height: 0;
	height: 600px;
	padding: 0 var(--ct-body-padding);
}

.ct-page-hero::before {
	background-color: var(--ct-overlay-strong);
}

.ct-page-hero::after {
	content: none;
}

.ct-page-hero .ct-page-hero__title .elementor-heading-title {
	margin: 0 0 24px;
	font-size: var(--ct-size-h1);
	line-height: 1.25;
}

/* --------------------------------------------------------------- section --
 * White, framed 12px, 96px above and below; the cards sit in a 1182px box
 * (live: 1282px with 50px sides). */
.ct-blog-archive.e-con {
	--width: calc(100% - 2 * var(--ct-body-padding));
	--padding-top: var(--ct-section-padding);
	--padding-bottom: var(--ct-section-padding);
	/* Padding percentages resolve against the page, not this framed section. */
	--padding-left: max(50px, calc((100% - 2 * var(--ct-body-padding) - 1182px) / 2));
	--padding-right: max(50px, calc((100% - 2 * var(--ct-body-padding) - 1182px) / 2));
	margin-inline: var(--ct-body-padding);
	background-color: var(--ct-canvas);
	/* The card rules reach past the cards, as live; clip them to the band so
	 * they never widen the page. */
	overflow: clip;
}

.elementor .ct-blog-archive.e-con > .elementor-widget.ct-blog-archive__grid {
	--kit-widget-spacing: 0px;
	width: 100%;
	margin: 0;
}

/* ------------------------------------------------------------------ card --
 * The whole card is the link. Card Surface ground; each row as tall as its
 * tallest card. */
.ct-blog-archive .e-loop-item {
	display: flex;
}

.ct-blog-archive .ct-blog-entry.e-con {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--padding-right: 0px;
	width: 100%;
	background-color: var(--ct-surface);
	color: var(--ct-ink);
	text-decoration: none;
}

.ct-blog-archive .ct-blog-entry .elementor-widget {
	--kit-widget-spacing: 0px;
	margin: 0;
}

/* Photo: a 70.16% frame (the 573 x 402 live card photo), grey until it
 * loads, the image cropped to fill it. */
.ct-blog-archive .ct-blog-entry__img {
	position: relative;
	width: 100%;
	padding-top: 70.16%;
	background-color: #808080; /* FACT: live photo ground */
}

.ct-blog-archive .ct-blog-entry__img img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.ct-blog-archive .ct-blog-entry__body.e-con {
	--padding-top: 46px;
	--padding-bottom: 46px;
	--padding-left: 36px;
	--padding-right: 36px;
}

/* Title: Playfair 21/1.5, as written (not uppercased), 36px above what
 * follows. Its rule runs from 116px outside the card to 40% across it on the
 * left-hand cards, and from 60% across to 116px outside on the right. */
.ct-blog-archive .ct-blog-entry__title .elementor-heading-title {
	position: relative;
	margin: 0 0 36px;
	font-family: var(--ct-font-display);
	font-size: 21px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 1px;
	text-transform: none;
	color: var(--ct-ink);
}

.ct-blog-archive .ct-blog-entry__title .elementor-heading-title::after {
	content: "";
	position: absolute;
	bottom: -17px;
	left: -116px;
	right: 60%;
	height: 1px;
	background-color: var(--ct-ink);
}

.ct-blog-archive .e-loop-item:nth-of-type(2n) .ct-blog-entry__title .elementor-heading-title::after {
	left: 60%;
	right: -116px;
}

/* The post's own excerpt, where it has one. */
.ct-blog-archive .ct-blog-entry__excerpt .elementor-heading-title {
	margin: 0;
	font-family: var(--ct-font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 1px;
	color: var(--ct-ink);
}

/* READ MORE: 36px under the text, Lato 700 14px on a grey rule; hover turns
 * the label red and runs a red rule across. */
.ct-blog-archive .ct-blog-entry__more .elementor-heading-title {
	font-family: var(--ct-font-body);
	font-size: 16px;
	line-height: 1.6;
	letter-spacing: 1px;
	color: var(--ct-ink);
}

.ct-blog-archive .ct-blog-entry__more-link {
	position: relative;
	display: inline-block;
	margin-top: 36px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	color: var(--ct-ink);
}

.ct-blog-archive .ct-blog-entry__more-link::before,
.ct-blog-archive .ct-blog-entry__more-link::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	height: 1px;
	transition: 0.4s;
}

.ct-blog-archive .ct-blog-entry__more-link::before {
	width: 100%;
	background-color: #ccc; /* FACT: live rule, not a palette colour */
}

.ct-blog-archive .ct-blog-entry__more-link::after {
	width: 0;
	background-color: var(--ct-accent);
}

.ct-blog-archive .ct-blog-entry__more-link:hover {
	color: var(--ct-accent);
}

.ct-blog-archive .ct-blog-entry__more-link:hover::after {
	width: 100%;
}

/* ------------------------------------------------------------ pagination --
 * WordPress's own pages (/blog/page/2/). 34px under the cards; 48px squares
 * in the accent, the current page and a hovered link filled red; the arrows
 * are chevrons drawn from two borders, 16px clear of the numbers, at half
 * strength when there is nowhere to go. */
.ct-blog-archive .elementor-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin: 34px 0 0;
	font-family: var(--ct-font-body);
	line-height: 1;
}

.ct-blog-archive .elementor-pagination .page-numbers {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 48px;
	height: 48px;
	padding: 0 14px;
	border: 2px solid transparent;
	background: transparent;
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 1px;
	text-decoration: none;
	color: var(--ct-accent);
	transition: all 0.3s;
}

.ct-blog-archive .elementor-pagination a.page-numbers:hover,
.ct-blog-archive .elementor-pagination a.page-numbers:focus-visible,
.ct-blog-archive .elementor-pagination .page-numbers.current {
	border-color: var(--ct-accent);
	background-color: var(--ct-accent);
	color: var(--ct-on-dark);
}

.ct-blog-archive .elementor-pagination .page-numbers.prev,
.ct-blog-archive .elementor-pagination .page-numbers.next {
	width: 48px;
	font-size: 0;
}

.ct-blog-archive .elementor-pagination span.page-numbers.prev,
.ct-blog-archive .elementor-pagination span.page-numbers.next {
	opacity: 0.5;
	pointer-events: none;
}

/* Written to outrank the rule Elementor generates for Pagination › Spacing
 * (0 here, so the numbers sit edge to edge as live). */
body:not(.rtl) .ct-blog-archive .elementor-element.elementor-widget.ct-blog-archive__grid .elementor-pagination .page-numbers.prev {
	margin-right: var(--ct-blog-arrow-gap, 16px);
}

body:not(.rtl) .ct-blog-archive .elementor-element.elementor-widget.ct-blog-archive__grid .elementor-pagination .page-numbers.next {
	margin-left: var(--ct-blog-arrow-gap, 16px);
}

.ct-blog-archive .elementor-pagination .page-numbers.prev::before,
.ct-blog-archive .elementor-pagination .page-numbers.next::before {
	content: "";
	display: block;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 11px;
	height: 11px;
	border-bottom: 2px solid;
	border-left: 2px solid;
	transform: translate(calc(-50% + 2px), -50%) rotate(45deg) skew(4deg, 4deg);
}

.ct-blog-archive .elementor-pagination .page-numbers.next::before {
	transform: translate(calc(-50% - 2px), -50%) rotate(-135deg) skew(4deg, 4deg);
}

/* ------------------------------------------------------ work with cary --
 * Elementor's tablet range starts at 1024, where the live section is still
 * its desktop 689px. */
@media (min-width: 901px) and (max-width: 1024px) {
	.ct-blog-work-with .ct-work-with.e-con {
		min-height: 689px;
	}
}

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 768px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 32px;
	}

	/* One column, the cards the full width of the band. */
	.ct-blog-archive.e-con {
		--padding-top: var(--ct-section-padding-compact);
		--padding-bottom: var(--ct-section-padding-compact);
		--padding-left: 0px;
		--padding-right: 0px;
	}

	.elementor .ct-blog-archive.e-con > .elementor-widget.ct-blog-archive__grid {
		--grid-row-gap: 32px;
	}

	.ct-blog-archive .ct-blog-archive__grid .elementor-loop-container {
		grid-template-columns: minmax(0, 1fr);
	}

	.ct-blog-archive .ct-blog-entry__body.e-con {
		--padding-top: 40px;
		--padding-bottom: 40px;
		--padding-left: 25px;
		--padding-right: 25px;
	}

	.ct-blog-archive .ct-blog-entry__title .elementor-heading-title {
		margin-bottom: 38px;
	}

	.ct-blog-archive .ct-blog-entry__title .elementor-heading-title::after {
		bottom: -21px;
		left: -25px;
		right: 40%;
	}

	.ct-blog-archive .e-loop-item:nth-of-type(2n) .ct-blog-entry__title .elementor-heading-title::after {
		left: 40%;
		right: -25px;
	}

	.ct-blog-archive .elementor-pagination {
		--ct-blog-arrow-gap: 12px;
		margin-top: 32px;
	}

	.ct-blog-archive .elementor-pagination .page-numbers {
		min-width: 36px;
		height: 36px;
		padding: 0 10px;
		font-size: 15px;
	}

	.ct-blog-archive .elementor-pagination .page-numbers.prev,
	.ct-blog-archive .elementor-pagination .page-numbers.next {
		width: 36px;
		font-size: 0;
	}

	.ct-blog-archive .elementor-pagination .page-numbers.prev::before,
	.ct-blog-archive .elementor-pagination .page-numbers.next::before {
		width: 9px;
		height: 9px;
	}
}

@media (max-width: 767px) {
	.ct-page-hero.e-con {
		--width: 100%;
		margin: 0;
		height: 600px;
		padding: 0 var(--ct-body-padding);
	}

	.ct-blog-archive.e-con {
		--width: 100%;
		margin-inline: 0;
	}
}

@media (max-width: 560px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		line-height: 1.6;
	}

	.ct-blog-archive .ct-blog-entry__title .elementor-heading-title {
		font-size: 18px;
		line-height: 1.6;
	}
}

@media (max-width: 360px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ct-blog-archive .ct-blog-entry__more-link::before,
	.ct-blog-archive .ct-blog-entry__more-link::after,
	.ct-blog-archive .elementor-pagination .page-numbers {
		transition: none;
	}
}
