/* ===== RESET & BASE STYLES ===== */
.plaidcars-homepage * {
    box-sizing: border-box;
}

.plaidcars-homepage body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica', Arial, sans-serif;
    line-height: 1.6;
    color: #000000;
    background-color: #FFFFFF;
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

.plaidcars-homepage {
    overflow-x: hidden; /* Prevent horizontal overflow */
    width: 100%;
    max-width: 100vw;
}

/* ===== UTILITY CLASSES ===== */
.plaidcars-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}


/* ===== TYPOGRAPHY ===== */
.plaidcars-homepage h1 {
    color: #990000;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.plaidcars-homepage h2 {
    color: #990000;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.plaidcars-homepage h3 {
    color: #990000;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.plaidcars-section-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    color: #990000;
    font-size: 2rem;
    font-weight: 700;
}

.plaidcars-section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #990000;
    margin: 1rem auto 0;
}

/* ===== BUTTONS ===== */
/* Using WordPress core button blocks with custom secondary styling */
.plaidcars-hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

/* Custom secondary button styling */
.plaidcars-hero-buttons .wp-block-button.is-style-outline .wp-block-button__link {
    background-color: white;
    color: #990000;
    border: 2px solid #990000;
    border-radius: 4px;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.plaidcars-hero-buttons .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: #990000;
    color: white;
    border-color: #990000;
}

/* ===== HERO BANNER ===== */
.plaidcars-hero-banner {
    position: relative;
    height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
}

.plaidcars-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.plaidcars-hero-content {
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 2rem;
    width: 100%;
}

.plaidcars-hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #990000;
}

.plaidcars-hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #FFFFFF;
}

/* ===== CAROUSEL ===== */
.plaidcars-carousel {
    padding: 4rem 0;
    background-color: #F8F9FA;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
}

.plaidcars-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.plaidcars-carousel-wrapper {
    overflow: hidden;
    position: relative;
}

.plaidcars-carousel-track {
    display: flex;
    width: 100%;
}

.plaidcars-carousel-item {
    flex: 0 0 100%;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

.plaidcars-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #990000;
    color: #990000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10;
}

.plaidcars-carousel-nav:focus {
    background: #990000;
    color: white;
}

.plaidcars-carousel-prev {
    left: 10px;
}

.plaidcars-carousel-next {
    right: 10px;
}

.plaidcars-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.plaidcars-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #DDD;
    cursor: pointer;
    border: none;
}

.plaidcars-indicator.active {
    background: #990000;
}

/* ===== CARDS ===== */
.plaidcars-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.plaidcars-card-image {
    width: 100%;
    height: 225px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.plaidcars-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.plaidcars-card-icon {
    text-align: center;
    margin-bottom: 1rem;
}

.plaidcars-card-icon img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.plaidcars-card-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Pillar card modifier */
.plaidcars-card.plaidcars-pillar-card {
    text-align: center;
    background: #F8F9FA;
    border-radius: 8px;
    padding: 2rem;
    height: 100%;
}

.plaidcars-card-content {
    padding: 1.5rem;
}

.plaidcars-card-title {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

.plaidcars-card-excerpt {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.plaidcars-read-more {
    color: #990000;
    text-decoration: none;
    font-weight: 500;
}

.plaidcars-read-more:focus {
    color: #CC0000;
    text-decoration: underline;
}

/* ===== GRID SYSTEM ===== */
.plaidcars-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.plaidcars-grid.plaidcars-grid-3 {
    justify-content: center;
}

.plaidcars-grid.plaidcars-grid-posts {
    justify-content: center;
}

/* Modern grid support */
@supports (display: grid) {
    .plaidcars-grid.plaidcars-grid-3 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
        margin: 0;
    }

    .plaidcars-grid.plaidcars-grid-posts {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 2rem;
        margin: 0;
    }
}

/* ===== CONTENT SECTIONS ===== */
.plaidcars-content-pillars {
    padding: 4rem 0;
    background: white;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ===== RECENT POSTS ===== */
.plaidcars-recent-posts {
    padding: 4rem 0;
    background: #F8F9FA;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.plaidcars-posts-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.plaidcars-filter-btn {
    background: white;
    border: 2px solid #DDD;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    box-sizing: border-box;
}

.plaidcars-filter-btn.active {
    background: #990000;
    border-color: #990000;
    color: white;
}



.plaidcars-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.plaidcars-card-category {
    background: #990000;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
}



/* ===== NEWSLETTER ===== */
.plaidcars-newsletter-cta {
    padding: 4rem 0;
    background: linear-gradient(135deg, #990000 0%, #CC0000 100%);
    color: white;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.plaidcars-newsletter-content {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
}

.plaidcars-newsletter-text {
    flex: 1;
}

.plaidcars-newsletter-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.plaidcars-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.plaidcars-stat-item {
    text-align: center;
}

.plaidcars-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.plaidcars-stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.plaidcars-newsletter-form {
    flex: 1;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.plaidcars-newsletter-form h3 {
    color: #990000;
    margin-bottom: 1.5rem;
}

.plaidcars-form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.plaidcars-form-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #DDD;
    border-radius: 5px;
    font-size: 1rem;
}

.plaidcars-form-group input:focus {
    outline: none;
    border-color: #990000;
}

.plaidcars-privacy-note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
}

/* ===== SOCIAL LINKS ===== */
.plaidcars-social-links {
    text-align: center;
    margin-bottom: 2rem;
}

.plaidcars-social-links h3 {
    color: white;
    margin-bottom: 1rem;
}

.plaidcars-social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.plaidcars-social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: white;
}

.plaidcars-social-link:focus {
    opacity: 0.8;
}

.plaidcars-social-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
    color: white;
}

.plaidcars-social-link:focus .plaidcars-social-icon {
    color: #990000;
}

.plaidcars-social-link.x-twitter {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
}

.plaidcars-social-label {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== TWITTER FEED ===== */
.plaidcars-twitter-feed {
    text-align: center;
    margin-top: 2rem;
}

.plaidcars-twitter-feed h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.plaidcars-twitter-embed {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    overflow: hidden;
}

.plaidcars-twitter-embed iframe {
    max-width: 100%;
    border: none;
}

/* ===== LOADING & ANIMATIONS ===== */
.plaidcars-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
}

.plaidcars-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.plaidcars-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #F3F3F3;
    border-top: 4px solid #990000;
    border-radius: 50%;
    animation: plaidcars-spin 1s linear infinite;
}

@keyframes plaidcars-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MODAL ===== */
.plaidcars-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.plaidcars-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.plaidcars-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
}

