/*
Theme Name: Ciberpioneros Base
Description: Tema base reutilizable para los proyectos digitales de Ciberpioneros, LLC.
Author: Ciberpioneros, LLC
Version: 0.1.0
Text Domain: ciberpioneros-base
License: GNU General Public License v2 or later
*/

/* =========================================================
   Ciberpioneros Base — Design System v0.1
   ========================================================= */

:root {
	--cb-background: #ffffff;
	--cb-surface: #ffffff;
	--cb-surface-soft: #f3f7fb;
	--cb-surface-elevated: #ffffff;

	--cb-text: #0f172a;
	--cb-text-muted: #5b6878;

	--cb-border: #dde5ee;

	--cb-accent: #1473e6;
	--cb-accent-hover: #0d63ca;
	--cb-accent-soft: #e8f2ff;
	--cb-accent-secondary: #20bfd5;

	--cb-success: #1aa866;
	--cb-warning: #e9a31b;
	--cb-danger: #df3d4f;

	--cb-radius-sm: 8px;
	--cb-radius-md: 12px;
	--cb-radius-lg: 18px;
	--cb-radius-xl: 24px;

	--cb-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
	--cb-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

	--cb-transition: 180ms ease;

	color-scheme: light;
}

html[data-theme="dark"] {
	--cb-background: #071521;
	--cb-surface: #0b1c2a;
	--cb-surface-soft: #102536;
	--cb-surface-elevated: #12293b;

	--cb-text: #f4f7fb;
	--cb-text-muted: #a8b6c5;

	--cb-border: #20394d;

	--cb-accent: #2494ff;
	--cb-accent-hover: #50a9ff;
	--cb-accent-soft: #102f4c;
	--cb-accent-secondary: #27c4d8;

	--cb-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.22);
	--cb-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.28);

	color-scheme: dark;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--cb-background);
	color: var(--cb-text);
	transition:
		background-color var(--cb-transition),
		color var(--cb-transition);
}

.wp-site-blocks {
	min-height: 100vh;
}

a {
	color: var(--cb-accent);
	transition:
		color var(--cb-transition),
		opacity var(--cb-transition);
}

a:hover {
	color: var(--cb-accent-hover);
}

::selection {
	background: var(--cb-accent-soft);
	color: var(--cb-text);
}


/* =========================================================
   Header
   ========================================================= */

.cb-site-header {
	position: relative;
	z-index: 20;
	margin: 0;
	background: color-mix(in srgb, var(--cb-background) 96%, transparent);
	border-bottom: 1px solid var(--cb-border);
}

.cb-header-inner {
	min-height: 76px;
	padding-inline: clamp(1rem, 3vw, 2rem);
	gap: 2rem;
}

.cb-brand {
	flex-shrink: 0;
	gap: 0.7rem;
}

.cb-brand .wp-block-site-logo {
	margin: 0;
}

.cb-brand .wp-block-site-title {
	margin: 0;
	font-size: 1.45rem;
	font-weight: 750;
	line-height: 1;
	white-space: nowrap;
}

.cb-brand .wp-block-site-title a {
	color: var(--cb-text);
	text-decoration: none;
}

.cb-main-nav {
	margin-inline: auto;
}

.cb-main-nav a {
	color: var(--cb-text);
	font-size: 0.93rem;
	font-weight: 550;
	text-decoration: none;
}

.cb-main-nav a:hover,
.cb-main-nav .current-menu-item > a {
	color: var(--cb-accent);
}

.cb-header-actions {
	flex-shrink: 0;
	gap: 0.45rem;
}

.cb-icon-button {
	display: inline-grid;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: var(--cb-text);
	cursor: pointer;
	transition:
		background-color var(--cb-transition),
		border-color var(--cb-transition),
		color var(--cb-transition),
		transform var(--cb-transition);
}

.cb-icon-button:hover {
	background: var(--cb-surface-soft);
	border-color: var(--cb-border);
	color: var(--cb-accent);
}

.cb-icon-button:focus-visible {
	outline: 3px solid var(--cb-accent-soft);
	outline-offset: 2px;
}

