/* Tarot del Día — estilos del frontend.
   Los colores/​tamaños principales se controlan con variables CSS
   generadas desde Cartas de Tarot > Configuración (ver class-tcd-shortcode.php). */

.tcd-wrap {
	--tcd-fondo: #fdf1f0;
	--tcd-panel: #ffffff;
	--tcd-titulo: #8b5cf6;
	--tcd-acento: #2dd4bf;
	--tcd-texto: #55506b;
	--tcd-boton-fondo: #8b5cf6;
	--tcd-boton-texto: #ffffff;
	--tcd-radio: 18px;

	box-sizing: border-box;
	background: var(--tcd-fondo);
	padding: clamp(20px, 4vw, 40px);
	border-radius: var(--tcd-radio);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--tcd-texto);
}

.tcd-wrap *,
.tcd-wrap *::before,
.tcd-wrap *::after {
	box-sizing: border-box;
}

.tcd-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(16px, 3vw, 32px);
	align-items: stretch;
}

@media (max-width: 720px) {
	.tcd-grid {
		grid-template-columns: 1fr;
	}
}

.tcd-panel {
	background: var(--tcd-panel);
	border-radius: calc(var(--tcd-radio) * 0.8);
	padding: clamp(20px, 4vw, 36px);
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.tcd-avatar {
	width: 110px;
	height: 110px;
	border-radius: 50%;
	overflow: hidden;
	margin: 0 auto 18px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.tcd-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tcd-author {
	display: inline-block;
	color: var(--tcd-acento);
	font-weight: 700;
	letter-spacing: 0.08em;
	font-size: 12px;
	margin-bottom: 10px;
}

.tcd-title {
	color: var(--tcd-titulo);
	font-size: clamp(22px, 3vw, 30px);
	font-weight: 800;
	margin: 0 0 14px;
	line-height: 1.25;
}

.tcd-desc {
	font-size: 15px;
	line-height: 1.65;
	margin: 0 0 10px;
	max-width: 46ch;
}

.tcd-divider {
	width: 100%;
	max-width: 320px;
	border: none;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	margin: 18px 0;
}

.tcd-subtitle {
	color: var(--tcd-titulo);
	font-size: 20px;
	font-weight: 800;
	margin: 0 0 14px;
}

.tcd-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: left;
	max-width: 46ch;
}

.tcd-steps li {
	position: relative;
	padding-left: 22px;
	margin-bottom: 12px;
	font-size: 14.5px;
	line-height: 1.6;
}

.tcd-steps li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 8px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--tcd-acento);
}

.tcd-panel-card {
	justify-content: center;
	gap: 18px;
}

.tcd-card-stage {
	perspective: 1200px;
	width: 100%;
	max-width: 260px;
	aspect-ratio: 0.59;
	margin: 0 auto;
	/* El drop-shadow vive acá (afuera del contexto 3D) a propósito: aplicar
	   filter directamente sobre .tcd-card rompe el flip 3D en Chrome/Safari
	   (el filter fuerza un "flattening" del preserve-3d). */
	filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.15));
}

.tcd-card {
	position: relative;
	width: 100%;
	height: 100%;
	transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
	transform-style: preserve-3d;
}

.tcd-card-face {
	position: absolute;
	inset: 0;
	border-radius: 14px;
	overflow: hidden;
	backface-visibility: hidden;
	background: #fff;
}

.tcd-card-face img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tcd-card-back {
	transform: rotateY(0deg);
}

.tcd-card-front {
	transform: rotateY(180deg);
}

/* Animación tipo "flip" (por defecto) */
.tcd-wrap[data-animacion="flip"] .tcd-card.is-revealed {
	transform: rotateY(180deg);
}

/* Animación tipo "fade": ambas caras superpuestas, se hace un crossfade */
.tcd-wrap[data-animacion="fade"] .tcd-card-face {
	transition: opacity 0.5s ease;
	backface-visibility: visible;
}
.tcd-wrap[data-animacion="fade"] .tcd-card-back {
	transform: none;
	opacity: 1;
}
.tcd-wrap[data-animacion="fade"] .tcd-card-front {
	transform: none;
	opacity: 0;
}
.tcd-wrap[data-animacion="fade"] .tcd-card.is-revealed .tcd-card-back {
	opacity: 0;
}
.tcd-wrap[data-animacion="fade"] .tcd-card.is-revealed .tcd-card-front {
	opacity: 1;
}

.tcd-card.is-shuffling {
	animation: tcd-shuffle 0.6s ease-in-out;
}

@keyframes tcd-shuffle {
	0%, 100% { transform: translateX(0) rotate(0); }
	20% { transform: translateX(-6px) rotate(-2deg); }
	40% { transform: translateX(5px) rotate(2deg); }
	60% { transform: translateX(-4px) rotate(-1deg); }
	80% { transform: translateX(3px) rotate(1deg); }
}

.tcd-result {
	text-align: center;
	max-width: 340px;
	animation: tcd-fade-up 0.5s ease both;
}

.tcd-result[hidden] {
	display: none;
}

@keyframes tcd-fade-up {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.tcd-result-numero {
	color: var(--tcd-acento);
	font-size: 13px;
	letter-spacing: 0.1em;
	margin: 0 0 4px;
	font-weight: 700;
}

.tcd-result-title {
	color: var(--tcd-titulo);
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 8px;
}

.tcd-result-meaning {
	font-size: 14.5px;
	line-height: 1.6;
	margin: 0;
}

.tcd-button {
	appearance: none;
	border: none;
	cursor: pointer;
	background: var(--tcd-boton-fondo);
	color: var(--tcd-boton-texto);
	font-size: 15px;
	font-weight: 700;
	padding: 14px 28px;
	border-radius: 999px;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.tcd-button:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16);
}

.tcd-button:disabled {
	opacity: 0.6;
	cursor: default;
	transform: none;
}

.tcd-loading {
	font-size: 13px;
	color: var(--tcd-texto);
	opacity: 0.75;
	margin: 0;
}

.tcd-loading[hidden] {
	display: none;
}

.tcd-empty {
	font-size: 14px;
	opacity: 0.8;
}

/* Estado restringido (LearnDash) */
.tcd-wrap-restricted .tcd-panel-restricted {
	max-width: 520px;
	margin: 0 auto;
	gap: 14px;
}

.tcd-lock {
	font-size: 34px;
}

.tcd-restricted-message {
	font-size: 15px;
	line-height: 1.6;
}
