/**
 * Cloudsoft UI layer
 * ---------------------------------------------------------------------------
 * Additive design layer loaded AFTER the theme's compiled min.css. Nothing here
 * edits the base stylesheet, so the whole visual refresh can be reverted by
 * dequeuing this one file.
 *
 * Contents
 *   1. Design tokens
 *   2. Base & accessibility
 *   3. Header (top bar, middle, nav, sticky glass)
 *   4. Search
 *   5. Module & widget titles
 *   6. Post cards & thumbnails
 *   7. Category pills
 *   8. Buttons & pagination
 *   9. Sidebar widgets
 *  10. Footer
 *  11. Motion & print
 */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
	/* Brand — taken from the existing theme options so the refresh stays on-brand. */
	--cs-crimson: #cf2156;
	--cs-crimson-600: #b71b49;
	--cs-crimson-300: #ef4d7c;
	--cs-navy: #1b2e8d;
	--cs-navy-700: #142269;
	--cs-navy-300: #4258c4;

	/* Neutrals */
	--cs-ink: #14161c;
	--cs-body: #444a54;
	--cs-muted: #7b828e;
	--cs-line: #e6e9ef;
	--cs-surface: #ffffff;
	--cs-surface-2: #f6f7fb;

	/* Gradients */
	--cs-grad-brand: linear-gradient(135deg, var(--cs-navy) 0%, var(--cs-crimson) 100%);
	--cs-grad-crimson: linear-gradient(135deg, var(--cs-crimson) 0%, var(--cs-crimson-300) 100%);
	--cs-grad-navy: linear-gradient(135deg, var(--cs-navy-700) 0%, var(--cs-navy-300) 100%);
	--cs-grad-sheen: linear-gradient(120deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 70%);

	/* Glass */
	--cs-glass-bg: rgba(255, 255, 255, 0.72);
	--cs-glass-brd: rgba(255, 255, 255, 0.55);
	--cs-glass-blur: saturate(180%) blur(14px);

	/* Elevation — layered, tinted toward the brand navy rather than pure black. */
	--cs-sh-1: 0 1px 2px rgba(20, 34, 105, 0.06), 0 2px 8px rgba(20, 34, 105, 0.05);
	--cs-sh-2: 0 4px 12px rgba(20, 34, 105, 0.09), 0 12px 28px rgba(20, 34, 105, 0.09);
	--cs-sh-3: 0 10px 24px rgba(20, 34, 105, 0.13), 0 22px 48px rgba(20, 34, 105, 0.13);
	--cs-ring: 0 0 0 3px rgba(207, 33, 86, 0.35);

	--cs-r-sm: 8px;
	--cs-r-md: 12px;
	--cs-r-lg: 18px;
	--cs-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--cs-fast: 0.18s;
	--cs-slow: 0.42s;
}

/* ==========================================================================
   2. Base & accessibility
   ========================================================================== */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* The theme ships no visible focus ring. Keyboard users need one; mouse users
   are unaffected thanks to :focus-visible. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--cs-crimson);
	outline-offset: 2px;
	border-radius: 3px;
	box-shadow: var(--cs-ring);
}

::selection {
	background: var(--cs-crimson);
	color: #fff;
}

img {
	max-width: 100%;
	height: auto;
}

/* ==========================================================================
   3. Header
   ========================================================================== */

.header-top {
	background: var(--cs-grad-navy) !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-top a {
	transition: color var(--cs-fast) var(--cs-ease), opacity var(--cs-fast) var(--cs-ease);
}

.header-top a:hover {
	opacity: 0.82;
}

.header-middle {
	background: var(--cs-surface) !important;
	border-bottom: 1px solid var(--cs-line);
}

/* Primary nav bar: brand gradient instead of the flat crimson. */
.header-bottom {
	background: var(--cs-grad-brand) !important;
	box-shadow: var(--cs-sh-1);
}

/* Animated underline on nav items — transform-based, so it stays on the
   compositor and never triggers layout. */
.cloudsoft-menu > li > a {
	position: relative;
	transition: color var(--cs-fast) var(--cs-ease);
}

.cloudsoft-menu > li > a::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 10px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	opacity: 0.9;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--cs-slow) var(--cs-ease);
}

.cloudsoft-menu > li > a:hover::after,
.cloudsoft-menu > li.current-menu-item > a::after {
	transform: scaleX(1);
}

.cloudsoft-menu > li:hover > a {
	background: rgba(255, 255, 255, 0.1);
}

/* Dropdowns get elevation + a soft entrance. */
.cloudsoft-menu ul.sub-menu,
.cloudsoft-menu .cloudsoft-mega-menu {
	border: 1px solid var(--cs-line);
	border-radius: var(--cs-r-md);
	box-shadow: var(--cs-sh-3);
	overflow: hidden;
}

