/*
 Theme Name:   Astra Child General
 Description:  Child theme for WP Job Manager
 Author:       Giorgio
 Template:     astra
 Version:      1.0.1
*/

/* ==========================================================================
   1. COMPANY DIRECTORY GRID (3 Columns)
   ========================================================================== */
.company-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important; /* Standardized to 3 */
    gap: 20px;
    margin: 20px 0;
}

.company-card-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

.company-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #eee;
    padding: 20px;
    text-align: center;
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.company-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.logo-wrapper {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-wrapper img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

/* ==========================================================================
   2. JOB LISTING GRID (3 Columns)
   ========================================================================== */
.vfx-job-grid {
    display: grid !important;
    /* SET TO 3 COLUMNS FOR DESKTOP */
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    margin: 30px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important; 
    box-sizing: border-box !important;
}

/* --- THE FIX: NUCLEAR OPTION FOR LINKS --- */
.vfx-job-card-link {
    display: block !important;
    min-width: 0 !important; 
    width: 100% !important;
    text-decoration: none !important;
}

/* Hover effects */
.vfx-job-card-link:hover .vfx-job-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #0073aa;
}

.vfx-job-card-link:hover .vfx-job-title {
    color: #0073aa; 
}

/* --- CARD STYLING --- */
.vfx-job-card {
    display: flex !important;
    flex-direction: row !important;
    position: relative;
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 10px;
    height: 100%;
    min-width: 0 !important; 
    box-sizing: border-box !important;
    transition: all 0.3s ease;
}

/* --- LOGO --- */
.vfx-job-logo {
    flex: 0 0 65px !important;
    width: 65px !important;
    height: 65px !important;
    margin-right: 15px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.vfx-job-logo img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

/* Text Content */
.vfx-job-content {
    flex: 1;
    min-width: 0; 
}

/* --- TYPOGRAPHY --- */
.vfx-job-title {
    font-size: 0.95rem !important;
    margin: 0 0 4px 0 !important;
    font-weight: 700 !important;
    color: #333;
}

.vfx-job-company {
    font-size: 0.85rem !important;
    margin: 0 0 8px 0 !important;
    color: #666;
}

.vfx-job-meta {
    display: flex !important;
    gap: 6px !important;      /* Smaller gap for multiple badges */
    align-items: center;
    flex-wrap: wrap !important; /* Allows badges to move to a new line if needed */
}

.vfx-dept {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.70rem !important; /* Slightly smaller to fit more */
    white-space: nowrap;
    color: #555;
    border: 1px solid #e0e0e0;
}

.vfx-loc {
    font-size: 0.75rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure the NEW badge is at the very top layer */
.vfx-badge-new {
    position: absolute !important;
    top: -5px !important;    /* Slightly offset to make it pop */
    right: -5px !important;  /* Slightly offset */
    background-color: #ff4757 !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: bold !important;
    padding: 4px 10px !important;
    border-radius: 4px !important; /* Changed from ribbon to small pill for better visibility */
    z-index: 999 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: block !important;
}

/* ==========================================================================
   3. FILTERS & RESPONSIVENESS
   ========================================================================== */
.vfx-filter-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.vfx-filter-container form {
    display: flex !important;
    flex-direction: row !important; /* Forces side-by-side layout */
    gap: 15px !important;
    align-items: center;
    flex-wrap: nowrap; /* Prevents wrapping on desktop */
}

/* Styled Select Dropdowns */
.vfx-filter-container select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    
    /* FIX: Added vertical padding and explicit line-height to prevent cropping */
    padding: 14px 40px 14px 15px !important;
    line-height: 1.2 !important;
    height: auto !important; 
    
    border: 1px solid #ddd;
    border-radius: 8px;
    
    /* FIX: Reduced min-width so they fit side-by-side easier */
    flex: 1; /* Allows them to grow and share space equally */
    min-width: 150px; 
    max-width: 300px;
    
    font-size: 14px;
    color: #333;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover and Focus states */
.vfx-filter-container select:hover {
    border-color: #0073aa; /* Matches your theme blue */
}

.vfx-filter-container select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Clear Filters Link */
.vfx-clear-filter {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #666 !important; /* Neutral color when not in use */
    text-decoration: none !important;
    padding: 10px 18px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    background: #fff !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    margin-left: 10px !important;
    height: 44px; /* Matches the height of your styled dropdowns */
    box-sizing: border-box;
}

.vfx-clear-filter:hover {
    background: #f8f9fa !important;
    border-color: #ff4757 !important;
    color: #ff4757 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* RESPONSIVE RULES - Cleaned up to avoid conflicts */
@media (max-width: 1024px) {
    .vfx-job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 768px) {
    .company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 600px) {
    .vfx-job-grid, .company-grid { grid-template-columns: 1fr !important; }
    .vfx-filter-container select { width: 100%; }
}

@media (max-width: 600px) {
    .vfx-filter-container form {
        flex-direction: column !important; /* Stack them only on small mobile */
        align-items: stretch;
    }
    .vfx-filter-container select {
        max-width: 100%;
    }
}

/* ==========================================================================
   5. PAGINATION
   ========================================================================== */
.vfx-pagination {
    margin: 40px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.vfx-pagination .page-numbers {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none !important;
    color: #333 !important;
    font-weight: 600;
}

.vfx-pagination .page-numbers.current {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}



/* This ensures the badge pins to the corner of the card */
.job_listing a {
    position: relative !important;
    display: block !important;
}

li.job_listing a {
    position: relative !important;
    display: flex !important; /* WP Job Manager usually uses flex for rows */
    overflow: visible !important;
}

/* 1. Anchor the badge to the company card */
.company-card {
    position: relative; 
}

/* 2. Force the badge to always be visible on the company grid */
.company-card .vfx-badge-new {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important; /* Use inline-block if block looks weird */
    
    /* Optional: You may need to tweak these numbers to place it exactly where you want it on the card */
    top: 15px; 
    right: 15px;
}