/**
 * Blog sidebar – archive & single post
 */

.post-sidebar,
.post-sidebar #secondary.widget-area {
	width: 100%;
}

.post-sidebar .widget {
	background: var(--cuuho-white);
	border: 1px solid var(--cuuho-border);
	border-radius: var(--cuuho-radius);
	padding: 22px 22px 20px;
	margin-bottom: 24px;
	box-shadow: var(--cuuho-shadow);
}

.post-sidebar .widget:last-child {
	margin-bottom: 0;
}

.post-sidebar .widget-title,
.post-sidebar .widget > h2,
.post-sidebar .widget > h3,
.post-sidebar .widget .widgettitle {
	font-size: 0.78rem !important;
	font-weight: 800 !important;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--cuuho-navy) !important;
	margin: 0 0 16px !important;
	padding: 0 0 12px !important;
	border-bottom: 2px solid var(--cuuho-amber);
	line-height: 1.4;
}

.post-sidebar .widget-title span,
.post-sidebar .widget > h2 span {
	font-weight: 800;
}

/* ── Search (icon button + input rộng) ── */
.cuuho-searchform--inline {
	display: flex !important;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}

.cuuho-searchform--inline .cuuho-searchform__input,
.post-sidebar .widget_search .search-field,
.post-sidebar .widget_search input[type="search"] {
	flex: 1 1 auto !important;
	width: 100% !important;
	min-width: 0 !important;
	border: 1px solid var(--cuuho-border) !important;
	border-radius: var(--cuuho-radius-sm) !important;
	padding: 11px 14px !important;
	font-size: 0.9rem !important;
	color: var(--cuuho-text) !important;
	background: var(--cuuho-surface) !important;
	min-height: 44px;
	margin: 0 !important;
	box-shadow: none !important;
}

.cuuho-searchform--inline .cuuho-searchform__input:focus,
.post-sidebar .widget_search .search-field:focus,
.post-sidebar .widget_search input[type="search"]:focus {
	border-color: var(--cuuho-amber) !important;
	outline: none;
	background: var(--cuuho-white) !important;
}

.cuuho-searchform__btn,
.post-sidebar .widget_search .cuuho-searchform__btn,
.post-sidebar .widget_search .ux-search-submit,
.post-sidebar .widget_search button[type="submit"],
.post-sidebar .widget_search input[type="submit"] {
	flex: 0 0 44px !important;
	width: 44px !important;
	min-width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: var(--cuuho-radius-sm) !important;
	background: var(--cuuho-amber) !important;
	border: 1px solid var(--cuuho-amber) !important;
	color: var(--cuuho-navy) !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 18px !important;
	line-height: 1 !important;
	overflow: visible;
}

.post-sidebar .widget_search input[type="submit"] {
	font-size: 0 !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230B2D4A' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}

.cuuho-searchform__btn:hover,
.post-sidebar .widget_search .cuuho-searchform__btn:hover,
.post-sidebar .widget_search .ux-search-submit:hover,
.post-sidebar .widget_search button[type="submit"]:hover,
.post-sidebar .widget_search input[type="submit"]:hover {
	background-color: var(--cuuho-amber-hover) !important;
	border-color: var(--cuuho-amber-hover) !important;
}

.cuuho-searchform__btn svg,
.cuuho-searchform__btn .icon-search,
.post-sidebar .widget_search .cuuho-searchform__btn svg,
.post-sidebar .widget_search .ux-search-submit svg,
.post-sidebar .widget_search .ux-search-submit i,
.post-sidebar .widget_search button[type="submit"] svg,
.post-sidebar .widget_search button[type="submit"] i {
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	font-size: 18px !important;
	line-height: 1 !important;
	color: var(--cuuho-navy) !important;
	flex-shrink: 0;
	pointer-events: none;
}

.cuuho-searchform__btn svg,
.post-sidebar .widget_search button[type="submit"] svg {
	stroke: var(--cuuho-navy);
}

/* Form WP mặc định (search-form) – ép layout inline */
.post-sidebar .widget_search .search-form,
.post-sidebar .widget_search form.search-form {
	display: flex !important;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}

.post-sidebar .widget_search .search-form label {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.post-sidebar .widget_search .search-form .search-submit {
	flex: 0 0 44px;
}

/* ── Categories & generic lists ── */
.post-sidebar .widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.post-sidebar .widget_categories li,
.post-sidebar .widget_archive li,
.post-sidebar .widget_pages li,
.post-sidebar .widget_meta li,
.post-sidebar .widget_nav_menu li {
	margin: 0;
	border-bottom: 1px solid var(--cuuho-border);
}

.post-sidebar .widget_categories li:last-child,
.post-sidebar .widget_archive li:last-child,
.post-sidebar .widget_pages li:last-child,
.post-sidebar .widget_meta li:last-child,
.post-sidebar .widget_nav_menu li:last-child {
	border-bottom: 0;
}

.post-sidebar .widget_categories a,
.post-sidebar .widget_archive a,
.post-sidebar .widget_pages a,
.post-sidebar .widget_meta a,
.post-sidebar .widget_nav_menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 0;
	color: var(--cuuho-navy) !important;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none !important;
	transition: color 0.2s ease, padding-left 0.2s ease;
}

.post-sidebar .widget_categories a:hover,
.post-sidebar .widget_archive a:hover,
.post-sidebar .widget_pages a:hover,
.post-sidebar .widget_meta a:hover,
.post-sidebar .widget_nav_menu a:hover {
	color: var(--cuuho-amber-hover) !important;
	padding-left: 4px;
}

.post-sidebar .widget_categories .count,
.post-sidebar .widget_archive .count {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--cuuho-muted);
	background: var(--cuuho-surface);
	padding: 2px 8px;
	border-radius: 999px;
}