.cloudsoft-menu ul.sub-menu li a {
	transition: background var(--cs-fast) var(--cs-ease), padding-left var(--cs-fast) var(--cs-ease), color var(--cs-fast) var(--cs-ease);
}

.cloudsoft-menu ul.sub-menu li a:hover {
	background: var(--cs-surface-2);
	padding-left: 22px;
	color: var(--cs-crimson);
}

/* --- Sticky header: dark glass --------------------------------------------
   The sticky bar carries white nav text and the white logo variant, so the
   glass must be a DARK tint. A light frosted surface renders white-on-white
   and lets page content read straight through it.

   The fallback background is nearly opaque on purpose: without backdrop-filter
   support a translucent bar is unreadable over scrolling content. */
.cloudsoft-header-sticky {
	background: linear-gradient(180deg, rgba(20, 34, 105, 0.97) 0%, rgba(27, 46, 141, 0.97) 100%) !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 6px 24px rgba(10, 18, 60, 0.28);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.cloudsoft-header-sticky {
		-webkit-backdrop-filter: saturate(180%) blur(16px);
		backdrop-filter: saturate(180%) blur(16px);
		background: linear-gradient(180deg, rgba(20, 34, 105, 0.82) 0%, rgba(27, 46, 141, 0.82) 100%) !important;
	}
}

.cloudsoft-header-sticky .cloudsoft-menu > li > a {
	color: rgba(255, 255, 255, 0.92);
}

.cloudsoft-header-sticky .cloudsoft-menu > li > a:hover,
.cloudsoft-header-sticky .cloudsoft-menu > li.current-menu-item > a {
	color: #fff;
}

.cloudsoft-header-sticky .cloudsoft-menu > li:hover > a {
	background: rgba(255, 255, 255, 0.12);
}

/* Keep the logo legible and stop it stretching the bar. */
.cloudsoft-header-sticky .cloudsoft-logo img,
.cloudsoft-header-sticky .logo img {
	max-height: 40px;
	width: auto;
}

/* Search + toggles inherit the light-on-dark treatment. */
.cloudsoft-header-sticky .cloudsoft-search-submit,
.cloudsoft-header-sticky .cloudsoft-nav-toggle,
.cloudsoft-header-sticky .cloudsoft-menu-toggler {
	color: rgba(255, 255, 255, 0.92);
}

.cloudsoft-header-sticky .cloudsoft-search-submit:hover {
	color: #fff;
}

/* Dropdowns opened from the sticky bar stay light for readability. */
.cloudsoft-header-sticky .cloudsoft-menu ul.sub-menu {
	background: var(--cs-surface);
}

/* ==========================================================================
   4. Search
   ========================================================================== */

.cloudsoft-search-form {
	position: relative;
}

.cloudsoft-search-input {
	border: 1px solid var(--cs-line) !important;
	border-radius: var(--cs-r-sm) !important;
	background: var(--cs-surface-2) !important;
	transition: border-color var(--cs-fast) var(--cs-ease), background var(--cs-fast) var(--cs-ease), box-shadow var(--cs-fast) var(--cs-ease);
}

.cloudsoft-search-input:focus {
	border-color: var(--cs-crimson) !important;
	background: var(--cs-surface) !important;
	box-shadow: var(--cs-ring);
	outline: none;
}

.cloudsoft-search-submit {
	transition: color var(--cs-fast) var(--cs-ease), transform var(--cs-fast) var(--cs-ease);
}

.cloudsoft-search-submit:hover {
	color: var(--cs-crimson);
	transform: scale(1.08);
}

.cloudsoft-menu-popup-search {
	border-radius: var(--cs-r-md);
	box-shadow: var(--cs-sh-3);
}

/* ==========================================================================
   5. Module & widget titles
   ========================================================================== */

.cloudsoft-mod-title,
.widget-title {
	position: relative;
}

/* Gradient accent bar under section headings. */
.cloudsoft-mod-title::after,
.widget-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 56px;
	height: 3px;
	border-radius: 3px;
	background: var(--cs-grad-crimson);
}

.cloudsoft-mod-title h1,
.cloudsoft-mod-title h2,
.cloudsoft-mod-title h3,
.cloudsoft-mod-title h4,
.cloudsoft-mod-title h5,
.widget-title {
	letter-spacing: 0.01em;
}

/* ==========================================================================
   6. Post cards & thumbnails
   ========================================================================== */

.cloudsoft-post-thumbnail {
	overflow: hidden;
	border-radius: var(--cs-r-md);
	background: var(--cs-surface-2);
	/* Promote to its own layer so the zoom below is GPU-composited. */
	transform: translateZ(0);
}

.cloudsoft-post-thumbnail img {
	display: block;
	width: 100%;
	transition: transform var(--cs-slow) var(--cs-ease), filter var(--cs-slow) var(--cs-ease);
	will-change: transform;
}

