/* 
 * News Cards Lumina - Stili per schede graficamente accattivanti
 * Version: 1.0.1
 */

/* Container principale */
.ncl-news-cards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Griglia delle card */
.ncl-news-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Layout masonry */
.ncl-layout-masonry .ncl-news-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Layout lista */
.ncl-layout-list .ncl-news-cards-grid {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

/* Singola card */
.ncl-news-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #f0f0f0;
}

.ncl-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
}

/* Immagine con taglio top CENTRATO */
.ncl-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.ncl-featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top; /* ✅ Taglio top centrato */
    transition: transform 0.5s ease;
    display: block;
}

.ncl-news-card:hover .ncl-featured-image {
    transform: scale(1.05);
}

/* Contenuto della card */
.ncl-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Header della card */
.ncl-card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.ncl-card-title {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    line-height: 1.3;
    font-weight: 700;
    color: #2c3e50;
}

.ncl-card-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.ncl-card-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Body della card */
.ncl-card-body {
    flex-grow: 1;
}

/* ✅ Contenuto HTML personalizzato - RISOLTO DUPLICAZIONE */
.ncl-card-html-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #2c3e50;
    font-family: inherit;
}

.ncl-card-html-content p {
    margin: 0 0 15px 0;
}

.ncl-card-html-content p:last-child {
    margin-bottom: 0;
}

.ncl-card-html-content h1,
.ncl-card-html-content h2,
.ncl-card-html-content h3,
.ncl-card-html-content h4,
.ncl-card-html-content h5,
.ncl-card-html-content h6 {
    margin: 20px 0 15px 0;
    color: #2c3e50;
    font-weight: 600;
}

.ncl-card-html-content h1 { font-size: 1.8rem; }
.ncl-card-html-content h2 { font-size: 1.6rem; }
.ncl-card-html-content h3 { font-size: 1.4rem; }
.ncl-card-html-content h4 { font-size: 1.2rem; }

.ncl-card-html-content ul,
.ncl-card-html-content ol {
    margin: 0 0 15px 20px;
    padding: 0;
}

.ncl-card-html-content li {
    margin-bottom: 8px;
}

.ncl-card-html-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.ncl-card-html-content a:hover {
    border-bottom-color: #3498db;
}

.ncl-card-html-content blockquote {
    border-left: 4px solid #3498db;
    margin: 20px 0;
    padding: 10px 20px;
    font-style: italic;
    background: #f8f9fa;
}

.ncl-card-html-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Messaggio nessuna card */
.ncl-no-cards {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 1.1rem;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ncl-news-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .ncl-card-content {
        padding: 20px;
    }
    
    .ncl-card-title {
        font-size: 1.2rem;
    }
    
    .ncl-card-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .ncl-news-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .ncl-news-cards-container {
        padding: 15px;
    }
    
    .ncl-card-image {
        height: 160px;
    }
    
    .ncl-card-content {
        padding: 18px;
    }
}

/* Supporto per dark mode */
@media (prefers-color-scheme: dark) {
    .ncl-news-card {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .ncl-card-title,
    .ncl-card-html-content,
    .ncl-card-html-content h1,
    .ncl-card-html-content h2,
    .ncl-card-html-content h3,
    .ncl-card-html-content h4,
    .ncl-card-html-content h5,
    .ncl-card-html-content h6 {
        color: #ecf0f1;
    }
    
    .ncl-card-header {
        border-bottom-color: #34495e;
    }
    
    .ncl-card-html-content blockquote {
        background: #34495e;
        border-left-color: #3498db;
    }
    
    .ncl-card-html-content code {
        background: #34495e;
    }
    
    .ncl-no-cards {
        background: #34495e;
        border-color: #4a6572;
        color: #bdc3c7;
    }
}