/*
Theme Name: Hello Elementor Child
Template: hello-elementor
Version: 2.1.1
*/


/* --- THE NUCLEAR GRID FIX --- */

/* This targets the Elementor/Theme wrapper that is likely blocking our grid */
.community-container, 
#content .community-container,
.elementor-posts-container {
    display: block !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Force the grid on the actual parent of the cards */
.listings-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    gap: 25px !important;
    width: 100% !important;
    /* This stops Elementor from forcing the cards into a single column */
    flex-direction: row !important; 
    flex-wrap: wrap !important;
}

/* Kills the 'Article' or 'Post' wrapper height issues */
.listings-grid article, 
.listings-grid .elementor-post {
    display: contents !important; /* This makes the wrapper 'invisible' to the layout */
}

/* The card itself stays solid */
body .custom-listing-card {
    min-height: 380px !important;
    width: 100% !important;
    background: #ffffff !important;
    margin: 0 !important;
}






/* --- 1. CORE ARCHIVE LAYOUT & MARGINS --- */
.community-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 60px 20px !important; /* Proper breathing room from header/footer */
}

.archive-header {
    text-align: left !important;
    margin-bottom: 20px !important;
    border-bottom: 2px solid #f7fafc;
    padding-bottom: 20px;
}

.archive-header h1 {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    color: #1a202c !important;
    margin-bottom: 10px !important;
}




/* --- 2. THE GRID ENGINE (FIXES PLACEMENT) --- */
body .listings-grid, 
body .profile-listings-grid {
    display: grid !important;
    /* Automatically creates columns based on screen width */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 30px !important;
    padding: 0 !important;
    margin: 40px 0 !important;
    /* Kills old theme "float" logic that causes staggered cards */
    float: none !important;
    clear: both !important;
}




/* --- 3. THE UNIVERSAL CARD --- */
body .custom-listing-card {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 28px !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
    transition: all 0.3s ease !important;
    width: 100% !important; /* Fills the grid cell perfectly */
    margin: 0 !important;   /* Prevents theme-induced shifting */
    box-sizing: border-box !important;
}

body .custom-listing-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 25px rgba(0,0,0,0.1) !important;
    border-color: #cbd5e0 !important;
}




/* --- 4. TEXT STYLING --- */
body .custom-listing-card .listing-title {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: #1a202c !important;
    margin: 0 0 15px 0 !important;
    line-height: 1.2 !important;
}

body .custom-listing-card .listing-details {
    font-size: 1rem !important;
    color: #4a5568 !important;
    line-height: 1.8 !important;
    margin-bottom: 25px !important;
    list-style: none !important;
    padding: 0 !important;
}

body .custom-listing-card .listing-details strong {
    color: #2d3748;
    font-weight: 700;
}




/* --- 5. THE BUTTON ENGINE --- */
.listing-actions {
    margin-top: auto;
    width: 100%;
}

body .custom-listing-card .condo-btn {
    display: block !important;
    width: 100% !important;
    padding: 16px 10px !important;
    text-align: center !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    border: none !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

/* Blue Button: Contact */
body .custom-listing-card .condo-btn-blue {
    background-color: #1C3755 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0px #005177 !important;
}

/* Orange Button: Edit */
body .custom-listing-card .condo-btn-orange {
    background-color: #f0ad4e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0px #d58512 !important;
}

/* Red Button: Delete */
body .custom-listing-card .condo-btn-red,
.condo-btn-red {
    background-color: #e53e3e !important; /* Red */
    color: #ffffff !important;
    box-shadow: 0 4px 0px #b91c1c !important;
    margin-top: 8px !important; /* Small gap between Edit and Delete */
}

body .custom-listing-card .condo-btn-red:hover {
    background-color: #f56565 !important;
}

body .custom-listing-card .condo-btn:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-2px) !important;
    color: #ffffff !important;
}




/* --- 6. FORMS & DASHBOARD --- */
#acf-form #post-title input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.my-listings-container { background: #fff; border: 1px solid #eef0f2; border-radius: 12px; }
.my-listing-item { padding: 15px 20px; border-bottom: 1px solid #edf2f7; display: flex; justify-content: space-between; }

/* --- 7. MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .community-container { padding: 30px 15px !important; }
    
    body .listings-grid {
        grid-template-columns: 1fr !important; /* Stacked layout for phones */
        gap: 20px !important;
    }
    
    .archive-header h1 { font-size: 1.8rem !important; }
    
    body .custom-listing-card { padding: 22px !important; }
}

.listing-details strong:contains("Rate"), 
.listing-details strong:contains("Rent") {
    color: #2b6cb0 !important; /* Makes the word "Rate/Rent" Blue */
}