/*
 * Blog post furniture: the sticky quote card, related articles, the in-article calls to action and
 * the service link block. Markup comes from includes/blog.php and the child theme's single.php.
 * Loaded on posts and blog views only.
 */

/* Sidebar
   ========================================================================== */

.ri-sidebar__sticky { display: flex; flex-direction: column; gap: 24px; }

@media (min-width: 993px) {
	/* Follows the reader, clearing the sticky header above it */
	.ri-sidebar__sticky { position: sticky; top: 140px; }
}

/* Quote card, at the top of the sidebar so the ask sits level with the first paragraph */
.ri-qcard {
	position: relative; overflow: hidden;
	padding: 24px 22px 22px; border-radius: var(--rh-radius);
	background:
		repeating-linear-gradient(135deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 22px),
		radial-gradient(420px 220px at 90% 0%, rgba(235, 35, 41, .3), transparent 70%),
		linear-gradient(165deg, #22262d 0%, var(--rh-ink) 70%);
	box-shadow: var(--rh-shadow-lg);
}
.ri-qcard::after {
	content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
	background: linear-gradient(90deg, var(--rh-red), var(--rh-red-light), var(--rh-red));
}
.ri-styled .ri-qcard__eyebrow {
	margin: 0 0 6px;
	font-family: Montserrat, sans-serif; font-size: 12px; font-weight: 700; line-height: 1.3;
	letter-spacing: .14em; text-transform: uppercase; color: var(--rh-red);
}
.ri-styled .ri-qcard__lead {
	margin: 0 0 18px;
	font-family: var(--rh-head); font-size: 19px; line-height: 1.3; font-weight: 700;
	letter-spacing: -0.015em; color: #fff;
}
.ri-qcard__cta { display: flex; width: 100%; margin-bottom: 10px; }
.ri-qcard__phone {
	display: flex; align-items: center; justify-content: center; gap: .55em;
	padding: .85em 1.2em; border-radius: 999px;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5);
	font-family: Montserrat, sans-serif; font-size: 16px; font-weight: 700;
	color: #fff !important; text-decoration: none !important; white-space: nowrap;
	transition: background-color .2s var(--rh-ease), color .2s ease;
}
.ri-qcard__phone:hover { background: #fff; color: var(--rh-ink) !important; box-shadow: none; }
.ri-styled .ri-qcard__note {
	margin: 12px 0 0; font-family: Montserrat, sans-serif; font-size: 12.5px; line-height: 1.4;
	color: rgba(255, 255, 255, .6); text-align: center;
}

/* Related articles list in the sidebar, in place of Recent Posts */
.ri-sidenav {
	padding: 22px 22px 8px; border-radius: var(--rh-radius);
	background: var(--rh-surface-2); box-shadow: var(--rh-shadow);
}
.ri-styled .ri-sidenav h2 {
	margin: 0 0 14px;
	font-family: var(--rh-head); font-size: 19px; line-height: 1.2; font-weight: 700;
	letter-spacing: -0.015em; text-transform: none; color: var(--rh-ink);
}
.ri-inner .ri-sidenav .ri-recent li { padding: 12px 0; border-top: 1px solid var(--rh-line); }
.ri-inner .ri-sidenav .ri-recent li:first-child { border-top: 0; padding-top: 0; }
.ri-inner .ri-sidenav .ri-recent a {
	display: block; font-family: var(--rh-head); font-size: 16px; line-height: 1.3; font-weight: 600;
	letter-spacing: -0.01em; color: var(--rh-ink);
}
.ri-inner .ri-sidenav .ri-recent a:hover { color: var(--rh-red); }
.ri-recent__cat {
	display: block; margin-top: 5px;
	font-family: Montserrat, sans-serif; font-size: 11px; font-weight: 700;
	letter-spacing: .12em; text-transform: uppercase; color: var(--rh-red);
}

/* Strip shown on phones, where the sidebar sits below the article
   ========================================================================== */

.ri-post-strip { display: none; }

/* In-article call to action
   ========================================================================== */

.ri-inline-cta {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px;
	margin: 2.4em 0; padding: 26px 28px; border-radius: var(--rh-radius);
	background: var(--rh-surface-2); box-shadow: inset 0 0 0 1px var(--rh-line);
	border-left: 4px solid var(--rh-red);
}
.ri-styled .ri-inline-cta__title {
	margin: 0; font-family: var(--rh-head); font-size: 21px; line-height: 1.25; font-weight: 700;
	letter-spacing: -0.015em; color: var(--rh-ink);
}
.ri-styled .ri-inline-cta__sub {
	margin: 4px 0 0; font-family: Montserrat, sans-serif; font-size: 15.5px; line-height: 1.5;
	color: var(--rh-muted);
}
.ri-inline-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rh-btn--ghost {
	color: var(--rh-ink) !important; box-shadow: inset 0 0 0 2px var(--rh-line);
}
.rh-btn--ghost:hover { background: var(--rh-ink); color: #fff !important; box-shadow: none; }

/* Related articles under the post: grid on desktop, swipe carousel on phones
   ========================================================================== */

.ri-related-posts { padding: 72px 0; background: #fff; }
.ri-styled .ri-related-posts h2 {
	margin: 0 0 28px;
	font-family: var(--rh-head); font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; font-weight: 700;
	letter-spacing: -0.015em; text-transform: none; color: var(--rh-ink);
}
.ri-styled .ri-related-posts h2::after { display: none !important; }
.ri-rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
@media (min-width: 993px) {
	/* Three across, so six cards make two full rows */
	.ri-rgrid { grid-template-columns: repeat(3, 1fr); }
}

.ri-rcard {
	display: flex; flex-direction: column; overflow: hidden;
	border-radius: var(--rh-radius); background: #fff; box-shadow: var(--rh-shadow);
	text-decoration: none !important;
	transition: transform .25s var(--rh-ease), box-shadow .25s var(--rh-ease);
}
.ri-rcard:hover { transform: translateY(-4px); box-shadow: var(--rh-shadow-lg); }
.ri-rcard__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--rh-surface-2); }
.ri-rcard__img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--rh-ease); }
.ri-rcard:hover .ri-rcard__img { transform: scale(1.05); }
.ri-rcard__body { display: block; padding: 18px 20px 22px; }
.ri-rcard__cat {
	display: block; margin-bottom: 7px;
	font-family: Montserrat, sans-serif; font-size: 11px; font-weight: 700;
	letter-spacing: .12em; text-transform: uppercase; color: var(--rh-red);
}
.ri-rcard__title {
	display: block; font-family: var(--rh-head); font-size: 17.5px; line-height: 1.3; font-weight: 700;
	letter-spacing: -0.015em; color: var(--rh-ink); transition: color .2s ease;
}
.ri-rcard:hover .ri-rcard__title { color: var(--rh-red); }

