/*
 * [lghs_calendar] : mêmes valeurs que les classes Tailwind de lghs.be/agenda,
 * pour un rendu identique quel que soit le thème.
 */
.lghs-calendar-intro {
    font-size: 1.125rem;
    line-height: 1.75rem;
    margin-bottom: 0.75rem;
}
.lghs-calendar-note,
.lghs-calendar-meta {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #4a5565;
}
.lghs-calendar abbr {
    text-decoration: underline dotted;
    cursor: help;
}
.lghs-calendar-events {
    line-height: 1.625;
}
.lghs-calendar-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid #ffd800;
}
.lghs-calendar-time {
    margin-left: 0.75rem;
    font-weight: 400;
}
.lghs-calendar-day {
    font-weight: 600;
}
.lghs-calendar-description {
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.lghs-calendar-subscribe {
    margin-top: 2rem;
    padding: 1rem;
    background: #f9fafb;
    border: 2px solid #000;
    text-align: center;
}
.lghs-calendar-subscribe-title {
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.75rem;
    margin-bottom: 0.75rem;
}
.lghs-calendar-subscribe-text {
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-bottom: 1rem;
}
.lghs-calendar-url {
    display: inline-block;
    background: #fff;
    border: 2px solid #000;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.lghs-calendar-url code {
    font-size: 0.875rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.lghs-calendar-copy {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s;
}
.lghs-calendar-copy:hover {
    background: #1e2939;
}
.lghs-calendar-cat {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: #4a5565;
    white-space: nowrap;
}
.lghs-calendar-cat.has-desc {
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}
.lghs-calendar-cat::before {
    content: "";
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    margin-right: 0.375rem;
    border-radius: 9999px;
    background: var(--lghs-cat, #ffd800);
}
.lghs-calendar-change {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
}
.lghs-calendar-description p {
    margin: 0 0 0.5rem;
}
/* Même espace sous chaque événement, quel que soit son dernier bloc (description, lien…) et les marges du thème. */
.lghs-calendar-event > *,
.lghs-calendar-description > * {
    margin-top: 0;
    margin-bottom: 0.5rem;
}
.lghs-calendar-event > .lghs-calendar-title {
    margin-top: 0;
    margin-bottom: 0.625rem;
}
/* Aération : un fin trait entre deux événements, et les blocs (changements, description, lien) détachés des infos. */
.lghs-calendar-events > .lghs-calendar-event {
    margin-top: 1.75rem;
}
.lghs-calendar-events > .lghs-calendar-event + .lghs-calendar-event {
    padding-top: 1.75rem;
    border-top: 1px solid #e5e7eb;
}
.lghs-calendar-event > .lghs-calendar-meta {
    margin-bottom: 0.25rem;
}
.lghs-calendar-event > .lghs-calendar-meta + .lghs-calendar-change,
.lghs-calendar-event > .lghs-calendar-description,
.lghs-calendar-event > .lghs-calendar-more {
    margin-top: 0.75rem;
}
.lghs-calendar-description > p:empty {
    display: none;
}
.lghs-calendar-event > :last-child,
.lghs-calendar-description > :last-child {
    margin-bottom: 0;
}
.lghs-calendar-more {
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.lghs-calendar-more a {
    font-weight: 600;
    text-decoration: underline;
}
.lghs-calendar.is-compact .lghs-calendar-event > .lghs-calendar-title {
    margin-top: 1.25rem;
}

/* Choix « Liste / Mois ». */
.lghs-calendar-tabs {
    display: inline-flex;
    border: 2px solid #000;
    margin-bottom: 1rem;
}
.lghs-calendar-tabs button {
    padding: 0.375rem 1rem;
    font-weight: 700;
    background: #fff;
    color: #000;
    cursor: pointer;
}
.lghs-calendar-tabs button[aria-selected="true"] {
    background: #000;
    color: #fff;
}

/* Vue Mois : une grille de 7 colonnes par semaine ; les pastilles se placent sous le numéro du jour. */
.lghs-calendar-month-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.lghs-calendar-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 10rem;
    text-align: center;
}
.lghs-calendar-month-arrow {
    display: inline-block;
    border: 2px solid #000;
    padding: 0.125rem 0.625rem;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
}
.lghs-calendar-month-arrow:hover {
    background: #000;
    color: #fff;
}
.lghs-calendar-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 2rem;
}
.lghs-calendar-pager .lghs-calendar-month-arrow {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}
.lghs-calendar-pager .lghs-calendar-month-arrow:last-child {
    margin-left: auto;
}
.lghs-calendar-month-today {
    font-size: 0.875rem;
    text-decoration: underline;
}
.lghs-calendar-grid {
    border: 2px solid #000;
}
.lghs-calendar-weekdays,
.lghs-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.lghs-calendar-weekdays span {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #000;
}
.lghs-calendar-week {
    grid-auto-flow: row dense;
    grid-auto-rows: minmax(1.5rem, auto);
    row-gap: 2px;
    min-height: 6.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #d1d5dc;
    /* Traits verticaux entre les jours. */
    background-image: linear-gradient(to right, #d1d5dc 1px, transparent 1px);
    background-size: calc(100% / 7) 100%;
}
.lghs-calendar-week:last-child {
    border-bottom: 0;
}
.lghs-calendar-daynum {
    grid-row: 1;
    padding: 0.25rem 0.375rem;
    font-size: 0.8125rem;
    color: #4a5565;
}
.lghs-calendar-daynum.is-other {
    color: #b0b6bf;
}
.lghs-calendar-daynum.is-today {
    font-weight: 700;
    color: #000;
    text-decoration: underline;
    text-decoration-color: #ffd800;
    text-decoration-thickness: 3px;
}
.lghs-calendar-chip {
    margin: 0 0.25rem;
    padding: 0.0625rem 0.375rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
    text-align: left;
    /* Deux lignes au plus, puis « … ». */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    background: #fff;
    color: #000;
    border: 0;
    border-left: 4px solid var(--lghs-cat, #ffd800);
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    cursor: pointer;
}
.lghs-calendar-chip.is-band {
    /* Fond teinté de la couleur de la catégorie (repli : gris clair). */
    background: #f3f4f6;
    background: color-mix(in srgb, var(--lghs-cat, #ffd800) 22%, #fff);
}
.lghs-calendar-chip.cont-before {
    margin-left: 0;
    border-left-style: dashed;
}
.lghs-calendar-chip.cont-after {
    margin-right: 0;
}
.lghs-calendar-chip:hover,
.lghs-calendar-chip:focus-visible {
    box-shadow: inset 0 0 0 2px #000;
}
.lghs-calendar-month-list {
    display: none;
}
.lghs-calendar-dialog {
    /* Bulle flottante à côté de l'événement cliqué (position calculée en JS) ; valeurs explicites car
       certains thèmes remettent à zéro le style des <dialog>. */
    position: fixed;
    inset: auto;
    margin: 0;
    z-index: 100000;
    width: min(26rem, calc(100vw - 2rem));
    max-height: min(32rem, calc(100vh - 2rem));
    overflow: auto;
    padding: 0.25rem 1rem 1rem;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-top: 6px solid var(--lghs-cat, #ffd800);
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.25);
}
.lghs-calendar-dialog:not([open]) {
    display: none;
}
.lghs-calendar-dialog-close {
    position: sticky;
    top: 0;
    float: right;
    margin-right: -0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    background: none;
    border: 0;
    cursor: pointer;
}
.lghs-calendar-dialog .lghs-calendar-event > .lghs-calendar-title {
    margin-top: 0.5rem;
}
/* Téléphone : la grille est illisible, on montre la liste du mois. */
@media (max-width: 640px) {
    .lghs-calendar-grid {
        display: none;
    }
    .lghs-calendar-month-list {
        display: block;
    }
    /* Liste + grille : sur téléphone, seulement la liste (affichée par calendar.js), sans les boutons. */
    .lghs-calendar.has-views .lghs-calendar-tabs {
        display: none !important;
    }
}
