/****** General ***********/
* {
    font-family: 'Raleway', sans-serif;
}



/****** Variables ***********/
:root {
    --main-bg-color: #FFFFFF;
    --section-bg-color: #F2F2F2;
    --card-bg-color: #FFFFFF;
    --highlight-color: #0065FC;
    --filter-bg-color: #DEEBFF;
    --border-color: #D9D9D9;

    --font-big: 1.375em;
    --font-medium: 1.125em;
    --font-medium-small: 1.0625em;
    --font-small: 1em;
    --font-extra-small: 0.875em;

    --font-semi-bold: 600;
    --font-bold: 700;
}

@media (max-width: 1024px) {
    :root {
        --font-medium-small: 1em;
        --font-small: 0.875em;          /*     was like that on the base code      */
        --font-extra-small:0.8125em;    /*     but not on the model ?              */
    }
}

@media (max-width: 767.98px) {
    :root {
        --font-big: 1.3125em;           /*      set to match above, there is        */
        --font-medium: 1.0625em;        /*      no font size changes on the model   */
        --font-medium-small: 0.875em;   /*      except for the medium-small         */
    }
}



/****** Body ***********/
body {
    background-color: var(--main-bg-color);
    display: flex;
    justify-content: center;
    margin: 0; /* set to 0 to respect the model, possibility to revert ? */
}

.fa-solid {
    color: var(--highlight-color);
}

.main-container {
    width: 100%;
    max-width: 1440px;
    padding: 0 3rem;
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

.section-title {
    margin: 0;
    font-size: var(--font-big);
}

.section-subtitle {
    margin: 0;
    font-size: var(--font-small);
}

.card {
    background-color: var(--card-bg-color);
    border-radius: 20px;
    padding: 5px;
    filter: drop-shadow(0px 3px 15px rgba(0, 0, 0, 0.1));
}

.card img {
    object-fit: cover;
}

.card-title {
    font-size: var(--font-small);
}

.card-subtitle {
    font-size: var(--font-extra-small);
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.euro {
    font-weight: var(--font-semi-bold); 
    /* was bold on the base code, changed to semi-bold to match the model */
}

.neutral-star {
    color: var(--section-bg-color)
}

/****** Header ***********/
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 1.1875rem;
    aspect-ratio: 61/19;
}

nav {
    display: flex;
    gap: 4rem;
}

.nav-link {
    padding: 1rem;
    border-top: 2px solid rgba(0, 0, 0, 0);
}

.nav-link:hover {
    color: var(--highlight-color);
    border-top-color: var(--highlight-color);
}



/****** Search-bar And Search-filter ***********/
.search {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    margin: 2rem 0 2.2rem;
}

.search-headline p {
    margin-top: 0.5rem;
}

/****** Search-bar ***********/
.search-container {
    display: flex;
    width: 23.5rem;
    height: 3rem;
}

.search-container-icon-box {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--section-bg-color);
    border-radius: 15px 0 0 15px;
    width: 3rem;
}

.search-container-icon {
    color: inherit;
    font-size: var(--font-medium);
}

.search-container form {
    display: flex;
    width: 20.5rem;
}

.search-input {
    background-color: var(--card-bg-color);
    height: 100%;
    width: 100%;
    border-color: var(--section-bg-color);
    border-style: solid;
    border-width: 1px 0 1px 1px;
    text-align: center;
}

.search-input::placeholder, .search-input {
    color: inherit;
    font-weight: var(--font-bold);
    font-size: var(--font-medium);
    opacity: 1; /* to match chrome with firefox */
}

.search-input:focus {
    border-color: var(--border-color);
    outline: none;
}

.search-button {
    height: 100%;
    width: max-content;
    border: none;
    border-radius: 0 15px 15px 0;
    background-color: var(--highlight-color);
    color: var(--filter-bg-color);
    font-weight: var(--font-bold);
    font-size: var(--font-medium);

    padding: 0 1rem 0 1rem;
    cursor: pointer;
}

/****** Search-filter ***********/
.search-filter, .filter-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-button {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    height: 2.6rem;
    padding: 0 1rem 0 1rem;
    background-color: var(--card-bg-color);
    border-radius: 20px;
    border-color: var(--border-color);
    border-style: solid;
}

.filter-button:hover {
    background-color: var(--filter-bg-color);
}

.filter-icon {
   font-size: var(--font-big);
}

.filter-button-title {
    text-wrap: nowrap;
    font-size: var(--font-medium-small);
    font-weight: var(--font-bold);
}

.infobar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.circle-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50%;
}



/****** Hebergements And Populaires ***********/
.hebergements-and-populaires {
    display: flex;
    justify-content: space-between;
}

.hebergements-and-populaires section {
    background-color: var(--section-bg-color);
    border-radius: 20px;
    padding: 2rem;
    box-sizing: border-box;
}

/****** Hebergements ***********/
.hebergements {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 2rem;
    width: 65%;
}

.hebergements-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 2rem;
}

