/* Redlands Auto Protection - blog post template
   Tokens sourced from the site's active design system. */

.rap-post {
	--rap-bg: #FFFFFF;
	--rap-surface: #F2F3F3;
	--rap-ink: #596277;
	--rap-accent: #A8935A;
	--rap-dark: #000000;
	--rap-space-sm: 8px;
	--rap-space-md: 16px;
	--rap-space-lg: 32px;
	--rap-space-xl: 64px;
	--rap-sticky-offset: 130px; /* Divi's fixed nav (data-height-onload=50) + 80px breathing margin */
	--rap-font-heading: 'Montserrat', Helvetica, Arial, Lucida, sans-serif;
	--rap-font-body: 'Hind', Helvetica, Arial, Lucida, sans-serif;
	background: var(--rap-bg);
	color: var(--rap-ink);
	font-family: var(--rap-font-body);
}

.rap-post *, .rap-post *::before, .rap-post *::after {
	box-sizing: border-box;
}

.rap-container {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--rap-space-lg);
	padding-right: var(--rap-space-lg);
}

/* ---------------- Hero ---------------- */

.rap-post-hero {
	position: relative;
	background-color: var(--rap-dark);
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: clamp(420px, 55vh, 560px);
	border-top: 3px solid var(--rap-accent);
}

.rap-post-hero.has-image {
	background-image: var(--rap-hero-image);
	background-size: cover;
	background-position: center;
}

.rap-post-hero__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.92) 100%);
}

.rap-post-hero.has-image .rap-post-hero__scrim {
	background: linear-gradient(180deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.48) 42%, rgba(0,0,0,0.94) 100%);
}

.rap-post-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 760px;
	width: 100%;
	padding-top: 48px;
	padding-bottom: 48px;
}

.rap-breadcrumbs {
	font-family: var(--rap-font-body);
	font-weight: 500;
	font-size: 13px;
	letter-spacing: .02em;
	color: rgba(255,255,255,0.6);
	margin-bottom: var(--rap-space-md);
}

.rap-breadcrumbs a {
	color: rgba(255,255,255,0.6);
	text-decoration: none;
}

.rap-breadcrumbs a:hover {
	color: #FFFFFF;
}

.rap-crumb-sep {
	margin: 0 6px;
	opacity: .5;
}

.rap-post-hero__category {
	display: inline-block;
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 12px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--rap-accent);
	text-decoration: none;
	margin-bottom: var(--rap-space-sm);
}

.rap-post-hero__title {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	color: #FFFFFF;
	font-size: clamp(30px, 4.5vw, 52px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 var(--rap-space-md);
}

.rap-post-hero__meta {
	font-family: var(--rap-font-body);
	font-weight: 600;
	font-size: 15px;
	color: rgba(255,255,255,0.78);
	padding-top: var(--rap-space-md);
	border-top: 1px solid rgba(255,255,255,0.18);
}

.rap-post-hero__meta .rap-dot {
	margin: 0 8px;
	color: var(--rap-accent);
}

/* ---------------- Reading progress ---------------- */

.rap-progress {
	position: sticky;
	top: var(--rap-sticky-offset);
	height: 3px;
	background: var(--rap-surface);
	z-index: 20;
}

.rap-progress__bar {
	height: 100%;
	width: 100%;
	background: var(--rap-accent);
	transform: scaleX(0);
	transform-origin: left;
	will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
	.rap-progress__bar {
		transition: transform .1s linear;
	}
}

/* ---------------- Layout ---------------- */

.rap-post-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--rap-space-lg);
	padding-top: var(--rap-space-xl);
	padding-bottom: var(--rap-space-xl);
}

.rap-post-main {
	min-width: 0;
	max-width: 760px;
}

@media (min-width: 1080px) {
	.rap-post-layout {
		grid-template-columns: minmax(0, 760px) 260px;
		gap: 64px;
		align-items: start;
	}
}

/* ---------------- Table of contents ---------------- */

.rap-post-toc {
	order: -1;
}

.rap-post-toc__inner {
	background: var(--rap-surface);
	border-top: 2px solid var(--rap-accent);
}

.rap-post-toc__toggle {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	background: none;
	border: 0;
	cursor: pointer;
	padding: var(--rap-space-md) var(--rap-space-md);
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rap-dark);
}

