/* Latest Posts Grid - Mobile First Responsive Design */

/* Base container - Mobile First */
.lpg-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tablet - 2 columns */
@media (min-width: 768px) {
    .lpg-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 20px;
    }
}

/* Small Desktop - 3 columns */
@media (min-width: 1024px) {
    .lpg-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        padding: 24px;
    }
}

/* Large Desktop - 4 columns */
@media (min-width: 1200px) {
    .lpg-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
        padding: 28px;
    }
}

/* Post item container */
.lpg-post-item {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 12px;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Card styling */
.lpg-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Enhanced hover effects */
.lpg-card:hover {
    border: 2px solid #7B5FB4;
    box-shadow: 0 8px 25px rgba(123, 95, 180, 0.15);
    transform: translateY(-1px);
}

/* Image container */
.lpg-card .lpg-image {
    background-color: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    height: 160px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 8px;
    position: relative;
}

/* Responsive image heights */
@media (min-width: 768px) {
    .lpg-card .lpg-image {
        height: 180px;
    }
}

@media (min-width: 1024px) {
    .lpg-card .lpg-image {
        height: 200px;
    }
}

@media (min-width: 1200px) {
    .lpg-card .lpg-image {
        height: 220px;
    }
}

/* Image styling */
.lpg-card .lpg-image img {
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Image hover effect */
.lpg-card:hover .lpg-image img {
    transform: scale(1.05);
}

/* Title styling */
.lpg-card h2 {
    font-size: 1rem;
    margin: 0 0 12px 0;
    flex-grow: 1;
    color: #000000;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive title sizes */
@media (min-width: 768px) {
    .lpg-card h2 {
        font-size: 1.1rem;
    }
}

@media (min-width: 1024px) {
    .lpg-card h2 {
        font-size: 1.2rem;
    }
}

/* Price styling */
.lpg-card .lpg-price {
    color: #000000;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

/* Responsive price sizes */
@media (min-width: 768px) {
    .lpg-card .lpg-price {
        font-size: 1.6rem;
    }
}

@media (min-width: 1024px) {
    .lpg-card .lpg-price {
        font-size: 1.8rem;
    }
}

/* Score badge styling */
.lpg-score {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border-radius: 50%;
    box-sizing: border-box;
    text-align: center;
    width: 55px;
    height: 55px;
    position: absolute;
    top: 8px;
    right: 8px;
    border: 3px solid #7B5FB4;
    box-shadow: 0 2px 8px rgba(123, 95, 180, 0.2);
    z-index: 2;
}

/* Responsive score badge sizes */
@media (min-width: 768px) {
    .lpg-score {
        width: 60px;
        height: 60px;
        padding: 8px;
        top: 12px;
        right: 12px;
    }
}

@media (min-width: 1024px) {
    .lpg-score {
        width: 65px;
        height: 65px;
        padding: 10px;
        top: 16px;
        right: 16px;
    }
}

@media (min-width: 1200px) {
    .lpg-score {
        width: 70px;
        height: 70px;
        padding: 12px;
        top: 20px;
        right: 20px;
    }
}

/* Score text styling */
.lpg-score-text {
    margin: 0 !important;
    font-size: 1.1rem !important;
    color: #7B5FB4 !important;
    line-height: 1 !important;
    font-weight: 700 !important;
}

/* Responsive score text sizes */
@media (min-width: 768px) {
    .lpg-score-text {
        font-size: 1.2rem !important;
    }
}

@media (min-width: 1024px) {
    .lpg-score-text {
        font-size: 1.3rem !important;
    }
}

@media (min-width: 1200px) {
    .lpg-score-text {
        font-size: 1.5rem !important;
    }
}

/* Score label text */
.lpg-score p {
    margin: 0 !important;
    font-size: 0.45rem !important;
    color: #7B5FB4;
    line-height: 1.1;
    font-weight: 600;
}

/* Responsive score label sizes */
@media (min-width: 768px) {
    .lpg-score p {
        font-size: 0.5rem !important;
    }
}

@media (min-width: 1024px) {
    .lpg-score p {
        font-size: 0.55rem !important;
    }
}

@media (min-width: 1200px) {
    .lpg-score p {
        font-size: 0.6rem !important;
    }
}

/* Mobile specific enhancements */
@media (max-width: 767px) {
    .lpg-container {
        padding: 12px;
        gap: 12px;
    }
    
    .lpg-card {
        padding: 12px;
        border-radius: 10px;
    }
    
    .lpg-card .lpg-image {
        height: 140px;
        margin-bottom: 12px;
        padding: 6px;
    }
    
    .lpg-score {
        width: 50px;
        height: 50px;
        padding: 5px;
        top: 6px;
        right: 6px;
        border-width: 2px;
    }
    
    .lpg-score-text {
        font-size: 1rem !important;
    }
    
    .lpg-score p {
        font-size: 0.4rem !important;
    }
}

/* Tablet specific enhancements */
@media (min-width: 768px) and (max-width: 1023px) {
    .lpg-container {
        padding: 16px;
        gap: 18px;
    }
    
    .lpg-card {
        padding: 14px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .lpg-card:hover {
        transform: none;
        border: 1px solid #e8e8e8;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .lpg-card:hover .lpg-image img {
        transform: none;
    }
    
    .lpg-card:active {
        transform: scale(0.98);
        border: 2px solid #7B5FB4;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .lpg-card {
        border: 2px solid #000;
    }
    
    .lpg-card:hover {
        border: 3px solid #7B5FB4;
    }
    
    .lpg-score {
        border: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .lpg-card,
    .lpg-card .lpg-image img {
        transition: none;
    }
    
    .lpg-card:hover {
        transform: none;
    }
    
    .lpg-card:hover .lpg-image img {
        transform: none;
    }
}

/* Focus styles for accessibility */
.lpg-card:focus {
    outline: 2px solid #7B5FB4;
    outline-offset: 2px;
}

.lpg-card:focus:not(:focus-visible) {
    outline: none;
}

/* Print styles */
@media print {
    .lpg-container {
        display: block;
        padding: 0;
    }
    
    .lpg-post-item {
        break-inside: avoid;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .lpg-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .lpg-score {
        position: static;
        margin-bottom: 10px;
    }
}


