/* New blog post design (issue #49). Loaded only on posts routed to single-post-new.php. */

.ci-post-page .ci-header {
	box-shadow: none;
}

.ci-post {
	--ci-post-text: #2b3443;
	--ci-post-soft: #f5f9fd;
	--ci-post-max: 1360px; /* overall width of hero, article + sidebar, related posts */
	background: #ffffff;
	color: var(--ci-post-text);
	font-size: 18px;
	line-height: 1.75;
}

/* Padding stays inside width:100% boxes (the sidebar button used to stick out of its card). */
.ci-post-btn,
.ci-post-side,
.ci-post-side *,
.ci-post-cta,
.ci-post-faq,
.ci-post-toc {
	box-sizing: border-box;
}

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

.ci-post-hero {
	position: relative;
	padding: 48px 24px 0;
	background: linear-gradient(180deg, #f2f8fc 0%, #f7fbff 62%, #ffffff 62%);
}

.ci-post-hero__inner {
	max-width: 880px;
	margin: 0 auto;
	text-align: center;
}

.ci-post-crumbs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 22px;
	color: #59677b;
	font-size: 14px;
	line-height: 1.4;
}

.ci-post-crumbs a {
	color: #59677b;
	text-decoration: none;
}

.ci-post-crumbs a:hover {
	color: var(--ci-ink);
	text-decoration: underline;
}

.ci-post-hero__pill {
	display: inline-block;
	margin-bottom: 18px;
	padding: 6px 14px;
	border-radius: 999px;
	background: #dcecff;
	color: #1f3a5c;
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
}

.ci-post-hero__title {
	margin: 0;
	color: var(--ci-ink);
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: clamp(30px, 4.2vw, 50px);
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.14;
	text-wrap: balance;
}

.ci-post-hero__lead {
	max-width: 700px;
	margin: 18px auto 0;
	color: var(--ci-muted);
	font-size: 18px;
	line-height: 1.6;
}

.ci-post-hero__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 10px;
	margin-top: 20px;
	color: #59677b;
	font-size: 15px;
	line-height: 1.4;
}

.ci-post-hero__author {
	color: var(--ci-ink);
	font-weight: 600;
}

.ci-post-hero__image {
	max-width: 1120px;
	margin: 36px auto 0;
	overflow: hidden;
	border-radius: 16px;
	background: #eef2f6;
	box-shadow: 0 24px 60px rgba(21, 25, 35, 0.14);
	line-height: 0;
}

.ci-post-hero__image img {
	display: block;
	width: 100%;
	height: auto;
}

/* Desktop: text on the left, featured image on the right, so the hero has no empty side space. */
@media (min-width: 1025px) {
	.ci-post-hero {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
		align-items: center;
		gap: 56px;
		padding: 44px max(32px, calc((100% - var(--ci-post-max)) / 2)) 52px;
		border-bottom: 1px solid rgba(0, 159, 227, 0.12);
		background: linear-gradient(135deg, #f2f8fc 0%, #f7fbff 55%, #ffffff 100%);
	}

	.ci-post-hero__inner {
		max-width: none;
		margin: 0;
		text-align: left;
	}

	.ci-post-crumbs,
	.ci-post-hero__meta {
		justify-content: flex-start;
	}

	.ci-post-crumbs {
		margin-bottom: 18px;
	}

	.ci-post-hero__title {
		font-size: clamp(32px, 2.9vw, 44px);
		line-height: 1.16;
	}

	.ci-post-hero__lead {
		margin-left: 0;
	}

	.ci-post-hero__meta {
		margin-top: 22px;
		padding-top: 18px;
		border-top: 1px solid rgba(21, 25, 35, 0.08);
	}

	.ci-post-hero__image {
		max-width: none;
		margin: 0;
		box-shadow: 0 22px 50px rgba(21, 25, 35, 0.16);
	}

	.ci-post-layout {
		padding-top: 48px;
	}
}

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

.ci-post-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	justify-content: center;
	gap: 72px;
	max-width: var(--ci-post-max);
	margin: 0 auto;
	padding: 56px 24px 32px;
}

