/**
 * PSH Child - blog.css
 *
 * Styles for single.php, archive.php, and sidebar.php.
 * Enqueued conditionally (single posts + blog archives only) by
 * psh_child_enqueue_blog_styles() in functions.php.
 *
 * Colors are pulled from CSS variables so they can be aligned with
 * PSH Settings → Page Headers at any point. Defaults match the
 * existing page-hero gradient (#0d2a40 -> #083020) and comment
 * button blue already in use elsewhere on the site.
 */

:root {
	--psh-blog-accent: #2f7dc7;
	--psh-blog-accent-dark: #235f99;
	--psh-blog-ink: #1c2b30;
	--psh-blog-muted: #6b7a80;
	--psh-blog-border: #e6ebee;
	--psh-blog-card-bg: #ffffff;
	--psh-blog-sidebar-bg: #eef5fb;
	--psh-blog-radius: 12px;
}

/* ── Archive/blog-index hero title ───────────────────────────────
   Category/tag/date names can be short, but this keeps the hero
   title visually in line with the rest of the blog UI instead of
   the full-size heading used on page/team/service headers.
   Scoped via .psh-ph-title--archive (added only on archive/blog-
   index requests in psh_child_page_header_html()) so this file
   never affects headers on Elementor-controlled pages.        */

.psh-ph-title.psh-ph-title--archive {
	font-size: clamp(1.25rem, 2.4vw, 1.5rem);
	line-height: 1.3;
}

/* ── Container / two-column layout ───────────────────────────── */

.psh-container.psh-blog-layout {
	max-width: 1180px;
	margin: 0 auto;
	padding: 40px 24px 64px;
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.psh-blog-main {
	min-width: 0; /* prevents grid blowout from wide images/embeds */
}

@media (max-width: 860px) {
	.psh-container.psh-blog-layout {
		grid-template-columns: 1fr;
		gap: 36px;
	}
}

/* ── Single post ──────────────────────────────────────────────── */

.psh-single-post__categories {
	margin-bottom: 12px;
}

.psh-single-post__categories a {
	display: inline-block;
	background: var(--psh-blog-sidebar-bg);
	color: var(--psh-blog-accent-dark);
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 5px 12px;
	border-radius: 999px;
	text-decoration: none;
	margin: 0 6px 6px 0;
}

.psh-single-post__categories a:hover {
	background: var(--psh-blog-accent);
	color: #fff;
}

.psh-single-post__meta,
.psh-blog-card__meta {
	color: var(--psh-blog-muted);
	font-size: 0.9rem;
	margin-bottom: 24px;
}

.psh-single-post__sep,
.psh-blog-card__sep {
	margin: 0 6px;
	opacity: 0.6;
}

.psh-single-post__meta a,
.psh-blog-card__meta a {
	color: var(--psh-blog-muted);
	text-decoration: underline;
}

.psh-single-post__thumbnail {
	margin: 0 0 32px;
	border-radius: var(--psh-blog-radius);
	overflow: hidden;
}

.psh-single-post__thumbnail img {
	display: block;
	width: 100%;
	height: auto;
}

.psh-single-post__content {
	font-size: 1.05rem;
	line-height: 1.75;
	color: var(--psh-blog-ink);
}

.psh-single-post__content > * + * {
	margin-top: 1.25em;
}

.psh-single-post__content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.psh-single-post__tags {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--psh-blog-border);
}

.psh-tags__label {
	font-weight: 600;
	margin-right: 6px;
}

.psh-single-post__tags a {
	display: inline-block;
	font-size: 0.82rem;
	color: var(--psh-blog-muted);
	background: #f4f6f7;
	padding: 4px 10px;
	border-radius: 6px;
	margin: 0 6px 6px 0;
	text-decoration: none;
}

.psh-single-post__tags a:hover {
	background: var(--psh-blog-border);
}

/* ── Author box ───────────────────────────────────────────────── */

.psh-author-box {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	background: #f8fafb;
	border: 1px solid var(--psh-blog-border);
	border-radius: var(--psh-blog-radius);
	padding: 20px;
	margin-top: 32px;
}

.psh-author-box__avatar img {
	border-radius: 50%;
	display: block;
}

.psh-author-box__name {
	margin: 0 0 6px;
	font-size: 1rem;
}

.psh-author-box__bio {
	margin: 0;
	color: var(--psh-blog-muted);
	font-size: 0.92rem;
	line-height: 1.6;
}

/* ── Post navigation (prev/next) ──────────────────────────────── */

.psh-post-navigation {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 36px 0;
}

.psh-post-navigation__next {
	text-align: right;
}

.psh-post-navigation a {
	display: block;
	padding: 14px 18px;
	background: var(--psh-blog-card-bg);
	border: 1px solid var(--psh-blog-border);
	border-radius: 8px;
	color: var(--psh-blog-ink);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.92rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.psh-post-navigation a:hover {
	border-color: var(--psh-blog-accent);
	background: var(--psh-blog-sidebar-bg);
}

@media (max-width: 600px) {
	.psh-post-navigation {
		grid-template-columns: 1fr;
	}
	.psh-post-navigation__next {
		text-align: left;
	}
}

/* ── Related posts ────────────────────────────────────────────── */

.psh-related-posts {
	margin: 40px 0;
	padding-top: 32px;
	border-top: 1px solid var(--psh-blog-border);
}

.psh-related-posts__title {
	font-size: 1.2rem;
	margin: 0 0 18px;
}

.psh-related-posts__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 18px;
}

