/* ========================================
   FEATURED COMPANIES SECTION - SPACING IMPROVEMENTS
   Enhanced visual presentation and spacing
   Created: 2025-11-09
   ======================================== */

/* Main Featured Companies Section Container */
.featured-companies-section {
    /* Vertical spacing - more breathing room */
    margin-top: 48px !important;           /* Increased from default */
    margin-bottom: 56px !important;        /* More separation from next section */
    padding: 40px 32px !important;         /* Increased internal padding */

    /* Visual improvements */
    background: linear-gradient(135deg,
        rgba(100, 255, 218, 0.04),
        rgba(0, 196, 232, 0.04)
    );
    border-radius: 20px;                   /* Slightly larger radius */
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Featured Header Section */
.featured-header {
    margin-bottom: 32px !important;        /* Increased from 20px - better separation */
    text-align: center;
}

.featured-header h2 {
    margin-bottom: 12px !important;        /* Spacing between title and subtitle */
    line-height: 1.3;
}

.featured-header p {
    margin-bottom: 0;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Featured Companies Grid */
.featured-companies-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);  /* 4 columns by default on desktop */
    gap: 24px !important;                  /* Consistent 24px gap between cards */
    max-width: 1400px;
    margin: 0 auto 32px auto;              /* Bottom margin before button */
}

/* Individual Featured Company Cards */
.featured-company-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px !important;              /* Consistent internal padding */
    border: 1px solid var(--border-medium);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    min-height: 280px;                     /* Ensures consistent card height */
    display: flex;
    flex-direction: column;
}

.featured-company-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--accent-orange));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.featured-company-card:hover {
    transform: translateY(-6px);           /* Slightly more pronounced hover */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-cyan);
}

.featured-company-card:hover::before {
    opacity: 1;
}

/* Card Internal Spacing */
.featured-company-header {
    margin-bottom: 16px;
}

.featured-company-name {
    margin-bottom: 8px;
    line-height: 1.3;
}

.featured-company-location {
    margin-bottom: 16px;
}

.featured-company-description {
    margin-bottom: 20px;
    flex-grow: 1;                          /* Pushes footer to bottom */
    line-height: 1.7;
}

.featured-company-tags {
    margin-bottom: 16px;
    gap: 8px;
}

.featured-company-footer {
    margin-top: auto;                      /* Aligns to bottom of card */
    padding-top: 16px;
}

/* Refresh Button Spacing */
.featured-companies-section > div:last-child {
    margin-top: 32px;                      /* Space between grid and button */
    text-align: center;
}

#refreshFeatured,
.refresh-featured-btn {
    margin-top: 0;                         /* Remove extra margin */
}

/* ========================================
   RESPONSIVE SPACING ADJUSTMENTS
   ======================================== */

/* Large Desktop (1400px+) - 4 columns */
@media (min-width: 1400px) {
    .featured-companies-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (1200px - 1399px) - 3 columns */
@media (min-width: 1200px) and (max-width: 1399px) {
    .featured-companies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet (768px - 1199px) - 2 columns */
@media (min-width: 768px) and (max-width: 1199px) {
    .featured-companies-section {
        margin-top: 40px !important;
        margin-bottom: 48px !important;
        padding: 32px 24px !important;
    }

    .featured-header {
        margin-bottom: 28px !important;
    }

    .featured-companies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px !important;
    }
}

/* Mobile (375px - 767px) */
@media (max-width: 767px) {
    .featured-companies-section {
        margin-top: 32px !important;
        margin-bottom: 40px !important;
        padding: 24px 16px !important;      /* Reduced padding on mobile */
        border-radius: 16px;
    }

    .featured-header {
        margin-bottom: 24px !important;     /* Slightly reduced on mobile */
    }

    .featured-header h2 {
        font-size: 1.5rem !important;       /* Slightly smaller on mobile */
        margin-bottom: 10px !important;
    }

    .featured-header p {
        font-size: 0.95rem !important;
    }

    .featured-companies-grid {
        grid-template-columns: 1fr;         /* Single column on mobile */
        gap: 16px !important;               /* Slightly reduced gap */
        margin-bottom: 24px !important;
    }

    .featured-company-card {
        padding: 20px !important;           /* Slightly reduced padding */
        min-height: auto;                   /* Allow natural height on mobile */
    }

    .featured-companies-section > div:last-child {
        margin-top: 24px;                   /* Reduced spacing on mobile */
    }
}

/* Small mobile (max 375px) */
@media (max-width: 375px) {
    .featured-companies-section {
        padding: 20px 12px !important;      /* Even tighter on small screens */
    }

    .featured-company-card {
        padding: 16px !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .featured-companies-section {
        page-break-inside: avoid;
        margin: 20px 0 !important;
        padding: 20px !important;
        border: 1px solid #ccc;
        background: white !important;
    }

    .featured-company-card {
        page-break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    #refreshFeatured,
    .refresh-featured-btn {
        display: none !important;
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus states for keyboard navigation */
.featured-company-card:focus-visible {
    outline: 3px solid var(--accent-orange);
    outline-offset: 4px;
}

#refreshFeatured:focus-visible,
.refresh-featured-btn:focus-visible {
    outline: 3px solid var(--accent-orange);
    outline-offset: 4px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .featured-company-card,
    .featured-company-card::before {
        transition: none !important;
    }

    .featured-company-card:hover {
        transform: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .featured-companies-section {
        border: 2px solid currentColor;
    }

    .featured-company-card {
        border: 2px solid currentColor;
    }
}