.cloudsoft-post-thumbnail:hover img,
.cloudsoft-lay-a:hover .cloudsoft-post-thumbnail img,
.cloudsoft-lay-b:hover .cloudsoft-post-thumbnail img,
.cloudsoft-lay-c:hover .cloudsoft-post-thumbnail img,
.cloudsoft-lay-f:hover .cloudsoft-post-thumbnail img,
.cloudsoft-lay-f1:hover .cloudsoft-post-thumbnail img,
.cloudsoft-lay-g:hover .cloudsoft-post-thumbnail img {
	transform: scale(1.06);
	filter: saturate(1.06);
}

/* Sheen sweep across the thumbnail on hover. */
.cloudsoft-post-thumbnail::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--cs-grad-sheen);
	transform: translateX(-120%);
	transition: transform 0.75s var(--cs-ease);
	pointer-events: none;
	z-index: 2;
}

.cloudsoft-post-thumbnail {
	position: relative;
}

.cloudsoft-post-thumbnail:hover::after {
	transform: translateX(120%);
}

/* Card lift. The grid layouts are the ones that read as "cards". */
.cloudsoft-lay-f,
.cloudsoft-lay-f1,
.cloudsoft-lay-g,
.cloudsoft-lay-b {
	border-radius: var(--cs-r-lg);
	transition: transform var(--cs-slow) var(--cs-ease), box-shadow var(--cs-slow) var(--cs-ease);
	will-change: transform;
}

.cloudsoft-lay-f:hover,
.cloudsoft-lay-f1:hover,
.cloudsoft-lay-g:hover,
.cloudsoft-lay-b:hover {
	transform: translateY(-4px);
	box-shadow: var(--cs-sh-2);
}

.entry-title a {
	background-image: linear-gradient(var(--cs-crimson), var(--cs-crimson));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0% 2px;
	transition: background-size var(--cs-slow) var(--cs-ease), color var(--cs-fast) var(--cs-ease);
}

.entry-title a:hover {
	background-size: 100% 2px;
	color: var(--cs-crimson);
}

/* ==========================================================================
   7. Category pills
   ========================================================================== */

.meta-category a,
.cloudsoft-cats a {
	border-radius: 999px;
	transition: transform var(--cs-fast) var(--cs-ease), box-shadow var(--cs-fast) var(--cs-ease), filter var(--cs-fast) var(--cs-ease);
}

.meta-category a:hover,
.cloudsoft-cats a:hover {
	transform: translateY(-1px);
	box-shadow: var(--cs-sh-1);
	filter: brightness(1.08);
}

/* ==========================================================================
   8. Buttons & pagination
   ========================================================================== */

.cloudsoft-load-more a,
.cloudsoft-pagination a,
.btn,
button,
input[type="submit"] {
	border-radius: var(--cs-r-sm);
	transition: transform var(--cs-fast) var(--cs-ease), box-shadow var(--cs-fast) var(--cs-ease), filter var(--cs-fast) var(--cs-ease);
}

.cloudsoft-load-more a {
	background: var(--cs-grad-crimson) !important;
	border: 0 !important;
	color: #fff !important;
	box-shadow: var(--cs-sh-1);
}

.cloudsoft-load-more a:hover,
.cloudsoft-pagination a:hover,
input[type="submit"]:hover {
	transform: translateY(-2px);
	box-shadow: var(--cs-sh-2);
	filter: brightness(1.05);
}

.cloudsoft-load-more a:active,
.cloudsoft-pagination a:active {
	transform: translateY(0);
	box-shadow: var(--cs-sh-1);
}

/* ==========================================================================
   9. Sidebar widgets
   ========================================================================== */

.widget {
	border-radius: var(--cs-r-lg);
	transition: box-shadow var(--cs-slow) var(--cs-ease);
}

.cloudsoft-sidebar .widget:hover {
	box-shadow: var(--cs-sh-1);
}

.cloudsoft-sidebar .widget li a {
	transition: color var(--cs-fast) var(--cs-ease), padding-left var(--cs-fast) var(--cs-ease);
}

.cloudsoft-sidebar .widget li a:hover {
	color: var(--cs-crimson);
	padding-left: 5px;
}

/* Social icon buttons */
.mks_social_widget_ul a {
	border-radius: 50% !important;
	transition: transform var(--cs-fast) var(--cs-ease), box-shadow var(--cs-fast) var(--cs-ease), filter var(--cs-fast) var(--cs-ease);
}

.mks_social_widget_ul a:hover {
	transform: translateY(-3px) scale(1.06);
	box-shadow: var(--cs-sh-2);
	filter: brightness(1.1);
}

/* ==========================================================================
   10. Footer
   ========================================================================== */