.ci-post-body {
	min-width: 0;
}

/* ---------- Article typography ---------- */

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

.ci-post-content p,
.ci-post-content ul,
.ci-post-content ol {
	margin: 0 0 1.25em;
}

.ci-post-content > p:first-child {
	color: var(--ci-ink);
	font-size: 20px;
	line-height: 1.7;
}

.ci-post-content h2 {
	margin: 2.2em 0 0.7em;
	padding-top: 0.2em;
	color: var(--ci-ink);
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: clamp(25px, 2.6vw, 32px);
	font-weight: 800;
	letter-spacing: -0.005em;
	line-height: 1.25;
	scroll-margin-top: 110px;
}

.ci-post-content h2::before {
	content: "";
	display: block;
	width: 44px;
	height: 4px;
	margin-bottom: 16px;
	border-radius: 4px;
	background: var(--ci-red);
}

.ci-post-content h3 {
	margin: 1.8em 0 0.5em;
	color: var(--ci-ink);
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: 21px;
	font-weight: 800;
	line-height: 1.35;
}

.ci-post-content a {
	color: var(--ci-blue-text);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.ci-post-content a:hover {
	color: var(--ci-ink);
}

.ci-post-content strong {
	color: var(--ci-ink);
}

.ci-post-content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.ci-post-content blockquote {
	margin: 1.6em 0;
	padding: 18px 22px;
	border-left: 4px solid var(--ci-blue);
	border-radius: 0 10px 10px 0;
	background: var(--ci-post-soft);
	font-style: normal;
}

/* ---------- Tables ---------- */

.ci-post-table {
	margin: 1.6em 0;
	overflow-x: auto;
	border: 1px solid var(--ci-line);
	border-radius: 12px;
	-webkit-overflow-scrolling: touch;
}

.ci-post-table table {
	width: 100%;
	min-width: 560px;
	margin: 0;
	border-collapse: collapse;
	font-size: 16px;
	line-height: 1.55;
}

.ci-post-table th {
	padding: 14px 16px;
	background: var(--ci-ink);
	color: #ffffff;
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-weight: 800;
	text-align: left;
}

.ci-post-table td {
	padding: 14px 16px;
	border-top: 1px solid var(--ci-line);
	vertical-align: top;
}

.ci-post-table tbody tr:nth-child(even) td {
	background: var(--ci-post-soft);
}

.ci-post-table td:first-child {
	color: var(--ci-ink);
	font-weight: 700;
	white-space: nowrap;
}

/* ---------- FAQ accordion ---------- */

.ci-post-faqs {
	display: grid;
	gap: 12px;
	margin: 1.2em 0 1.6em;
}

.ci-post-faq {
	border: 1px solid var(--ci-line);
	border-radius: 12px;
	background: #ffffff;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ci-post-faq[open] {
	border-color: rgba(0, 159, 227, 0.4);
	box-shadow: 0 10px 28px rgba(21, 25, 35, 0.07);
}

.ci-post-faq summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px;
	cursor: pointer;
	list-style: none;
}

.ci-post-faq summary::-webkit-details-marker {
	display: none;
}

.ci-post-faq summary::after {
	content: "+";
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--ci-post-soft);
	color: var(--ci-ink);
	font-size: 20px;
	font-weight: 700;
	line-height: 30px;
	text-align: center;
	transition: transform 160ms ease, background 160ms ease;
}

.ci-post-faq[open] summary::after {
	background: var(--ci-red);
	color: #ffffff;
	transform: rotate(45deg);
}

.ci-post-faq summary:focus-visible {
	outline: 3px solid var(--ci-focus);
	outline-offset: 2px;
	border-radius: 12px;
}

