/* =================================================================
   MASTER STYLE SHEET: JADE CATEGORY & PROPERTY DETAILS
   VERSION: CLEAN (Optimized for Manual Image Resizing)
   ================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Playfair+Display:wght@700&display=swap');

/* --- 1. GLOBAL SETTINGS --- */
* { box-sizing: border-box; }

body { 
    font-family: 'Lato', Arial, sans-serif !important; 
    background: #fff; 
    color: #555 !important; 
    margin: 0; 
    padding: 10px; 
}

/* --- 2. HEADINGS & TITLES --- */
h1, h2, h3, h4, 
.category_headline, 
.property_caption {
    color: #C5A059 !important; 
    font-family: 'Playfair Display', serif !important; 
    font-weight: bold; 
    text-transform: uppercase;
    border-bottom: 2px solid #C5A059 !important; 
    padding-bottom: 10px; 
    margin-top: 0;
}

/* --- 3. FIX FOR "LISTINGS" LINKS --- */
.category-link-row {
    width: 100% !important;
    display: block !important;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee; 
}
.category-link-row a, 
.category_name {
    display: inline-block !important; 
    margin-right: 15px !important;
    padding: 10px 0;
    font-size: 16px !important;
    color: #C5A059 !important;
    text-decoration: none !important;
    font-weight: bold !important;
}
.category-link-row br { display: none !important; }

/* --- 4. NAVIGATION ICONS --- */
a.category_navigation img, 
.category_navigation img, 
.property_navigation img,
img[src*="box_black"] {
    width: auto !important; height: auto !important;
    border: none !important; display: inline-block !important; margin: 0 2px;
}

/* --- 5. SEARCH RESULTS GRID --- */
table.properties_table { width: 100% !important; table-layout: fixed !important; }
td.properties_table_cell { width: 50% !important; vertical-align: top; }
.properties_table_cell img {
    width: 100% !important; height: 250px !important; object-fit: cover !important;
    border: none !important; display: block !important;
}

/* =================================================================
   6. SINGLE PROPERTY PAGE FIXES
   ================================================================= */

/* Target the layout table (excludes the image gallery) */
h1.property_caption ~ table:not(.images_table):not(.property_navigation) {
    width: 100% !important;
    table-layout: fixed !important;
    border-spacing: 0 !important;
    border-collapse: separate !important;
    margin-top: 20px;
}

/* Text Column */
td[width="50%"] {
    width: 35% !important;
    display: table-cell !important;
    vertical-align: top !important;
    padding-left: 15px !important;
    background-color: #fff !important;
}

/* Main Image Column */
h1.property_caption ~ table:not(.images_table):not(.property_navigation) > tbody > tr > td:first-child,
h1.property_caption ~ table:not(.images_table):not(.property_navigation) > tr > td:first-child {
    width: 65% !important; 
    display: table-cell !important;
    vertical-align: top !important;
    padding-right: 20px !important;
}

/* Main Image Sizing */
h1.property_caption ~ table td:first-child img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border: 1px solid #ccc;
}

/* Styling for Text & Buttons */
.property_factlabel { font-weight: bold; color: #C5A059; width: 100px; }
.property_price { font-size: 1.4rem !important; color: #C5A059 !important; font-weight: bold; margin: 10px 0; display:block; }
.property_status { font-weight: bold; color: #333; }

a[href^="mailto"] {
    display: block; 
    background-color: #C5A059;
    color: white !important;
    padding: 10px;
    text-align: center;
    text-decoration: none !important;
    border-radius: 4px;
    margin-top: 15px;
    font-weight: bold;
}
a[href^="mailto"]:hover { background-color: #aa8c2c !important; }

.property_description {
    clear: both;
    display: block;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    line-height: 1.6;
}

/* --- 7. FOOTER --- */
footer { background: #C5A059 !important; color: white !important; padding: 30px; text-align: center; border-top: 5px solid #aa8c2c !important; }

/* --- 8. MOBILE FIX --- */
@media screen and (max-width: 768px) {
    h1.property_caption ~ table:not(.images_table):not(.property_navigation) td,
    td[width="50%"] {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
    }
}

/* =================================================================
   9. GALLERY FIX (Clean Version)
   This respects your manually resized images.
   ================================================================= */

/* Ensure the table fits the page */
table.images_table {
    width: 100% !important;
    table-layout: fixed !important; /* Keeps columns even (25% each) */
    border-collapse: collapse !important;
}

/* Ensure the image fits the cell without distorting */
table.images_table img {
    width: 100% !important;
    height: auto !important; /* Maintains the aspect ratio of your upload */
    display: block !important;
    border: 1px solid #eee;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

/* Optional: Slight zoom on hover for a modern feel */
table.images_table img:hover {
    opacity: 0.9;
    transform: scale(1.02);
    transition: transform 0.2s ease;
}