/**
 * Blog listing + single post styles
 * Chrome parity with optimataxrelief.com PageHero / content pages
 */

/* Hero — PageHero compactTitle */
.otr-blog-hero {
	background-color: var(--otr-blue-deep, #1c50a4);
	color: #fff;
	font-family: var(--otr-font);
}

.otr-blog-hero__inner {
	width: 100%;
	max-width: 72rem; /* max-w-6xl */
	margin: 0 auto;
	padding: 2.5rem 1rem; /* py-10 */
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.otr-blog-hero__inner {
		padding-top: 3rem; /* md:py-12 */
		padding-bottom: 3rem;
	}
}

.otr-blog-hero__crumbs {
	margin-bottom: 1rem;
	font-size: 0.875rem; /* text-sm */
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.8);
}

.otr-blog-hero__crumb-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.otr-blog-hero__crumb-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.otr-blog-hero__crumbs a {
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
}

.otr-blog-hero__crumbs a:hover,
.otr-blog-hero__crumbs a:focus-visible {
	color: #fff;
}

.otr-blog-hero__sep {
	color: rgba(255, 255, 255, 0.8);
}

.otr-blog-hero__current {
	font-weight: 600;
	color: #fff;
}

.otr-blog-hero__title {
	margin: 0;
	max-width: 56rem;
	font-size: 1.5rem; /* text-2xl / 24px */
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.025em; /* tracking-wide */
	text-transform: uppercase;
	color: #fff;
}

@media (min-width: 768px) {
	.otr-blog-hero__title {
		font-size: 24px;
	}
}

/* Layout */
.otr-blog {
	font-family: var(--otr-font);
	background: #fff;
	padding: 3rem 0 0;
}

@media (min-width: 768px) {
	.otr-blog {
		padding-top: 4rem;
	}
}

.otr-blog__container {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.75rem;
	width: 100%;
	max-width: 72rem; /* max-w-6xl — match marketing pages */
	margin: 0 auto;
	padding: 0 1rem 3.5rem;
	box-sizing: border-box;
}

.otr-blog__container--full {
	display: block;
	max-width: 58rem;
}

@media (min-width: 981px) {
	.otr-blog__container {
		grid-template-columns: minmax(0, 1fr) 260px;
		gap: 2rem;
		align-items: start;
	}
}

.otr-blog__main {
	min-width: 0;
}

.otr-blog .otr-blog__main {
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding-right: 0 !important;
}

.otr-blog .otr-blog-sidebar {
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding-left: 0 !important;
}

/* Listing cards */
.otr-post-card {
	margin: 0 0 2rem;
	padding: 0 0 1.75rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.otr-post-card:last-of-type {
	border-bottom: 0;
}

.otr-post-card__title {
	margin: 0 0 0.5rem;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--otr-text);
}

@media (min-width: 768px) {
	.otr-post-card__title {
		font-size: 22px;
	}
}

.otr-post-card__title a {
	color: var(--otr-text);
	text-decoration: none;
}

.otr-post-card__title a:hover,
.otr-post-card__title a:focus-visible {
	color: var(--otr-blue);
}

.otr-post-card__meta {
	margin: 0 0 0.75rem;
	font-size: 14px;
	color: var(--otr-text-muted);
}

.otr-post-card__meta a {
	color: var(--otr-blue);
	text-decoration: none;
}

.otr-post-card__meta a:hover,
.otr-post-card__meta a:focus-visible {
	text-decoration: underline;
}

.otr-post-card__excerpt,
.otr-post-card__excerpt p {
	margin: 0;
	font-size: 16px;
	line-height: 1.625;
	color: var(--otr-text);
}

.otr-post-card__excerpt p + p {
	margin-top: 0.75rem;
}

/* Pagination */
.otr-blog__pagination {
	margin-top: 1.5rem;
	padding-bottom: 0.5rem;
}

.otr-blog__pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.otr-blog__pagination a,
.otr-blog__pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	padding: 0.35rem 0.6rem;
	font-size: 14px;
	font-weight: 500;
	color: var(--otr-blue);
	text-decoration: none;
}

