/* ==========================================================================
   Custom Sidebar Pro — Frontend Styles
   Design language: clean editorial, inspired by major news sites.
   ========================================================================== */

.csp-sidebar {
	--csp-accent: #c0392b;
	--csp-width: 320px;
	width: var(--csp-width);
	max-width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a1a;
	box-sizing: border-box;
}

.csp-sidebar * {
	box-sizing: border-box;
}

/* Sticky behavior on desktop */
@media (min-width: 1025px) {
	.csp-sidebar.csp-sticky {
		position: sticky;
		top: 24px;
		align-self: flex-start;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
	}
}

/* ---- Section base ---- */
.csp-section {
	margin-bottom: 28px;
}

.csp-section-title {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 3px solid var(--csp-accent);
	color: #111;
}

/* ---- Style Presets ---- */

/* Minimal: no borders, generous whitespace */
.csp-style-minimal .csp-section {
	padding: 0;
}

/* Bordered / Classic: dividers between sections */
.csp-style-bordered .csp-section {
	padding-bottom: 20px;
	border-bottom: 1px solid #e2e2e2;
}
.csp-style-bordered .csp-section-title {
	border-bottom: none;
	padding-bottom: 0;
}

/* Card: each section in its own card */
.csp-style-card .csp-section {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 8px;
	padding: 18px 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ---- Recent posts / categories lists ---- */
.csp-recent-posts,
.csp-categories {
	list-style: none;
	margin: 0;
	padding: 0;
}
.csp-recent-posts li,
.csp-categories li {
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
	line-height: 1.4;
}
.csp-recent-posts li:last-child,
.csp-categories li:last-child {
	border-bottom: none;
	padding-bottom: 0;
}
.csp-recent-posts a,
.csp-categories a {
	color: #1a1a1a;
	text-decoration: none;
}
.csp-recent-posts a:hover,
.csp-categories a:hover {
	color: var(--csp-accent);
}

/* ---- Tags ---- */
.csp-tags a {
	display: inline-block;
	margin: 0 6px 8px 0;
	padding: 4px 10px;
	background: #f4f4f4;
	border-radius: 20px;
	font-size: 12px !important;
	color: #333;
	text-decoration: none;
}
.csp-tags a:hover {
	background: var(--csp-accent);
	color: #fff;
}

/* ---- Social icons ---- */
.csp-social-icons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.csp-social-icons a {
	padding: 8px 14px;
	background: #f4f4f4;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	text-decoration: none;
}
.csp-social-icons a:hover {
	background: var(--csp-accent);
	color: #fff;
}

/* ---- Newsletter ---- */
.csp-newsletter-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.csp-newsletter-form input[type="email"] {
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
}
.csp-newsletter-form button {
	padding: 10px 12px;
	background: var(--csp-accent);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
}

/* ---- Search ---- */
.csp-section-search .search-form,
.csp-section-search input[type="search"] {
	width: 100%;
}

/* ==========================================================================
   Off-canvas drawer (mobile-first)
   ========================================================================== */

.csp-offcanvas-trigger {
	display: none;
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 9999;
	width: 44px;
	height: 44px;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	cursor: pointer;
}
.csp-offcanvas-trigger span {
	display: block;
	width: 20px;
	height: 2px;
	background: #1a1a1a;
}

.csp-offcanvas-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	z-index: 10000;
}

.csp-offcanvas-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100vh;
	width: min(85vw, var(--csp-width));
	background: #fff;
	z-index: 10001;
	padding: 24px 20px;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.3s ease;
}
.csp-pos-left ~ .csp-offcanvas-drawer,
body.csp-pos-left .csp-offcanvas-drawer {
	right: auto;
	left: 0;
	transform: translateX(-100%);
}

.csp-offcanvas-drawer.csp-open {
	transform: translateX(0);
}
.csp-offcanvas-overlay.csp-open,
.csp-offcanvas-trigger.csp-visible {
	display: flex;
}
.csp-offcanvas-overlay.csp-open {
	display: block;
}

.csp-offcanvas-close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	margin-bottom: 12px;
}

body.csp-offcanvas-locked {
	overflow: hidden;
}

/* Show hamburger trigger only where off-canvas is active */
@media (max-width: 1024px) {
	.csp-offcanvas-trigger.csp-visible {
		display: flex;
	}
}

/* Hide the static sticky sidebar on mobile when off-canvas handles it */
@media (max-width: 1024px) {
	.csp-sidebar.csp-hide-on-mobile {
		display: none;
	}
}

/* Tablet: sidebar drops below content, full width, no sticky */
@media (min-width: 768px) and (max-width: 1024px) {
	.csp-sidebar.csp-tablet-stack {
		width: 100%;
		position: static;
		max-height: none;
	}
}

/* Small phones: tighten padding */
@media (max-width: 480px) {
	.csp-style-card .csp-section {
		padding: 14px 16px;
	}
	.csp-section-title {
		font-size: 13px;
	}
}
