/**
 * Blog Posts Grid Styles
 *
 * Styles für die Blog-Sektion (sowohl Fallback als auch Pattern)
 *
 * Features:
 * - Responsive Grid-Layout (1/2/3 Spalten)
 * - Card-basiertes Design
 * - Hover-Effekte
 * - Accessibility-optimiert
 *
 * Verwendung:
 * - Fallback-Sektion in front-page.php
 * - Gutenberg Block Pattern "Blog Posts Grid"
 *
 * @package SLV_Transporte
 * @version 1.0.0
 */

/* ============================================
   BASE STYLES
   ============================================ */

.latest-posts {
    padding: 4rem 0;
    background: #f8f9fa;
}

.latest-posts h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #2c3e50;
}

/* ============================================
   POSTS GRID
   ============================================ */

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 0 auto;
}

/* Tablet: 2 Spalten */
@media (min-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 Spalten */
@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   POST CARD
   ============================================ */

.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ============================================
   POST THUMBNAIL
   ============================================ */

.post-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e9ecef;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card__image img {
    transform: scale(1.05);
}

/* ============================================
   POST CONTENT
   ============================================ */

.post-card h3 {
    margin: 1.5rem 1.5rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card h3 a:hover {
    color: #5cb8e9;
}

.post-card .post-excerpt {
    margin: 0 1.5rem 1rem;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.post-card .read-more {
    display: inline-block;
    margin: 0 1.5rem 1.5rem;
    padding: 0.5rem 1.25rem;
    background: #5cb8e9;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.post-card .read-more:hover {
    background: #4a9fd4;
}

/* ============================================
   GUTENBERG QUERY LOOP COMPATIBILITY
   ============================================ */

/* Query Loop template (entfernt List-Styling) */
.wp-block-post-template {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Post Card innerhalb Query Loop (volle Höhe) */
.wp-block-post-template .post-card {
    height: 100%;
}

/* Post Template Grid Layout (automatische Spalten) */
.wp-block-post-template.is-flex-container {
    display: grid;
    gap: 2rem;
}

/* Responsive Grid für Post Template */
@media (max-width: 767px) {
    .wp-block-post-template.is-flex-container {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .wp-block-post-template.is-flex-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .wp-block-post-template.is-flex-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   GUTENBERG BLOCK ELEMENTS
   ============================================ */

/* Post Featured Image in Card */
.post-card .wp-block-post-featured-image {
    margin: 0;
}

.post-card .wp-block-post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Post Title in Card */
.post-card .wp-block-post-title {
    margin: 1.5rem 1.5rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-card .wp-block-post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card .wp-block-post-title a:hover {
    color: #5cb8e9;
}

/* Post Excerpt in Card */
.post-card .wp-block-post-excerpt {
    margin: 0 1.5rem 1rem;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.post-card .wp-block-post-excerpt__excerpt {
    margin: 0;
}

.post-card .wp-block-post-excerpt__more-text {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: #5cb8e9;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.post-card .wp-block-post-excerpt__more-text:hover {
    background: #4a9fd4;
}

/* Post Date in Card */
.post-card .wp-block-post-date {
    margin: 0 1.5rem 1.5rem;
    color: #666;
    font-size: 0.875rem;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.post-card a:focus {
    outline: 2px solid #5cb8e9;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .post-card,
    .post-card__image img,
    .post-card h3 a,
    .post-card .read-more,
    .post-card .wp-block-post-excerpt__more-text {
        transition: none;
    }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.wp-block-query .wp-block-query-no-results {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
}
