/* Postcard Component Styles */

.postcard-container {
    perspective: 1000px;
    cursor: pointer;
}

.postcard-card {
    width: 400px;
    height: 250px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s;
}

.postcard-landing .postcard-card {
    width: min(480px, 90vw);
    height: calc(min(480px, 90vw) * 0.625);
}

.postcard-card.flipped {
    transform: rotateY(180deg);
}

.postcard-card.spoiler-flip {
    transform: rotateY(40deg);
}

.postcard-front,
.postcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.postcard-front {
    background: center/cover;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    color: white;
    text-shadow: 1px 1px 2px black;
}

.postcard-back {
    background: #F5F5F5;
    transform: rotateY(180deg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.postcard-stamp {
    width: 60px;
    height: 60px;
    background: #D32F2F;
    border-radius: 50%;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.postcard-stamp-top {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 80px;
    background: #D32F2F;
    border: 2px solid #000;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.postcard-address-line {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 11px;
    color: #333;
    font-weight: bold;
    border-bottom: 1px solid #333;
    padding-bottom: 3px;
    width: 120px;
    text-align: right;
}

.postcard-tell-more {
    cursor: pointer;
    transition: all 0.3s ease;
}

.postcard-tell-more:hover {
    color: #0066cc;
    border-bottom-color: #0066cc;
    transform: scale(1.05);
}

.postcard-frame-stamp {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.postcard-frame-stamp:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.postcard-frame-stamp img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.postcard-frame-text {
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    text-align: center;
    pointer-events: none;
    transition: all 0.3s ease;
}

.postcard-frame-stamp:hover .postcard-frame-text {
    color: #0066cc;
    font-size: 11px;
}

.postcard-text-container {
    flex: 1;
    height: 120px;
}

.postcard-back h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.postcard-frame {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.postcard-card.wiggle {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg) translateX(-1px); }
    50% { transform: rotate(2deg) translateX(1px); }
    75% { transform: rotate(-1deg) translateX(-0.5px); }
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    .postcard-card {
        width: 280px;
        height: 175px;
    }
    
    .postcard-front,
    .postcard-back {
        padding: 15px;
    }
    
    .postcard-stamp {
        width: 45px;
        height: 45px;
    }
    
    .postcard-stamp-top {
        width: 35px;
        height: 60px;
        top: 15px;
        right: 15px;
    }
    
    .postcard-address-line {
        bottom: 15px;
        right: 15px;
        font-size: 9px;
        width: 90px;
    }
    
    .postcard-frame-stamp {
        width: 25px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .postcard-frame-text {
        font-size: 8px;
    }
    
    .postcard-frame-stamp:hover .postcard-frame-text {
        font-size: 9px;
    }
    
    .postcard-text-container {
        height: 90px;
    }
    
    .postcard-back h3 {
        font-size: 12px;
    }
}

