/* =============================================================
   Rental Planning – Frontend Calendar
   Design cohérent avec bevan-dudi.fr
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Barlow:wght@500;600&display=swap');

/* -------- Variables -------- */
.rp-calendar-widget {
    --rp-navy:       #1d3557;
    --rp-green:      #CDDFC5;
    --rp-orange:     #FFAA4D;
    --rp-red:        #DB6064;
    --rp-grey:       #e0e0e0;
    --rp-cell-max:   40px;   /* taille max d'un cercle */
    --rp-gap:        6px;
    --rp-font-title: 'Barlow Condensed', sans-serif;
    --rp-font-body:  'Barlow', 'Hind', sans-serif;

    width: 100%;             /* prend toute la largeur du conteneur parent */
    max-width: 100%;
    background: transparent; /* pas de fond – hérite du parent */
    font-family: var(--rp-font-body);
    box-sizing: border-box;
}

/* ================================================================
   HEADER
   ================================================================ */
.rp-calendar-widget .rp-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}

.rp-calendar-widget .rp-prev-month,
.rp-calendar-widget .rp-next-month {
    width:  34px;
    height: 34px;
    border-radius: 50%;
    background: var(--rp-navy);
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .15s;
    padding: 0;
}
.rp-calendar-widget .rp-prev-month:hover,
.rp-calendar-widget .rp-next-month:hover { opacity: .75; }

.rp-calendar-widget .rp-current-month {
    flex: 1;
    text-align: center;
    font-family: var(--rp-font-title);
    font-size: 17px;
    font-weight: 700;
    color: var(--rp-navy);
    letter-spacing: .02em;
    text-transform: capitalize;
}

/* ================================================================
   NOMS DES JOURS
   ================================================================ */
.rp-calendar-widget .rp-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 6px;
}
.rp-calendar-widget .rp-days-header span {
    text-align: center;
    font-family: var(--rp-font-title);
    font-size: 11px;
    font-weight: 700;
    color: var(--rp-navy);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 0;
}

/* ================================================================
   GRILLE
   ================================================================ */
.rp-calendar-widget .rp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--rp-gap);
    position: relative;
}

/* ================================================================
   CELLULES — cercles à taille plafonnée
   La grille est 100% large mais chaque cercle est max --rp-cell-max.
   Résultat : plus le conteneur est large, plus il y a d'espace
   entre les cercles, mais les cercles ne grossissent plus.
   ================================================================ */
.rp-calendar-widget .rp-day {
    width:  min(100%, var(--rp-cell-max));
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: 0 auto;          /* centré dans la colonne */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--rp-font-title);
    font-size: 13px;
    font-weight: 700;
    color: var(--rp-navy);
    cursor: default;
    transition: transform .1s;
    user-select: none;
    box-sizing: border-box;
}

.rp-calendar-widget .rp-day.rp-empty       { background: transparent; }
.rp-calendar-widget .rp-day.rp-available   { background: var(--rp-green);  }
.rp-calendar-widget .rp-day.rp-partial     { background: var(--rp-orange); }
.rp-calendar-widget .rp-day.rp-unavailable { background: var(--rp-red);    color: #fff; }
.rp-calendar-widget .rp-day.rp-past        { background: var(--rp-grey);   color: #999; }

.rp-calendar-widget .rp-day:not(.rp-empty):not(.rp-past):hover {
    transform: scale(1.12);
    z-index: 1;
}

/* Overlay chargement */
.rp-calendar-widget .rp-cal-grid.rp-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.55);
    z-index: 5;
}

/* ================================================================
   LÉGENDE
   ================================================================ */
.rp-calendar-widget .rp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}
.rp-calendar-widget .rp-legend .rp-leg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--rp-font-body);
    font-size: 11px;
    font-weight: 500;
    color: var(--rp-navy);
}
.rp-calendar-widget .rp-legend .rp-leg::before {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rp-calendar-widget .rp-legend .rp-available::before   { background: var(--rp-green); }
.rp-calendar-widget .rp-legend .rp-partial::before     { background: var(--rp-orange); }
.rp-calendar-widget .rp-legend .rp-unavailable::before { background: var(--rp-red); }
