/* ===================================
   FEATURED PROJECTS SECTION - COMPACT V2
   =================================== */

.featured {
    padding: 3rem 0 4rem;
    /* Reduced padding */
    background: transparent;
    position: relative;
    z-index: 10;
}

.featured-header {
    text-align: center;
    margin-bottom: 2rem;
    /* Reduced margin */
}

.featured-subtitle {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.featured-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    /* Smaller title */
    font-family: var(--font-display);
    color: var(--text-primary);
    margin: 0;
}

.featured-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch !important;
}

/* Compact Card Styling */
.featured-card {
    background: var(--bg-card);
    border-radius: 12px;
    /* Less rounded */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transform: translateY(0);
    /* Initial state - important for transition */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    width: calc(33.333% - 1rem);
    /* 3 cols by default */
    min-width: 280px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Stronger border for delineation */
    cursor: pointer;
    will-change: transform;
    /* Performance hint */
}

[data-theme="dark"] .featured-card {
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

a.featured-card:hover,
.featured-card:hover {
    transform: translateY(-20px) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
    border-color: var(--accent-color);
    z-index: 5;
}

@media (max-width: 767px) {

    a.featured-card:hover,
    .featured-card:hover {
        transform: translateY(-3px) !important;
        /* Minimal lift for mobile safety */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }
}

/* Compact Image Area */
.featured-img-container {
    width: 100%;
    height: 180px;
    /* Much smaller height */
    overflow: hidden;
    position: relative;
}

.featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-card:hover .featured-img {
    transform: scale(1.03);
    /* Subtle zoom */
}

/* Hover Overlay (Minimalist) */
.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-card:hover .featured-overlay {
    opacity: 1;
}

.featured-overlay-btn {
    background: white;
    color: black;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.featured-card:hover .featured-overlay-btn {
    transform: scale(1);
    opacity: 1;
}

/* Compact Content Area */
.featured-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.featured-meta-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.featured-category-pill {
    padding: 3px 8px;
    background-color: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border-radius: 4px;
    /* Pill to rounded rect */
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .featured-category-pill {
    border-color: rgba(255, 255, 255, 0.1);
}

.featured-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    line-height: 1.2;
}

.featured-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit text lines */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 767px) {
    .featured {
        padding: 0.5rem 0 3.5rem;
        /* Increased bottom padding for the next section header visibility */
    }

    .featured-header {
        margin-bottom: 0.5rem;
    }

    .featured-grid {
        flex-direction: row;
        /* Keep them in a row */
        flex-wrap: nowrap;
        /* No wrapping */
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.5rem 0.5rem 2rem;
        /* Increased bottom padding to prevent clipping and give space */
        overflow-y: visible !important;
        align-items: stretch !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Hide scrollbar */
    }

    .featured-grid::-webkit-scrollbar {
        display: none;
    }

    .featured-card {
        flex: 0 0 calc(33.33% - 0.4rem);
        /* Fit 3 projects on one line */
        min-width: 80px;
        min-height: auto;
        border-radius: 8px;
    }

    .featured-img-container {
        height: 70px;
        /* Slimmer for 3-col layout */
    }

    .featured-card-title {
        font-size: 0.65rem;
        /* Smaller text to fit 3 columns */
        margin-bottom: 0.1rem;
    }

    .featured-card-desc {
        display: none;
        /* Hide description on mobile to save space */
    }

    .featured-content {
        padding: 0.6rem 0.6rem 0.8rem;
        /* More bottom padding for titles */
    }

    .featured-meta-container {
        gap: 4px;
        margin-bottom: 4px;
    }

    .featured-category-pill {
        font-size: 0.5rem;
        padding: 2px 4px;
    }
}