.cb-icon-button svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cb-theme-toggle {
	background: var(--cb-surface-soft);
	border-color: var(--cb-border);
}

.cb-theme-moon {
	display: none;
}

html[data-theme="dark"] .cb-theme-sun {
	display: none;
}

html[data-theme="dark"] .cb-theme-moon {
	display: block;
}

.cb-search-panel {
	display: none;
	padding:
		0
		clamp(1rem, 3vw, 2rem)
		1.25rem;
}

.cb-search-panel.is-open {
	display: block;
}

.cb-search-form {
	max-width: 760px;
	margin-inline: auto;
}

.cb-search-form .wp-block-search__inside-wrapper {
	padding: 0.35rem;
	background: var(--cb-surface);
	border: 1px solid var(--cb-border);
	border-radius: var(--cb-radius-md);
	box-shadow: var(--cb-shadow-sm);
}

.cb-search-form input {
	min-height: 46px;
	padding-inline: 1rem;
	background: transparent;
	border: 0;
	color: var(--cb-text);
	font: inherit;
}

.cb-search-form input:focus {
	outline: 0;
}

.cb-search-form button {
	border-radius: var(--cb-radius-sm);
}

@media (max-width: 900px) {
	.cb-header-inner {
		min-height: 68px;
		gap: 1rem;
	}

	.cb-brand .wp-block-site-title {
		font-size: 1.2rem;
	}

	.cb-main-nav {
		order: 3;
		margin-inline: 0;
	}

	.cb-header-actions {
		margin-left: auto;
	}
}


/* =========================================================
   Header controls — v0.2
   ========================================================= */

.cb-header-actions {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
}

.cb-header-button {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	flex: 0 0 42px;
	width: 42px !important;
	height: 42px !important;
	min-width: 42px;
	min-height: 42px;

	margin: 0;
	padding: 0;

	border: 1px solid transparent;
	border-radius: 999px;

	background: transparent;
	color: var(--cb-text);

	font: inherit;
	line-height: 1;

	cursor: pointer;

	transition:
		color var(--cb-transition),
		background-color var(--cb-transition),
		border-color var(--cb-transition),
		transform var(--cb-transition);
}

.cb-header-button:hover {
	background: var(--cb-surface-soft);
	border-color: var(--cb-border);
	color: var(--cb-accent);
}

.cb-header-button:active {
	transform: scale(0.96);
}

.cb-header-button:focus-visible {
	outline: 3px solid var(--cb-accent-soft);
	outline-offset: 2px;
}

.cb-header-button svg {
	display: block;
	width: 20px;
	height: 20px;

	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

#cb-theme-toggle {
	background: var(--cb-surface-soft);
	border-color: var(--cb-border);
}

.cb-theme-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.cb-theme-icon-moon {
	display: none;
}

html[data-theme="dark"] .cb-theme-icon-sun {
	display: none;
}

html[data-theme="dark"] .cb-theme-icon-moon {
	display: inline-flex;
}

.cb-search-wrapper[hidden] {
	display: none !important;
}

.cb-search-wrapper {
	padding:
		0
		clamp(1rem, 3vw, 2rem)
		1.25rem;
}

@media (max-width: 900px) {
	.cb-header-button {
		flex-basis: 40px;
		width: 40px !important;
		height: 40px !important;
		min-width: 40px;
		min-height: 40px;
	}
}


/* =========================================================
   Hero
   ========================================================= */

.cb-hero {
	margin: 0;
	padding:
		clamp(3.5rem, 7vw, 6.5rem)
		clamp(1rem, 3vw, 2rem);
	background:
		radial-gradient(
			circle at 72% 35%,
			var(--cb-accent-soft) 0,
			transparent 32%
		),
		var(--cb-background);
}

.cb-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
	align-items: center;
	gap: clamp(3rem, 6vw, 5.5rem);
}

.cb-hero-copy {
	max-width: 610px;
}

.cb-eyebrow {
	margin: 0 0 1.15rem;
	color: var(--cb-accent);
	font-size: 0.78rem;
	font-weight: 750;
	letter-spacing: 0.18em;
	line-height: 1.4;
}

