/* --- CONFIGURACIÓN GENERAL Y TEMA --- */
:root {
    --color-fondo: #0d0b14;
    --color-primario: #cba258;
    --color-texto: #e0d2c1;
    --color-sombra: #cba25855;
    --fuente-principal: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--fuente-principal);
    background-color: var(--color-fondo);
    color: var(--color-texto);
    display: flex;
    flex-direction: column; /* Para apilar título, cartas y enlaces */
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background-image: radial-gradient(circle at 20% 20%, rgba(203, 162, 88, 0.1), transparent 30%),
                      radial-gradient(circle at 80% 70%, rgba(100, 80, 150, 0.15), transparent 40%);
}

.landing-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80vh;
}

.main-title {
    font-size: 2.5rem;
    font-family: 'Times New Roman', Times, serif;
    color: var(--color-primario);
    text-shadow: 0 0 10px var(--color-sombra);
    margin-bottom: 0.5rem; /* Reducido para acercar el subtítulo */
    text-align: center;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-primario);
    margin-bottom: 2.5rem; /* Espacio antes de las cartas */
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* --- CONTENEDOR DE CARTAS --- */
.tarot-container {
    width: 100%;
    max-width: 850px; /* Ancho para 3 cartas */
    display: flex;
    flex-direction: row; /* Cartas una al lado de la otra */
    flex-wrap: wrap; /* Por defecto, permite que las cartas se reorganicen */
    justify-content: center;
    gap: 1.5rem;
}

/* --- ESTILO DE LA CARTA --- */
.card {
    width: 240px; /* Ancho fijo para cada carta */
    height: 380px; /* Altura ajustada para mejor proporción */
    perspective: 1000px;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* --- ESTADO VOLTEADO --- */
.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

/* --- CARAS DE LA CARTA (REVERSO Y ANVERSO) --- */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 16px;
    border: 2px solid var(--color-primario);
    box-shadow: 0 4px 20px var(--color-sombra);
    overflow: hidden;
}

/* --- REVERSO DE LA CARTA (DISEÑO MÍSTICO) --- */
.card-face--front {
    background-color: #1a1625;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-face--front::before {
    content: '❖';
    font-size: 6rem;
    color: var(--color-primario);
    opacity: 0.6;
    text-shadow: 0 0 15px var(--color-sombra);
}

/* --- ANVERSO DE LA CARTA (IMAGEN) --- */
.card-face--back {
    background-color: #1f1a2d;
    transform: rotateY(180deg);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra la carta sin deformarse */
}

.card-cta {
    background-color: var(--color-primario);
    color: var(--color-fondo);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0.5rem;
}

.cta-container {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Espacio entre botones */
    margin-bottom: 2.5rem; /* Espacio después de los botones */
}

.cta-button {
    background-color: var(--color-primario);
    color: var(--color-fondo);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--color-sombra);
}

.card-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px var(--color-sombra);
}

/* --- SECCIÓN DE DETALLES --- */
.details-section {
    display: none; /* Oculto por defecto */
    width: 100%;
    max-width: 600px;
    margin-top: 2.5rem;
    padding: 2rem;
    background-color: #1f1a2d;
    border: 1px solid var(--color-primario);
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.details-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primario);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.details-text {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* --- ENLACES SOCIALES --- */
.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-link {
    color: var(--color-texto);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--color-primario);
    border-radius: 25px;
    transition: background-color 0.3s, color 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-link:hover {
    background-color: var(--color-primario);
    color: var(--color-fondo);
}

/* --- ANIMACIÓN DE APARICIÓN --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- AJUSTES PARA MÓVILES (PANTALLAS HASTA 767px) --- */
@media (max-width: 767px) {
    .main-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .tarot-container {
        flex-wrap: nowrap; /* Forzamos a que estén siempre en una línea */
        gap: 0.5rem;       /* Reducimos el espacio entre ellas */
        padding-bottom: 1rem; /* Espacio para que la sombra se vea */
    }

    .card {
        width: 30vw;       /* Cada carta ocupa el 30% del ancho de la pantalla */
        height: calc(30vw * 1.58); /* Mantenemos la proporción de la carta (380/240) */
    }
    
    .details-section {
        margin-top: 1.5rem;
        padding: 1.5rem 1rem;
    }
}

/* --- PÁGINA DE GUÍA PDF --- */
body.pdf-viewer-page {
    display: flex;
    flex-direction: column;
    padding: 0; /* Reset padding para esta página */
    height: 100vh; /* Asegurar que ocupe toda la altura */
}

.pdf-viewer-page .back-button {
    padding: 1rem;
    background-color: #1a1625;
    color: var(--color-primario);
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    flex-shrink: 0;
    transition: background-color 0.3s;
}

.pdf-viewer-page .back-button:hover {
    background-color: #2a2438;
}

.pdf-viewer-page iframe {
    flex-grow: 1;
    border: none;
    width: 100%;
}
