/* ================================================================
   Calendrier des évènements RP — /calendrier (web/js/calendar.js)
   Cibles tactiles ≥ 40 px, vue liste par défaut sur mobile.
================================================================ */
.cal-hero {
    background: linear-gradient(to bottom, rgba(0,0,0,.72), var(--bg-deep)), url('/IMG/welcome.png') center/cover no-repeat;
    padding: 5rem 0 2.5rem; text-align: center;
}
.cal-hero h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 3.2rem); color: var(--bone); margin: 1rem 0 .6rem; }
.cal-main { padding: 1.5rem 0 3rem; }
.cal-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cal-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-views, .cal-nav, .cal-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cal-period { font-family: var(--font-display); color: var(--bone); margin-left: .4rem; text-transform: capitalize; }
.cal-btn {
    min-height: 44px; min-width: 44px; padding: .45rem .9rem; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
    background: var(--bg-card); color: var(--bone); border: 1px solid var(--border-warm); border-radius: 6px;
    font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.cal-btn:hover, .cal-btn:focus-visible { background: var(--bg-card-hover); border-color: var(--orange); }
.cal-btn.is-active { background: var(--orange); border-color: var(--orange); color: #fff; }
.cal-btn[hidden] { display: none; }
.cal-btn:disabled { opacity: .6; cursor: wait; }
.cal-btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.cal-btn-danger { border-color: var(--rust); color: var(--rust-light); }
.cal-select {
    min-height: 44px; padding: .4rem .6rem; background: var(--bg-card); color: var(--bone);
    border: 1px solid var(--border-warm); border-radius: 6px; font: inherit; font-size: 16px; max-width: 220px;
}
.cal-root { min-height: 200px; }
.cal-empty, .cal-none { color: var(--ash); text-align: center; padding: 2rem 1rem; }
.cal-none { padding: .4rem; margin: 0; }
.cal-tz { color: var(--ash); font-size: .8rem; margin-top: .8rem; text-align: right; }

/* Mois */
.cal-month { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-dark); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { padding: .5rem; text-align: center; color: var(--bone-dim); font-size: .8rem; font-family: var(--font-accent); border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 110px; padding: .3rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.is-out { background: rgba(0,0,0,.25); }
.cal-cell.is-out .cal-daynum { opacity: .45; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-daynum { font-size: .8rem; color: var(--bone-dim); }
.cal-chip {
    display: flex; flex-wrap: wrap; gap: 0 .3rem; align-items: baseline; width: 100%; min-height: 40px; text-align: left;
    padding: .25rem .4rem; border: 0; border-left: 3px solid var(--ev, var(--rust)); border-radius: 4px;
    background: color-mix(in srgb, var(--ev, #C0392B) 18%, var(--bg-card)); color: var(--bone); font: inherit; font-size: .78rem; cursor: pointer;
}
.cal-chip:hover, .cal-chip:focus-visible { filter: brightness(1.2); }
.cal-chip:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.cal-chip-time { font-weight: 700; color: var(--gold); }
.cal-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cal-chip-meta { width: 100%; color: var(--bone-dim); font-size: .72rem; }
.cal-chip.is-cancelled { opacity: .55; text-decoration: line-through; }
.cal-chip.is-mine { box-shadow: inset 0 0 0 1px #43b581; }
.cal-more { min-height: 32px; min-width: 24px; background: none; border: 0; color: var(--orange); cursor: pointer; font: inherit; font-size: .78rem; text-align: left; }

/* Semaine */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.cal-wday { background: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; padding: .5rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.cal-wday h3 { font-size: .85rem; color: var(--bone-dim); margin: 0 0 .2rem; text-transform: capitalize; font-family: var(--font-accent); }
.cal-wday.is-today { border-color: var(--orange); }

/* Liste */
.cal-list { display: flex; flex-direction: column; gap: .6rem; }
.cal-list-day { font-family: var(--font-display); color: var(--orange); font-size: 1rem; margin: 1rem 0 .2rem; text-transform: capitalize; }
.cal-card {
    display: grid; grid-template-columns: 96px 1fr; gap: .8rem; align-items: center; width: 100%; min-height: 72px; text-align: left;
    background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--ev, var(--rust)); border-radius: 8px;
    padding: .5rem; color: var(--bone); font: inherit; cursor: pointer;
}
.cal-card:hover, .cal-card:focus-visible { background: var(--bg-card-hover); }
.cal-card:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.cal-card.is-cancelled { opacity: .6; }
.cal-card.is-cancelled .cal-card-title { text-decoration: line-through; }
.cal-card-img { width: 96px; height: 64px; object-fit: cover; border-radius: 5px; }
.cal-card-noimg { display: flex; align-items: center; justify-content: center; background: var(--bg-dark); font-size: 1.6rem; }
.cal-card-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.cal-card-title { font-family: var(--font-display); font-size: 1.05rem; }
.cal-card-meta { color: var(--bone-dim); font-size: .82rem; }

.cal-badge { display: inline-block; padding: .05rem .45rem; border-radius: 3px; font-size: .7rem; font-family: var(--font-accent); vertical-align: middle; }
.cal-badge-ok { background: rgba(67,181,129,.2); color: #43b581; }
.cal-badge-wait { background: rgba(241,196,15,.18); color: #f1c40f; }
.cal-badge-off { background: rgba(231,76,60,.2); color: var(--rust-light); }

/* Détail */
.cal-modal { position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.75); padding: 1rem; }
.cal-modal.is-open { display: flex; }
.cal-modal-box { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: var(--bg-dark); border: 1px solid var(--border-warm); border-radius: 10px; padding: 1.3rem; }
.cal-modal-close { position: absolute; top: .5rem; right: .5rem; width: 40px; height: 40px; background: var(--bg-card); color: var(--bone); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; font-size: 1rem; }
.cal-d-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 6px; margin-bottom: .8rem; }
.cal-d-title { font-family: var(--font-display); color: var(--bone); border-left: 4px solid var(--ev, var(--rust)); padding-left: .6rem; margin: 0 2.5rem .8rem 0; font-size: 1.4rem; }
.cal-d-meta { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .3rem; color: var(--bone-dim); }
.cal-d-desc { color: var(--bone); line-height: 1.55; margin-bottom: 1rem; overflow-wrap: anywhere; }
.cal-d-actions, .cal-d-links { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.cal-check { display: flex; align-items: center; gap: .5rem; min-height: 40px; width: 100%; color: var(--bone-dim); cursor: pointer; }
.cal-check input { width: 22px; height: 22px; accent-color: var(--orange); }
.cal-note { width: 100%; margin: 0; color: var(--bone-dim); }
.cal-note-ok { color: #43b581; }
.cal-note-off { color: var(--rust-light); }
.cal-d-others { color: var(--bone-dim); font-size: .85rem; }
.cal-link { min-height: 40px; background: none; border: 0; color: var(--orange); cursor: pointer; font: inherit; text-decoration: underline; padding: 0 .2rem; }

.cal-toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(150%); background: var(--bg-card); color: var(--bone); border: 1px solid #43b581; padding: .7rem 1.1rem; border-radius: 6px; z-index: 1300; transition: transform .25s; max-width: 90vw; }
.cal-toast.is-show { transform: translateX(-50%) translateY(0); }
.cal-toast.is-err { border-color: var(--rust-light); }

@media (max-width: 720px) {
    .cal-hero { padding: 4rem 0 1.5rem; }
    .cal-toolbar { flex-direction: column; align-items: stretch; }
    .cal-views .cal-btn { flex: 1; }
    .cal-filters .cal-select { flex: 1; max-width: none; }
    .cal-cell { min-height: 64px; padding: .15rem; }
    .cal-chip-title, .cal-chip-meta { display: none; }
    .cal-chip { justify-content: center; padding: .2rem; }
    .cal-week { grid-template-columns: 1fr; }
    .cal-card { grid-template-columns: 72px 1fr; }
    .cal-card-img { width: 72px; height: 56px; }
    .cal-modal { padding: 0; align-items: flex-end; }
    .cal-modal-box { max-height: 94vh; border-radius: 12px 12px 0 0; }
}

.cal-btn:focus-visible, .cal-select:focus-visible, .cal-more:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