.psh-related-posts__item {
	display: block;
	text-decoration: none;
	color: var(--psh-blog-ink);
}

.psh-related-posts__thumb {
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 10px;
	aspect-ratio: 16 / 10;
}

.psh-related-posts__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.2s ease;
}

.psh-related-posts__item:hover .psh-related-posts__thumb img {
	transform: scale(1.05);
}

.psh-related-posts__item-title {
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.4;
}

/* ── Comments ─────────────────────────────────────────────────── */

.comment-respond textarea,
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"] {
	width: 100%;
	border: 1px solid var(--psh-blog-border);
	border-radius: 8px;
	padding: 12px 14px;
	font-size: 0.95rem;
}

.comment-respond .form-submit input,
.comment-respond input[type="submit"] {
	background: var(--psh-blog-accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 28px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.comment-respond .form-submit input:hover,
.comment-respond input[type="submit"]:hover {
	background: var(--psh-blog-accent-dark);
}

/* ── Archive: header + card grid ──────────────────────────────── */

.psh-archive-header {
	margin-bottom: 28px;
}

.psh-archive-header__description {
	color: var(--psh-blog-muted);
	font-size: 1rem;
}

.psh-blog-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 28px;
}

.psh-blog-card {
	background: var(--psh-blog-card-bg);
	border: 1px solid var(--psh-blog-border);
	border-radius: var(--psh-blog-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.psh-blog-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(13, 42, 64, 0.1);
}

.psh-blog-card__thumbnail {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.psh-blog-card__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.psh-blog-card__body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.psh-blog-card__categories {
	margin-bottom: 8px;
}

.psh-blog-card__categories a {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--psh-blog-accent-dark);
	text-decoration: none;
}

.psh-blog-card__title {
	font-size: 1.15rem;
	line-height: 1.35;
	margin: 0 0 10px;
}

.psh-blog-card__title a {
	color: var(--psh-blog-ink);
	text-decoration: none;
}

.psh-blog-card__title a:hover {
	color: var(--psh-blog-accent);
}

.psh-blog-card__excerpt {
	color: var(--psh-blog-muted);
	font-size: 0.92rem;
	line-height: 1.6;
	margin-bottom: 14px;
}

.psh-blog-card__readmore {
	margin-top: auto;
	color: var(--psh-blog-accent);
	font-weight: 600;
	font-size: 0.88rem;
	text-decoration: none;
}

.psh-blog-card__readmore:hover {
	color: var(--psh-blog-accent-dark);
}

.psh-blog-empty {
	color: var(--psh-blog-muted);
	font-size: 1rem;
}

/* ── Pagination ───────────────────────────────────────────────── */

.pagination,
.navigation.pagination {
	margin-top: 36px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid var(--psh-blog-border);
	color: var(--psh-blog-ink);
	text-decoration: none;
	font-size: 0.9rem;
}

.pagination .page-numbers.current {
	background: var(--psh-blog-accent);
	border-color: var(--psh-blog-accent);
	color: #fff;
}

.pagination .page-numbers:hover:not(.current) {
	border-color: var(--psh-blog-accent);
}

/* ── Sidebar widgets ──────────────────────────────────────────── */

.psh-blog-sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.psh-blog-sidebar .widget {
	background: var(--psh-blog-sidebar-bg);
	border-radius: var(--psh-blog-radius);
	padding: 22px 24px;
}

.psh-blog-sidebar .widget-title {
	font-size: 1rem;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid rgba(47, 125, 199, 0.25);
	color: var(--psh-blog-ink);
}

.psh-blog-sidebar .widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.psh-blog-sidebar .widget li {
	padding: 10px 0;
	border-bottom: 1px solid rgba(13, 42, 64, 0.08);
	font-size: 0.92rem;
}

.psh-blog-sidebar .widget li:last-child {
	border-bottom: none;
}

.psh-blog-sidebar .widget a {
	color: var(--psh-blog-ink);
	text-decoration: none;
}

.psh-blog-sidebar .widget a:hover {
	color: var(--psh-blog-accent);
}

/* Override the parent/KiviCare theme's default widget-link truncation
   (-webkit-line-clamp: 2 + ellipsis) - it was cutting Recent Posts
   titles off mid-word ("...Small Daily Habits For…"). Full title,
   wraps to as many lines as it needs. */
.psh-blog-sidebar .widget a,
.psh-blog-sidebar .widget li a,
.psh-blog-sidebar .widget_recent_entries li a {
	display: block;
	overflow: visible !important;
	white-space: normal !important;
	text-overflow: unset !important;
	-webkit-line-clamp: unset !important;
	-webkit-box-orient: unset !important;
	max-height: none !important;
}

.psh-blog-sidebar .widget_search .search-form {
	display: flex;
	gap: 8px;
}

.psh-blog-sidebar .widget_search input[type="search"] {
	flex: 1;
	border: 1px solid var(--psh-blog-border);
	border-radius: 8px;
	padding: 10px 12px;
}

.psh-blog-sidebar .widget_search input[type="submit"] {
	background: var(--psh-blog-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0 16px;
	font-weight: 600;
	cursor: pointer;
}

/* Recent-posts / archives widgets that show post thumbnails as list items */
.psh-blog-sidebar .widget img {
	border-radius: 6px;
}
