/* ==========================================================================
   iTexClouds Blog template  (template-blog.php)
   Every selector is prefixed `itxb-`. Colours match the header/footer palette.
   ========================================================================== */
.itxb {
	--itxb-navy: #06214a;
	--itxb-navy-2: #0a5391;
	--itxb-blue: #1a8fdc;
	--itxb-cyan: #45bdf0;
	--itxb-ink: #2a4a6b;
	--itxb-text: #4a5b6e;
	--itxb-soft: #eef7fd;
	--itxb-line: #e1ebf3;
	--itxb-shadow: 0 8px 24px rgba(20, 70, 120, .10);
	font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	color: var(--itxb-text);
	font-size: 15px;
	line-height: 1.6;
}
.itxb, .itxb *, .itxb *::before, .itxb *::after { box-sizing: border-box; }
.itxb a { color: inherit; text-decoration: none; }
.itxb svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.itxb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Hero ---------- */
/* The sticky header floats in the flow, so pull the hero up underneath it. */
.itxb-hero {
	position: relative; overflow: hidden; margin-top: -72px; padding: 150px 0 64px; color: #fff;
	background: linear-gradient(160deg, #04183a 0%, var(--itxb-navy) 45%, var(--itxb-navy-2) 100%);
}
.itxb-hero-glow {
	position: absolute; inset: 0; pointer-events: none;
	background:
		radial-gradient(circle at 85% 10%, rgba(69, 189, 240, .28), transparent 40%),
		radial-gradient(circle at 8% 90%, rgba(26, 143, 220, .22), transparent 45%);
}
.itxb-hero-inner { position: relative; max-width: 860px; margin: 0 auto; padding: 0 20px; text-align: center; }
.itxb-eyebrow { margin: 0 0 12px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: #9fd8f6; font-weight: 500; }
.itxb-hero h1 { margin: 0; font-size: clamp(28px, 4.2vw, 46px); line-height: 1.2; font-weight: 600; color: #fff; }

/* ---------- Featured slider ---------- */
.itxb-slider { position: relative; margin-top: 48px; }
.itxb-track {
	display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	padding: 8px max(20px, calc(50% - 360px)); scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.itxb-track::-webkit-scrollbar { display: none; }
.itxb-slide {
	position: relative; flex: 0 0 min(720px, 86vw); height: 340px; border-radius: 16px; overflow: hidden;
	scroll-snap-align: center; background: var(--itxb-navy-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
	opacity: .55; transform: scale(.96); transition: opacity .3s, transform .3s;
}
.itxb-slide.is-active { opacity: 1; transform: none; }
.itxb-slide-media, .itxb-slide-media img, .itxb-slide .itxb-ph { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.itxb-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4, 20, 50, .92) 0%, rgba(4, 20, 50, .45) 55%, rgba(4, 20, 50, .05) 100%); pointer-events: none; }
.itxb-slide-body { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 28px 32px; max-width: 620px; }
.itxb-slide-body h2 { margin: 10px 0 8px; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; font-weight: 600; color: #fff; }
.itxb-slide-body h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.itxb-slide-body p { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 16px; font-size: 14px; color: rgba(255, 255, 255, .88); }
.itxb-chip { display: inline-block; padding: 3px 12px; border-radius: 999px; background: rgba(69, 189, 240, .25); border: 1px solid rgba(159, 216, 246, .5); color: #d6f0fd; font-size: 12px; font-weight: 500; }
.itxb-btn-ghost {
	display: inline-block; padding: 9px 22px; border: 1px solid rgba(255, 255, 255, .8); border-radius: 8px;
	color: #fff; font-size: 13px; font-weight: 500; transition: background .15s, color .15s;
}
.itxb-btn-ghost:hover { background: #fff; color: var(--itxb-navy-2); }

.itxb-slider-ctrl { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.itxb-arrow {
	display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%; background: transparent; color: #fff; cursor: pointer; transition: background .15s, opacity .15s;
}
.itxb-arrow svg { width: 20px; height: 20px; }
.itxb-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }
.itxb-arrow:disabled { opacity: .35; cursor: default; }
.itxb-dots { display: flex; gap: 10px; }
.itxb-dot { width: 34px; height: 4px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .3); cursor: pointer; transition: background .2s, width .2s; }
.itxb-dot.is-active { width: 48px; background: var(--itxb-cyan); }

/* ---------- Listing layout ---------- */
.itxb-listing { background: #fff; padding: 56px 20px 72px; }
.itxb-layout { max-width: 1200px; margin: 0 auto; padding: 0 12px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }

/* ---------- Sidebar ---------- */
.itxb-side { position: sticky; top: 100px; }
.admin-bar .itxb-side { top: 132px; }
.itxb-filter { margin: 0; }
.itxb-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 14px; color: var(--itxb-ink); }
.itxb-side-title, .itxb-reset { display: inline-flex; align-items: center; gap: 8px; }
.itxb-side-title svg, .itxb-reset svg { width: 16px; height: 16px; }
.itxb-reset { color: var(--itxb-blue); font-weight: 500; }
.itxb-reset:hover { text-decoration: underline; text-underline-offset: 3px; }

.itxb-search { position: relative; display: block; margin-bottom: 22px; }
.itxb-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: #7a93ab; pointer-events: none; }
.itxb-search input {
	width: 100%; height: 40px; padding: 0 12px 0 36px; font: inherit; font-size: 13px; color: var(--itxb-ink);
	border: 1px solid var(--itxb-line); border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.itxb-search input:focus { outline: 0; border-color: var(--itxb-blue); box-shadow: 0 0 0 3px rgba(26, 143, 220, .15); }

.itxb-group { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
.itxb-group legend { padding: 0; margin-bottom: 12px; font-size: 15px; font-weight: 600; color: var(--itxb-navy); }
.itxb-check { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; color: var(--itxb-ink); cursor: pointer; }
.itxb-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.itxb-box { flex: 0 0 auto; width: 16px; height: 16px; border: 1.5px solid #9db4c8; border-radius: 3px; background: #fff; transition: background .15s, border-color .15s; }
.itxb-check:hover .itxb-box { border-color: var(--itxb-blue); }
.itxb-check input:checked + .itxb-box {
	border-color: var(--itxb-blue); background: var(--itxb-blue)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.itxb-check input:focus-visible + .itxb-box { outline: 2px solid var(--itxb-cyan); outline-offset: 2px; }
.itxb-check-label { flex: 1 1 auto; }
.itxb-count { font-size: 11px; color: #8aa0b5; }

.itxb-apply, .itxb-btn {
	display: inline-block; padding: 10px 22px; border: 0; border-radius: 999px; cursor: pointer;
	background: linear-gradient(90deg, var(--itxb-cyan), var(--itxb-blue)); color: #fff; font: inherit; font-size: 13px; font-weight: 600;
	box-shadow: 0 6px 14px rgba(26, 143, 220, .28); transition: transform .15s, box-shadow .15s;
}
.itxb-apply:hover, .itxb-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 18px rgba(26, 143, 220, .36); color: #fff; }
@media (min-width: 901px) { .itxb.has-js .itxb-apply { display: none; } }   /* desktop auto-submits; mobile keeps the button */
.itxb-mbar, .itxb-close, .itxb-overlay { display: none; }

/* ---------- Results & cards ---------- */
.itxb-status { min-height: 22px; margin: 0 0 14px; font-size: 13px; color: #6b8299; }
.itxb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.itxb-card { display: flex; flex-direction: column; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--itxb-shadow); transition: transform .2s, box-shadow .2s; }
.itxb-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(20, 70, 120, .18); }
.itxb-card-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--itxb-soft); }
.itxb-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.itxb-card:hover .itxb-card-media img { transform: scale(1.04); }
.itxb-card-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 18px 20px 20px; }
.itxb-meta-top { margin: 0 0 8px; min-height: 18px; font-size: 11.5px; color: #7a8ea3; }
.itxb-meta-top strong { font-weight: 600; }
.itxb-card h3 { margin: 0 0 10px; font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--itxb-navy); }
.itxb-card h3 a:hover { color: var(--itxb-blue); }
.itxb-excerpt { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 16px; font-size: 13.5px; line-height: 1.6; color: var(--itxb-text); }
.itxb-meta { display: flex; gap: 8px; margin: auto 0 0; font-size: 12px; color: #8aa0b5; }

/* Placeholder when a post has no featured image */
.itxb-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #cfeafb, #8fd0f3 55%, #4fb2e8); position: relative; }
.itxb-ph::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .55), transparent 45%); }
.itxb-slide .itxb-ph { background: linear-gradient(135deg, #0a5391, #1a8fdc); }

/* ---------- Pagination ---------- */
.itxb-pager { margin-top: 44px; }
.itxb-pager ul { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.itxb-pager li { margin: 0; padding: 0; }
.itxb-pager .page-numbers {
	display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px;
	font-size: 13px; font-weight: 500; color: var(--itxb-blue); transition: background .15s, color .15s;
}
.itxb-pager a.page-numbers:hover { background: var(--itxb-soft); }
.itxb-pager .page-numbers.current { background: var(--itxb-blue); color: #fff; }
.itxb-pager .page-numbers.dots { color: #8aa0b5; }

/* ---------- Empty state ---------- */
.itxb-empty { padding: 56px 24px; text-align: center; border: 1px dashed #bcd6e8; border-radius: 12px; background: var(--itxb-soft); }
.itxb-empty h3 { margin: 0 0 8px; font-size: 20px; color: var(--itxb-navy); }
.itxb-empty p { margin: 0 0 20px; }

/* ---------- CTA band ---------- */
.itxb-cta { padding: 64px 20px; text-align: center; background: var(--itxb-soft); position: relative; overflow: hidden; }
.itxb-cta::after {
	content: ""; position: absolute; right: 6%; bottom: 14%; width: 190px; height: 130px; opacity: .55;
	background-image: radial-gradient(var(--itxb-cyan) 2px, transparent 2.5px); background-size: 20px 20px;
}
.itxb-cta-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.itxb-cta h2 { margin: 0 0 24px; font-size: clamp(22px, 3vw, 32px); line-height: 1.3; font-weight: 500; color: var(--itxb-navy); }
.itxb-cta .itxb-btn { padding: 12px 30px; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .itxb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
	.itxb-layout { grid-template-columns: 1fr; gap: 0; }
	.itxb-mbar { display: block; max-width: 1200px; margin: 0 auto 20px; padding: 0 12px; }
	.itxb-filter-btn {
		display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; cursor: pointer;
		font: inherit; font-size: 14px; font-weight: 500; color: var(--itxb-ink); background: #fff;
		border: 1px solid var(--itxb-line); border-radius: 999px; box-shadow: var(--itxb-shadow);
	}
	.itxb-filter-btn svg { width: 16px; height: 16px; }
	.itxb-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--itxb-blue); color: #fff; font-size: 11px; font-weight: 600; }

	/* Sidebar becomes an off-canvas drawer */
	.itxb-side, .admin-bar .itxb-side {
		position: fixed; top: 0; bottom: 0; left: 0; z-index: 100001; width: min(86vw, 340px); padding: 20px 20px 28px;
		overflow-y: auto; background: #fff; box-shadow: 0 0 40px rgba(4, 20, 50, .35);
		transform: translateX(-105%); visibility: hidden; transition: transform .28s ease, visibility .28s;
	}
	.admin-bar .itxb-side { top: 46px; }
	.itxb-side.is-open { transform: none; visibility: visible; }
	.itxb-close { order: 3; display: grid; place-items: center; width: 34px; height: 34px; margin-left: auto; padding: 0; border: 0; border-radius: 50%; background: var(--itxb-soft); color: var(--itxb-ink); cursor: pointer; }
	.itxb-close svg { width: 18px; height: 18px; }
	.itxb-side-head { gap: 12px; }
	.itxb-apply { display: block; width: 100%; padding: 12px; }
	.itxb-overlay { position: fixed; inset: 0; z-index: 100000; background: rgba(4, 20, 50, .55); }
	.itxb-overlay:not([hidden]) { display: block; }
}
body.itxb-lock { overflow: hidden; }
@media (max-width: 782px) { .itxb-hero { margin-top: -66px; padding-top: 128px; } }
@media (max-width: 640px) {
	.itxb-hero { padding-bottom: 44px; }
	.itxb-slide { height: 400px; }
	.itxb-slide-body { padding: 22px 20px; }
	.itxb-track { padding-left: 7vw; padding-right: 7vw; }
	.itxb-grid { grid-template-columns: 1fr; }
	.itxb-listing { padding: 40px 12px 56px; }
	.itxb-cta::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.itxb *, .itxb *::before, .itxb *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Safety: never let long unbroken text widen the page ---------- */
.itxb { overflow-x: clip; }
.itxb-slide-body, .itxb-card-body, .itxb-hero h1 { overflow-wrap: anywhere; }

/* ---------- Live filtering states ---------- */
.itxb [hidden] { display: none !important; }
.itxb-results { transition: opacity .2s; }
.itxb-results.is-loading { opacity: .45; pointer-events: none; }