.cb-hero-title {
	margin: 0;
	max-width: 700px;
	color: var(--cb-text);
	font-size: clamp(2.75rem, 5vw, 4.7rem);
	font-weight: 760;
	letter-spacing: -0.045em;
	line-height: 0.99;
}

.cb-text-accent {
	color: var(--cb-accent);
}

.cb-hero-description {
	max-width: 590px;
	margin:
		1.5rem
		0
		0;
	color: var(--cb-text-muted);
	font-size: clamp(1rem, 1.5vw, 1.14rem);
	line-height: 1.65;
}

.cb-hero-actions {
	margin-top: 2rem;
	gap: 0.85rem;
}

.cb-hero-actions .wp-block-button__link {
	padding: 0.9rem 1.45rem;
	border-radius: var(--cb-radius-md);
	font-size: 0.95rem;
	font-weight: 650;
	transition:
		background-color var(--cb-transition),
		color var(--cb-transition),
		border-color var(--cb-transition),
		transform var(--cb-transition);
}

.cb-hero-actions .wp-block-button__link:hover {
	transform: translateY(-1px);
}

.cb-button-secondary .wp-block-button__link {
	background: transparent;
	border-color: var(--cb-border);
	color: var(--cb-text);
}

.cb-button-secondary .wp-block-button__link:hover {
	background: var(--cb-surface-soft);
	border-color: var(--cb-accent);
	color: var(--cb-accent);
}


/* Featured Hero Card */

.cb-feature-card {
	position: relative;
	box-sizing: border-box;
	min-height: 410px;
	overflow: hidden;

	display: flex;
	flex-direction: column;
	justify-content: flex-end;

	padding: clamp(1.6rem, 3vw, 2.2rem);

	border: 1px solid var(--cb-border);
	border-radius: var(--cb-radius-xl);

	background:
		linear-gradient(
			180deg,
			transparent 10%,
			rgba(3, 17, 30, 0.24) 44%,
			rgba(3, 17, 30, 0.94) 100%
		),
		radial-gradient(
			circle at 72% 24%,
			rgba(32, 191, 213, 0.48),
			transparent 27%
		),
		linear-gradient(
			135deg,
			#173e5c,
			#0a2236 52%,
			#071521
		);

	box-shadow: var(--cb-shadow-md);
	isolation: isolate;
}

.cb-feature-card::before,
.cb-feature-card::after {
	content: "";
	position: absolute;
	z-index: -1;
	border-radius: 999px;
	pointer-events: none;
}

.cb-feature-card::before {
	top: 18%;
	right: 9%;
	width: 44%;
	height: 3px;
	background: rgba(80, 190, 255, 0.65);
	box-shadow:
		0 34px 0 rgba(80, 190, 255, 0.26),
		0 68px 0 rgba(80, 190, 255, 0.16);
	transform: rotate(-17deg);
}

.cb-feature-card::after {
	top: 10%;
	right: 18%;
	width: 145px;
	height: 145px;
	border: 1px solid rgba(116, 211, 255, 0.22);
	box-shadow:
		0 0 50px rgba(36, 148, 255, 0.2),
		inset 0 0 40px rgba(36, 148, 255, 0.08);
}

.cb-feature-badge {
	position: absolute;
	top: 1.35rem;
	left: 1.35rem;

	margin: 0;
	padding: 0.45rem 0.7rem;

	border-radius: 999px;

	background: rgba(12, 96, 139, 0.86);
	color: #d9f7ff;

	font-size: 0.72rem;
	font-weight: 750;
	letter-spacing: 0.04em;
}

.cb-feature-content {
	max-width: 680px;
	margin: 0;
}

.cb-feature-title {
	max-width: 640px;
	margin: 0;

	color: #ffffff;
	font-size: clamp(1.65rem, 3vw, 2.3rem);
	font-weight: 720;
	letter-spacing: -0.025em;
	line-height: 1.06;
}

.cb-feature-description {
	max-width: 600px;
	margin: 0.85rem 0 0;

	color: rgba(255, 255, 255, 0.77);
	font-size: 0.96rem;
	line-height: 1.5;
}

