/* =============================================================
   Find a Carpenter – Page Styles
   Mirrors the redesign layout (fac-redesign.html)
   ============================================================= */

/* ── Page wrapper ────────────────────────────────────────────── */
.fac-page {
    /* font-family: 'Inter', sans-serif; */
    color: #1a1c1c;
    background: #f9f9f9;
}

/* ── Hero / Search ───────────────────────────────────────────── */
.fac-hero {
    position: relative;
    background: #fdf7f4; /* Lightest tint of the primary color #F36F32 */
    /* overflow: hidden; -- Removed to allow location suggestions to be visible */
}

.fac-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(243, 111, 50, 0.12), rgba(243, 111, 50, 0.12)),
        url('../images/search-hero.webp');
    background-size: cover;
    background-position: center 70%;
    opacity: 0.15;
    pointer-events: none;
}




.fac-hero__inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 32px 96px;
}


.fac-hero__eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #a63b00;
    margin-bottom: 16px;
}

.fac-hero__title {
    /* font-family: 'Work Sans', sans-serif; */
    font-size: clamp(32px, 6vw, 64px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    /* text-transform: uppercase; */
    color: #1a1c1c;
    margin: 0;
    margin-bottom: 16px;
}

/* ── Compact bar (fixed — zero layout impact, no scroll jank) ─── */
.elementor-element-d02e0a2 {
    z-index:500!important;
}

.fac-compact-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    /* Slide in from above; JS adds --visible to trigger */
    transform: translateY(-200%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

@media (max-width: 1023px) {
    .fac-compact-bar {
        top: 57px;
    }
}

@media (max-width: 782px) {
    .fac-compact-bar {
        top: 65px;
    }
}

/* WP admin bar offsets */
.admin-bar .fac-compact-bar          { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .fac-compact-bar      { top: 46px; }
}


.fac-compact-bar--visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.fac-compact-bar__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.fac-compact-bar__logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.fac-compact-bar__logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.fac-compact-bar__logo--mobile {
    display: none;
}

@media (max-width: 1023px) {
    .fac-compact-bar {
        background: #1a1c1c;
    }
    .fac-compact-bar__logo--desktop {
        display: none;
    }
    .fac-compact-bar__logo--mobile {
        display: block;
        height: 28px;
    }
}

.fac-compact-bar__input {
    width: 100%;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: #1a1c1c;
    background: transparent;
    box-shadow: none !important;
}

.fac-compact-bar__search {
    flex: 1;
    min-width: 0;
}

.fac-compact-bar__input::placeholder {
    color: #b0b0b0;
}

.fac-compact-bar__submit {
    min-height: 0 !important;
    padding: 0 20px !important;
    font-size: 11px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fac-search__submit-icon {
    display: none;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

@media (max-width: 1023px) {
    .fac-compact-bar__inner {
        padding: 6px 8px;
        gap: 6px;
    }
    .fac-compact-bar__logo-link {
        padding: 0;
    }
    .fac-compact-bar__submit {
        padding: 0 12px !important;
    }
    .fac-compact-bar .fac-search__submit-text {
        display: none;
    }
    .fac-compact-bar .fac-search__submit-icon {
        display: block;
    }
    /* In search-bar.twig, we use fac-search__icon--left for field icons */
    .fac-compact-bar .fac-search__icon--left {
        display: none;
    }
}

.fac-compact-bar__filters {
    flex-shrink: 0;
    margin: 0;
}

@media (max-width: 1023px) {
    .fac-compact-bar__filters {
        position: static;
        background: transparent;
        padding: 0;
        border: none;
        box-shadow: none;
        display: block;
    }
}

/* ── Search form ─────────────────────────────────────────────── */
.fac-search__container {
    margin-bottom: 24px;
    position: relative;
}

/* ── Geolocation Permission Prompt ─────────────────────────── */
.fac-search__prompt {
    display: none; /* Initially hidden */
    background: #ffffff;
    border: 1px solid #ff8243;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 4px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #1a1c1c;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
    z-index: 20;
    animation: facFadeIn 0.3s ease;
}

.fac-search__prompt--visible {
    display: flex;
}

.fac-search__prompt-text {
    flex: 1;
    line-height: 1.4;
}

.fac-search__prompt-text strong {
    color: #ff8243;
}

.fac-search__prompt-actions {
    display: flex;
    gap: 8px;
}

.fac-search__prompt-btn {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.fac-search__prompt-btn--allow {
    background: #ff8243;
    color: #fff;
}

.fac-search__prompt-btn--allow:hover {
    background: #e65a1a;
}

.fac-search__prompt-btn--deny {
    background: #e2e2e2;
    color: #5b5e66;
}

.fac-search__prompt-btn--deny:hover {
    background: #d4d4d4;
}

@keyframes facFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fac-search {
    background: #e2e2e2;
    padding: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.fac-search__form {
    display: flex;
    flex-direction: column;
    background: rgba(225,191,179,0.2);
    gap: 1px;
}

@media (min-width: 1024px) {
    .fac-search__form {
        flex-direction: row;
        align-items: stretch;
    }
}

.fac-search__field {
    background: #ffffff;
    padding: 20px 24px;
    flex: 1;
}

.fac-search__label {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5b5e66;
    margin-bottom: 8px;
}

.fac-search__field-inner {
    display: flex;
    align-items: center;
    position: relative; /* For absolute suggestions */
    /* gap: 10px; */
}

/* ── Location Suggestions ────────────────────────────────── */
.fac-search__suggestions {
    position: absolute;
    top: calc(100% + 12px);
    left: -24px; /* Align with field edges considering padding */
    right: -24px;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.fac-search--minimal .fac-search__suggestions {
    left: -1px;
    right: -1px;
    top: 100%;
}

.fac-search__suggestions[hidden] {
    display: none;
}

.fac-search__suggestion-item {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1c1c;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fac-search--minimal .fac-search__suggestion-item {
    padding: 10px 16px;
}

.fac-search__suggestion-item:last-child {
    border-bottom: none;
}

.fac-search__suggestion-item:hover,
.fac-search__suggestion-item--active {
    background-color: #fdf7f4;
    color: #F46F32;
}

.fac-search__suggestion-item strong {
    font-weight: 700;
}

.fac-search__suggestion-sub {
    font-size: 11px;
    font-weight: 400;
    color: #888888;
}

.fac-search__suggestion-item--active .fac-search__suggestion-sub {
    color: #F46F32;
    opacity: 0.8;
}


.fac-search__input::placeholder {
    color: #e2e2e2;
}

.fac-search__icon {
    width: 18px;
    height: 18px;
    color: #a63b00;
    flex-shrink: 0;
    margin: 0px 10px;
}

.fac-search__input {
    width: 100%;
    border: none;
    outline: none;
    padding: 0;
    font-size: 16px;
    font-weight: 500;
    color: #1a1c1c;
    background: transparent;
    box-shadow: none !important;
}

.fac-search__input::placeholder {
    color: #e2e2e2;
}

.fac-search__divider {
    display: none;
}

@media (min-width: 1024px) {
    .fac-search__divider {
        display: block;
        width: 1px;
        background: rgba(225,191,179,0.4);
    }
}

.fac-search__submit {
    /* background: linear-gradient(135deg, #f76a28, #a63b00); */
    background: #F46F32!important; /* Adjusted to match original bright orange */
    color: #ffffff;
    border: none;
    padding: 0 40px;
    min-height: 80px;
    /* font-family: 'Work Sans', sans-serif; */
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.2s;
    white-space: nowrap;
}

.fac-search__submit:hover {
    filter: brightness(1.1);
}

.fac-search__submit:active {
    transform: scale(0.98);
}

/* ── Minimal Variant (thinner, transparent boxes) ───────────── */
.fac-search--minimal {
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-left: auto;
    margin-right: auto;
}

.fac-search--minimal .fac-search__form {
    background: transparent;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
}

.fac-search--minimal .fac-search__field {
    background: #ffffff;
    border: 1px solid #c2c2c2;
    /* border-radius: 4px; */
    padding: 0px;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.fac-search--minimal .fac-search__field:focus-within {
    border-color: #f76a28;
}

.fac-search--minimal .fac-search__field-inner {
    flex: 1;
    display: flex;
    align-items: center;
}

.fac-search--minimal .fac-search__input {
    height: 40px;
    font-size: 14px;
    color: #1a1c1c;
    border: none!important;
    width: 100%;
}

.fac-search--minimal .fac-search__input::placeholder {
    color: #888888;
    font-weight: 400;
}

.fac-search__locator {
    background: transparent;
    border: none;
    padding: 4px;
    margin-left: 8px;
    cursor: pointer;
    color: #888888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    margin-right: 10px!important;
}

.fac-search__locator:focus{
    outline: none!important;
    background-color: #f76a28!important;
}

.fac-search__locator:hover {
    color: #f76a28!important;
    background-color: transparent!important;
}

.fac-search__locator:active{
    background-color: transparent!important;
}

.fac-search__icon--locator {
    width: 20px;
    height: 20px;
}

.fac-search--minimal .fac-search__submit {
    background: #F46F32; /* Adjusted to match original bright orange */
    color: #ffffff;
    min-height: 40px;
    padding: 0 24px;
    font-size: 13px;
    font-weight: 700;
    text-transform: none; /* Matches original standard casing */
    letter-spacing: 0;
    /* border-radius: 4px; */
    border: none;
}

@media (max-width: 640px) {
    .fac-search--minimal .fac-search__form {
        flex-direction: column;
        gap: 8px;
    }
    .fac-search--minimal .fac-search__submit {
        min-height: 40px;
    }
}

/* ── Qualification filters ───────────────────────────────────── */
.fac-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.fac-filters__label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5b5e66;
}

.fac-filters__toggle {
    display: flex;
    background: #e2e2e2;
    padding: 4px;
}

.fac-filters__btn {
    padding: 8px 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #5b5e66;
    transition: color 0.15s;
}

.fac-filters__btn:hover {
    color: #1a1c1c;
    text-decoration: none;
}

.fac-filters__btn--active {
    background: #ffffff;
    color: #1a1c1c;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Results section ─────────────────────────────────────────── */
.fac-results {
    background: #f9f9f9;
    padding: 80px 32px;
}

.fac-results__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.fac-results__top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    gap: 20px;
}

@media (max-width: 640px) {
    .fac-results__top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

.fac-results__summary {
    font-size: 14px;
    font-weight: 500;
    color: #5b5e66;
    line-height: 1.4;
}

.fac-results__summary strong {
    color: #1a1c1c;
    font-weight: 700;
}

.fac-results__sorting {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.fac-results__sort-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5b5e66;
    white-space: nowrap;
}

.fac-results__sort-select {
    padding: 10px 36px 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1c1c;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath stroke='%231a1c1c' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.fac-results__sort-select:focus {
    outline: none;
    border-color: #a63b00;
}

.fac-results__empty {
    color: #5b5e66;
    font-size: 15px;
    text-align: center;
    padding: 80px 0;
}

/* ── Result group ────────────────────────────────────────────── */
.fac-result-group {
    margin-bottom: 80px;
}

.fac-result-group__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.fac-result-group__title {
    /* font-family: 'Work Sans', sans-serif; */
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.02em;
    /* text-transform: uppercase; */
    color: #1a1c1c;
    margin: 0;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .fac-result-group__title {
        font-size: 32px;
    }
}

.fac-result-group__line {
    flex: 1;
    height: 4px;
    background: #e2e2e2;
    /* margin-bottom: 6px; */
}

.fac-result-group__count {
    font-size: 13px;
    font-weight: 700;
    color: #a63b00;
    white-space: nowrap;
    margin-bottom: 4px;
}

/* ── Result grid ─────────────────────────────────────────────── */
.fac-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 640px) {
    .fac-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .fac-result-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fac-result-grid.fac-result-grid--shortcode-featured {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ── Result card ─────────────────────────────────────────────── */
.fac-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    height: 100%;
    min-width: 0;
}

.fac-card:hover {
    text-decoration: none;
    color: inherit;
}

.fac-card__image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e2e2e2;
    flex-shrink: 0;
}

.fac-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* filter: grayscale(100%); */
    transform: scale(1.15);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.fac-card:hover .fac-card__image img {
    /* filter: grayscale(0%); */
    transform: scale(1);
}

.fac-card__pills {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fac-card__pill {
    display: inline-block;
    padding: 4px 10px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    line-height: 1.4;
}



.fac-card__pill--membership,
.fac-card__pill--employee,
.fac-card__pill--sole-trader,
.fac-card__pill--sme-owner {
    background: #a63b00;
    color: #ffffff;
}

.fac-card__pill--apprentice {
    background: #5b5e66;
    color: #ffffff;
}

/* ── Card body ───────────────────────────────────────────────── */
.fac-card__body {
    padding: 20px 16px 16px;
    background: #ffffff;
    transition: background-color 0.3s;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fac-card:hover .fac-card__body {
    background: #f3f3f3;
}

.fac-card__name-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.fac-card__name {
    /* font-family: 'Work Sans', sans-serif; */
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #1a1c1c;
    margin: 0;
    line-height: 1.1;
}

.fac-card__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.fac-card__star {
    color: #f5c518;
    font-size: 15px;
    line-height: 1;
}

.fac-card__rating span:last-child {
    font-weight: 600;
    font-size: 14px;
    color: #1a1c1c;
}

.fac-card__bio {
    font-size: 13px;
    color: #5b5e66;
    line-height: 1.6;
    margin: 0 0 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Card footer ─────────────────────────────────────────────── */
.fac-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(225,191,179,0.3);
    padding-top: 14px;
    margin-top: auto;
}

.fac-card__distance {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #a63b00;
}

.fac-card__arrow {
    width: 16px;
    height: 16px;
    color: #5b5e66;
    flex-shrink: 0;
}

/* ── Load more (invisible sentinel – triggers IntersectionObserver) ── */
.fac-load-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 48px;
}

.fac-load-more {
    visibility: hidden;
    pointer-events: none;
    height: 1px;
    padding: 0;
    border: none;
}

.fac-load-more--revealed {
    visibility: visible;
    pointer-events: auto;
    height: auto;
    background: transparent;
    border: 2px solid #1a1c1c;
    color: #1a1c1c;
    padding: 14px 48px;
    /* font-family: 'Work Sans', sans-serif; */
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.fac-load-more--revealed:hover {
    background: #1a1c1c;
    color: #ffffff;
}

.fac-load-more__spinner {
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid #e2e2e2;
    border-top-color: #a63b00;
    border-radius: 50%;
    animation: fac-spin 0.7s linear infinite;
}

@keyframes fac-spin {
    to { transform: rotate(360deg); }
}

/* ── Results loading / error states ─────────────────────────── */
.fac-results__loading {
    text-align: center;
    padding: 80px 0;
    color: #5b5e66;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fac-results__error {
    text-align: center;
    padding: 40px 0;
    color: #a63b00;
    font-size: 14px;
}

/* ── Featured card pill ──────────────────────────────────────── */
.fac-card__pill--featured {
    background: #f5c518;
    color: #1a1c1c;
}
