/* ── Calendrier bibliothèque ─────────────────────────────────────────────── */

.bc-cal-wrap {
    font-family: inherit;
    max-width: 100%;
    margin-top: 4.5rem;
}

/* Header navigation */
.bc-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}
.bc-cal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}
.bc-cal-nav {
    background: var(--bc-primary, #2c6e91);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .4rem .9rem;
    cursor: pointer;
    font-size: .85rem;
    transition: opacity .2s;
}
.bc-cal-nav:hover { opacity: .85; }

/* Légende */
.bc-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.bc-cal-legend__item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    padding: .2rem .6rem;
    border-radius: 4px;
    background: #f0f0f0;
}
.bc-cal-legend__item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #ccc;
}
.bc-cal-legend__item--ouvert::before   { background: #27ae60; }
.bc-cal-legend__item--ferme::before    { background: #e0e0e0; }
.bc-cal-legend__item--vacances::before { background: #3498db; }
.bc-cal-legend__item[style]::before    { background: var(--ev-color, #e74c3c); }

/* Tabs */
.bc-cal-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: .5rem;
}
.bc-cal-tab {
    background: none;
    border: none;
    padding: .4rem 1rem;
    cursor: pointer;
    font-size: .95rem;
    color: #666;
    border-radius: 6px 6px 0 0;
    transition: all .2s;
}
.bc-cal-tab--active,
.bc-cal-tab:hover {
    background: var(--bc-primary, #2c6e91);
    color: #fff;
}

/* Vues */
.bc-cal-vue { display: none; }
.bc-cal-vue--active { display: block; }

/* ── Vue annuelle ──────────────────────────────────────────────────────────── */
.bc-cal-annee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.bc-cal-mois { }
.bc-cal-mois__titre {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 .5rem;
    text-align: center;
}

.bc-cal-mois__grille {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.bc-cal-mois__dh {
    text-align: center;
    font-size: .7rem;
    font-weight: 700;
    color: #999;
    padding: 2px 0;
}

.bc-cal-mois__jour {
    text-align: center;
    font-size: .75rem;
    padding: 3px 2px;
    border-radius: 3px;
    cursor: default;
    transition: transform .1s;
    position: relative;
}
.bc-cal-mois__jour:hover { transform: scale(1.2); z-index: 1; }

.bc-cal-mois__jour--ouvert   { background: #d5f0e0; color: #1a7a40; }
.bc-cal-mois__jour--ferme    { background: #f0f0f0; color: #aaa; }
.bc-cal-mois__jour--vacances { background: #d6eaf8; color: #1a6fa8; }
.bc-cal-mois__jour--we       { opacity: .7; }
.bc-cal-mois__jour[style]    { background: color-mix(in srgb, var(--ev-color) 20%, white); color: var(--ev-color); }

/* ── Vue mensuelle ─────────────────────────────────────────────────────────── */
.bc-cal-mois-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.bc-cal-mois-prev,
.bc-cal-mois-next {
    background: var(--bc-primary, #2c6e91);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .4rem .9rem;
    cursor: pointer;
    font-size: .85rem;
}
.bc-cal-mois-titre {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.bc-cal-mois-detail {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.bc-cal-mois__jour--lg {
    min-height: 80px;
    border-radius: 6px;
    padding: .4rem;
    font-size: .85rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bc-cal-mois__num {
    font-weight: 700;
    font-size: .9rem;
}
.bc-cal-mois__horaire {
    font-size: .7rem;
    opacity: .85;
}
.bc-cal-mois__ev {
    font-size: .68rem;
    background: rgba(0,0,0,.08);
    border-radius: 3px;
    padding: 1px 3px;
}

/* ── Admin ─────────────────────────────────────────────────────────────────── */
.bc-admin-cal__table td,
.bc-admin-cal__table th { vertical-align: middle; }
.bc-plage-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .3rem;
}
.bc-plage-row input[type="time"] { width: 110px; }

@media (max-width: 600px) {
    .bc-cal-annee-grid { grid-template-columns: 1fr 1fr; }
    .bc-cal-mois-detail { grid-template-columns: repeat(7, 1fr); }
    .bc-cal-mois__jour--lg { min-height: 50px; font-size: .7rem; }
}

/* ── Widget statut du jour ───────────────────────────────────────────────────── */
.bc-statut-jour {
    padding: 1rem 1.2rem;
    border-radius: 8px;
    border-left: 4px solid #ccc;
    background: #f9f9f9;
}
.bc-statut-jour--ouvert {
    border-left-color: #27ae60;
    background: #f0faf4;
}
.bc-statut-jour--ferme {
    border-left-color: #e74c3c;
    background: #fdf4f4;
}
.bc-statut-jour__date {
    font-size: .85rem;
    color: #666;
    margin: 0 0 .4rem;
}
.bc-statut-jour__msg {
    font-size: 1rem;
    margin: 0;
}
.bc-statut-jour__msg--ouvert { color: #1a7a40; }
.bc-statut-jour__msg--ferme  { color: #c0392b; }
.bc-statut-jour__raison {
    font-size: .85rem;
    opacity: .8;
}

/* Légende titre et hint */
.bc-cal-legend__titre {
    font-size: .8rem;
    font-weight: 700;
    margin: 0 0 .4rem;
    color: var(--contrast-2, #575760);
    width: 100%;
}
.bc-cal-legend__items {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.bc-cal-legend__hint {
    font-size: .72rem;
    color: var(--contrast-3, #b2b2be);
    margin: .4rem 0 0;
    width: 100%;
    font-style: italic;
}

.bc-cal-titre {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--bc-primary, #2c6e91);
}

/* Masque le <p></p> parasite généré par Gutenberg */
.bc-cal-wrap--compact > p:empty {
    display: none;
}
