/*
 Theme Name:   Rehub Theme Child
 Theme URI:    http://example.com/rehub-theme-child/
 Description:  Rehub Theme Child Theme
 Author:       Your Name
 Author URI:   http://example.com
 Template:     rehub-theme
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  rehub-theme-child
*/

/* CLI VERIFICATION - ORANGE BUTTON FIX */
body.elementor-page .elementor-button {
    /* 1. Kill the conflicting gradient */
    background-image: none !important;
    background: none !important;

    /* 2. Apply the new color */
    background-color: #ff7034 !important;
    color: #ffffff !important;

    /* 3. Keep the border for visibility */
    border: 2px solid #ffffff !important;
}

/* Responsive table styling for Formidable Forms */
.entry-content table,
.elementor-widget-container table,
article table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    /* Add some space below the table */
}

/* Default table cell styling (desktop) */
.entry-content table th,
.entry-content table td,
.elementor-widget-container table th,
.elementor-widget-container table td,
article table th,
article table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
    white-space: normal;
    /* Allow text to wrap on desktop */
}

/* Responsive Table Styling - Enhanced (for screens up to 768px) */
@media screen and (max-width: 768px) {

    /* Hide table headers (but not display: none;, for accessibility) */
    .entry-content table thead,
    .elementor-widget-container table thead,
    article table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    .entry-content table tr,
    .elementor-widget-container table tr,
    article table tr {
        border: 1px solid #ddd;
        display: block;
        margin-bottom: 0.625em;
        /* Spacing between "cards" */
        background-color: #fff;
    }

    .entry-content table td,
    .elementor-widget-container table td,
    article table td {
        border-bottom: 1px solid #ddd;
        display: block;
        text-align: right;
        /* Align content to the right */
        font-size: 0.8em;
        /* Slightly smaller font for compactness */
        padding-left: 50%;
        /* Space for the label */
        position: relative;
        white-space: normal;
        /* Allow text to wrap */
    }

    .entry-content table td:last-child,
    .elementor-widget-container table td:last-child,
    article table td:last-child {
        border-bottom: 0;
        /* No border for the last cell in a "card" */
    }

    .entry-content table td::before,
    .elementor-widget-container table td::before,
    article table td::before {
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        /*
         * To display proper column labels, each <td> needs a data-label attribute (e.g., <td data-label="Header Text">).
         * This typically requires JavaScript or server-side rendering to populate dynamically.
         * For now, generic labels are provided as a fallback.
         */
        content: attr(data-label);
        /* This will use the data-label attribute if present */
    }

    /* Fallback/Generic labels if data-label attributes are not dynamically populated */
    .entry-content table td:nth-of-type(1)::before {
        content: "Column 1:";
    }

    .entry-content table td:nth-of-type(2)::before {
        content: "Column 2:";
    }

    .entry-content table td:nth-of-type(3)::before {
        content: "Column 3:";
    }

    .entry-content table td:nth-of-type(4)::before {
        content: "Column 4:";
    }

    .entry-content table td:nth-of-type(5)::before {
        content: "Column 5:";
    }

    /* Compactness adjustments for mobile */
    .entry-content table th,
    .entry-content table td,
    .elementor-widget-container table th,
    .elementor-widget-container table td,
    article table th,
    article table td {
        padding: 6px 8px;
        /* Reduce padding */
    }

    .entry-content table td {
        font-size: 0.9em;
        /* slightly larger for readability after padding reduction */
    }
}


/* Custom layout adjustments for wider content and narrower sidebar */

/* Desktop views (when .rh-container is 1200px) */
@media screen and (min-width: 1200px) {
    .rh-container .main-side.page.clearfix {
        width: 980px;
        margin-right: 20px;
        /* Explicit gap between main content and sidebar */
        float: left;
        /* Ensure it floats to the left */
    }

    .rh-container .sidebar,
    .rh-container .side-twocol {
        width: 200px;
        float: right;
        /* Ensure it floats to the right */
    }
}

/* Adjustments for breakpoint: max-width: 1279px and min-width: 1141px (1080px container) */
@media screen and (max-width: 1279px) and (min-width: 1141px) {
    .rh-container .main-side {
        width: 880px;
        /* 1080px (container) - 180px (sidebar) - 20px (gap) = 880px */
        margin-right: 20px;
    }

    .rh-container .sidebar,
    .rh-container .side-twocol {
        width: 180px;
    }
}

/* Adjustments for breakpoint: max-width: 1140px and min-width: 1024px (980px container) */
@media (max-width: 1140px) and (min-width: 1024px) {
    .rh-container .main-side {
        width: 800px;
        /* 980px (container) - 160px (sidebar) - 20px (gap) = 800px */
        margin-right: 20px;
    }

    .rh-container .sidebar,
    .rh-container .side-twocol {
        width: 160px;
    }
}

/* Make table headers bold */
.entry-content table th,
.elementor-widget-container table th,
article table th {
    font-weight: bold;
}

/* Custom Search Interface Styling - Optimized */
#dup-search-interface {
    background-color: #d2d2d2;
    border: 1px solid #e0e0e0;
    padding: 15px;
    /* Reduced padding */
    margin-bottom: 25px;
    /* Reduced margin */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 1.2em;
    /* Reduced base font size */
}

#dup-search-interface .search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /* Gap between fields */
    margin-bottom: 10px;
    /* Reduced margin between rows */
}

#dup-search-interface .search-row:last-of-type {
    margin-bottom: 0;
}


