/**
 * Single blog post template styles.
 *
 * @package Caterpillar_Care
 */

/* ==========================================================================
   Single Blog Hero
   ========================================================================== */

.single-blog-hero {
	position: relative;
	min-height: 42vh;
	display: flex;
	align-items: center;
	background: linear-gradient(135deg, rgba(232, 245, 233, 0.6) 0%, rgba(255, 248, 230, 0.5) 100%);
}

.single-blog-hero__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.single-blog-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.single-blog-hero__inner {
	width: 100%;
	padding: 3rem 0;
	z-index: 1;
}

.single-blog-hero__shape {
	position: absolute;
	border-radius: 50%;
	opacity: 0.15;
	pointer-events: none;
	z-index: 0;
}

.single-blog-hero__shape--1 {
	width: 12rem;
	height: 12rem;
	background: var(--cc-primary);
	top: 10%;
	left: 5%;
}

.single-blog-hero__shape--2 {
	width: 8rem;
	height: 8rem;
	background: var(--cc-yellow);
	bottom: 20%;
	right: 10%;
}

.single-blog-hero__header {
	position: relative;
	z-index: 1;
}

.single-blog-hero__breadcrumb-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 var(--cc-space-sm);
	padding: 0;
	font-family: var(--cc-font-body);
	font-size: 0.875rem;
}

.single-blog-hero__breadcrumb-list li + li::before {
	content: "›";
	margin-right: 0.5rem;
	opacity: 0.6;
}

.single-blog-hero .single-blog-hero__breadcrumb-list a,
.single-blog-hero .single-blog-hero__breadcrumb-current {
	color: rgba(255, 255, 255, 0.9);
}

.single-blog-hero .single-blog-hero__breadcrumb-list a:hover {
	color: #fff;
}

.single-blog-hero:not(.single-blog-hero--has-img) .single-blog-hero__breadcrumb-list a,
.single-blog-hero:not(.single-blog-hero--has-img) .single-blog-hero__breadcrumb-current {
	color: var(--cc-text);
}

.single-blog-hero:not(.single-blog-hero--has-img) .single-blog-hero__breadcrumb-list a:hover {
	color: var(--cc-primary);
}

.single-blog-hero__category {
	display: inline-block;
	font-family: var(--cc-font-body);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--cc-leaf);
	text-decoration: none;
	margin-bottom: var(--cc-space-xs);
}

.single-blog-hero__category:hover {
	color: var(--cc-yellow);
	text-decoration: underline;
}

.single-blog-hero:not(.single-blog-hero--has-img) .single-blog-hero__category {
	color: var(--cc-primary);
}

.single-blog-hero:not(.single-blog-hero--has-img) .single-blog-hero__category:hover {
	color: var(--cc-primary-dark);
}

.single-blog-hero__title {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: clamp(1.5rem, 4vw, 2.5rem);
	line-height: 1.3;
	color: #fff;
	margin: 0 0 var(--cc-space-sm);
}

.single-blog-hero:not(.single-blog-hero--has-img) .single-blog-hero__title {
	color: var(--cc-text);
}

.single-blog-hero__meta {
	font-family: var(--cc-font-body);
	font-size: 0.9375rem;
	color: rgba(255, 255, 255, 0.9);
}

.single-blog-hero:not(.single-blog-hero--has-img) .single-blog-hero__meta {
	color: var(--cc-text-muted);
}

.single-blog-hero__sep {
	opacity: 0.8;
}

.single-blog-hero__reading-time {
	white-space: nowrap;
}

/* ==========================================================================
   Single Blog Article
   ========================================================================== */

.single-blog-article__thumbnail {
	margin: 0 0 var(--cc-space-sm);
	border-radius: var(--cc-radius-xl);
	overflow: hidden;
	box-shadow: var(--cc-shadow-soft);
}

.single-blog-article__img {
	width: 100%;
	height: auto;
	display: block;
}

.single-blog-article__content,
.blog-content {
	font-family: var(--cc-font-body);
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--cc-text);
}