/* ── Recent posts (Flatsome widget) ── */
.post-sidebar .widget.flatsome_recent_posts ul {
	counter-reset: cuuho-sidebar-post;
}

.post-sidebar .widget.flatsome_recent_posts .recent-blog-posts-li {
	counter-increment: cuuho-sidebar-post;
	border-bottom: 1px solid var(--cuuho-border);
	padding: 14px 0 14px 40px;
	position: relative;
}

.post-sidebar .widget.flatsome_recent_posts .recent-blog-posts-li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.post-sidebar .widget.flatsome_recent_posts .recent-blog-posts-li:first-child {
	padding-top: 0;
}

.post-sidebar .widget.flatsome_recent_posts .recent-blog-posts-li::before {
	content: counter(cuuho-sidebar-post);
	position: absolute;
	left: 0;
	top: 14px;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--cuuho-amber-soft);
	color: var(--cuuho-navy);
	font-size: 0.78rem;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.post-sidebar .widget.flatsome_recent_posts .recent-blog-posts-li:first-child::before {
	top: 0;
}

.post-sidebar .widget.flatsome_recent_posts .flex-col.mr-half,
.post-sidebar .widget.flatsome_recent_posts .badge,
.post-sidebar .widget.flatsome_recent_posts .post_comments {
	display: none !important;
}

.post-sidebar .widget.flatsome_recent_posts .flex-row {
	display: block;
}

.post-sidebar .widget.flatsome_recent_posts .flex-col.flex-grow {
	width: 100%;
}

.post-sidebar .widget.flatsome_recent_posts a {
	color: var(--cuuho-navy) !important;
	font-weight: 600;
	font-size: 0.88rem;
	line-height: 1.5;
	text-decoration: none !important;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s ease;
}

.post-sidebar .widget.flatsome_recent_posts a:hover {
	color: var(--cuuho-amber-hover) !important;
}

/* WordPress default recent posts */
.post-sidebar .widget_recent_entries li {
	border-bottom: 1px solid var(--cuuho-border);
	padding: 12px 0;
}

.post-sidebar .widget_recent_entries li:last-child {
	border-bottom: 0;
}

.post-sidebar .widget_recent_entries a {
	color: var(--cuuho-navy) !important;
	font-weight: 600;
	font-size: 0.88rem;
	line-height: 1.5;
	text-decoration: none !important;
}

.post-sidebar .widget_recent_entries a:hover {
	color: var(--cuuho-amber-hover) !important;
}

.post-sidebar .widget_recent_entries .post-date {
	display: block;
	margin-top: 4px;
	font-size: 0.78rem;
	color: var(--cuuho-muted);
}

/* ── Recent comments ── */
.post-sidebar .widget_recent_comments li {
	border-bottom: 1px solid var(--cuuho-border);
	padding: 12px 0;
	font-size: 0.86rem;
	line-height: 1.55;
	color: var(--cuuho-muted);
}

.post-sidebar .widget_recent_comments li:last-child {
	border-bottom: 0;
}

.post-sidebar .widget_recent_comments .recentcomments,
.post-sidebar .widget_recent_comments li > a {
	color: var(--cuuho-navy) !important;
	font-weight: 600;
	text-decoration: none !important;
}

.post-sidebar .widget_recent_comments li > a:hover {
	color: var(--cuuho-amber-hover) !important;
}

.post-sidebar .widget_recent_comments .comment-author-link {
	font-weight: 700;
	color: var(--cuuho-navy);
}

/* ── Tag cloud ── */
.post-sidebar .widget_tag_cloud .tagcloud a {
	display: inline-block;
	margin: 0 6px 8px 0;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--cuuho-surface);
	border: 1px solid var(--cuuho-border);
	color: var(--cuuho-navy) !important;
	font-size: 0.78rem !important;
	font-weight: 600;
	text-decoration: none !important;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.post-sidebar .widget_tag_cloud .tagcloud a:hover {
	background: var(--cuuho-amber-soft);
	border-color: rgba(245, 166, 35, 0.4);
	color: var(--cuuho-amber-hover) !important;
}

@media (max-width: 849px) {
	.post-sidebar {
		margin-top: 36px;
	}

	.post-sidebar .widget {
		margin-bottom: 20px;
	}
}