.rap-post-toc__toggle svg {
	transition: transform .15s ease;
	flex-shrink: 0;
}

.rap-post-toc.is-open .rap-post-toc__toggle svg {
	transform: rotate(180deg);
}

.rap-post-toc__nav {
	display: none;
	padding: 0 var(--rap-space-md) var(--rap-space-md);
}

.rap-post-toc.is-open .rap-post-toc__nav {
	display: block;
}

.rap-post-toc__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	border-left: 1px solid rgba(89,98,119,0.25);
}

.rap-post-toc__nav li a {
	display: block;
	padding: 6px 0 6px var(--rap-space-md);
	margin-left: -1px;
	border-left: 2px solid transparent;
	font-size: 14px;
	line-height: 1.4;
	color: var(--rap-ink);
	text-decoration: none;
}

.rap-post-toc__nav li.rap-toc-item--h3 a {
	padding-left: calc(var(--rap-space-md) + 14px);
	font-size: 13px;
}

.rap-post-toc__nav li a:hover {
	color: var(--rap-dark);
}

.rap-post-toc__nav li a.is-active {
	border-left-color: var(--rap-accent);
	color: var(--rap-dark);
	font-weight: 600;
}

@media (min-width: 1080px) {
	.rap-post-toc {
		order: 0;
		position: sticky;
		top: var(--rap-sticky-offset);
		align-self: start;
	}

	.rap-post-toc__toggle {
		cursor: default;
		pointer-events: none;
	}

	.rap-post-toc__toggle svg {
		display: none;
	}

	.rap-post-toc__nav {
		display: block;
		max-height: calc(100vh - var(--rap-sticky-offset) - 80px);
		overflow-y: auto;
	}
}

/* ---------------- Article content ---------------- */

.rap-post-content {
	font-family: var(--rap-font-body);
	font-weight: 500;
	font-size: 18px;
	line-height: 1.75;
	color: var(--rap-ink);
}

.rap-post-content > *:first-child {
	margin-top: 0;
}

.rap-post-content h2 {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 28px;
	line-height: 1.2;
	color: var(--rap-dark);
	margin: var(--rap-space-lg) 0 var(--rap-space-md);
	scroll-margin-top: calc(var(--rap-sticky-offset) + 16px);
}

.rap-post-content > h2:first-child {
	margin-top: 0;
}

.rap-post-content h3 {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 21px;
	line-height: 1.25;
	color: var(--rap-dark);
	margin: var(--rap-space-lg) 0 var(--rap-space-sm);
	scroll-margin-top: calc(var(--rap-sticky-offset) + 16px);
}

.rap-post-content h4 {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 17px;
	color: var(--rap-dark);
	margin: var(--rap-space-lg) 0 var(--rap-space-sm);
}

.rap-post-content p {
	margin: 0 0 var(--rap-space-md);
}

.rap-post-content a {
	color: var(--rap-dark);
	text-decoration: underline;
	text-decoration-color: var(--rap-accent);
	text-underline-offset: 3px;
}

.rap-post-content a:hover {
	color: var(--rap-accent);
}

.rap-post-content ul,
.rap-post-content ol {
	margin: 0 0 var(--rap-space-md);
	padding-left: 22px;
	list-style-position: outside;
}

.rap-post-content ul {
	list-style-type: disc;
}

.rap-post-content ol {
	list-style-type: decimal;
}

.rap-post-content ul ul {
	list-style-type: circle;
}

.rap-post-content li {
	margin-bottom: 8px;
	display: list-item;
}

.rap-post-content li::marker {
	color: var(--rap-accent);
}

.rap-post-content blockquote {
	margin: var(--rap-space-lg) 0;
	padding: var(--rap-space-md) var(--rap-space-lg);
	border-left: 3px solid var(--rap-accent);
	background: var(--rap-surface);
	font-style: italic;
	color: var(--rap-dark);
}

.rap-post-content blockquote p:last-child {
	margin-bottom: 0;
}

.rap-post-content img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: var(--rap-space-lg) 0;
	border-top: 3px solid var(--rap-accent);
}

.rap-post-content figure {
	margin: var(--rap-space-lg) 0;
}