/* ==========================================================================
   Blog content container – typography & elements
   ========================================================================== */

.blog-content p {
	margin-bottom: 1.25rem;
}

.blog-content p:last-child {
	margin-bottom: 0;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	margin-top: 2rem;
	margin-bottom: 0.75rem;
	color: var(--cc-text);
	line-height: 1.3;
}

.blog-content h1 { font-size: 1.75rem; }
.blog-content h2 { font-size: 1.5rem; }
.blog-content h3 { font-size: 1.25rem; }
.blog-content h4 { font-size: 1.125rem; }

.blog-content h1:first-child,
.blog-content h2:first-child,
.blog-content h3:first-child,
.blog-content h4:first-child {
	margin-top: 0;
}

.blog-content img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: var(--cc-radius-lg);
	box-shadow: var(--cc-shadow-soft);
	margin-top: 1.5rem;
	margin-bottom: 1.5rem;
}

.blog-content img.alignleft {
	float: left;
	margin-right: 1.5rem;
	margin-top: 0.25rem;
	margin-bottom: 1rem;
}

.blog-content img.alignright {
	float: right;
	margin-left: 1.5rem;
	margin-top: 0.25rem;
	margin-bottom: 1rem;
}

.blog-content img.aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.blog-content blockquote {
	margin: 1.5rem 0;
	padding: 1.25rem 1.5rem 1.25rem 1.5rem;
	background: rgba(232, 245, 233, 0.4);
	border-left: 4px solid var(--cc-primary);
	border-radius: 0 var(--cc-radius-sm) var(--cc-radius-sm) 0;
	font-style: italic;
	color: var(--cc-text);
}

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

.blog-content ul,
.blog-content ol {
	margin: 1rem 0 1.25rem;
	padding-left: 0;
	list-style: none;
}

.blog-content ul li {
	position: relative;
	padding-left: 1.75rem;
	margin-bottom: 0.5rem;
}

.blog-content ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 0.5rem;
	height: 0.5rem;
	background: var(--cc-primary);
	border-radius: 50%;
}

.blog-content ol {
	counter-reset: blog-ol;
}

.blog-content ol li {
	position: relative;
	padding-left: 2.25rem;
	margin-bottom: 0.5rem;
	counter-increment: blog-ol;
}

.blog-content ol li::before {
	content: counter(blog-ol) ".";
	position: absolute;
	left: 0;
	font-family: var(--cc-font-heading);
	font-weight: 700;
	color: var(--cc-primary);
}

.blog-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5rem 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: var(--cc-radius-sm);
	overflow: hidden;
}

.blog-content thead {
	background: rgba(63, 125, 10, 0.12);
}

