/* ===================== Planetario 3D — Frontend ===================== */

.p3d-widget {
	position: relative;
	overflow: hidden;
	background: #05060a;
	padding: 72px 40px 100px;
	border-radius: 0;
	color: #fff;
	font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.p3d-starfield {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	z-index: 0;
	pointer-events: none;
}

.p3d-header {
	position: relative;
	z-index: 2;
	max-width: 1240px;
	margin: 0 auto 110px;
}

.p3d-title {
	font-size: clamp(32px, 5vw, 54px);
	line-height: 1.12;
	font-weight: 700;
	letter-spacing: 0.5px;
	margin: 0 0 32px;
	text-transform: uppercase;
	max-width: 14ch;
}

.p3d-badge {
	position: absolute;
	top: 4px;
	right: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 999px;
	font-size: 12px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.85);
	background: rgba(255,255,255,0.04);
	white-space: nowrap;
}

.p3d-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #7CFFB2;
	box-shadow: 0 0 8px 2px rgba(124,255,178,0.8);
}

.p3d-cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	color: #0b0c10;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	padding: 16px 26px;
	border-radius: 999px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 0 0 0 rgba(255,255,255,0);
}
.p3d-cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px -6px rgba(255,255,255,0.35);
}
.p3d-cta svg { width: 16px; height: 16px; flex: none; }

.p3d-row {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: flex-end;
	gap: clamp(24px, 5vw, 72px);
	max-width: 1240px;
	margin: 0 auto;
}

.p3d-planet {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	color: inherit;
	width: clamp(160px, 22vw, 300px);
	cursor: grab;
}
.p3d-planet:active { cursor: grabbing; }

/* Línea orbital casi plana bajo cada planeta (vista de canto), igual que la
   línea horizontal continua que cruza los tres planetas en el sitio de
   referencia. Se puede ocultar con [planetario_3d rings="0"]. */
.p3d-orbit-ring {
	position: absolute;
	left: 50%;
	bottom: 6%;
	width: 145%;
	height: 34px;
	transform: translateX(-50%) rotateX(82deg);
	border-top: 1px solid color-mix(in srgb, var(--p3d-color) 60%, transparent);
	border-radius: 50%;
	box-shadow: 0 0 20px -2px color-mix(in srgb, var(--p3d-color) 40%, transparent);
	animation: p3d-ring-pulse 4s ease-in-out infinite;
	pointer-events: none;
}

.p3d-widget.p3d-hide-rings .p3d-orbit-ring {
	display: none;
}

@keyframes p3d-ring-pulse {
	0%, 100% { opacity: 0.55; }
	50% { opacity: 1; }
}

.p3d-sphere-mount {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	overflow: visible;
	/* Importante: NO usar "filter: drop-shadow()" aquí — al aplicarse sobre el
	   elemento que contiene el <canvas> de Three.js, algunos navegadores lo
	   rasterizan a baja resolución antes de filtrar, y la esfera se ve
	   facetada/octogonal en vez de un círculo perfecto. Usamos box-shadow
	   (que pinta fuera del borde, sin re-rasterizar el contenido) en su lugar. */
	box-shadow: 0 0 34px 4px color-mix(in srgb, var(--p3d-color, #8fd3ff) 30%, transparent);
	transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.p3d-planet:hover .p3d-sphere-mount {
	box-shadow: 0 0 52px 8px color-mix(in srgb, var(--p3d-color, #8fd3ff) 50%, transparent);
	transform: translateY(-4px) scale(1.03);
}

.p3d-sphere-mount canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border-radius: 50%;
	touch-action: none;
}

.p3d-sphere-mount:not(:has(canvas)) {
	background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25), rgba(255,255,255,0) 60%),
	            radial-gradient(circle at 60% 65%, var(--p3d-color, #8fd3ff), #0a0d14 75%);
}

.p3d-caption {
	margin-top: 22px;
	text-align: center;
}

.p3d-name {
	display: block;
	font-size: clamp(16px, 2vw, 22px);
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	margin-bottom: 6px;
}

.p3d-subtitle {
	display: block;
	font-size: 13px;
	line-height: 1.5;
	color: rgba(255,255,255,0.65);
	max-width: 30ch;
	margin: 0 auto;
}

/* Hint that appears on hover to invite the drag interaction */
.p3d-planet::after {
	content: "Arrastra para girar";
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translate(-50%, -100%);
	font-size: 11px;
	letter-spacing: 0.5px;
	color: rgba(255,255,255,0.55);
	background: rgba(255,255,255,0.08);
	padding: 4px 10px;
	border-radius: 999px;
	white-space: nowrap;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}
.p3d-planet:hover::after { opacity: 1; }

@media (max-width: 640px) {
	.p3d-planet::after { display: none; }
}

/* ===================== Página individual del planeta ===================== */

.p3d-single {
	position: relative;
	min-height: 100vh;
	color: #fff;
	overflow: hidden;
}

.p3d-single-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	filter: saturate(1.05) brightness(0.75);
	transform: scale(1.02);
}

.p3d-single-overlay {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(4,5,10,0.55) 0%, rgba(4,5,10,0.45) 30%, rgba(4,5,10,0.85) 100%),
		radial-gradient(ellipse at 50% 0%, transparent 0%, rgba(2,3,8,0.5) 80%);
}

.p3d-starfield--single {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0.7;
}

.p3d-single-inner {
	position: relative;
	z-index: 2;
	max-width: 900px;
	margin: 0 auto;
	padding: 48px 24px 100px;
}

.p3d-back {
	display: inline-block;
	color: rgba(255,255,255,0.75);
	text-decoration: none;
	font-size: 14px;
	letter-spacing: 0.5px;
	margin-bottom: 40px;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease, color 0.2s ease;
}
.p3d-back:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

.p3d-single-header {
	display: flex;
	align-items: center;
	gap: 32px;
	flex-wrap: wrap;
	margin-bottom: 48px;
}

.p3d-sphere-mount--single {
	position: relative;
	width: 190px;
	height: 190px;
	flex: none;
	border-radius: 50%;
	box-shadow: 0 0 46px 6px color-mix(in srgb, var(--p3d-color, #8fd3ff) 45%, transparent);
}
.p3d-sphere-mount--single canvas {
	position: absolute; inset: 0; width: 100% !important; height: 100% !important; border-radius: 50%; touch-action: none;
}

.p3d-single-titles h1 {
	font-size: clamp(32px, 5vw, 56px);
	text-transform: uppercase;
	letter-spacing: 2px;
	margin: 0 0 12px;
	font-weight: 700;
}

.p3d-single-subtitle {
	font-size: 16px;
	color: rgba(255,255,255,0.75);
	max-width: 55ch;
	margin: 0;
}

.p3d-single-content {
	background: rgba(8,10,18,0.45);
	border: 1px solid rgba(255,255,255,0.12);
	backdrop-filter: blur(6px);
	border-radius: 16px;
	padding: clamp(24px, 4vw, 48px);
	font-size: 17px;
	line-height: 1.8;
}

.p3d-single-content h2,
.p3d-single-content h3 {
	color: var(--p3d-color, #8fd3ff);
	text-transform: uppercase;
	letter-spacing: 1px;
}

.p3d-single-content a { color: var(--p3d-color, #8fd3ff); }

.p3d-single-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}