.cb-feature-meta {
	margin-top: 1.25rem;
	gap: 1.1rem;
	color: rgba(255, 255, 255, 0.68);
	font-size: 0.78rem;
}

.cb-feature-meta p {
	margin: 0;
}

.cb-feature-note {
	position: absolute;
	top: 1.45rem;
	right: 1.55rem;

	margin: 0;

	color: rgba(255, 255, 255, 0.84);
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1rem;
	font-style: italic;
	line-height: 1.25;
	text-align: right;

	transform: rotate(-4deg);
}

.cb-feature-note::after {
	content: "";
	display: block;
	width: 72%;
	height: 2px;
	margin: 0.35rem 0 0 auto;
	border-radius: 999px;
	background: var(--cb-accent-secondary);
	transform: rotate(-4deg);
}

html[data-theme="dark"] .cb-hero {
	background:
		radial-gradient(
			circle at 72% 35%,
			rgba(36, 148, 255, 0.1) 0,
			transparent 32%
		),
		var(--cb-background);
}


/* Responsive */

@media (max-width: 980px) {
	.cb-hero-grid {
		grid-template-columns: 1fr;
		gap: 3rem;
	}

	.cb-hero-copy {
		max-width: 720px;
	}

	.cb-feature-card {
		min-height: 390px;
	}
}

@media (max-width: 600px) {
	.cb-hero {
		padding-top: 3rem;
		padding-bottom: 3.5rem;
	}

	.cb-hero-title {
		font-size: clamp(2.35rem, 12vw, 3.3rem);
	}

	.cb-hero-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.cb-hero-actions .wp-block-button,
	.cb-hero-actions .wp-block-button__link {
		width: 100%;
	}

	.cb-feature-card {
		min-height: 430px;
		padding: 1.4rem;
	}

	.cb-feature-note {
		font-size: 0.9rem;
	}

	.cb-feature-badge {
		top: 1rem;
		left: 1rem;
	}
}


/* =========================================================
   Dynamic Featured Post
   ========================================================= */

.cb-feature-query,
.cb-feature-query .wp-block-post-template {
	width: 100%;
	margin: 0;
	padding: 0;
}

.cb-feature-query .wp-block-post-template {
	display: block;
	list-style: none;
}

.cb-feature-query .wp-block-post {
	margin: 0;
	padding: 0;
}

.cb-feature-card {
	position: relative;
	min-height: 410px;
	overflow: hidden;
	background:
		linear-gradient(135deg, #173e5c, #071521);
}

.cb-feature-image {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	margin: 0;
}

.cb-feature-image a {
	display: block;
	width: 100%;
	height: 100%;
}

.cb-feature-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cb-feature-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;

	margin: 0;

	background:
		linear-gradient(
			180deg,
			rgba(3, 17, 30, 0.04) 5%,
			rgba(3, 17, 30, 0.28) 40%,
			rgba(3, 17, 30, 0.94) 100%
		);
}

.cb-feature-badge,
.cb-feature-note,
.cb-feature-content {
	position: relative;
	z-index: 2;
}

.cb-feature-content {
	margin-top: auto;
}

.cb-feature-category {
	margin: 0 0 0.65rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.cb-feature-category a {
	color: #8edcff;
	text-decoration: none;
}

.cb-feature-title a {
	color: #fff;
	text-decoration: none;
}

.cb-feature-title a:hover {
	color: #fff;
	opacity: 0.9;
}

.cb-feature-description .wp-block-post-excerpt__excerpt {
	margin: 0.85rem 0 0;
	color: rgba(255, 255, 255, 0.78);
}

.cb-feature-meta .wp-block-post-date {
	margin: 0;
}

.cb-feature-meta time {
	color: rgba(255, 255, 255, 0.68);
}

.cb-feature-query .wp-block-query-no-results {
	min-height: 410px;
	display: grid;
	place-items: center;
	padding: 2rem;

	border: 1px solid var(--cb-border);
	border-radius: var(--cb-radius-xl);

	background: var(--cb-surface-soft);
	color: var(--cb-text-muted);
}


/* =========================================================
   Featured Post Card — layout fix
   ========================================================= */

.cb-feature-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;

	box-sizing: border-box;
	min-height: 410px;
	padding: clamp(1.5rem, 3vw, 2rem);

	overflow: hidden;
	border: 1px solid var(--cb-border);
	border-radius: var(--cb-radius-xl);

	background: #071521;
	isolation: isolate;
}


