/* ===================================================================
   cmpCalendar.css — Styles PROPRES au composant cmpCalendar : la maquette
   décorative du calendrier (hero) et l'aperçu « live » du configurateur.
   Le châssis commun vient de ../assets/css/composant.css.
   =================================================================== */
.cal-mock {
    --rail: 30px;
    --cell: 42px;
    --gap: 2px;
    width: 100%;
    max-width: 360px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(112, 189, 149, .06);
    font-size: 13px;
    position: relative;
    transition: transform .4s ease, box-shadow .4s ease;
}
[data-theme="light"] .cal-mock { box-shadow: 0 24px 60px -24px rgba(30, 41, 59, .35); }
.cal-mock:hover { transform: translateY(-4px); }

/* En-tête du calendrier : ‹ Mois Année › */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 6px;
    background: var(--bg-panel);
    color: var(--text-dim);
    font-size: 15px;
    border: 1px solid transparent;
}
/* Pas de flex:1 : le titre garde sa largeur pour que « › » reste collé à
   l'année (cluster ‹ Mois Année › + icône « aujourd'hui » aligné à gauche). */
.cal-title { font-weight: 700; font-size: 14px; color: var(--text-light); }

/* Chips contextuels */
.cal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cal-chip {
    font-size: 10px; font-weight: 700; letter-spacing: .03em;
    padding: 2px 7px; border-radius: 999px;
    color: var(--g-text); background: var(--primary-glow);
    border: 1px solid rgba(112, 189, 149, .3);
}
.cal-selline { font-size: 11px; color: var(--text-dim); margin-bottom: 10px; }
.cal-selline b { color: var(--text-light); font-weight: 700; }

/* Grille : rail des semaines + 7 jours */
.cal-grid { display: grid; grid-template-columns: var(--rail) repeat(7, 1fr); gap: var(--gap); }
.cal-hcell, .cal-week, .cal-cell { height: var(--cell); display: grid; place-items: center; position: relative; }
.cal-hcell { height: 26px; font-size: 10px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.cal-hcell.rail-h { color: var(--primary); }

.cal-week { font-size: 11px; font-weight: 700; color: var(--g-text); background: var(--primary-glow); border-radius: 7px; cursor: default; }

.cal-cell { color: var(--text-light); font-weight: 600; border-radius: 8px; }
.cal-cell .d { position: relative; z-index: 3; }
.cal-cell.adj .d { color: var(--text-dim); opacity: .55; }
.cal-cell.we { background: rgba(127, 145, 170, .07); }

/* Couches empilées (bande de plage, disque) */
.cal-cell .layer { position: absolute; inset: 0; pointer-events: none; }
.cal-cell .band { inset-block: 6px; inset-inline: calc(var(--gap) * -1); background: rgba(112, 189, 149, .20); z-index: 1; }
.cal-cell.r-start .band { inset-inline-start: 4px; border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.cal-cell.r-end   .band { inset-inline-end: 4px; border-top-right-radius: 999px; border-bottom-right-radius: 999px; }

/* Disque de sélection (extrémités de plage) */
.cal-cell .disc { position: absolute; width: 30px; height: 30px; border-radius: 50%; z-index: 2; }
.cal-cell.sel .disc { background: var(--g-fill); box-shadow: 0 2px 8px rgba(112, 189, 149, .4); }
.cal-cell.sel .d { color: #fff; }
/* Forme de l'indicateur de sélection (Settings.SelectionRadius) : cercle par
   défaut (-1), carré arrondi quand le configurateur passe en « Carré ». */
.cal-live.sel-square .cal-cell.sel .disc { border-radius: 9px; }

/* Aujourd'hui (TodayStyle) */
.cal-cell.today .disc { border: 2px solid var(--primary); }
.cal-cell.today-fill .disc { background: var(--g-fill); }
.cal-cell.today-fill .d { color: #fff; }
.cal-cell.today-bold .d { font-weight: 800; color: var(--g-text); }

/* Marqueurs data-driven */
.cal-cell.m-fill .disc { background: var(--mk, #ef4444); }
.cal-cell.m-fill .d { color: #fff; }
.cal-cell.m-ring .disc { border: 2px solid var(--mk, #3b82f6); }

/* Jour bloqué : barré + grisé */
.cal-cell.blocked .d { color: var(--text-dim); text-decoration: line-through; opacity: .7; }

/* Pastilles d'événements */
.cal-dots { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; z-index: 3; }
.cal-dots i { width: 4px; height: 4px; border-radius: 50%; }

/* Pied : légende + actions */
.cal-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.cal-leg { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-dim); }
.cal-leg .sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
/* margin-left:auto : les actions restent calées à DROITE même quand la
   légende est masquée (sinon, sans la légende flex:1, elles glissent à gauche). */
.cal-actions { display: flex; gap: 6px; margin-left: auto; }
.cal-btn { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-dim); background: var(--bg-panel); }
.cal-btn.ok { background: var(--g-fill); color: #fff; border-color: var(--g-fill); }
/* Icône « aujourd'hui » : petit calendrier (SVG) avec le numéro du jour par
   dessus, à droite de la flèche « › » (miroir de imgHeaderToday du composant). */
.cal-today-ic { position: relative; width: 24px; height: 24px; display: inline-grid; place-items: center; color: var(--g-text); }
.cal-today-ic svg { width: 20px; height: 20px; }
.cal-today-ic .d-num { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 8px; font-weight: 700; color: var(--g-text); }

/* Ligne d'heure (sélection d'heure) */
.cal-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--text-dim); }
.cal-time .clock { font-size: 13px; }
.cal-time .drop { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-weight: 700; color: var(--text-light); }

/* ---- Variante « live » : calendrier piloté par le configurateur ---- */
.cal-mock.cal-live { width: fit-content; max-width: 100%; transition: none; }
.cal-mock.cal-live:hover { transform: none; }
.cal-live .cal-grid { grid-template-columns: var(--rail) repeat(7, var(--cell)); }
.cal-live .cal-grid.no-rail { grid-template-columns: repeat(7, var(--cell)); }
.cal-mock.compact { --cell: 34px; font-size: 12px; }
.cal-duo { display: flex; gap: 16px; }
/* Maquette hero (mono-mois, hors .cal-live) : la grille doit REMPLIR la carte.
   .cal-duo étant un conteneur flex, une grille à colonnes 1fr enfant flex ne
   s'étire pas et se réduit à son contenu (~214px), laissant un vide à droite.
   On la fait grandir pour occuper toute la largeur de la carte. */
.cal-mock:not(.cal-live) .cal-grid { flex: 1; min-width: 0; }
/* DarkMode DU COMPOSANT : palette propre (indépendante du thème du site),
   par surcharge locale des variables utilisées par .cal-* */
.cal-mock.cal-live[data-cmp="light"] {
    --bg-sidebar: #ffffff; --bg-panel: #eef1f5; --text-light: #1a2332;
    --text-dim: #5a6b7d; --border: #dde3ea; --primary-glow: rgba(112, 189, 149, .14);
}
.cal-mock.cal-live[data-cmp="dark"] {
    --bg-sidebar: #1e2a38; --bg-panel: #253446; --text-light: #e8ecf1;
    --text-dim: #8899aa; --border: #2e4058; --primary-glow: rgba(112, 189, 149, .15);
}

/* Reflow (WCAG 1.4.10) : sous 560px on réduit les cellules et on empile le
   double-mois verticalement plutôt que d'imposer un long scroll horizontal. */
@media (max-width: 560px) {
    .cal-mock.cal-live { --cell: 32px; --rail: 24px; }
    .cal-duo { flex-wrap: wrap; }
}