.ci-post-content .ci-post-faq h3 {
	margin: 0;
	font-size: 18px;
}

.ci-post-faq__answer {
	padding: 0 20px 4px;
	font-size: 17px;
}

/* ---------- Buttons + CTAs ---------- */

.ci-post-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 22px;
	border-radius: 10px;
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: 16px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ci-post-btn--red {
	background: var(--ci-red-dark);
	color: #ffffff !important;
	box-shadow: 0 10px 22px rgba(207, 20, 24, 0.24);
}

.ci-post-btn--red:hover {
	background: #b01014;
	transform: translateY(-1px);
}

.ci-post-btn--ghost {
	border: 1px solid rgba(255, 255, 255, 0.4);
	color: #ffffff !important;
}

.ci-post-btn--ghost:hover {
	background: rgba(255, 255, 255, 0.1);
}

.ci-post-btn:focus-visible {
	outline: 3px solid var(--ci-focus);
	outline-offset: 2px;
}

.ci-post-cta__eyebrow {
	margin: 0 0 6px !important;
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: 12px !important;
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1.3 !important;
	text-transform: uppercase;
}

.ci-post-cta__title {
	margin: 0 0 8px !important;
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: 21px !important;
	font-weight: 800;
	line-height: 1.3 !important;
}

.ci-post-cta__text {
	margin: 0 !important;
	font-size: 16px !important;
	line-height: 1.6 !important;
}

.ci-post-cta--inline {
	display: flex;
	align-items: center;
	gap: 24px;
	margin: 2.4em 0 0.5em;
	padding: 24px 26px;
	border: 1px solid rgba(0, 159, 227, 0.22);
	border-radius: 14px;
	background: var(--ci-post-soft);
}

.ci-post-cta--inline .ci-post-cta__eyebrow {
	color: var(--ci-red-dark);
}

.ci-post-cta--inline .ci-post-cta__title {
	color: var(--ci-ink);
}

.ci-post-cta--end {
	margin-top: 48px;
	padding: 36px 32px;
	border-radius: 18px;
	background: radial-gradient(circle at 100% 0%, rgba(244, 38, 42, 0.35), transparent 45%), var(--ci-ink);
	color: #d6dce6;
}

.ci-post-cta--end .ci-post-cta__eyebrow {
	color: #ffb4b5;
}

.ci-post-cta--end .ci-post-cta__title {
	color: #ffffff;
	font-size: clamp(24px, 3vw, 30px) !important;
}

.ci-post-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 22px;
}

/* ---------- Author box (Simple Author Box plugin, added to the content) ---------- */

.ci-post .saboxplugin-wrap {
	margin-top: 44px;
	overflow: hidden;
	border: 1px solid var(--ci-line) !important;
	border-radius: 14px;
	background: var(--ci-post-soft);
}

.ci-post .saboxplugin-wrap .saboxplugin-gravatar img {
	border-radius: 50%;
}

.ci-post .saboxplugin-wrap .saboxplugin-authorname a {
	color: var(--ci-ink) !important;
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-weight: 800;
	text-decoration: none;
}

/* ---------- Sidebar ---------- */

.ci-post-side {
	position: sticky;
	top: 110px;
	align-self: start;
}

.ci-post-side > * + * {
	margin-top: 20px;
}

.ci-post-toc--side {
	padding: 20px 20px 14px;
	border: 1px solid var(--ci-line);
	border-radius: 14px;
	background: #ffffff;
}

.ci-post-toc__title,
.ci-post-toc summary {
	margin: 0 0 10px;
	color: var(--ci-ink);
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ci-post-toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ci-toc;
}

.ci-post-toc li {
	counter-increment: ci-toc;
}

.ci-post-toc a {
	display: grid;
	grid-template-columns: 26px 1fr;
	padding: 7px 0;
	border-top: 1px solid #eef1f5;
	color: #3b4555;
	font-size: 14.5px;
	line-height: 1.45;
	text-decoration: none;
}

