/* Contractor Grid Layout */
.ibew103-contractor-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    align-items: stretch;
    overflow: visible !important; /* allow hover shadow */
}

/* Spacing Between Header and Footer */
#ibew103-contractors {
    padding-top: 50px;
    padding-bottom: 50px;
    overflow: visible !important;
}

/* Individual Contractor Box */
.ibew103-contractor {
    flex: 0 1 calc(33.33% - 20px);
    max-width: calc(33.33% - 20px);
    min-width: 300px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    background: #f9f9f9;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 250px;
    word-break: break-word;
    overflow-wrap: break-word;
    align-self: stretch;
    position: relative;
    z-index: 0;
    transition: box-shadow 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
    will-change: transform, box-shadow;
}

/* ✅ Hover Shadow */
.ibew103-contractor:hover,
.ibew103-contractor:focus-within {
    z-index: 10;
    background-color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    transform: translateY(-6px);
}

/* Ensure Layout Consistency With Fewer Results */
.ibew103-contractor-grid::after {
    content: "";
    flex: 0 1 calc(33.33% - 20px);
    max-width: calc(33.33% - 20px);
    min-width: 300px;
    visibility: hidden;
}

/* A-Z Filter */
.az-filter {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 3px;
    border-bottom: 2px solid #ccc;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    gap: 10px;
}
.az-filter button {
    background: none !important;
    border: none !important;
    color: #333 !important;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease-in-out;
    text-transform: uppercase;
    text-decoration: underline;
    letter-spacing: 1px !important;
    margin: 0 !important;
    padding: 0 5px !important;
    display: inline-block;
    line-height: 1 !important;
}
.az-filter button:hover {
    color: #0073aa !important;
}
.az-filter button.active {
    color: #fff !important;
    background-color: #906e49 !important;
    border-radius: 3px;
    padding: 2px 6px;
    text-decoration: none !important;
}

/* ✅ Icon + Text Alignment Inside Cards */
.ibew103-contractor p {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 8px;
    align-items: start;
    font-size: 0.9rem;
    margin: 8px 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.ibew103-contractor p i {
    grid-column: 1;
    margin-right: 0;
    color: #0073aa;
    font-size: 1rem;
}
.ibew103-contractor p a,
.ibew103-contractor p span,
.ibew103-contractor p strong,
.ibew103-contractor p em {
    grid-column: 2;
    max-width: 100%;
    white-space: normal;
}

/* Icon Colors */
.ibew103-contractor p.email i,
.ibew103-contractor p.phone_number i,
.ibew103-contractor p.fax_number i {
    color: #4CAF50;
}
.ibew103-contractor p.address i {
    color: #FF9800;
}
.ibew103-contractor p.contact i {
    color: #673AB7;
}
.ibew103-contractor p.website i {
    color: #03A9F4;
}

/* Stack Fields Neatly */
.ibew103-contractor .contractor-details {
    display: grid;
    grid-auto-rows: min-content;
    row-gap: 8px;
}

/* Search Bar */
#ibew103-search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
#ibew103-contractors-search {
    width: 60%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1rem;
}
#ibew103-search-button {
    padding: 10px 15px;
    background-color: #0056b3;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease-in-out;
}
#ibew103-search-button:hover {
    background-color: #004080;
}

/* Trade Filter Buttons */
.filter.trade {
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    background-color: #0056b3;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: background-color 0.3s ease-in-out;
}
.filter.trade:hover {
    background-color: #004080;
}
.filter.trade.active {
    background-color: #002855;
}

/* Clear Filters */
#clear-filters {
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    background-color: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
}
#clear-filters:hover {
    background-color: #ff4b4b;
}

/* Keep equal sizing */
.ibew103-contractor-grid .ibew103-contractor {
    order: 0;
    flex-grow: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    margin: 20px 0;
    padding: 10px 0;
    gap: 2px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}
.pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 2px;
}
.pagination li {
    display: inline-block;
}
.pagination a,
.pagination .current {
    padding: 6px 8px;
    min-width: 32px;
    height: 32px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #0056b3;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}
.pagination a:hover {
    background-color: #0056b3;
    color: #fff;
}
.pagination .current {
    background: #0056b3;
    color: #fff;
    font-weight: bold;
    border: 1px solid #0056b3;
}