.otr-blog__pagination .current {
	font-weight: 700;
	color: var(--otr-text);
}

/* Single post */
.otr-single-post__meta {
	margin: 0 0 10px;
	font-size: 14px;
	color: var(--otr-text-muted);
}

.otr-single-post__featured {
	margin: 0 0 1.25rem;
}

.otr-single-post__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 2px;
}

.otr-single-post__content {
	font-size: 16px;
	line-height: 1.625;
	color: var(--otr-text);
}

.otr-single-post__content::after {
	content: "";
	display: table;
	clear: both;
}

.otr-single-post__content > *:first-child {
	margin-top: 0;
}

.otr-single-post__content h2 {
	margin: 1.75rem 0 0.75rem;
	font-size: 1.375rem; /* ~22px marketing-adjacent */
	font-weight: 700;
	line-height: 1.35;
	color: var(--otr-navy);
}

@media (min-width: 768px) {
	.otr-single-post__content h2 {
		font-size: 1.5rem;
	}
}

.otr-single-post__content h2 strong {
	font-weight: 700;
}

.otr-single-post__content h3 {
	margin: 1.5rem 0 0.65rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--otr-navy);
}

.otr-single-post__content p {
	margin: 0 0 1rem;
}

.otr-single-post__content a {
	color: var(--otr-blue);
	text-decoration: none;
}

.otr-single-post__content a:hover {
	text-decoration: underline;
}

.otr-single-post__content ul,
.otr-single-post__content ol {
	margin: 0 0 1rem;
	padding-left: 1.5rem;
}

/* Gutenberg sometimes emits one <ul> per <li> — tighten the stack */
.otr-single-post__content ul + ul,
.otr-single-post__content ol + ol {
	margin-top: -0.65rem;
}

.otr-single-post__content li {
	margin-bottom: 0.4rem;
}

.otr-single-post__content blockquote {
	margin: 1.25rem 0;
	padding: 0 0 0 20px;
	border-left: 4px solid var(--otr-blue);
}

.otr-single-post__content blockquote h2 {
	margin-top: 0;
}

.otr-single-post__content figure {
	margin: 1.25rem 0;
}

.otr-single-post__content img {
	max-width: 100%;
	height: auto;
}

/* ------------------------------------------------------------------ */
/* Video / media embeds (incl. portrait 9:16 Ask Phil / Shorts)        */
/* ------------------------------------------------------------------ */

.otr-single-post__content .wp-block-embed,
.otr-single-post__content .wp-block-video,
.otr-single-post__content .jetpack-video-wrapper {
	margin: 0 0 1.5rem;
}

.otr-single-post__content .wp-block-embed__wrapper,
.otr-single-post__content .fluid-width-video-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 12px;
	background: #0b1220;
	box-shadow: 0 8px 24px rgba(16, 42, 84, 0.14);
}

.otr-single-post__content .wp-block-embed iframe,
.otr-single-post__content .wp-block-video video,
.otr-single-post__content .fluid-width-video-wrapper iframe,
.otr-single-post__content iframe[src*="vimeo.com"],
.otr-single-post__content iframe[src*="youtube.com"],
.otr-single-post__content iframe[src*="youtu.be"] {
	display: block;
	max-width: 100%;
	border: 0;
	border-radius: 12px;
}

/* Landscape / default responsive embeds */
.otr-single-post__content .wp-block-embed:not(.wp-embed-aspect-9-16) .wp-block-embed__wrapper,
.otr-single-post__content .wp-embed-aspect-16-9 .wp-block-embed__wrapper,
.otr-single-post__content .wp-embed-aspect-4-3 .wp-block-embed__wrapper {
	aspect-ratio: 16 / 9;
}

.otr-single-post__content .wp-block-embed:not(.wp-embed-aspect-9-16) iframe,
.otr-single-post__content .wp-embed-aspect-16-9 iframe,
.otr-single-post__content .wp-embed-aspect-4-3 iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Portrait (9:16) — Ask Phil / Shorts / Reels */
.otr-single-post__content .wp-block-embed.wp-embed-aspect-9-16,
.otr-single-post__content .wp-block-embed.wp-has-aspect-ratio.wp-embed-aspect-9-16 {
	width: 100%;
	max-width: 300px;
}

