/**************** GENERAL ****************/
* {
    font-family: "Raleway", sans-serif;
}

:root {
    /* Colors */
    --main-color: #0065fc;
    --main-bg-color: #f2f2f2;
    --filter-bg-color: #deebff;
    --full-black: #000000;
    --black-25: #00000040;
    --full-white: #ffffff;
    --transparent: #ffffff00;

    /* Font sizes */
    --title-size: 1.375rem; /* 22px */
    --xlarge-size: 1.125rem; /* 18px */
    --large-size: 1.063rem; /* 17px */
    --base-size: 1rem; /* 16px */
    --small-size: 0.875rem; /* 14px */
}

body {
    display: flex;
    justify-content: center;
    margin: 0;
}

.main-container {
    width: 100%;
    max-width: 1440px;
    min-width: 320px;
    padding: 0 50px;
    box-sizing: border-box;
}

h1,
h2,
h3 {
    margin: 0;
}

h3 {
    font-size: var(--xlarge-size);
}

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

p {
    font-size: var(--base-size);
    margin: 10px 0;
}

.section-title {
    font-size: 22px;
}

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

/**************** HEADER ****************/
header {
    display: flex;
    justify-content: space-between;
}

nav {
    display: flex;
    justify-content: space-around;
    width: 344px;
    font-size: var(--base-size);
}

.nav-item {
    padding: 16px 0;
}

.nav-item:hover {
    border: var(--main-color) 2px;
    border-top-style: solid;
    padding: 14px 0 16px 0;
}

.nav-item.active {
    color: var(--main-color);
}

/**************** FILTERS & SEARCH ****************/
.header-logo {
    width: 61px;
    height: 19px;
    margin: 30px 0;
}

.section-filtres {
    padding: 30px 0 35px 0;
}

.search-bar {
    display: flex;
    margin: 35px 0;
}

.search-form {
    display: flex;
}

.search-elements {
    color: var(--main-bg-color);
    border-radius: 15px 0 0 15px;
    align-items: center;
    max-height: 48px;
    display: flex;
    border-width: 1px 0;
    border-style: solid;
}

