/**
 * Mulberry Homepage V2 - Performance Optimized CSS
 * 
 * This file contains consolidated CSS classes to replace inline styles
 * and improve Core Web Vitals performance metrics
 * 
 * @version 2.0.0 - Performance Optimized
 * @author Go Agency - Paul Roffey
 */

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Consolidated Button Classes
   Replaces duplicate inline styles throughout the template
   ============================================================================ */

.mulberry-btn-primary {
    background-color: #5b3897;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

.mulberry-btn-primary:hover {
    background-color: #4a2e7a;
    color: white;
}

.mulberry-btn-secondary {
    background-color: transparent;
    color: #5b3897;
    padding: 12px 24px;
    border: 2px solid #5b3897;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
}

.mulberry-btn-secondary:hover {
    background-color: #5b3897;
    color: white;
}

.mulberry-btn-outline {
    background-color: transparent;
    color: #5b3897;
    padding: 10px 20px;
    border: 1px solid #5b3897;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mulberry-btn-outline:hover {
    background-color: #5b3897;
    color: white;
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Hero Section Background Classes
   Consolidates repeated background image styles
   ============================================================================ */

.mulberry-hero-bg-image {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.mulberry-hero-v2-bg-wrapper {
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 500px;
}

@media (max-width: 768px) {
    .mulberry-hero-v2-bg-wrapper {
        min-height: 300px;
    }
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Button Group Layouts
   Standardizes button container spacing and alignment
   ============================================================================ */

.mulberry-hero-button-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.mulberry-ceo-button-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

@media (max-width: 480px) {
    .mulberry-ceo-button-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .mulberry-ceo-button-group a {
        text-align: center;
        width: 100%;
    }
    
    /* Keep mobile hero buttons side-by-side */
    .mulberry-mobile-hero-buttons {
        flex-direction: row !important;
        gap: 10px !important;
    }
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Panel and Card Classes
   Reduces CSS redundancy across trust panels and masonry sections
   ============================================================================ */

.mulberry-panels-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    padding: 40px 0;
}

.mulberry-panel-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.mulberry-panel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.mulberry-panel-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mulberry-trust-icon,
.mulberry-trust-icon-svg {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.mulberry-panel-title {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.mulberry-panel-content {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Masonry Panel Background Classes
   Standardizes background image handling for better loading
   ============================================================================ */

.mulberry-masonry-panel-bg {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.mulberry-masonry-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.mulberry-chevron-icon {
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: News Section Classes
   Consolidates news card styles and improves loading performance
   ============================================================================ */

.mulberry-news-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.mulberry-school-news-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.mulberry-news-card {
    background: white;
    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;
}

.mulberry-news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.mulberry-news-banner {
    color: white;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mulberry-news-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.mulberry-news-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mulberry-news-card:hover .mulberry-news-thumbnail {
    transform: scale(1.05);
}

.mulberry-news-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: white;
    font-weight: 700;
    font-size: 24px;
}

.mulberry-news-initial {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mulberry-news-content {
    padding: 20px;
}

.mulberry-news-meta {
    margin-bottom: 10px;
}

.mulberry-news-date {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mulberry-news-title {
    margin-bottom: 12px;
    font-size: 18px;
    line-height: 1.4;
}

.mulberry-news-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mulberry-news-title a:hover {
    color: #5b3897;
}

.mulberry-news-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.mulberry-read-more {
    color: #5b3897;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.mulberry-read-more:hover {
    color: #4a2e7a;
}

.mulberry-arrow {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.mulberry-read-more:hover .mulberry-arrow {
    transform: translateX(3px);
}

.mulberry-news-section-title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.3;
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Image Placeholder and Loading States
   Prevents layout shifts during image loading (CLS improvement)
   ============================================================================ */

.mulberry-image-placeholder {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    min-height: 200px;
    border-radius: 4px;
}

.mulberry-ceo-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Responsive Utilities
   Mobile-first approach for better performance on mobile devices
   ============================================================================ */

.mulberry-hero-desktop-section {
    display: block;
}

@media (max-width: 768px) {
    .mulberry-hero-desktop-section {
        display: none;
    }
    
    .mulberry-panels-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 0;
    }
    
    .mulberry-panel-card {
        padding: 20px;
    }
    
    .mulberry-news-section-title {
        font-size: 24px;
    }
    
    .mulberry-school-news-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Focus and Accessibility States
   Improves accessibility without impacting performance
   ============================================================================ */

.mulberry-btn-primary:focus,
.mulberry-btn-secondary:focus,
.mulberry-btn-outline:focus {
    outline: 2px solid #5b3897;
    outline-offset: 2px;
}

.mulberry-news-title a:focus {
    outline: 2px solid #5b3897;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Reduced Motion Support
   Respects user preferences for reduced motion
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .mulberry-btn-primary,
    .mulberry-btn-secondary,
    .mulberry-btn-outline,
    .mulberry-panel-card,
    .mulberry-news-card,
    .mulberry-news-thumbnail,
    .mulberry-read-more,
    .mulberry-arrow {
        transition: none;
    }
    
    .mulberry-panel-card:hover,
    .mulberry-news-card:hover {
        transform: none;
    }
    
    .mulberry-news-card:hover .mulberry-news-thumbnail {
        transform: none;
    }
    
    .mulberry-read-more:hover .mulberry-arrow {
        transform: none;
    }
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION: Print Styles
   Optimized for printing while maintaining performance
   ============================================================================ */

@media print {
    .mulberry-hero-button-group,
    .mulberry-ceo-button-group,
    .mulberry-btn-primary,
    .mulberry-btn-secondary,
    .mulberry-btn-outline,
    .mulberry-read-more {
        display: none;
    }
    
    .mulberry-news-card,
    .mulberry-panel-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}