/**
 * Trade Landing Page Styles
 * Responsive padding for search input and category tag overlay
 */

/* Hero section */
#trade-hero {
    position: relative;
}

/* Results section with smooth entry */
.results-section {
    position: relative;
}

.results-lead {
    margin-bottom: 2rem;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA at bottom of results section */
.results-cta {
    animation: fade-in-up 0.7s ease-out 0.5s backwards;
}

/* Responsive padding for both input and tag overlay */
.responsive-input,
.tag-overlay-responsive {
    padding-right: 8rem; /* Default: space for button on tablet+ */
}

/* Simplified reassurance — right column from tablet up, stacked under the form on mobile */
.trade-trust-strip {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
}

.trade-trust-strip p {
    margin: 0;
    line-height: 1.4;
}

.trade-trust-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

@media screen and (max-width: 768px) {
    .trade-trust-strip {
        margin-top: 1.5rem;
        align-items: center;
        text-align: center;
        gap: 0.65rem;
    }

    .trade-trust-rating {
        justify-content: center;
    }
}

/* How it works — compact when collapsed, normal section padding when open */
.section.hiw-section {
    border-top: 1px solid #dbdbdb;
    border-bottom: 1px solid #dbdbdb;
    transition: padding 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.section.hiw-section--collapsed {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.section.hiw-section--expanded {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* Collapsed title is Bulma is-6 (1rem). Expanded matches is-5 (1.25rem). */
.section.hiw-section .title {
    transition: font-size 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.section.hiw-section--expanded .title.is-6 {
    font-size: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .section.hiw-section,
    .section.hiw-section .title {
        transition: none;
    }
}

/* On mobile, remove right padding since button is below */
@media screen and (max-width: 768px) {
    .responsive-input,
    .tag-overlay-responsive {
        padding-right: 1rem !important;
    }

    .breadcrumb {
        display: none;
    }
}

/* Step height is driven by the Web Animations API in trade-landing.js.
   Section padding eases between the compact and expanded sizes. */
.hiw-steps.is-animating {
    overflow: hidden;
}

#howItWorksSteps[hidden] {
    display: none;
}

/* The heading is the disclosure control. Chevron points down while collapsed
   and rotates up while expanded, matching aria-expanded. */
.hiw-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.15rem 0.35rem;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.hiw-toggle .icon {
    color: #3273dc;
    width: 1.15em;
    height: 1.15em;
    font-size: 0.85em;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.hiw-toggle:hover,
.hiw-toggle:focus-visible {
    color: #3273dc;
    border-bottom-color: #3273dc;
    background-color: rgba(50, 115, 220, 0.06);
    outline: none;
}

.hiw-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(50, 115, 220, 0.35);
}

.hiw-toggle[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

/* How it Works - step icons */
.hiw-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin: 0.5rem auto 1rem;
    border-radius: 50%;
    background-color: #eaf4fd;
}

/* Tradesperson Directory Styles */
.tradesperson-directory {
    min-height: 400px;
}

.tradesperson-card {
    height: 100%;
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fade-in-card 0.5s ease-out backwards;
}

/* Stagger the card animations */
.tradesperson-directory .column:nth-child(1) .tradesperson-card {
    animation-delay: 0.1s;
}

.tradesperson-directory .column:nth-child(2) .tradesperson-card {
    animation-delay: 0.2s;
}

.tradesperson-directory .column:nth-child(3) .tradesperson-card {
    animation-delay: 0.3s;
}

.tradesperson-directory .column:nth-child(4) .tradesperson-card {
    animation-delay: 0.4s;
}

.tradesperson-directory .column:nth-child(n+5) .tradesperson-card {
    animation-delay: 0.5s;
}

@keyframes fade-in-card {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tradesperson-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(10, 10, 10, 0.1);
}

.tradesperson-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.tradesperson-link:hover {
    color: inherit;
}

.tradesperson-card .title {
    color: #363636;
}

/* Star rating styles - matches job-interest.css */
.stars {
    color: #ffa31a;
    font-size: 1rem;
    letter-spacing: 0.1rem;
}

.stars .star-full {
    color: #ffa31a;
}

.stars .star-empty {
    color: #d3d3d3;
}

.stars .star-half {
    background: linear-gradient(to right, #ffa31a 50%, #d3d3d3 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media screen and (max-width: 768px) {
    .tradesperson-directory {
        min-height: 300px;
    }
}

/* Bottom sticky CTA — slides up from bottom once hero is out of view */
.trade-bottom-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: 0.75rem 1rem;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eee;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    display: none;
}

.trade-bottom-cta.show {
    transform: translateY(0);
}

.trade-bottom-cta-form .field.is-grouped {
    flex-wrap: nowrap;
}

@media screen and (min-width: 769px) {
    .trade-bottom-cta {
        display: block;
    }
}

/* Mobile: show as a simpler fixed bar */
@media screen and (max-width: 768px) {
    .trade-bottom-cta {
        display: block;
        padding: calc(0.75rem + env(safe-area-inset-bottom, 0px)) 0.75rem 0.75rem;
    }

    .trade-bottom-cta-btn {
        flex-shrink: 0;
        width: 100%;
    }

    .trade-bottom-cta-btn .button {
        width: 100%;
    }

    .trade-bottom-cta-form .field.is-grouped {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