/* Service link block
   ========================================================================== */

.ri-post-service { padding: 0 0 72px; background: #fff; }
.ri-post-service__inner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px;
	padding: 26px 30px; border-radius: var(--rh-radius);
	background: var(--rh-surface-2); box-shadow: inset 0 0 0 1px var(--rh-line);
}
.ri-styled .ri-post-service__eyebrow {
	margin: 0 0 4px; font-family: Montserrat, sans-serif; font-size: 12px; font-weight: 700;
	letter-spacing: .14em; text-transform: uppercase; color: var(--rh-red);
}
.ri-styled .ri-post-service__title {
	margin: 0; font-family: var(--rh-head); font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2;
	font-weight: 700; letter-spacing: -0.015em; color: var(--rh-ink);
}

/* Body images
   ========================================================================== */

.ri-inner .ri-prose img:not(.ri-prose__lead) {
	display: block; height: auto; margin: 1.8em 0;
	border-radius: var(--rh-radius); box-shadow: var(--rh-shadow-lg);
}
.ri-inner .ri-prose figure { margin: 1.8em 0; padding: 0; background: none; border: 0; }

/* Rebuilt figures on the posts that came from the old site: one width, not the natural size of
   whatever was uploaded that year */
.ri-inner .ri-prose .ri-fig__img { width: 100%; }

/* Images that ran one under another become a row, which is also how a before and after pair reads */
.ri-inner .ri-prose .ri-figs {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px; margin: 1.8em 0;
}
.ri-inner .ri-prose .ri-figs .ri-fig { margin: 0; }
.ri-inner .ri-prose .ri-figs .ri-fig__img { aspect-ratio: 4 / 3; object-fit: cover; margin: 0; }
.ri-inner .ri-prose .ri-figs figcaption { margin-top: 8px; font-size: 13px; }
.ri-inner .ri-prose figcaption {
	margin-top: 10px; font-family: Montserrat, sans-serif; font-size: 14px; line-height: 1.5;
	color: var(--rh-muted);
}

/* Tablet
   ========================================================================== */

@media (max-width: 992px) {
	.ri-sidebar__sticky { position: static; }
	.ri-related-posts { padding: 56px 0; }
}

/* Phone
   ========================================================================== */

@media (max-width: 767px) {
	/* The sidebar is below the article here, so the ask moves inline after the opening */
	.ri-post-strip {
		display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
		margin: 1.6em 0; padding: 14px; border-radius: var(--rh-radius);
		background: var(--rh-surface-2); box-shadow: inset 0 0 0 1px var(--rh-line);
	}
	.ri-post-strip a {
		display: flex; align-items: center; justify-content: center; min-height: 46px;
		padding: 0 10px; border-radius: 999px;
		font-family: Montserrat, sans-serif; font-size: 14px; font-weight: 700;
		text-decoration: none; white-space: nowrap;
	}
	.ri-post-strip__call { background: var(--rh-red); color: #fff !important; }
	.ri-post-strip__quote { color: var(--rh-ink) !important; box-shadow: inset 0 0 0 2px var(--rh-line); }

	.ri-inline-cta { padding: 22px 20px; }
	.ri-inline-cta__actions { width: 100%; }
	.ri-inline-cta__actions .rh-btn { flex: 1 1 100%; }

	.ri-post-service__inner { padding: 22px 20px; }
	.ri-post-service__inner .rh-btn { width: 100%; }

	/* Related posts become a swipe carousel, where horizontal scrolling is natural */
	.ri-rgrid {
		display: flex; gap: 14px;
		margin: 0 -16px; padding: 4px 16px 10px;
		overflow-x: auto; scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch; scrollbar-width: none;
	}
	.ri-rgrid::-webkit-scrollbar { display: none; }
	.ri-rcard { flex: 0 0 78%; scroll-snap-align: start; }
}

/* Articles block on a service page
   ========================================================================== */

.ri-related-posts--page { padding: 72px 0; background: var(--rh-surface-2); }
.ri-related-posts--page .ri-rcard { box-shadow: var(--rh-shadow); }
.ri-rmore {
	display: inline-flex; align-items: center; gap: .5em; margin-top: 26px;
	font-family: Montserrat, sans-serif; font-size: 15px; font-weight: 700;
	color: var(--rh-red) !important; text-decoration: none !important;
	transition: gap .2s var(--rh-ease);
}
.ri-rmore:hover { gap: .85em; }

@media (max-width: 767px) {
	.ri-related-posts--page { padding: 48px 0; }
}
