/* --- Masonry Grid --- */
.pe-masonry-grid {
    display: grid;
    gap: 32px;
    margin-top: 40px;
    grid-template-columns: 1fr;
}
@media (min-width: 600px) { .pe-masonry-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pe-masonry-grid { grid-template-columns: repeat(3, 1fr); } }

/* --- Visual Card Design --- */
.pe-card.pe-card-visual {
    padding: 0 !important;       
    background: #1e293b;      
    border: none;                
    border-radius: 32px;         
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4; 
    box-shadow: 0 10px 40px -10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; 
    isolation: isolate;
}

.pe-card-visual:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px -12px rgba(0,0,0,0.5);
}

/* Background Image */
.pe-card-bg {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; 
    z-index: 0;
}
.pe-card-bg img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s ease;
}
.pe-card-visual:hover .pe-card-bg img { transform: scale(1.08); }

/* Floating Header */
.pe-card-header-floating {
    position: absolute; top: 24px; left: 24px; right: 24px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 2; 
    pointer-events: none;
}
.pe-card-header-floating > * { pointer-events: auto; }

/* Bottom Overlay */
.pe-card-overlay {
    position: absolute; bottom: 0; left: 0; 
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 40%, rgba(0,0,0,0) 100%);
    padding: 120px 24px 28px 24px; 
    z-index: 2;
    display: flex; flex-direction: column; justify-content: flex-end;
    pointer-events: none; 
}

.pe-card-prompt-text {
    margin: 0 0 24px 0; 
    font-size: 0.95rem; 
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95); 
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    pointer-events: none; 
}

/* Actions Row */
.pe-card-actions { 
    display: flex; justify-content: space-between; align-items: center; 
    pointer-events: auto; 
    position: relative;
    z-index: 10;
}

.pe-card-author { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); font-weight: 500; }

/* Badges */
.pe-badge-pill {
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 1px 10px; border-radius: 100px;
    font-size: 0.7rem; font-weight: 800; letter-spacing: 1px;
    text-transform: uppercase; display: flex; align-items: center;
    gap: 6px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}
.pe-badge-pill:hover {
    transform: scale(1.05);
}

.pe-badge-dark {
    background: rgba(0, 0, 0, 0.6); color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Top Right Like Badge Status */
.pe-like-badge.liked svg {
    fill: #ef4444; 
    stroke: #ef4444;
}

/* Buttons */
.pe-btn-glassy {
    background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.2);
    color: white; padding: 10px 20px; border-radius: 100px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: 0.2s; backdrop-filter: blur(8px);
    pointer-events: auto; position: relative; z-index: 10; 
}
.pe-btn-glassy:hover {
    background: rgba(255, 255, 255, 0.25); transform: translateY(-1px);
}

/* Like Button State */
.js-like-btn.liked {
    background: rgba(239, 68, 68, 0.3); 
    border-color: #ef4444;
}
.js-like-btn.liked svg {
    fill: #ef4444;
    stroke: #ef4444;
}

/* Legacy Card */
.pe-card { 
    background: var(--bg-surface); 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: 0 2px 4px var(--shadow-color); 
    border: 1px solid var(--border-color); 
    padding: 20px; 
}

/* ---------------------------------------------------------
   SKELETON LOADING (NEW)
   --------------------------------------------------------- */
@keyframes peSkeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.pe-skeleton-item {
    pointer-events: none !important;
    cursor: default !important;
    position: relative;
    background: #1e293b; /* Match visual card bg */
}

/* Animated Background (The Shimmer) */
.pe-skeleton-animate {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    background-size: 200% 100%;
    animation: peSkeletonShimmer 1.5s infinite linear;
    z-index: 0;
}
/* Light Mode Adjustment for Skeleton Base */
@media (prefers-color-scheme: light) {
    [data-theme="light"] .pe-skeleton-item { background: #e2e8f0; }
    [data-theme="light"] .pe-skeleton-animate {
        background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
    }
}

/* Skeleton Elements */
.pe-skeleton-badge {
    width: 70px; height: 22px; border-radius: 50px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
}
.pe-skeleton-badge.right { width: 40px; }

.pe-skeleton-line {
    height: 12px; margin-bottom: 10px; border-radius: 4px;
    background: rgba(255,255,255,0.15);
    width: 100%;
}
.pe-skeleton-line.w-80 { width: 80%; }
.pe-skeleton-line.w-60 { width: 60%; }

.pe-skeleton-btn {
    width: 80px; height: 38px; border-radius: 50px;
    background: rgba(255,255,255,0.15);
}
.pe-skeleton-author {
    width: 90px; height: 14px; border-radius: 4px;
    background: rgba(255,255,255,0.15);
}