.hebergements-cards .card {
    aspect-ratio: 250/207;
    display: flex;
    flex-direction: column;
}

.hebergements-cards img {
    width: 100%;
    height: 60%;
    border-radius: 20px 20px 0 0;
}

.hebergements-cards .card-content {
    min-height: 40%;
    margin-left:1rem;
    margin-right: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.hebergements .card-title {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.extend-title {
    margin: 0;
    font-size: var(--font-medium);
    font-weight: var(--font-bold);
}

/****** Populaires ***********/
.populaires {
    width: 32%;
}

.populaires-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.populaires-cards {
    min-width: 14rem;
}

.populaires-cards .card {
    display: flex;
    margin-top: 2rem;
}


.populaires-cards img {
    width: 33%;
    height: 136px;
    border-radius: 20px 0 0 20px;
}

.populaires-cards .card-content {
    width: 67%;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.populaires-cards .card-title {
    margin-top: 0.66rem;
    margin-bottom: 0.33rem;
}

.populaires-cards .card-rating {
    margin-bottom: 0.33rem;
}



/****** activites ***********/
.activites {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.activites-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.activites-cards .card {
    height: 100%;
    aspect-ratio: 297.5/439;
    box-sizing: border-box;
    padding: 0 0 0.5rem 0;
}

.activites-cards img {
    height: 87%;
    width: 100%;
    border-radius: 20px 20px 0 0;
}

.activites-cards .card-content {
    display: table;
    height: 13%;
}

.activites-cards .card-title {
    padding-left: 1rem;
    padding-right: 1rem;
    display: table-cell;
    vertical-align: middle;
}



/****** footer ***********/
footer {
    margin-top: 5rem;
    display: flex;
}

footer section {
    display: flex;
    flex-direction: column;
    width: 33%;
    background-color: var(--section-bg-color);
    padding: 0 0 1rem 1rem;
}

.about-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}





/****** Media queries ***********/
/* Medium devices (tablets, less/equal than 1024px) */
@media (max-width: 1024px) {
    .hebergements-and-populaires {
        flex-direction: column;
        gap: 3rem;
    }

    .hebergements, .populaires {
        width: 100%;
    }

    .hebergements-cards .card {
        aspect-ratio: 268/207;
    }

    .populaires-cards {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
    }

    .activites-cards .card {
        aspect-ratio: 193.5/270;
    }

    .activites-cards img {
        height: 74%;
    }

    .activites-cards .card-content {
        height: 26%;
    }
}

/* Small devices (phones, less than 768px) */
@media (max-width: 767.98px) {
    .main-container {
        padding: 0;
    }

    header {
        flex-direction: column;
        padding: 1rem;
        gap: 1.5em;
    }

    nav {
        width: 100vw;
        gap: 0;
    }

    .nav-link {
        padding: 0 0 1rem 0;
        border-top-style: none;
        border-bottom-style: solid;
        border-color: var(--section-bg-color);
        border-width: 2px;
        width: 50%;
        text-align: center;
    }

    .nav-link:hover {
        border-color: var(--highlight-color);
    }

    main {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .search {
        margin: 2rem;
    }

    .search-container {
        width: 100%;
        justify-content: center;
    }

    .search-button {
        border-radius: 15px;
        margin-left: -1rem;
        filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
    }

    .search-button-txt {
        display: none;
    }

    .search-button::before {
        content: "\f002";
        font-family: FontAwesome;
    }

    .search-filter {
        flex-direction: column;
        align-items: start;
    }

    .filter-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(6em, 15em));
        justify-content: center;
    }

    .hebergements-and-populaires {
        width: 100%;
        gap: 1rem;
    }

    .hebergements-and-populaires section {
        padding-left: 10vw;
        padding-right: 10vw;
        border-radius: 0;
    }

    .populaires {
        order: -1;
    }

    .populaires-cards {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .populaires-cards .card {
        max-width: 80vw;
        aspect-ratio: 335/146;
    }

    .populaires-cards img {
        height: 100%;
    }

    .hebergements-and-populaires .hebergements {
        background-color: var(--card-bg-color);
    }
    
    .hebergements-cards {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .hebergements-cards .card {
        width: 80vw;
        aspect-ratio: 335/207;
    }

    .activites {
        margin-top: 1rem;
    }

    .activites-cards {
        grid-template-columns: 1fr;
    }
    
    .activites-cards .card {
        width: 100%;
        max-width: 80vw;
        aspect-ratio: 315/200;
    }

    .activites-cards img {
        height: 71%;
    }

    .activites-cards .card-content {
        height: 29%;
    }

    footer {
        margin-top: 2rem;
        padding-top: 1rem;
        padding-left: 10vw;
        background-color: var(--section-bg-color);
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    footer section {
        padding-left: 0;
        width: 100%;
    }
}

/* 
    base width of the search bar 
    to support screen width below 376px
*/
@media (max-width: 23.5rem) {
    .search-container {
        max-width: 95vw;
    }
}