/* public/styles/oracle.css */

/* 1. HUGE CARD CONTAINER */
.flip-card {
    background-color: transparent;
    width: 600px;
    height: 900px;
    max-width: 90vw;
    max-height: 85vh; 
    aspect-ratio: 2 / 3;
    perspective: 1000px;
    cursor: pointer;
    margin: 0 auto; 
}

/* Inner Container */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* FLIP LOGIC */
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* Front & Back Common Styles */
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; 
    border-radius: 20px; 
    overflow: hidden; 
    -webkit-backface-visibility: hidden;
}

/* --- THE BACK (Gold Side) --- */
.flip-card-back {
    background-color: #b08a48 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateY(0deg);
    border: 4px solid #fff;
    z-index: 2;
}

.flip-card-back i {
    color: #fff;
    font-size: 4rem;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* --- THE FRONT (Image + Text) --- */
.flip-card-front {
    background-color: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column; 
}

/* 1. The Image (Flex - Fills available space) */
.card-image-full {
    width: 100%;
    height: auto;
    flex: 1; /* Takes all remaining space */
    min-height: 0;
    
    /* FIX: Pin image to TOP so the head is never cut off */
    object-fit: cover; 
    object-position: top center; 
    
    display: block;
    border-bottom: 1px solid rgba(176, 138, 72, 0.3); 
}

/* 2. The Text Area (Auto height - Shrink wraps text) */
.card-overlay {
    position: relative; 
    height: auto;
    max-height: 50%;
    width: 100%;
    padding: 1.5rem;
    
    background: #fff;   
    color: #333;       
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Start text at the top */
    align-items: center;
    text-align: center;
    
    /* FIX: Enable scrolling for long descriptions */
    overflow-y: auto;
}

/* Typography */
.card-overlay h5 {
    font-family: serif; 
    font-size: 1.8rem;
    color: #b08a48; 
    margin-bottom: 1rem;
    font-weight: bold;
    flex-shrink: 0;
}

.card-overlay p {
    font-size: 1rem;
    line-height: 1.5;
    color: #444; 
    margin-bottom: 0;
    
    /* FIX: REMOVED LINE CLAMP - Text will flow naturally now */
    display: block;
}

/* Placeholder adjustments */
#cardPlaceholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #b08a48;
    background: rgba(176, 138, 72, 0.05);
    border-radius: 20px;
}