/* This Week Featured Section Styles */
.featured {
    background: #f8f9fa;
    padding: 4rem 0;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.featured .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.featured h2 {
    text-align: center;
    color: #2c5aa0;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
}

.featured h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3f73 100%);
    border-radius: 2px;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
    position: relative;
}

.featured-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.featured-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.featured-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    flex-shrink: 0;
}

.featured-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3f73 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    opacity: 0.8;
}

.featured-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.featured-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.featured-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    background: #f0f4ff;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

.featured-meta i {
    color: #2c5aa0;
}

.featured-content h3 {
    color: #2c5aa0;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.scripture-ref {
    background: #f0f4ff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #2c5aa0;
    font-style: italic;
    color: #2c5aa0 !important;
    font-weight: 500;
}

.event-location {
    background: #f0f8f0;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    color: #28a745 !important;
    font-weight: 500;
}

.featured-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1.5rem;
}

.btn.btn-outline {
    background: transparent;
    color: #2c5aa0;
    border: 2px solid #2c5aa0;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn.btn-outline:hover {
    background: #2c5aa0;
    color: white;
    transform: translateY(-2px);
}

.more-events {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .featured {
        padding: 3rem 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .featured h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
        display: block !important;
        visibility: visible !important;
    }

    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
        display: grid !important;
        visibility: visible !important;
    }

    .featured-card {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .featured-card img,
    .featured-placeholder {
        height: 200px;
    }

    .featured-content {
        padding: 1.5rem;
    }

    .featured-content h3 {
        font-size: 1.3rem;
    }

    .featured-meta {
        gap: 0.5rem;
    }

    .featured-meta span {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .featured-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .btn.btn-outline {
        text-align: center;
        justify-content: center;
    }

    .more-events {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .featured {
        padding: 2rem 0;
        min-height: auto;
        display: block !important;
    }

    .featured .container {
        padding: 0 0.5rem;
    }

    .featured h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .featured-grid {
        gap: 1rem;
        padding: 0;
    }

    .featured-placeholder {
        font-size: 3rem;
        height: 180px;
    }

    .featured-card img {
        height: 180px;
    }

    .featured-content {
        padding: 1rem;
    }

    .featured-content h3 {
        font-size: 1.2rem;
    }

    .featured-content p {
        font-size: 0.9rem;
    }

    .featured-meta span {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Ad
ditional fixes to prevent card movement on scroll */
.featured-card * {
    transform: translateZ(0);
}

.featured-content {
    position: relative;
    z-index: 1;
}

.featured-card img,
.featured-placeholder {
    position: relative;
    z-index: 0;
}

/* Ensure proper stacking context */
.featured .container {
    position: relative;
    z-index: 1;
}

/* Prevent any transform issues */
.featured-grid,
.featured-card,
.featured-content {
    transform-style: flat;
}

/* NUCLEAR OPTION: Completely isolate and lock featured section */
.featured {
    contain: layout style paint !important;
    isolation: isolate !important;
    transform: translateZ(0) !important;
}

.featured-grid {
    contain: layout style !important;
    isolation: isolate !important;
}

.featured-card {
    /* Create a new stacking context and isolate from parent transforms */
    contain: layout style paint !important;
    isolation: isolate !important;
    transform: translateZ(0) !important;
    will-change: auto !important;
    animation: none !important;
    transition: box-shadow 0.3s ease !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Force the card to stay in its layout position */
    float: none !important;
    clear: none !important;
}

/* Override ANY style attempts on featured cards */
.featured-card[style*="transform"],
.featured-card[style*="top"],
.featured-card[style*="left"],
.featured-card[style*="margin"] {
    transform: translateZ(0) !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
}

/* Disable all animations and transforms on featured section and ALL children */
.featured,
.featured *,
.featured-grid,
.featured-card,
.featured-content,
.featured-card *,
.featured-card > *,
.featured-card * * {
    animation: none !important;
    will-change: auto !important;
}

/* Force all featured card children to stay in place too */
.featured-card * {
    transform: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* Prevent any layout shifts */
.featured-card {
    box-sizing: border-box !important;
    min-height: auto !important;
    max-height: none !important;
    height: auto !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
}

/* Disable button transform on hover within featured cards */
.featured-card .btn.btn-outline:hover {
    transform: none !important;
}

/* Mobile-specific overrides to ensure visibility */
@media (max-width: 768px) {
    .featured {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .featured .container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .featured h2 {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .featured-grid {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        grid-template-columns: 1fr !important;
    }

    .featured-card {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        height: auto !important;
        min-height: auto !important;
    }

    .featured-content {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {

    .featured,
    .featured .container,
    .featured h2,
    .featured-grid,
    .featured-card,
    .featured-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .featured-grid {
        display: grid !important;
    }

    .featured-card {
        display: flex !important;
    }

    .featured-content {
        display: flex !important;
    }
}