/**
 * Rainbows Ireland - article styling for parent guide posts.
 *
 * Scoped to .ri-guide so nothing outside the post body is affected.
 * Colours come from the site palette (navy text) plus the brand rainbow
 * accents used on the homepage.
 */

.ri-guide {
	--ri-navy: #102249;
	--ri-muted: #5b5c6e;
	--ri-tint: #f7fbfb;
	--ri-line: #e7ebf0;
}

.ri-guide > :first-child {
	margin-top: 0;
}

.ri-guide p,
.ri-guide li {
	color: var(--ri-navy);
}

.ri-guide p {
	line-height: 1.85;
	margin-bottom: 1.25em;
}

.ri-guide__lead {
	font-size: 1.1875rem;
	line-height: 1.8;
	font-weight: 400;
}

.ri-guide h2 {
	color: var(--ri-navy);
	font-size: 1.55rem;
	line-height: 1.3;
	margin: 2.4em 0 0.75em;
	padding-bottom: 0.5em;
	border-bottom: 1px solid var(--ri-line);
	position: relative;
}

/* Rainbow underline echoing the Rainbows Ireland brand. */
.ri-guide h2::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 78px;
	height: 3px;
	border-radius: 2px;
	background: linear-gradient(90deg, #f24040 0%, #ffa130 34%, #f2c440 66%, #8ad1e5 100%);
}

.ri-guide h3 {
	color: var(--ri-navy);
	font-size: 1.1875rem;
	line-height: 1.45;
	margin: 2em 0 0.5em;
}

.ri-guide ul {
	margin: 0.9em 0 1.5em;
	padding-left: 1.4em;
}

.ri-guide ul li {
	line-height: 1.8;
	margin-bottom: 0.45em;
}

.ri-guide ul li::marker {
	color: var(--ri-navy);
}

/* Pulled out key message. */
.ri-guide__key {
	background: var(--ri-tint);
	border-left: 4px solid #f2c440;
	border-radius: 0 6px 6px 0;
	padding: 1.25em 1.5em;
	margin: 1.9em 0;
}

.ri-guide__key p {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.7;
}

/* Closing support box. */
.ri-guide__cta {
	background: var(--ri-tint);
	border: 1px solid var(--ri-line);
	border-radius: 8px;
	padding: 1.5em 1.6em;
	margin-top: 2.6em;
}

.ri-guide__cta p {
	margin: 0;
}

.ri-guide__cta-links {
	margin-top: 0.85em;
	padding-top: 0.85em;
	border-top: 1px solid var(--ri-line);
	font-size: 0.9375rem;
	color: var(--ri-muted);
}

.ri-guide__cta-links a {
	color: var(--ri-navy);
	text-decoration: underline;
}

@media (max-width: 767px) {
	.ri-guide h2 {
		font-size: 1.35rem;
		margin-top: 2em;
	}

	.ri-guide__lead {
		font-size: 1.0625rem;
	}
}

/**
 * Landing / hub pages: intro copy plus a responsive grid of guide posts.
 * Used by /parental-separation and its siblings under Parents & Families.
 * Colours come from the site palette plus the brand rainbow accents.
 */

:root {
	--ri-navy: #102249;
	--ri-muted: #5b5c6e;
	--ri-tint: #f7fbfb;
	--ri-line: #e7ebf0;
}

/**
 * Blue-band hero title for blog posts and landing pages.
 * Sits below the injected blue wave band, matching the homepage page header.
 * Colour #0B1F6B matches the homepage hero title (Elementor widget 106c71f).
 */
.ri-hero-title {
	max-width: 1140px;
	margin: 0 auto;
	padding: 2rem 20px 1.5rem;
}

.ri-hero-title__text {
	color: #0b1f6b;
	font-size: 50px;
	font-weight: 400;
	line-height: 1.2;
	margin: 0;
}

/* Matches the homepage hero title (40px, centred) at the tablet/mobile breakpoint. */
@media (max-width: 999px) {
	.ri-hero-title {
		text-align: center;
		padding: 1.5rem 15px 0;
	}

	.ri-hero-title__text {
		font-size: 40px;
		line-height: 1.3;
	}
}

/*
 * Blog posts carry no featured image, but the single-post template 2 still
 * renders an empty full-width header with a 650px min-height. That is the big
 * white gap under the hero title, so collapse it when there is no image.
 */
.jupiterx-post-template-2 .jupiterx-post-header:not(:has(.jupiterx-post-image)) {
	min-height: 0;
	display: none;
}

/*
 * Related guides card on single blog posts.
 *
 * Two-column layout: the article on the left, a sticky card on the right
 * listing the other posts in the same category (matching the iWorks blog).
 */
.single-post .jupiterx-post-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 3rem;
}

/* Neutralise the clearfix pseudo-element so it does not become an empty grid cell. */
.single-post .jupiterx-post-content::after {
	content: none;
	display: none;
}

.ri-related-card {
	position: sticky;
	top: 2rem;
	align-self: start;
	background: var(--ri-tint);
	border: 1px solid var(--ri-line);
	border-radius: 8px;
	overflow: hidden;
	padding: 1.5rem 1.5rem 0.75rem;
}

.ri-related-card::before {
	content: "";
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #f24040 0%, #ffa130 34%, #f2c440 66%, #8ad1e5 100%);
}

.ri-related-card__heading {
	color: var(--ri-navy);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 0.5rem;
}

.ri-related-card__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ri-related-card__item {
	border-bottom: 1px solid var(--ri-line);
}

.ri-related-card__item:last-child {
	border-bottom: 0;
}

.ri-related-card__item a {
	display: block;
	padding: 0.8rem 0;
	color: var(--ri-navy);
	text-decoration: none;
	font-size: 0.95rem;
	line-height: 1.45;
	transition: color 0.15s ease;
}

