/**
 * Featured News Block - Frontend Styles
 * Place this file in your theme's /blocks/featured-news/ directory
 */

/* CSS Variables for News Block */
:root {
    --news-primary-blue: #3258c2;
    --news-dark-blue: #1a2b5a;
    --news-text-dark: #333333;
    --news-text-gray: #666666;
    --news-border-light: #e0e0e0;
    --news-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --news-shadow-hover: 0 4px 10px rgba(0,0,0,0.15);
}

/* Main Section */
.wp-block-custom-featured-news {
    padding: 80px 20px;
    background-color: #f8f9fa;
    margin: 0;
}

.wp-block-custom-featured-news.alignfull {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.wp-block-custom-featured-news.alignwide {
    margin-left: calc(25% - 25vw);
    margin-right: calc(25% - 25vw);
    max-width: 100vw;
}

/* Container */
.wp-block-custom-featured-news .news-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Section Title */
.wp-block-custom-featured-news .news-section-title {
    font-size: 36px;
    margin-bottom: 50px;
    text-align: center;
    color: var(--news-dark-blue);
    font-weight: 700;
    letter-spacing: 1px;
}

/* Grid Layouts */
.wp-block-custom-featured-news .news-grid {
    display: grid;
    gap: 40px;
    margin-bottom: 40px;
}

.wp-block-custom-featured-news .news-grid-1 {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto 40px;
}

.wp-block-custom-featured-news .news-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wp-block-custom-featured-news .news-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.wp-block-custom-featured-news .news-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* News Item Card */
.wp-block-custom-featured-news .news-item {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: var(--news-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wp-block-custom-featured-news .news-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--news-shadow-hover);
}

/* Thumbnail */
.wp-block-custom-featured-news .news-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.wp-block-custom-featured-news .news-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.wp-block-custom-featured-news .news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wp-block-custom-featured-news .news-item:hover .news-thumbnail img {
    transform: scale(1.05);
}

/* Content Area */
.wp-block-custom-featured-news .news-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Date */
.wp-block-custom-featured-news .news-date {
    font-size: 12px;
    color: var(--news-text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: block;
    font-weight: 500;
}

/* Title */
.wp-block-custom-featured-news .news-title {
    font-size: 24px;
    margin: 0 0 15px 0;
    color: var(--news-primary-blue);
    line-height: 1.3;
    font-weight: 600;
}

.wp-block-custom-featured-news .news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.wp-block-custom-featured-news .news-title a:hover {
    color: var(--news-dark-blue);
    text-decoration: none;
}

/* Excerpt */
.wp-block-custom-featured-news .news-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--news-text-gray);
    margin-bottom: 20px;
    flex-grow: 1;
}

.wp-block-custom-featured-news .news-excerpt p {
    margin: 0;
}

/* Read More Link */
.wp-block-custom-featured-news .read-more {
    color: var(--news-primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
    margin-top: auto;
}

.wp-block-custom-featured-news .read-more:hover {
    color: var(--news-dark-blue);
    padding-left: 5px;
}

/* CTA Section */
.wp-block-custom-featured-news .news-cta {
    text-align: center;
    margin-top: 50px;
}

/* See All Button */
.wp-block-custom-featured-news .see-all-button {
    display: inline-block;
    background-color: var(--news-primary-blue);
    color: #ffffff;
    padding: 15px 40px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 2px solid var(--news-primary-blue);
    border-radius: 4px;
}

.wp-block-custom-featured-news .see-all-button:hover {
    background-color: transparent;
    color: var(--news-primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(50, 88, 194, 0.2);
}

/* No Posts Message */
.wp-block-custom-featured-news .no-posts-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--news-text-gray);
    font-size: 16px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: var(--news-shadow);
}

/* Special Layouts */
/* Featured/Hero style for single column */
.wp-block-custom-featured-news .news-grid-1 .news-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.wp-block-custom-featured-news .news-grid-1 .news-thumbnail {
    height: 100%;
    min-height: 300px;
}

.wp-block-custom-featured-news .news-grid-1 .news-content {
    padding: 40px;
}

.wp-block-custom-featured-news .news-grid-1 .news-title {
    font-size: 32px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .wp-block-custom-featured-news .news-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wp-block-custom-featured-news .news-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wp-block-custom-featured-news {
        padding: 60px 20px;
    }
    
    .wp-block-custom-featured-news .news-section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .wp-block-custom-featured-news .news-grid-2,
    .wp-block-custom-featured-news .news-grid-3,
    .wp-block-custom-featured-news .news-grid-4 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .wp-block-custom-featured-news .news-grid-1 .news-item {
        grid-template-columns: 1fr;
    }
    
    .wp-block-custom-featured-news .news-grid-1 .news-thumbnail {
        min-height: 200px;
    }
    
    .wp-block-custom-featured-news .news-grid-1 .news-content {
        padding: 30px;
    }
    
    .wp-block-custom-featured-news .news-grid-1 .news-title {
        font-size: 24px;
    }
    
    .wp-block-custom-featured-news .news-content {
        padding: 20px;
    }
    
    .wp-block-custom-featured-news .news-title {
        font-size: 20px;
    }
    
    .wp-block-custom-featured-news .see-all-button {
        padding: 12px 30px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .wp-block-custom-featured-news {
        padding: 40px 15px;
    }
    
    .wp-block-custom-featured-news .news-thumbnail {
        height: 150px;
    }
    
    .wp-block-custom-featured-news .news-content {
        padding: 15px;
    }
    
    .wp-block-custom-featured-news .news-title {
        font-size: 18px;
    }
    
    .wp-block-custom-featured-news .news-excerpt {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .wp-block-custom-featured-news .see-all-button {
        display: none;
    }
    
    .wp-block-custom-featured-news .news-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--news-border-light);
    }
}