/* =========================================
   Home Page - Hero Section
   ========================================= */

/* Hero Section */
.hero {
    background-color: var(--color-white);
    padding: 3.5rem 1.5rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2rem;
    color: var(--color-text-main);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    color: var(--color-text-muted, #6b7280);
    margin-bottom: 2rem;
}

/* Search form */
.hero .search-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: var(--color-secondary);
    border-radius: 1rem;
    padding: 1.25rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    /* overflow must stay visible so autocomplete suggestions can drop below the card */
}

/* Labels are redundant on mobile — placeholder text does the job */
.hero .location-group label,
.hero .radius-container label {
    display: none;
}

@media (min-width: 768px) {
    .hero .search-form {
        flex-direction: column;
        gap: 1.5rem;
    }
    .location-input-group {
        flex-direction: row;
        align-items: flex-end;
        gap: 1.25rem;
        width: 100%;
    }
    .postcode-container {
        flex: 3 1 0%;
        min-width: 0;
    }
    .radius-container {
        flex: 2 1 0%;
        min-width: 140px;
    }
    .input-container {
        min-width: 0;
    }
    .fetchabl-select,
    .fetchabl-select .select-box,
    .input-container input {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .form-group {
        width: 100%;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    position: relative;
}

.form-group label,
.input-container label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-light);
    text-align: left;
}


/* Location input group: stack on mobile, row on desktop */
.location-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Attributes (Size & Age) input group: stack on mobile, row on desktop */
.attributes-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.input-container {
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}


.input-container {
    display: flex;
    flex-direction: column;
    position: relative;
}

.input-container input,
.fetchabl-select .select-box {
    height: 48px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .hero .search-form {
        max-width: 800px;
        width: 100%;
        margin: 0 auto;
        padding: 2.5rem 2.5rem 2rem 2.5rem;
        box-sizing: border-box;
    }
    .location-input-group {
        flex-direction: row;
        align-items: flex-end;
        gap: 1.25rem;
        width: 100%;
    }
    .postcode-container {
        flex: 3 1 0%;
        min-width: 0;
    }
    .radius-container {
        flex: 2 1 0%;
        min-width: 120px;
    }
    .attributes-input-group {
        flex-direction: row;
        align-items: flex-end;
        gap: 1.25rem;
        width: 100%;
    }
    .size-container {
        flex: 0 0 60%;
        min-width: 0;
    }
    .age-container {
        flex: 0 0 40%;
        min-width: 140px;
    }
    .input-container {
        min-width: 0;
    }
    .fetchabl-select,
    .fetchabl-select .select-box,
    .input-container input {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* Actual input fields styles */
.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--color-grey);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--color-white);
    width: 100%;
}

.fetchabl-select select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    cursor: pointer;
    min-height: 2.5rem;
    border: 1px solid var(--color-grey);
    border-radius: 0.5rem;
    background-color: var(--color-white);
    font-size: 1rem;
    width: 100%;
}

.fetchabl-select {
    position: relative;
    width: 100%;
    font-family: inherit;
    user-select: none;
}

.fetchabl-select .select-box {
    border: 1px solid var(--color-grey);
    border-radius: 0.5rem;
    padding: 0.75rem;
    min-height: 2.875rem;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-white);
    cursor: pointer;
    height: 48px;
    box-sizing: border-box;
}

.fetchabl-select .selected-text {
    color: var(--color-text-main);
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    flex: 1;
}

/* Ensure radius select font-size matches other inputs on all breakpoints */
.fetchabl-select .select-box,
.fetchabl-select .selected-text,
.fetchabl-select select,
.fetchabl-select .option {
    font-size: 1rem;
}

.fetchabl-select .dropdown-arrow {
    transition: transform 0.3s ease;
}

.fetchabl-select .options-container {
    position: absolute;
    top: 105%;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey);
    border-radius: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.fetchabl-select .hidden {
    display: none;
}

.fetchabl-select .option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-light-grey);
}

.fetchabl-select .option:hover {
    background-color: var(--color-light-grey);
}

.fetchabl-select .option:last-child {
    border-bottom: none;
}


/* Form actions (the buttons) */
.form-actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;  
    margin: 1rem 0 0;
}

.hero .form-actions .more-filters,
.hero .form-actions .fetch-dogs {
    height: 48px;
    padding: 0 1.5rem;
    font-size: clamp(0.8rem, 3.5vw, 1rem); /* scales down on very narrow screens */
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    flex-grow: 1;
    min-width: 0;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden; /* clips text if it still can't fit */
}