.rap-post-content figure img {
	margin: 0;
	max-width: 100%;
	height: auto;
	display: block;
	border-top: 3px solid var(--rap-accent);
}

.rap-post-content figcaption {
	font-family: var(--rap-font-heading);
	font-weight: 600;
	font-size: 12px;
	letter-spacing: .02em;
	color: var(--rap-ink);
	margin-top: 14px;
	padding-top: 10px;
	border-top: 2px solid var(--rap-accent);
	display: inline-block;
}

.rap-post-content table {
	width: 100%;
	border-collapse: collapse;
	margin: var(--rap-space-lg) 0;
	font-size: 15px;
}

.rap-post-content th,
.rap-post-content td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid rgba(89,98,119,0.2);
}

.rap-post-content th {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	color: var(--rap-dark);
	border-bottom: 2px solid var(--rap-accent);
}

.rap-post-content code {
	background: var(--rap-surface);
	padding: 2px 6px;
	font-size: .9em;
}

/* Stray empty paragraphs (an extra Enter keypress while drafting) should
   not add visible whitespace on top of the template's own rhythm. */
.rap-post-content p:empty {
	display: none;
}
/* Authors sometimes add manual Gutenberg spacer blocks between sections;
   the template already provides consistent rhythm before headings, so
   neutralize manual spacers to avoid doubled-up whitespace. */
.rap-post-content .wp-block-spacer {
	height: 0 !important;
	margin: 0 !important;
}
.rap-post-content hr {
	border: 0;
	border-top: 1px solid rgba(89,98,119,0.25);
	margin: var(--rap-space-lg) 0;
}

/* ---------------- Quote CTA ---------------- */

.rap-quote-cta {
	margin: var(--rap-space-xl) 0;
	padding: var(--rap-space-lg);
	background: var(--rap-dark);
	display: flex;
	flex-wrap: wrap;
	gap: var(--rap-space-lg);
	align-items: center;
	justify-content: space-between;
}

.rap-quote-cta__copy h2 {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	color: #FFFFFF;
	font-size: 22px;
	margin: 0 0 6px;
}

.rap-quote-cta__copy p {
	color: rgba(255,255,255,0.72);
	font-size: 15px;
	margin: 0;
	max-width: 46ch;
}

.rap-quote-cta__actions {
	display: flex;
	gap: var(--rap-space-md);
	flex-wrap: wrap;
	flex-shrink: 0;
}

.rap-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 28px;
	border-radius: 999px;
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: .02em;
	text-decoration: none;
	white-space: nowrap;
	border: 1.5px solid transparent;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.rap-btn--solid {
	background: var(--rap-accent);
	color: #FFFFFF;
}

.rap-btn--solid:hover {
	background: #8c7a4e;
	color: #FFFFFF;
}

.rap-btn--ghost {
	background: transparent;
	border-color: rgba(255,255,255,0.4);
	color: #FFFFFF;
}

.rap-btn--ghost:hover {
	border-color: var(--rap-accent);
	color: var(--rap-accent);
}

/* ---------------- Tags ---------------- */

.rap-post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: var(--rap-space-lg) 0;
}

.rap-post-tags a {
	font-family: var(--rap-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--rap-ink);
	background: var(--rap-surface);
	padding: 6px 14px;
	border-radius: 999px;
	text-decoration: none;
}

.rap-post-tags a:hover {
	color: #FFFFFF;
	background: var(--rap-accent);
}

/* ---------------- Share ---------------- */

.rap-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--rap-space-md);
	padding: var(--rap-space-md) 0;
	border-top: 1px solid rgba(89,98,119,0.2);
	border-bottom: 1px solid rgba(89,98,119,0.2);
	margin-bottom: var(--rap-space-xl);
}

.rap-share__label {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rap-dark);
}

.rap-share__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rap-share__btn {
	font-family: var(--rap-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--rap-ink);
	background: var(--rap-surface);
	border: 0;
	padding: 8px 16px;
	border-radius: 999px;
	text-decoration: none;
	cursor: pointer;
}

.rap-share__btn:hover {
	color: #FFFFFF;
	background: var(--rap-dark);
}

/* ---------------- Author ---------------- */

.rap-author {
	display: flex;
	gap: var(--rap-space-md);
	align-items: flex-start;
	padding: var(--rap-space-lg);
	background: var(--rap-surface);
	margin-bottom: var(--rap-space-xl);
}