.search-icon-area {
    width: 50px;
    height: 50px;
    background-color: var(--main-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px 0 0 15px;
    border: none;
}

.search-icon {
    color: var(--full-black);
    width: 14px;
    height: 18px;
}

.search-input {
    border: none;
    font-size: var(--xlarge-size);
    font-weight: bold;
    padding: 0 0 0 24px;
    min-width: 171px;
}

.search-input::placeholder {
    color: var(--full-black);
}

.search-input:focus-visible {
    outline: none;
}

.search-button {
    background-color: var(--main-color);
    height: 48px;
    border: none;
    font-weight: bold;
    border-radius: 0 15px 15px 0;
    padding: 0 16px;
    border: 1px solid var(--main-color);
}

.search-button:hover {
    cursor: pointer;
}

.search-text {
    color: var(--full-white);
}

.search-magnifier {
    color: var(
        --full-white
    ); /* géré au niveau de l'élément pour overwrite la classe .fa*/
    display: none; /* pour toggle avec un media query en version mobile (ici, desktop first)*/
}

.filters {
    display: flex;
    gap: 0 15px;
    margin-bottom: 35px;
    align-items: center;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 15px;
    column-gap: 15px;
}

.filter-options > button {
    font-size: var(--large-size);
    font-weight: bold;
    border: solid var(--main-bg-color) 2px;
    border-radius: 25px;
    background-color: transparent;
    height: 50px;
    padding: 0 19px;
}

.filter-options > button:hover {
    background-color: var(--filter-bg-color);
    cursor: pointer;
}

.filter-options > button > i {
    width: 22px;
    height: 22px;
}

.xlarge {
    font-size: var(--xlarge-size);
}

.infobulle-elements {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 24px;
}

.infobulle-logo {
    width: 22px;
    height: 22px;
    border: solid var(--main-bg-color) 1px;
    border-radius: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
}

/**************** CARDS (base) ****************/
.card {
    background-color: white;
    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: 16px;
}

.euro {
    font-weight: 700;
}

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

/**************** LODGING & POPULAR ****************/
.hebergements-and-populaires {
    display: flex;
    justify-content: space-between;
}

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

/**************** LODGING ****************/
.hebergements {
    width: 65%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 0;
}

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

.hebergements-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.hebergements-cards a {
    flex: calc(100% / 3 - 30px);
}

.hebergements-cards .card {
    display: flex;
    flex-direction: column;
}

.hebergements-cards img {
    width: 100%;
    height: 124px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.hebergements-cards .card-content {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.hebergements-cards .card-title {
    margin-top: 9px;
    margin-bottom: 8px;
}

.hebergements-cards .card-subtitle {
    margin: 0;
    font-size: var(--small-size);
}

.hebergements-cards .card-rating {
    margin-top: 8px;
    margin-bottom: 10px;
}

.more {
    font-size: var(--xlarge-size);
    font-weight: bold;
}

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

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

.populaires-cards {
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: 100%;
}
.populaires-cards .card {
    display: flex;
    margin-top: 0;
}

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

.populaires-cards .card-content {
    width: 67%;
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.populaires-cards .card-title {
    margin-top: 10px;
    margin-bottom: 4px;
}

.populaires-cards .card-subtitle {
    margin: 0;
}

.populaires-cards .card-rating {
    margin-bottom: 5px;
}

/**************** ACTIVITIES ****************/
.activities,
section {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.activities {
    margin: 35px 0;
}

.activities.section-title {
    margin: 0 30px;
    padding-top: 30px;
}

.activities-cards {
    box-sizing: border-box;
    width: 100%;
    display: flex;
    justify-content: space-between;
    overflow: hidden;
    gap: 30px;
    padding: 30px;
}

.activity.card {
    padding: 0;
}

.activities-cards a {
    flex: calc(100% / 4 - 30px);
}

.activity.card img {
    height: 380px;
    width: 100%;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.card-txt.activity {
    padding: 20px 19px;
}

.activities > section {
    gap: 0;
}

/**************** FOOTER ****************/
footer {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background-color: var(--main-bg-color);
}

.footer-section {
    flex: 1;
}

.footer-section h3,
.footer-item {
    margin-bottom: 15px;
}

footer ul {
    list-style-type: none;
    padding: 0;
}

/**************** MEDIA QUERIES ****************/
/* Medium devices (tablets, less/equal than 1024px) */
@media (max-width: 1024px) {
    p {
        margin: 0;
    }

    .filters {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .hebergements-and-populaires {
        flex-direction: column;
    }

    .hebergements {
        width: 100%;
    }

    .populaires {
        width: 100%;
        margin-top: 50px;
    }

    .populaires-cards {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 20px;
    }

    .populaires-cards > a {
        flex: 1;
    }

    .populaires-cards .card-subtitle {
        font-size: var(--small-size);
    }

    .activity.card img {
        height: 200px;
    }

    .card-content.activity {
        height: 70px;
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .card-txt.activity {
        padding: 0 19px;
    }
}

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

    /* header */
    header {
        flex-direction: column;
        padding: 0;
        align-items: center;
    }

    nav {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .nav-item,
    .nav-item:hover {
        flex: 1;
        text-align: center;
        border-bottom-style: solid;
        border-top-style: none;
        border-color: var(--main-bg-color);
        padding: 16px 0;
        border-width: 2px;
    }

    .nav-item.active {
        /* en version mobile = tactile, donc hover n'a aucun intérêt. Davantage clair en appliquant le style de barre sur la classe .active */
        border-color: var(--main-color);
    }

    /* filters & search section */
    .section-filtres {
        padding: 30px 20px 25px 20px;
    }

    /* search bar */
    .search-text {
        display: none;
    }

    .search-magnifier {
        display: inline; /* pour toggle avec un media query en version mobile (ici, desktop first)*/
    }

    .search-button {
        border-radius: 15px;
        width: 50px;
        height: 50px;
        box-shadow: 0px 4px 4px var(--black-25);
        position: relative;
        top: -1px;
        border: none;
    }

    .search-form {
        flex: 1;
    }

    .search-input {
        flex: 1;
        width: 0;
        min-width: 0;
    }

    .search-elements {
        flex: 1;
    }

    .search-button-elements {
        border: solid;
        border-width: 1px 0;
        border-image: linear-gradient(
                to right,
                var(--main-bg-color) 15px,
                var(--transparent) 15px
            )
            1;
        height: 48px;
        width: 50px;
    }

    .search-bar {
        margin-top: 35px;
        margin-bottom: 35px;
    }

    /* filters */
    .section-filtres {
        padding-bottom: 35px;
    }

    .filter-options,
    button {
        flex: calc(100% / 2 - 15px);
        white-space: nowrap;
    }

    /* hebergements-and-populaires section */
    .hebergements-and-populaires {
        flex-direction: column-reverse;
        gap: 15px;
    }

    /* infobulle */
    .infobulle-elements {
        height: auto;
    }

    .infobulle-logo {
        min-width: 22px;
    }

    /* lodging */
    section.hebergements {
        background-color: var(--full-white);
        padding: 20px;
        margin-top: 0;
    }

    .hebergements {
        gap: 15px;
    }

    .hebergements-cards {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 15px;
    }

    /* popular */
    section.populaires {
        background-color: var(--main-bg-color);
        border-radius: 0;
    }

    .populaires-cards {
        flex-direction: column;
    }

    .populaires-cards a {
        width: 100%;
    }

    .populaires {
        margin: 0;
    }

    /* activities */
    .activities-cards {
        flex-direction: column;
        gap: 15px;
    }

    .card-content.activity {
        height: auto;
    }

    .card-txt.activity {
        padding: 20px 19px;
    }

    /* footer */
    footer {
        flex-direction: column;
        gap: 35px;
        padding: 30px;
    }
}