/* Image */

.cb-feature-image {
	position: absolute;
	inset: 0;
	z-index: 0;

	width: 100%;
	height: 100%;
	margin: 0;
}

.cb-feature-image a {
	display: block;
	width: 100%;
	height: 100%;
}

.cb-feature-image img {
	display: block;
	width: 100%;
	height: 100%;

	object-fit: cover;
	object-position: center;
}


/* Gradient over image */

.cb-feature-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;

	margin: 0;

	background:
		linear-gradient(
			to bottom,
			rgba(3, 17, 30, 0.05) 0%,
			rgba(3, 17, 30, 0.12) 28%,
			rgba(3, 17, 30, 0.72) 65%,
			rgba(3, 17, 30, 0.96) 100%
		);
}


/* Featured badge */

.cb-feature-badge {
	position: absolute !important;
	top: 1.25rem;
	left: 1.25rem;
	right: auto;

	z-index: 3;

	display: inline-flex;
	width: auto;
	max-width: max-content;

	margin: 0;
	padding: 0.45rem 0.75rem;

	border-radius: 999px;

	background: rgba(5, 111, 161, 0.94);
	color: #e7faff;

	font-size: 0.7rem;
	font-weight: 750;
	line-height: 1;
	letter-spacing: 0.035em;
}


/* Handwritten note */

.cb-feature-note {
	position: absolute !important;
	top: 1.3rem;
	right: 1.5rem;

	z-index: 3;

	margin: 0;

	color: rgba(255,255,255,0.9);

	font-family: Georgia, "Times New Roman", serif;
	font-size: 0.95rem;
	font-style: italic;
	line-height: 1.25;
	text-align: right;

	transform: rotate(-3deg);
}

.cb-feature-note::after {
	content: "";
	display: block;

	width: 70%;
	height: 2px;

	margin: 0.35rem 0 0 auto;

	border-radius: 999px;
	background: var(--cb-accent-secondary);

	transform: rotate(-4deg);
}


/* Bottom content */

.cb-feature-content {
	position: relative !important;
	z-index: 2;

	width: 100%;
	max-width: 620px;

	margin: auto 0 0;
}


/* Category tag */

.cb-feature-category {
	display: inline-flex;

	width: auto;
	max-width: max-content;

	margin: 0 0 0.65rem;
	padding: 0.3rem 0.55rem;

	border-radius: 999px;

	background: rgba(20, 115, 230, 0.88);

	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cb-feature-category a {
	color: #ffffff;
	text-decoration: none;
}


/* Title */

.cb-feature-title {
	max-width: 95%;
	margin: 0;

	font-size: clamp(1.55rem, 2.3vw, 2.15rem);
	line-height: 1.08;
	letter-spacing: -0.025em;
}

.cb-feature-title a {
	color: #ffffff;
	text-decoration: none;
}


/* Excerpt */

.cb-feature-description {
	max-width: 92%;
	margin-top: 0.7rem;
}

.cb-feature-description .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	overflow: hidden;

	margin: 0;

	color: rgba(255, 255, 255, 0.8);

	font-size: 0.9rem;
	line-height: 1.5;

	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}


/* Meta */

.cb-feature-meta {
	margin-top: 0.9rem;

	color: rgba(255, 255, 255, 0.68);

	font-size: 0.76rem;
	line-height: 1;
}

.cb-feature-meta time {
	color: inherit;
}


@media (max-width: 600px) {
	.cb-feature-card {
		min-height: 430px;
		padding: 1.25rem;
	}

	.cb-feature-badge {
		top: 1rem;
		left: 1rem;
	}

	.cb-feature-note {
		top: 1.05rem;
		right: 1rem;
		font-size: 0.82rem;
	}

	.cb-feature-title {
		font-size: 1.6rem;
	}
}