.rap-author img {
	flex-shrink: 0;
}

.rap-author__label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--rap-accent);
	font-family: var(--rap-font-heading);
	font-weight: 700;
	margin: 0 0 4px;
}

.rap-author__name {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 17px;
	color: var(--rap-dark);
	margin: 0 0 8px;
}

.rap-author__bio {
	font-size: 14px;
	color: var(--rap-ink);
	margin: 0;
}

/* ---------------- Prev / next ---------------- */

.rap-post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--rap-space-md);
	margin-bottom: var(--rap-space-xl);
}

.rap-post-nav__link {
	display: block;
	padding: var(--rap-space-md);
	border: 1px solid rgba(89,98,119,0.25);
	text-decoration: none;
	color: var(--rap-ink);
}

.rap-post-nav__link:hover {
	border-color: var(--rap-accent);
}

.rap-post-nav__link--next {
	text-align: right;
}

.rap-post-nav__link span {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--rap-accent);
	font-family: var(--rap-font-heading);
	font-weight: 700;
	margin-bottom: 6px;
}

.rap-post-nav__link strong {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 15px;
	color: var(--rap-dark);
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 599px) {
	.rap-post-nav {
		grid-template-columns: 1fr;
	}
	.rap-post-nav__link--next {
		text-align: left;
	}

	.rap-quote-cta {
		flex-direction: column;
		align-items: stretch;
	}

	.rap-quote-cta__actions {
		flex-direction: column;
		width: 100%;
	}

	.rap-quote-cta .rap-btn {
		width: 100%;
	}
}

/* ---------------- Related ---------------- */

.rap-related {
	margin-bottom: var(--rap-space-xl);
}

.rap-related h2 {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 22px;
	color: var(--rap-dark);
	margin: 0 0 var(--rap-space-md);
}

.rap-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--rap-space-md);
}

.rap-related__card {
	display: block;
	text-decoration: none;
	color: inherit;
	background: var(--rap-surface);
}

.rap-related__image {
	aspect-ratio: 4 / 3;
	background-color: var(--rap-dark);
	background-size: cover;
	background-position: center;
}

.rap-related__body {
	padding: var(--rap-space-md);
}

.rap-related__cat {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--rap-accent);
	font-family: var(--rap-font-heading);
	font-weight: 700;
	margin-bottom: 6px;
}

.rap-related__body h3 {
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 15px;
	line-height: 1.35;
	color: var(--rap-dark);
	margin: 0;
}

.rap-related__card:hover h3 {
	color: var(--rap-accent);
}

/* ---------------- Comments ---------------- */

.rap-comments {
	padding-top: var(--rap-space-lg);
	border-top: 1px solid rgba(89,98,119,0.2);
}

.rap-comments .comment-form input[type="text"],
.rap-comments .comment-form input[type="email"],
.rap-comments .comment-form input[type="url"],
.rap-comments .comment-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid rgba(89,98,119,0.3);
	font-family: var(--rap-font-body);
	font-size: 15px;
	background: #FFFFFF;
	color: var(--rap-ink);
}

.rap-comments .comment-form input[type="submit"] {
	display: inline-flex;
	align-items: center;
	padding: 13px 28px;
	border-radius: 999px;
	font-family: var(--rap-font-heading);
	font-weight: 700;
	font-size: 14px;
	background: var(--rap-accent);
	color: #FFFFFF;
	border: 0;
	cursor: pointer;
}

/* ---------------- Tablet / desktop refinements ---------------- */

@media (min-width: 768px) {
	.rap-post-hero {
		min-height: clamp(480px, 60vh, 620px);
	}
	.rap-post-hero__inner {
		padding-top: 56px;
		padding-bottom: 56px;
	}
}

@media (min-width: 1080px) {
	.rap-post-hero {
		min-height: clamp(540px, 70vh, 760px);
	}
	.rap-post-hero__inner {
		padding-top: 64px;
		padding-bottom: 64px;
	}
}

@media (min-width: 1080px) {
	.rap-quote-cta {
		flex-wrap: nowrap;
	}
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
	.rap-progress__bar,
	.rap-btn,
	.rap-post-toc__toggle svg {
		transition: none !important;
	}
}