.otr-single-post__content .wp-block-embed.wp-embed-aspect-9-16 .wp-block-embed__wrapper,
.otr-single-post__content .wp-block-embed.wp-embed-aspect-9-16 .fluid-width-video-wrapper {
	aspect-ratio: 9 / 16;
	padding-top: 0 !important; /* override FitVids inline padding */
	height: auto !important;
}

.otr-single-post__content .wp-block-embed.wp-embed-aspect-9-16 iframe,
.otr-single-post__content .wp-block-embed.wp-embed-aspect-9-16 .fluid-width-video-wrapper iframe {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
}

/* Float alignments — give text breathing room beside portrait video */
.otr-single-post__content .wp-block-embed.alignright,
.otr-single-post__content .alignright.wp-block-embed {
	float: right;
	margin: 0.15rem 0 1.5rem 1.75rem;
	max-width: 300px;
}

.otr-single-post__content .wp-block-embed.alignleft,
.otr-single-post__content .alignleft.wp-block-embed {
	float: left;
	margin: 0.15rem 1.75rem 1.5rem 0;
	max-width: 300px;
}

.otr-single-post__content .wp-block-embed.aligncenter,
.otr-single-post__content .aligncenter.wp-block-embed {
	float: none;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.otr-single-post__content .alignright:not(.wp-block-embed) {
	float: right;
	margin: 0.25rem 0 1.25rem 1.5rem;
	max-width: min(50%, 360px);
}

.otr-single-post__content .alignleft:not(.wp-block-embed) {
	float: left;
	margin: 0.25rem 1.5rem 1.25rem 0;
	max-width: min(50%, 360px);
}

.otr-single-post__content .aligncenter:not(.wp-block-embed) {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* Stack portrait embeds above copy on narrow viewports */
@media (max-width: 781px) {
	.otr-single-post__content .wp-block-embed.alignright,
	.otr-single-post__content .wp-block-embed.alignleft,
	.otr-single-post__content .alignright.wp-block-embed,
	.otr-single-post__content .alignleft.wp-block-embed {
		float: none;
		display: block;
		margin: 0 auto 1.5rem;
		max-width: 280px;
	}

	.otr-single-post__content .alignright:not(.wp-block-embed),
	.otr-single-post__content .alignleft:not(.wp-block-embed) {
		float: none;
		display: block;
		margin: 0 auto 1.25rem;
		max-width: 100%;
	}
}

@media (min-width: 782px) and (max-width: 980px) {
	.otr-single-post__content .wp-block-embed.wp-embed-aspect-9-16,
	.otr-single-post__content .wp-block-embed.alignright,
	.otr-single-post__content .wp-block-embed.alignleft {
		max-width: 260px;
	}
}

.otr-single-post__categories {
	margin: 1.75rem 0 0;
	font-size: 15px;
	color: var(--otr-text);
}

.otr-single-post__categories a {
	color: var(--otr-blue);
	text-decoration: none;
}

.otr-single-post__categories a:hover {
	text-decoration: underline;
}

.otr-single-post__nav {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 2rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
	.otr-single-post__nav {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
	}
}

.otr-single-post__nav a {
	color: var(--otr-blue);
	text-decoration: none;
	font-size: 15px;
}

.otr-single-post__nav a:hover {
	text-decoration: underline;
}

/* Sidebar */
.otr-blog-sidebar__widget {
	margin-bottom: 1.75rem;
}

.otr-blog-sidebar__title {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--otr-navy);
}

.otr-blog-sidebar__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.otr-blog-sidebar__list li {
	margin: 0;
	padding: 0.35rem 0;
	border-bottom: 1px solid #f1f3f4;
}

.otr-blog-sidebar__list a {
	color: var(--otr-blue);
	text-decoration: none;
	font-size: 15px;
	line-height: 1.4;
}

.otr-blog-sidebar__list a:hover,
.otr-blog-sidebar__list a:focus-visible {
	text-decoration: underline;
}

.otr-search {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

.otr-search__input {
	flex: 1;
	min-width: 0;
	padding: 0.5rem 0.65rem;
	border: 1px solid #ccc;
	border-radius: 0.375rem;
	font-family: inherit;
	font-size: 14px;
}

.otr-search__submit {
	padding: 0.5rem 0.85rem;
	border: 0;
	border-radius: 9999px;
	background: var(--otr-blue);
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.otr-search__submit:hover,
.otr-search__submit:focus-visible {
	background: var(--otr-blue-bright);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* CTA band — CtaBand parity */
.otr-cta-band {
	border-top: 1px solid rgba(12, 113, 195, 0.1);
	border-bottom: 1px solid rgba(12, 113, 195, 0.1);
	background: #f4f7fb;
	font-family: var(--otr-font);
}

.otr-cta-band__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	width: 100%;
	max-width: 72rem;
	margin: 0 auto;
	padding: 2.5rem 1rem;
	text-align: center;
	box-sizing: border-box;
}

@media (min-width: 640px) {
	.otr-cta-band__inner {
		padding-top: 3rem;
		padding-bottom: 3rem;
	}
}

@media (min-width: 768px) {
	.otr-cta-band__inner {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 3rem;
		padding-top: 4rem;
		padding-bottom: 4rem;
		text-align: left;
	}
}

.otr-cta-band__copy {
	width: 100%;
	max-width: 42rem;
}

.otr-cta-band__eyebrow {
	margin: 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--otr-blue);
}

@media (min-width: 640px) {
	.otr-cta-band__eyebrow {
		font-size: 0.75rem;
	}
}

.otr-cta-band__title {
	margin: 0.5rem 0 0;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--otr-navy);
}

@media (min-width: 640px) {
	.otr-cta-band__title {
		margin-top: 0.75rem;
		font-size: 1.5rem;
	}
}

@media (min-width: 768px) {
	.otr-cta-band__title {
		font-size: 32px;
	}
}

.otr-cta-band__rule {
	width: 3rem;
	height: 0.25rem;
	margin: 0.75rem auto 0;
	background: var(--otr-blue-deep);
}

@media (min-width: 640px) {
	.otr-cta-band__rule {
		margin-top: 1rem;
	}
}

@media (min-width: 768px) {
	.otr-cta-band__rule {
		margin-left: 0;
		margin-right: 0;
	}
}

.otr-cta-band__body {
	margin: 0.75rem 0 0;
	font-size: 15px;
	line-height: 1.625;
	color: var(--otr-text-muted);
}

@media (min-width: 640px) {
	.otr-cta-band__body {
		margin-top: 1rem;
		font-size: 1rem;
	}
}

@media (min-width: 768px) {
	.otr-cta-band__body {
		font-size: 17px;
	}
}

.otr-cta-band__action {
	width: 100%;
	flex-shrink: 0;
}

@media (min-width: 640px) {
	.otr-cta-band__action {
		width: auto;
	}
}

.otr-cta-band__button {
	width: 100%;
	min-height: 3rem;
	padding-left: 2rem;
	padding-right: 2rem;
	font-size: 1rem;
}

@media (min-width: 640px) {
	.otr-cta-band__button {
		width: auto;
	}
}

/* Back to top — BackToTop parity */
.otr-back-to-top {
	position: fixed;
	z-index: 50;
	right: 1.25rem;
	bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 0.75rem));
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: var(--otr-blue);
	color: #fff;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	opacity: 0;
	transform: translateY(0.5rem);
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

@media (min-width: 640px) {
	.otr-back-to-top {
		right: 1.5rem;
		bottom: 1.5rem;
	}
}

.otr-back-to-top.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.otr-back-to-top:hover,
.otr-back-to-top:focus-visible {
	background: var(--otr-blue-bright);
	color: #fff;
}

body.otr-blog-layout #et-main-area {
	background: #fff;
}
