/* Dynamic Blog Excerpts Styles */
.dynamic-blog-excerpts {
    margin: 20px 0;
    clear: both;
}

/* Layout Grid (default) */
.dbe-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: start;
}

/* Layout List */
.dbe-layout-list .dbe-excerpt-item {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.dbe-layout-list .dbe-thumbnail {
    flex: 0 0 150px;
    margin-right: 20px;
}

.dbe-layout-list .dbe-content {
    flex: 1;
}

/* Layout Carousel */
.dbe-layout-carousel {
    overflow-x: auto;
    display: flex;
    gap: 20px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.dbe-layout-carousel .dbe-excerpt-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

/* Stili comuni per gli estratti */
.dbe-excerpt-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.dbe-excerpt-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Thumbnail */
.dbe-thumbnail {
    overflow: hidden;
    position: relative;
}

.dbe-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dbe-excerpt-item:hover .dbe-thumbnail img {
    transform: scale(1.05);
}

.dbe-thumbnail a {
    display: block;
    line-height: 0;
}

/* Content */
.dbe-content {
    padding: 20px;
}

/* Meta informazioni */
.dbe-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: #666;
}

.dbe-category {
    background: #007cba;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dbe-date,
.dbe-author {
    color: #888;
}

.dbe-date::before {
    content: "📅 ";
    margin-right: 2px;
}

.dbe-author::before {
    content: "✍️ ";
    margin-right: 2px;
}

/* Titolo */
.dbe-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    line-height: 1.3;
}

.dbe-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dbe-title a:hover {
    color: #007cba;
}

/* Estratto */
.dbe-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Link "Leggi tutto" */
.dbe-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.dbe-read-more:hover {
    color: #005a87;
    border-bottom-color: #005a87;
    gap: 8px;
}

/* Messaggio nessun post */
.dbe-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* Responsive */
@media (max-width: 768px) {
    .dbe-layout-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dbe-layout-list .dbe-excerpt-item {
        flex-direction: column;
    }
    
    .dbe-layout-list .dbe-thumbnail {
        flex: none;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .dbe-layout-carousel .dbe-excerpt-item {
        flex: 0 0 280px;
    }
    
    .dbe-content {
        padding: 15px;
    }
    
    .dbe-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .dynamic-blog-excerpts {
        margin: 15px 0;
    }
    
    .dbe-layout-carousel .dbe-excerpt-item {
        flex: 0 0 250px;
    }
    
    .dbe-thumbnail img {
        height: 150px;
    }
}

/* Stili per accessibilità */
@media (prefers-reduced-motion: reduce) {
    .dbe-excerpt-item,
    .dbe-thumbnail img,
    .dbe-title a,
    .dbe-read-more {
        transition: none;
    }
    
    .dbe-excerpt-item:hover {
        transform: none;
    }
    
    .dbe-excerpt-item:hover .dbe-thumbnail img {
        transform: none;
    }
}

/* Modalità scura */
@media (prefers-color-scheme: dark) {
    .dbe-excerpt-item {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .dbe-title a {
        color: #e0e0e0;
    }
    
    .dbe-title a:hover {
        color: #4a9eff;
    }
    
    .dbe-excerpt {
        color: #c0c0c0;
    }
    
    .dbe-read-more {
        color: #4a9eff;
    }
    
    .dbe-read-more:hover {
        color: #66b3ff;
    }
    
    .dbe-no-posts {
        background: #333;
        color: #ccc;
        border-color: #555;
    }
}