.plaidcars-modal-overlay.active .plaidcars-modal-content {
    transform: scale(1);
}

.plaidcars-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    z-index: 1001;
}

.plaidcars-modal-body {
    padding: 2rem;
}

.plaidcars-modal-title {
    color: #990000;
    margin-bottom: 1rem;
}

.plaidcars-modal-excerpt {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ===== NOTIFICATIONS ===== */
.plaidcars-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #990000;
    color: white;
    padding: 1rem 2rem;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateX(100%);
}

.plaidcars-notification.show {
    transform: translateX(0);
}

.plaidcars-notification-success {
    background: #28a745;
}

.plaidcars-notification-error {
    background: #dc3545;
}

/* ===== X/TWITTER SPECIFIC STYLING ===== */
.plaidcars-social-link.x-twitter {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.plaidcars-social-link.x-twitter:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== ADDITIONAL OVERFLOW PREVENTION ===== */
.plaidcars-carousel-track {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.plaidcars-carousel-item {
    flex: 0 0 100%;
    min-width: 0; /* Prevent flex item overflow */
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

/* ===== ADDITIONAL LAYOUT FIXES ===== */
/* Ensure all content is constrained */
.plaidcars-container,
.plaidcars-hero-content,
.plaidcars-newsletter-content {
    box-sizing: border-box;
    max-width: 100%;
}


.plaidcars-form-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .plaidcars-hero-title {
        font-size: 2rem;
    }

    .plaidcars-hero-subtitle {
        font-size: 1rem;
    }

    .plaidcars-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .plaidcars-carousel-nav {
        display: none;
    }

    /* Force single column layout on mobile */

    .plaidcars-newsletter-content {
        flex-direction: column;
        gap: 2rem;
    }

    .plaidcars-posts-filter {
        flex-direction: column;
        align-items: center;
    }

    .plaidcars-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .plaidcars-social-icons {
        flex-direction: column;
        gap: 1rem;
    }

    .plaidcars-form-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .plaidcars-form-group input,
    .plaidcars-form-group button {
        width: 100%;
        box-sizing: border-box;
    }

    .plaidcars-container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .plaidcars-hero-content {
        padding: 1rem;
    }

    .plaidcars-hero-title {
        font-size: 1.75rem;
    }


    .plaidcars-section-title {
        font-size: 1.5rem;
    }

    .plaidcars-card-content {
        padding: 1rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .plaidcars-homepage *,
    .plaidcars-homepage *::before,
    .plaidcars-homepage *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
.plaidcars-filter-btn:focus,
.plaidcars-social-link:focus,
.plaidcars-read-more:focus,
.plaidcars-carousel-nav:focus {
    outline: 2px solid #990000;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .plaidcars-carousel-nav,
    .plaidcars-newsletter-form,
    .plaidcars-social-links {
        display: none !important;
    }

    .plaidcars-hero-banner {
        background: white !important;
        color: black !important;
    }

    .plaidcars-hero-overlay {
        background: transparent !important;
    }
}