.blog-content th,
.blog-content td {
	padding: 0.75rem 1rem;
	text-align: left;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.blog-content th {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	color: var(--cc-text);
}

.blog-content tbody tr:nth-child(even) {
	background: rgba(232, 245, 233, 0.25);
}

.blog-content tbody tr:nth-child(odd) {
	background: #fff;
}

.blog-content a {
	color: var(--cc-primary);
	text-decoration: none;
}

.blog-content a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Blog share
   ========================================================================== */

.blog-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.blog-share__label {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: 1rem;
	color: var(--cc-text);
	margin: 0;
}

.blog-share__links {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.blog-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var(--cc-radius-full);
	background: rgba(63, 125, 10, 0.1);
	color: var(--cc-primary);
	text-decoration: none;
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
	border: 0;
	cursor: pointer;
}

.blog-share__link:hover {
	background: var(--cc-primary);
	color: #fff;
	transform: translateY(-3px) scale(1.05);
	box-shadow: var(--cc-shadow-soft);
}

.blog-share__link:focus-visible {
	outline: 2px solid var(--cc-primary);
	outline-offset: 2px;
}

.blog-share__link--facebook:hover { background: #1877f2; color: #fff; }
.blog-share__link--twitter:hover { background: #000; color: #fff; }
.blog-share__link--linkedin:hover { background: #0a66c2; color: #fff; }
.blog-share__link--whatsapp:hover { background: #25d366; color: #fff; }
.blog-share__link--copy:hover { background: var(--cc-primary); color: #fff; }

.blog-share__copied {
	font-family: var(--cc-font-body);
	font-size: 0.875rem;
	color: var(--cc-primary);
	margin-left: 0.25rem;
}

/* ==========================================================================
   Blog author box
   ========================================================================== */

.blog-author-box {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	margin-top: 2rem;
	padding: 1.75rem;
	background: rgba(232, 245, 233, 0.5);
	border-radius: var(--cc-radius-xl);
	box-shadow: var(--cc-shadow-soft);
}

.blog-author-box__avatar {
	flex-shrink: 0;
}

.blog-author-box__img {
	width: 96px;
	height: 96px;
	border-radius: var(--cc-radius-full);
	display: block;
	object-fit: cover;
}

.blog-author-box__body {
	flex: 1;
	min-width: 0;
}

.blog-author-box__name {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: 1.25rem;
	margin: 0 0 0.5rem;
	color: var(--cc-text);
}

.blog-author-box__bio {
	font-family: var(--cc-font-body);
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--cc-text-muted);
	margin: 0;
}

/* ==========================================================================
   Post Navigation (prev/next)
   ========================================================================== */

.single-blog-nav-wrap {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.single-blog-nav-wrap .post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.single-blog-nav-wrap .nav-previous,
.single-blog-nav-wrap .nav-next {
	display: block;
}

.single-blog-nav-wrap .nav-next {
	text-align: right;
}

.single-blog-nav-wrap a {
	font-family: var(--cc-font-body);
	font-size: 0.9375rem;
	color: var(--cc-primary);
	text-decoration: none;
}

.single-blog-nav-wrap a:hover {
	text-decoration: underline;
}

.single-blog-nav__label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--cc-text-muted);
	margin-bottom: 0.25rem;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.single-blog-comments {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.blog-comments__title {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: 1.25rem;
	margin: 0 0 1.5rem;
	color: var(--cc-text);
}

.blog-comments__list {
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
}

.blog-comment {
	margin-bottom: 1.25rem;
}

.blog-comment__body {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	padding: 1.25rem;
	background: rgba(232, 245, 233, 0.35);
	border-radius: var(--cc-radius-lg);
	box-shadow: var(--cc-shadow-soft);
}

.blog-comment__header {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	flex: 1 1 100%;
}

.blog-comment__avatar {
	flex-shrink: 0;
}

.blog-comment__img {
	width: 56px;
	height: 56px;
	border-radius: var(--cc-radius-full);
	display: block;
	object-fit: cover;
}

.blog-comment__meta-wrap {
	flex: 1;
	min-width: 0;
}

.blog-comment__author {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: 1rem;
	font-style: normal;
	display: block;
	margin-bottom: 0.25rem;
}

.blog-comment__author a {
	color: var(--cc-text);
	text-decoration: none;
}

.blog-comment__author a:hover {
	color: var(--cc-primary);
}

.blog-comment__meta {
	font-family: var(--cc-font-body);
	font-size: 0.8125rem;
	color: var(--cc-text-muted);
}

.blog-comment__meta a {
	color: var(--cc-primary);
	text-decoration: none;
}

.blog-comment__meta a:hover {
	text-decoration: underline;
}

.blog-comment__content {
	font-family: var(--cc-font-body);
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--cc-text);
	width: 100%;
	margin: 0.5rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.blog-comment__content p {
	margin: 0 0 0.5rem;
}

.blog-comment__content p:last-child {
	margin-bottom: 0;
}

.blog-comment__reply {
	margin-top: 0.75rem;
	width: 100%;
}

.blog-comment__reply-link {
	display: inline-block;
	font-family: var(--cc-font-heading);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--cc-primary);
	text-decoration: none;
	padding: 0.35rem 0.75rem;
	border-radius: var(--cc-radius-full);
	background: rgba(63, 125, 10, 0.12);
	transition: background 0.2s ease, color 0.2s ease;
}

.blog-comment__reply-link:hover {
	background: var(--cc-primary);
	color: #fff;
}

.blog-comments__list .children {
	list-style: none;
	margin: 1rem 0 0 0;
	padding-left: 1.5rem;
	border-left: 3px solid rgba(63, 125, 10, 0.3);
}

.blog-comments__list .children .blog-comment__body {
	padding: 1rem;
}

/* Comment form */
.blog-comment-form {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.blog-comment-form__title {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: 1.25rem;
	margin: 0 0 1rem;
	color: var(--cc-text);
}

.blog-comment-form p {
	margin-bottom: 1rem;
}

.blog-comment-form label {
	display: block;
	font-family: var(--cc-font-body);
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--cc-text);
	margin-bottom: 0.35rem;
}

.blog-comment-form__input {
	width: 100%;
	max-width: 100%;
	padding: 0.75rem 1rem;
	font-family: var(--cc-font-body);
	font-size: 1rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: var(--cc-radius);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-comment-form__input:focus {
	border-color: var(--cc-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(63, 125, 10, 0.15);
}

.blog-comment-form__textarea {
	width: 100%;
	min-height: 160px;
	padding: 1rem;
	font-family: var(--cc-font-body);
	font-size: 1rem;
	line-height: 1.6;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: var(--cc-radius);
	resize: vertical;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-comment-form__textarea:focus {
	border-color: var(--cc-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(63, 125, 10, 0.15);
}

.blog-comment-form__submit {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	font-family: var(--cc-font-heading);
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
	background: var(--cc-primary);
	border: none;
	border-radius: var(--cc-radius-full);
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.blog-comment-form__submit:hover {
	background: var(--cc-primary-dark);
	transform: translateY(-1px);
}

.blog-comment-form .form-submit {
	margin: 1rem 0 0;
}

/* ==========================================================================
   Related posts
   ========================================================================== */

.related-posts {
	background: linear-gradient(180deg, rgba(232, 245, 233, 0.3) 0%, transparent 100%);
}

.related-posts__title {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: 1.5rem;
	text-align: center;
	margin: 0 0 1.5rem;
	color: var(--cc-text);
}

.related-posts__card {
	background: #fff;
	border-radius: var(--cc-radius-xl);
	overflow: hidden;
	box-shadow: var(--cc-shadow-soft);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.related-posts__card:hover {
	transform: translateY(-4px);
	box-shadow: var(--cc-shadow-soft-lg);
}

.related-posts__image-link {
	display: block;
	overflow: hidden;
}

.related-posts__image {
	width: 100%;
	height: auto;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.related-posts__card:hover .related-posts__image {
	transform: scale(1.03);
}

.related-posts__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 400 / 280;
	background: rgba(232, 245, 233, 0.5);
}

.related-posts__placeholder-text {
	font-family: var(--cc-font-body);
	font-size: 0.875rem;
	color: var(--cc-text);
	opacity: 0.7;
}

.related-posts__body {
	padding: 1.25rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.related-posts__card-title {
	font-family: var(--cc-font-heading);
	font-weight: 700;
	font-size: 1.0625rem;
	line-height: 1.35;
	margin: 0 0 0.5rem;
}

.related-posts__card-title a {
	color: var(--cc-text);
	text-decoration: none;
}

.related-posts__card-title a:hover {
	color: var(--cc-primary);
}

.related-posts__excerpt {
	font-family: var(--cc-font-body);
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--cc-text-muted);
	margin: 0 0 1rem;
	flex: 1;
}

.related-posts__btn {
	align-self: flex-start;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767.98px) {
	.blog-author-box {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.single-blog-nav {
		grid-template-columns: 1fr;
	}

	.single-blog-nav-wrap .post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.single-blog-nav-wrap .nav-next {
		text-align: left;
	}
}