/* Deep, low-saturation navy. The earlier gradient ran up to #4258c4, which
   reads as electric blue across the bottom-right of a full-width band. */
.cloudsoft-site-footer {
	position: relative;
	background: linear-gradient(160deg, #16205c 0%, #1d2a6f 45%, #202d78 100%) !important;
}

/* Soft brand glow, purely decorative. Kept subtle so it tints rather than
   lightens the surface. */
.cloudsoft-site-footer::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(70ch 44ch at 12% 0%, rgba(207, 33, 86, 0.16), transparent 62%),
		radial-gradient(56ch 36ch at 88% 20%, rgba(66, 88, 196, 0.18), transparent 64%);
	pointer-events: none;
}

.cloudsoft-site-footer > * {
	position: relative;
	z-index: 1;
}

.footer-widgets .widget-title {
	color: #fff;
}

.footer-widgets .widget-title::after {
	background: var(--cs-grad-crimson);
}

.cloudsoft-site-footer a {
	transition: color var(--cs-fast) var(--cs-ease), opacity var(--cs-fast) var(--cs-ease);
}

.cloudsoft-site-footer a:hover {
	color: #fff;
	opacity: 0.86;
}

/* --- Bottom bar -----------------------------------------------------------
   .cloudsoft-copyright is a child of .footer-bottom, so the frosted surface
   belongs on the strip only — putting it on both paints a second panel around
   the copyright text. */
.footer-bottom {
	/* Darker than the footer body, not lighter. A white overlay lifted this
	   strip above its surroundings and, combined with a saturate() boost,
	   turned it electric blue — a band across the base of the page instead of
	   a base for it. A dark wash reads as a settled foot. */
	position: relative;
	background: rgba(6, 10, 38, 0.55) !important;
	border-top: 1px solid rgba(255, 255, 255, 0.09);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.footer-bottom {
		-webkit-backdrop-filter: blur(6px);
		backdrop-filter: blur(6px);
	}
}

.footer-bottom .cloudsoft-copyright {
	background: none !important;
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	letter-spacing: 0.01em;
	color: rgba(255, 255, 255, 0.72);
}

/* The brand link was inheriting crimson, which fails contrast on the navy
   footer. White text with a rose underline reads cleanly and still marks it
   as a link. */
.footer-bottom .cloudsoft-copyright a {
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	box-shadow: inset 0 -1px 0 0 rgba(255, 154, 181, 0.85);
	transition: color var(--cs-fast) var(--cs-ease), box-shadow var(--cs-fast) var(--cs-ease);
}

.footer-bottom .cloudsoft-copyright a:hover {
	color: #ff9ab5;
	box-shadow: inset 0 -2px 0 0 #ff9ab5;
}

/* Layout for this bar now lives in the theme's own main.css / min.css, where
   the absolute-positioning + fixed-height idiom was replaced with flexbox.
   Only presentation belongs here. */

.footer-bottom .secondary-navigation ul.menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-bottom .secondary-navigation li {
	margin: 0;
	padding: 0;
	border: 0;
}

.footer-bottom .secondary-navigation a {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.82);
	transition: background var(--cs-fast) var(--cs-ease), color var(--cs-fast) var(--cs-ease), transform var(--cs-fast) var(--cs-ease);
}

.footer-bottom .secondary-navigation a:hover {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	transform: translateY(-1px);
}

/* The global nav underline is for the header bars; it reads as clutter on
   these pill links. */
.footer-bottom .cloudsoft-menu > li > a::after {
	content: none;
}

/* The theme already stacks .hel-l / .hel-r full-width and centres them under
   768px; this only centres the menu list inside that stacked block. */
@media (max-width: 767px) {
	.footer-bottom .secondary-navigation ul.menu {
		justify-content: center;
	}
}

/* Tag cloud chips */
.tagcloud a {
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	transition: background var(--cs-fast) var(--cs-ease), transform var(--cs-fast) var(--cs-ease), border-color var(--cs-fast) var(--cs-ease);
}

.tagcloud a:hover {
	background: var(--cs-grad-crimson);
	border-color: transparent;
	transform: translateY(-2px);
	color: #fff !important;
}

/* ==========================================================================
   11. Motion & print
   ========================================================================== */

/* Respect the OS "reduce motion" setting — required for WCAG 2.3.3. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.cloudsoft-post-thumbnail:hover img,
	.cloudsoft-lay-f:hover,
	.cloudsoft-lay-f1:hover,
	.cloudsoft-lay-g:hover,
	.cloudsoft-lay-b:hover {
		transform: none;
	}
}

@media print {
	.cloudsoft-site-header,
	.cloudsoft-site-footer,
	.cloudsoft-sidebar,
	.mks_ads_widget {
		display: none !important;
	}
}
