/*
|--------------------------------------------------------------------------
| THÈME PERSONNALISABLE
|--------------------------------------------------------------------------
*/

:root {
    --resa-font-family:
        Arial,
        Helvetica,
        sans-serif;

    --resa-page-background: #f4f3ef;
    --resa-card-background: #ffffff;

    --resa-text-color: #262626;
    --resa-muted-color: #77756f;

    --resa-primary-color: #333333;
    --resa-primary-text: #ffffff;

    --resa-border-color: #dedcd5;

    --resa-available-background: #dcefd7;
    --resa-available-text: #254c26;

    --resa-unavailable-background: #e88080;
    --resa-unavailable-text: #ffffff;

    --resa-past-background: #ecebe7;
    --resa-past-text: #aaa8a1;

    --resa-today-color: #2f65b8;

    --resa-border-radius: 14px;
    --resa-small-radius: 8px;

    --resa-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);
}

/*
|--------------------------------------------------------------------------
| BASE
|--------------------------------------------------------------------------
*/

* {
    box-sizing: border-box;
}

html {
    background: transparent;
}

body.resa-page {
    margin: 0;
    padding: 0;
    background: var(--resa-page-background);
    color: var(--resa-text-color);
    font-family: var(--resa-font-family);
}

.resa-app {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px;
}

/*
|--------------------------------------------------------------------------
| EN-TÊTE
|--------------------------------------------------------------------------
*/

.resa-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.resa-header-text {
    min-width: 0;
}

.resa-main-title {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    line-height: 1.1;
    font-weight: 700;
}

.resa-introduction {
    margin: 0;
    color: var(--resa-muted-color);
    line-height: 1.5;
}

.resa-month-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.resa-options-label {
    margin-right: 4px;
    color: var(--resa-muted-color);
    font-size: 0.9rem;
}

.resa-option-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 8px 13px;
    border: 1px solid var(--resa-border-color);
    border-radius: var(--resa-small-radius);
    background: var(--resa-card-background);
    color: var(--resa-text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

.resa-option-button:hover {
    transform: translateY(-1px);
}

.resa-option-button-active {
    border-color: var(--resa-primary-color);
    background: var(--resa-primary-color);
    color: var(--resa-primary-text);
}

/*
|--------------------------------------------------------------------------
| NAVIGATION
|--------------------------------------------------------------------------
*/

.resa-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.resa-nav-button,
.resa-today-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--resa-border-color);
    border-radius: var(--resa-small-radius);
    background: var(--resa-card-background);
    color: var(--resa-text-color);
    text-decoration: none;
    font-weight: 600;
}

.resa-nav-button:first-child {
    justify-self: start;
}

.resa-nav-button:last-child {
    justify-self: end;
}

.resa-today-button {
    background: var(--resa-primary-color);
    color: var(--resa-primary-text);
    border-color: var(--resa-primary-color);
}

/*
|--------------------------------------------------------------------------
| LÉGENDE
|--------------------------------------------------------------------------
*/

.resa-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    color: var(--resa-muted-color);
    font-size: 0.9rem;
}

.resa-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.resa-legend-color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid var(--resa-border-color);
    border-radius: 5px;
}

.resa-legend-available {
    background: var(--resa-available-background);
}

.resa-legend-unavailable {
    background: var(--resa-unavailable-background);
}

.resa-legend-past {
    background: var(--resa-past-background);
}

/*
|--------------------------------------------------------------------------
| HÉBERGEMENTS
|--------------------------------------------------------------------------
*/

.resa-accommodations {
    display: grid;
    gap: 24px;
}

.resa-accommodation {
    overflow: hidden;
    border: 1px solid var(--resa-border-color);
    border-radius: var(--resa-border-radius);
    background: var(--resa-card-background);
    box-shadow: var(--resa-shadow);
}

.resa-accommodation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--resa-border-color);
}

.resa-accommodation-title {
    margin: 0;
    font-size: 1.25rem;
}

.resa-accommodation-status {
    color: var(--resa-muted-color);
    font-size: 0.88rem;
}

/*
|--------------------------------------------------------------------------
| LISTE DES MOIS
|--------------------------------------------------------------------------
*/

.resa-calendar-list {
    display: grid;
    gap: 1px;
    background: var(--resa-border-color);
}

.resa-calendar-list-1 {
    grid-template-columns: minmax(0, 1fr);
}

.resa-calendar-list-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resa-calendar-list-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resa-calendar {
    min-width: 0;
    padding: 20px;
    background: var(--resa-card-background);
}

.resa-calendar-title {
    margin: 0 0 18px;
    text-align: center;
    font-size: 1.12rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.resa-calendar-year {
    color: var(--resa-muted-color);
    font-weight: 400;
}

/*
|--------------------------------------------------------------------------
| JOURS
|--------------------------------------------------------------------------
*/

.resa-weekdays,
.resa-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.resa-weekdays {
    margin-bottom: 7px;
}

.resa-weekdays span {
    padding: 5px 1px;
    color: var(--resa-muted-color);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.resa-day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: var(--resa-small-radius);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    font-weight: 600;
}

.resa-day-empty {
    visibility: hidden;
}

.resa-day-available {
    background: var(--resa-available-background);
    color: var(--resa-available-text);
}

.resa-day-unavailable {
    background: var(--resa-unavailable-background);
    color: var(--resa-unavailable-text);
}

.resa-day-past {
    background: var(--resa-past-background);
    color: var(--resa-past-text);
}

.resa-day-today {
    border: 3px solid var(--resa-today-color);
}

.resa-day-number {
    position: relative;
    z-index: 1;
}

/*
|--------------------------------------------------------------------------
| MESSAGE VIDE
|--------------------------------------------------------------------------
*/

.resa-empty-message {
    padding: 30px;
    border: 1px solid var(--resa-border-color);
    border-radius: var(--resa-border-radius);
    background: var(--resa-card-background);
    text-align: center;
    color: var(--resa-muted-color);
}

/*
|--------------------------------------------------------------------------
| TABLETTES
|--------------------------------------------------------------------------
*/

@media (max-width: 1050px) {
    .resa-calendar-list-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resa-calendar-list-3 .resa-calendar:last-child {
        grid-column: 1 / -1;
    }
}

/*
|--------------------------------------------------------------------------
| MOBILES
|--------------------------------------------------------------------------
*/

@media (max-width: 720px) {
    .resa-app {
        padding: 15px;
    }

    .resa-header {
        display: grid;
    }

    .resa-month-options {
        width: 100%;
    }

    .resa-options-label {
        width: 100%;
    }

    .resa-option-button {
        flex: 1;
    }

    .resa-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .resa-today-button {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .resa-nav-button:first-child {
        grid-column: 1;
        grid-row: 2;
        justify-self: stretch;
    }

    .resa-nav-button:last-child {
        grid-column: 2;
        grid-row: 2;
        justify-self: stretch;
    }

    .resa-accommodation-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .resa-calendar-list,
    .resa-calendar-list-2,
    .resa-calendar-list-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .resa-calendar-list-3 .resa-calendar:last-child {
        grid-column: auto;
    }

    .resa-calendar {
        padding: 16px 10px;
    }

    .resa-weekdays,
    .resa-days {
        gap: 4px;
    }

    .resa-day {
        border-radius: 6px;
    }
}