.ci-post-toc li:first-child a {
	border-top: 0;
}

.ci-post-toc a::before {
	content: counter(ci-toc, decimal-leading-zero);
	color: #9aa4b2;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.9;
}

.ci-post-toc a:hover {
	color: var(--ci-red-dark);
}

.ci-post-side__cta {
	padding: 22px 20px;
	border-radius: 14px;
	background: var(--ci-ink);
	color: #c9d1dd;
	font-size: 15px;
	line-height: 1.55;
}

.ci-post-side__cta p {
	margin: 0 0 16px;
}

.ci-post-side__cta-title {
	margin-bottom: 6px !important;
	color: #ffffff;
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: 19px;
	font-weight: 800;
	line-height: 1.3;
}

.ci-post-side__cta .ci-post-btn {
	width: 100%;
}

.ci-post-toc--mobile {
	display: none;
}

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

.ci-post-related {
	max-width: var(--ci-post-max);
	margin: 0 auto;
	padding: 40px 24px 88px;
}

.ci-post-related > h2 {
	margin: 0 0 28px;
	color: var(--ci-ink);
	font-family: "Mulish", "Segoe UI", Arial, sans-serif;
	font-size: clamp(24px, 2.6vw, 32px);
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
}

.ci-post-related .ci-blog-archive__posts {
	gap: 24px;
}

.ci-post-related .ci-blog-archive__excerpt {
	margin-top: 8px !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.ci-post-layout {
		grid-template-columns: minmax(0, 880px);
		gap: 0;
		padding-top: 40px;
	}

	.ci-post-side {
		display: none;
	}

	.ci-post-toc--mobile {
		display: block;
		margin-bottom: 32px;
		padding: 16px 18px;
		border: 1px solid var(--ci-line);
		border-radius: 12px;
		background: var(--ci-post-soft);
	}

	.ci-post-toc--mobile summary {
		margin: 0;
		cursor: pointer;
	}

	.ci-post-toc--mobile[open] summary {
		margin-bottom: 10px;
	}

	.ci-post-related .ci-blog-archive__posts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.ci-post {
		font-size: 17px;
	}

	.ci-post-hero {
		padding: 28px 16px 0;
	}

	.ci-post-hero__image {
		margin-top: 26px;
		border-radius: 12px;
	}

	.ci-post-layout {
		padding: 32px 16px 16px;
	}

	.ci-post-content > p:first-child {
		font-size: 18px;
	}

	/* Tables become one card per row */
	.ci-post-table {
		overflow: visible;
		border: 0;
		border-radius: 0;
	}

	.ci-post-table table {
		min-width: 0;
	}

	.ci-post-table thead {
		display: none;
	}

	.ci-post-table tbody,
	.ci-post-table tr,
	.ci-post-table td {
		display: block;
	}

	.ci-post-table tr {
		margin-bottom: 12px;
		overflow: hidden;
		border: 1px solid var(--ci-line);
		border-radius: 12px;
	}

	.ci-post-table td,
	.ci-post-table tbody tr:nth-child(even) td {
		padding: 10px 16px;
		border-top: 1px solid #eef1f5;
		background: #ffffff;
		white-space: normal;
	}

	.ci-post-table td:first-child {
		border-top: 0;
		background: var(--ci-post-soft);
	}

	.ci-post-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 2px;
		color: #6b7686;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
	}

	.ci-post-cta--inline {
		flex-direction: column;
		align-items: stretch;
		padding: 22px 20px;
	}

	.ci-post-cta--end {
		padding: 28px 22px;
	}

	.ci-post-cta__actions .ci-post-btn {
		flex: 1 1 100%;
	}

	.ci-post-related {
		padding: 24px 16px 64px;
	}

	.ci-post-related .ci-blog-archive__posts {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ci-post-btn,
	.ci-post-faq,
	.ci-post-faq summary::after {
		transition: none;
	}
}