.hero .form-actions .more-filters {
    background-color: var(--color-light-grey);
    color: var(--color-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.hero .form-actions .fetch-dogs {
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* =========================================
   Hero Radius — hidden until location is entered
   ========================================= */

/* Hidden by default — display:none removes it from layout so no gap appears */
.hero .radius-container {
    display: none;
    opacity: 0;
    transform: translateY(-6px); /* subtle upward slide on mobile */
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Step 1: JS adds this to restore display before animating */
.hero .radius-container.is-revealing {
    display: flex;
    flex-direction: column;
}

/* Step 2: JS adds this one frame later to trigger the transition */
.hero .radius-container.is-visible {
    opacity: 1;
    transform: none;
}

@media (min-width: 768px) {
    .hero .radius-container {
        transform: translateX(-8px); /* slide in from left on desktop row */
    }
}


/* =========================================
   Hero Section - Media Queries
   ========================================= */

@media (min-width: 768px) {

    .hero-content {
        max-width: 1100px;
    }

    /* Labels add unwanted height on the single-row layout — hide on desktop */
    .hero .location-group label,
    .hero .radius-container label {
        display: none;
    }

    /* Single horizontal row: location | radius | buttons */
    .hero .search-form {
        flex-direction: row;
        align-items: flex-end;
        gap: 1rem;
        max-width: 1000px;
        padding: 1.5rem 2rem;
    }

    /* Location group expands to fill remaining space */
    .hero .location-group {
        flex: 1;
        min-width: 0;
        margin: 0;
        width: auto;
        max-width: none;
    }

    /* Location input + radius side by side inside the group */
    .location-input-group {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: flex-end;
        width: 100%;
    }

    .postcode-container {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Radius fixed width so it doesn't grow too large */
    .radius-container {
        flex: 0 0 160px;
        min-width: 0;
    }

    /* Buttons sit inline at the end of the row */
    .hero .form-actions {
        flex-direction: row;
        flex-shrink: 0;
        margin: 0;
        gap: 0.75rem;
        align-items: flex-end;
        justify-content: flex-end;
    }

    .hero .form-actions .more-filters,
    .hero .form-actions .fetch-dogs {
        flex: none;
        width: auto;
        white-space: nowrap;
    }

}



/* =========================================
   Hero Image Section
   ========================================= */
.hero-illustration {
    overflow-x: hidden;
}

.hero-image {
    width: 100%;
    height: auto;
    margin: 0 auto;
    display:block;
}






/* =========================================
   Home Page - How It Works Section
   ========================================= */

.how-it-works {
    background-color: var(--color-light-grey);
}

.how-it-works-content{
    padding: 4rem 1rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.how-it-works h2 {
    font-size: 2rem;
    color: var(--color-text-main);
    margin-bottom: 2rem;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.tagline {
    font-size: 1rem;
    color: var(--color-text-main);
    margin-bottom: 3rem;
}


.step-illustration {
    width: 190px;
    height: auto;
    margin: 0 auto;
    margin-bottom: 1rem;
}

.step h3{
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
}

.step p {
    font-size: 1rem;
    color: var(--color-text-main);
}

/* =========================================
   How it works - Media Queries
   ========================================= */

/* Tablet and bigger screens */
@media (min-width: 768px) {


    .how-it-works-content {
        padding: 4rem 1rem;
    }

    .tagline {
        font-size: 1.125rem;
        margin-bottom: 4rem;
        padding: 0 5rem;
    }

    .steps {
        flex-direction: row;
    }

    .step {
        flex: 0 1 45%;
        max-width: 400px;
    } 

    .step-illustration {
        width: auto;
        height: 220px;
        margin: 0 auto;
        margin-bottom: 1rem;
    }
    
}





/* =========================================
   Home Page - Top dogs section
   ========================================= */

.top-dogs {
    padding: 4rem 1rem;
    background-color: var(--color-white);
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.top-dogs h2 {
    font-size: 2rem;
    color: var(--color-text-main);
    margin-bottom: 2rem;
}

.top-dogs .dog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.top-dogs .dog-card-content {
    text-align: left;
}

@media (min-width: 640px) {
    .top-dogs .dog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .top-dogs .dog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}







/* =========================================
   Home Page - Our Mission Section
   ========================================= */
.our-mission {
    background-color: var(--color-light-grey);
    padding: 4rem 1rem;
}

.our-mission-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.mission-text h2 {
    font-size: 2rem;
    color: var(--color-text-main);
    margin-bottom: 2rem;
}

.mission-text p {
    font-size: 1rem;
    color: var(--color-text-main);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.mission-cta {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--color-primary);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mission-cta:hover {
    background-color: #ff5630;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 110, 74, 0.3);
}

.mission-cta:active {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .mission-text p {
        font-size: 1.125rem;
    }
}