.ri-related-card__item a:hover,
.ri-related-card__item a:focus {
	color: #0b1f6b;
	text-decoration: underline;
}

@media (max-width: 991px) {
	.single-post .jupiterx-post-content {
		grid-template-columns: minmax(0, 1fr);
		gap: 2rem;
	}

	/* Drop the sticky behaviour but keep a positioned context for the rainbow bar. */
	.ri-related-card {
		position: relative;
	}
}

.jupiterx-post-content .ri-landing__lead {
	font-size: 1.1875rem;
	line-height: 1.8;
	color: var(--ri-navy);
}

.jupiterx-post-content .ri-landing__heading {
	color: var(--ri-navy);
	font-size: 1.55rem;
	line-height: 1.3;
	margin: 2.2em 0 0.2em;
	padding-bottom: 0.5em;
	border-bottom: 1px solid var(--ri-line);
	position: relative;
}

/* Rainbow underline echoing the Rainbows Ireland brand. */
.jupiterx-post-content .ri-landing__heading::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 78px;
	height: 3px;
	border-radius: 2px;
	background: linear-gradient(90deg, #f24040 0%, #ffa130 34%, #f2c440 66%, #8ad1e5 100%);
}

.ri-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
	margin: 1.75rem 0 4.5rem;
	padding: 0;
}

.ri-posts-grid .ri-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	padding: 1.7rem 1.5rem 1.4rem;
	background: #fff;
	border: 1px solid var(--ri-line);
	border-radius: 8px;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ri-posts-grid .ri-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #f24040 0%, #ffa130 34%, #f2c440 66%, #8ad1e5 100%);
}

.ri-posts-grid .ri-card:hover,
.ri-posts-grid .ri-card:focus-within {
	transform: translateY(-3px);
	border-color: rgba(16, 34, 73, 0.3);
	box-shadow: 0 12px 28px rgba(16, 34, 73, 0.12);
}

.ri-posts-grid .ri-card:focus-within {
	outline: 2px solid var(--ri-navy);
	outline-offset: 2px;
}

.ri-posts-grid .ri-card__title {
	margin: 0.35rem 0 0.6rem;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.4;
}

.ri-posts-grid .ri-card__link {
	color: var(--ri-navy);
	text-decoration: none;
}

/* Stretch the heading link over the whole card. */
.ri-posts-grid .ri-card__link::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.ri-posts-grid .ri-card__link:focus-visible {
	outline: none;
}

.ri-posts-grid .ri-card__link:hover {
	color: var(--ri-navy);
	text-decoration: none;
}

.ri-posts-grid .ri-card__excerpt {
	margin: 0 0 1.1rem;
	color: var(--ri-muted);
	font-size: 0.95rem;
	line-height: 1.65;
}

.ri-posts-grid .ri-card__more {
	margin-top: auto;
	padding-top: 0.35rem;
	color: var(--ri-navy);
	font-size: 0.9rem;
	font-weight: 600;
}

.ri-posts-grid .ri-card__more::after {
	content: "";
	display: block;
	width: 26px;
	height: 2px;
	margin-top: 0.4rem;
	background: currentColor;
	transition: width 0.18s ease;
}

.ri-posts-grid .ri-card:hover .ri-card__more::after,
.ri-posts-grid .ri-card:focus-within .ri-card__more::after {
	width: 46px;
}

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

@media (max-width: 640px) {
	.ri-posts-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.1rem;
	}

	.jupiterx-post-content .ri-landing__heading {
		font-size: 1.35rem;
	}

	.jupiterx-post-content .ri-landing__lead {
		font-size: 1.0625rem;
	}
}

/*
 * Author box and social share buttons are removed at the source (the single
 * post "elements" theme setting). These rules are a belt-and-braces hide in
 * case that setting is ever reset.
 */
.single-post .jupiterx-post-author-box,
.single-post .jupiterx-social-share {
	display: none !important;
}

/*
 * Previous / Next navigation styled as clean buttons at the end of an article.
 */
.single-post .jupiterx-post-navigation {
	margin: 3rem 0 0.5rem;
}

.single-post .jupiterx-post-navigation .row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
}

.single-post .jupiterx-post-navigation-link {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex: 1 1 260px;
	width: auto;
	max-width: none;
	margin: 0 !important;
	padding: 1.25rem 1.4rem;
	background: var(--ri-tint);
	border: 1px solid var(--ri-line);
	border-radius: 10px;
	text-decoration: none !important;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.single-post .jupiterx-post-navigation-link:hover,
.single-post .jupiterx-post-navigation-link:focus {
	border-color: rgba(16, 34, 73, 0.35);
	box-shadow: 0 12px 28px rgba(16, 34, 73, 0.12);
	transform: translateY(-2px);
	text-decoration: none !important;
}

.single-post .jupiterx-post-navigation-link:focus-visible {
	outline: 2px solid var(--ri-navy);
	outline-offset: 2px;
}

.single-post .jupiterx-post-navigation-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.single-post .jupiterx-post-navigation-label {
	order: -1;
	margin-bottom: 0.2rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ri-muted);
}

.single-post .jupiterx-post-navigation-title {
	margin: 0 !important;
	font-size: 1rem !important;
	line-height: 1.4 !important;
	font-weight: 600 !important;
	color: var(--ri-navy) !important;
}

.single-post .jupiterx-post-navigation-previous::before {
	content: "\2039";
	flex: 0 0 auto;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--ri-muted);
}

.single-post .jupiterx-post-navigation-next {
	justify-content: flex-end;
	text-align: right;
}

.single-post .jupiterx-post-navigation-next::after {
	content: "\203A";
	flex: 0 0 auto;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--ri-muted);
}