#dup-search-interface .search-field {
    display: flex;
    flex-direction: column;
    /* Stack label and input vertically */
    flex-grow: 1;
    /* Allow fields to grow */
    min-width: 150px;
    /* Minimum width for fields before wrapping */
}

/* Specific field widths for desktop */
@media (min-width: 769px) {
    #dup-search-interface .main-search-field {
        flex: 2 1 calc(50% - 10px);
        /* 50% width on desktop, accounting for gap */
    }

    #dup-search-interface .country-filter-field,
    #dup-search-interface .type-filter-field {
        flex: 1 1 calc(25% - 10px);
        /* 25% width on desktop, accounting for gap */
    }

    #dup-search-interface .services-filter-field,
    #dup-search-interface .specialties-filter-field {
        flex: 1 1 calc(50% - 5px);
        /* 50% width on desktop, accounting for gap */
    }
}

#dup-search-interface label {
    font-weight: bold;
    margin-bottom: 5px;
    /* Reduced margin below label */
    font-size: 0.9em;
    /* Reduced font size for labels */
    color: #555;
    white-space: nowrap;
    /* Prevent label wrapping */
}

#dup-search-interface input[type="text"],
#dup-search-interface select {
    padding: 6px 8px;
    /* Reduced padding inside inputs */
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    /* Reduced font size for inputs */
    line-height: 1.3;
    /* Tighter line height */
    height: auto;
    /* Allow height to adjust */
    -webkit-appearance: none;
    /* For consistent select styling */
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
}

#dup-search-interface select:not([multiple]) {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 25px;
    /* Make space for the arrow */
}

#dup-search-interface select[multiple] {
    min-height: 70px;
    /* Reduced multi-select height */
}

#dup-search-interface .search-actions {
    display: flex;
    justify-content: flex-end;
    /* Right-align buttons */
    align-items: center;
    margin-top: 15px;
    /* Reduced margin */
    flex-wrap: wrap;
    gap: 10px;
}

#dup-search-interface button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 15px;
    /* Reduced padding for buttons */
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    /* Reduced font size for buttons */
    transition: background-color 0.3s ease;
}

#dup-search-interface button:hover {
    background-color: #005177;
}

/* Custom styling for the Clear Filters button */
#dup-clear-filters {
    background-color: #ff7034 !important;
    color: #ffffff !important;
    /* Keep text white */
    font-weight: bold !important;
    padding: 10px 20px !important;
    /* Make it bigger */
    font-size: 1.0em !important;
    /* Adjust font size */
}

#dup-clear-filters:hover {
    background-color: #e06020 !important;
    /* Slightly darker orange on hover */
}

#dup-search-result-info {
    font-size: 0.9em;
    /* Reduced font size */
    font-weight: bold;
    color: #333;
    flex-grow: 1;
    /* Allow it to take available space */
    text-align: left;
    /* Align left */
    min-width: 150px;
    /* Ensure it doesn't get too small */
}

@media (max-width: 768px) {
    #dup-search-interface .search-actions {
        justify-content: space-between;
        /* Space out buttons and info on mobile */
    }

    #dup-search-result-info {
        order: -1;
        /* Place info above buttons on mobile */
        width: 100%;
        text-align: left;
    }
}


#dup-no-results {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px;
    /* Reduced padding */
    border: 1px solid #ffeeba;
    border-radius: 4px;
    margin-top: 15px;
    /* Reduced margin */
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    /* Reduced font size */
    display: none;
    /* Hidden by default, shown by JS */
}



/* Responsive stacking for mobile */

@media (max-width: 768px) {

    #dup-search-interface .search-row {

        flex-direction: column;

        /* Stack fields vertically */

        gap: 5px;

        /* Smaller gap on mobile */

    }



    #dup-search-interface .search-field {

        width: 100%;

        /* Full width on mobile */

        min-width: unset;

    }



    #dup-search-interface .search-actions {

        flex-direction: column;

        align-items: flex-start;

    }



    #dup-search-interface button {

        width: 100%;

    }

}


/* Header Styles - Two Row Layout */
.bg-light-gray {
    background-color: #C0C0C0 !important; /* Light gray background for top row */
}

.bg-teal {
    background-color: #4DB6AC !important; /* Teal/Turquoise background for bottom row */
}

.header-search {
    display: flex;
    align-items: center;
}

.search-input {
    background-color: white !important; /* White background for search input */
    border: 1px solid #ddd;
    border-radius: 0;
    margin-right: 5px;
}

.search-btn {
    background-color: #FFA500 !important; /* Orange background for search button */
    border: none;
    color: white !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-btn .fa-search {
    color: white !important;
    font-size: 16px;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand img {
    max-height: 50px;
    width: auto;
}

.nav-center {
    justify-content: center;
}

.navbar-nav .nav-link {
    color: white !important; /* White text for menu items */
    text-transform: uppercase; /* Uppercase menu items */
    font-weight: bold;
}

/* Front Page Specific Styles - Imported via separate CSS file */

/* Responsive adjustments */
@media (max-width: 991px) {
    .header-search {
        margin-top: 10px;
        width: 100%;
    }
    
    .navbar-nav {
        margin-top: 10px;
    }
}

/* Footer Styles */
.site-footer {
    background-color: #f8f8f8; /* Light gray background for footer */
    color: #666;
    padding: 20px 0;
    border-top: 1px solid #eee;
    text-align: center;
}

.site-footer .site-info {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-size: 14px;
}
