/* Fenêtre de détail d'un événement (carte et agenda) */
html.canet-event-modal-open,
html.canet-event-modal-open body {
    overflow: hidden;
}

.canet-event-modal {
    position: fixed;
    inset: 0;
    z-index: 100000; /* au-dessus de Leaflet et de la barre d'admin */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.55);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
}

.canet-event-modal[hidden] {
    display: none;
}

.canet-event-modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.canet-event-modal-dialog:focus {
    outline: none;
}

.canet-event-modal .canet-event-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 36px;
    height: 36px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    color: #333;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
}

.canet-event-modal .canet-event-modal-close:hover {
    background: #fff;
    color: #0073aa;
}

.canet-event-modal .canet-event-modal-close:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.canet-event-modal-content {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.canet-event-modal-image {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.canet-event-modal-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
}

.canet-event-modal-banner span {
    font-size: 48px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.canet-event-modal-body {
    padding: 20px 24px 24px;
    overflow-wrap: anywhere;
}

.canet-event-modal-type {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0073aa;
}

.canet-event-modal .canet-event-modal-title {
    margin: 0 0 14px 0;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

.canet-event-modal-meta {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.canet-event-modal-description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.canet-event-modal-description > :first-child {
    margin-top: 0;
}

.canet-event-modal-description > :last-child {
    margin-bottom: 0;
}

.canet-event-modal-description img {
    max-width: 100%;
    height: auto;
}

.canet-event-modal .canet-event-modal-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 18px;
    background: #0073aa;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.canet-event-modal .canet-event-modal-button:hover,
.canet-event-modal .canet-event-modal-button:focus {
    background: #005a87;
    color: #fff;
}

@media (max-width: 768px) {
    .canet-event-modal {
        padding: 8px;
    }

    .canet-event-modal-dialog {
        max-height: calc(100vh - 16px);
    }

    .canet-event-modal-body {
        padding: 16px;
    }

    .canet-event-modal .canet-event-modal-title {
        font-size: 19px;
    }
}
