/* =============================================================================
 * Calendrier public des activités partagées (activite_partagee_calendar.php).
 * -----------------------------------------------------------------------------
 * Regroupe les règles qui vivaient dans deux blocs <style> inline de la page —
 * dont un cassé (@media sans accolade : toute la règle mobile était ignorée).
 * Palette alignée sur act_partagee_polish.css pour que la page publique et le
 * widget embarqué se ressemblent.
 * =============================================================================
 */

#act_partagee_container_cards {
    --ap-radius: 12px;
    --ap-radius-sm: 8px;
    --ap-surface: #FFFFFF;
    --ap-bg: #F8FAFC;
    --ap-border: #E2E8F0;
    --ap-text: #0F172A;
    --ap-text-muted: #64748B;
    --ap-success: #10B981;
    --ap-success-soft: #D1FAE5;
    --ap-danger: #B91C1C;
    --ap-danger-soft: #FEE2E2;
    --ap-warn: #92400E;
    --ap-warn-soft: #FEF3C7;
    --ap-accent: #1D4ED8;
    --ap-accent-soft: #DBEAFE;
}

body {
    padding-top: 20px;
}

.fc-view-harness {
    background-color: #fff;
}

.table-bordered td {
    border: 1px solid #dee2e6;
}

.fc-toolbar-title::first-letter {
    text-transform: capitalize;
}

/* Correction bug caractères spéciaux en vue semaine et jour */
.fc-dayGridWeek-view .fc-daygrid-day-number,
.fc-dayGridWeek-view .fc-daygrid-week-number,
.fc-dayGridDay-view .fc-daygrid-day-number,
.fc-dayGridDay-view .fc-daygrid-week-number {
    display: none;
}

.fc-dayGridWeek-view .fc-daygrid-day-top,
.fc-dayGridDay-view .fc-daygrid-day-top {
    margin-bottom: 3px;
}

/* Une activité complète ou fermée doit se lire comme telle dans la grille,
   pas seulement une fois la fiche ouverte. */
#act_partagee_calendar_card .fc-event.ap-event-closed {
    opacity: .55;
}

/* ===== Filtre par organisation ===== */
.ap-orgfilter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.ap-orgfilter > label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-text-muted);
}

#act_partagee_container_cards .ap-orgfilter .bootstrap-select {
    width: auto !important;
    max-width: 100%;
}

/* ===== Panneau de gauche ===== */
.ap-today {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-text-muted);
    margin-bottom: 14px;
}

.ap-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ap-text-muted);
    margin: 18px 0 8px;
}

.infos_today .ap-section-title:first-child,
#act_partagee_allEvents > div:first-of-type .ap-section-title {
    margin-top: 0;
}

.ap-event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Carte d'activité : la date et l'heure passent avant tout, c'est ce qu'on
   cherche dans une liste d'activités — l'ancien bouton coloré ne portait que
   le libellé, deux créneaux d'une même activité étaient indiscernables. */
.ap-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 10px 12px 10px 10px;
    text-align: left;
    background: var(--ap-surface);
    border: 1px solid var(--ap-border);
    border-left: 4px solid var(--ap-event-color, var(--ap-accent));
    border-radius: var(--ap-radius-sm);
    cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.ap-event:hover,
.ap-event:focus-visible {
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
    outline: none;
}

.ap-event__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 4px 0;
    border-radius: 6px;
    background: var(--ap-bg);
    line-height: 1.1;
}

.ap-event__day {
    font-size: 17px;
    font-weight: 700;
    color: var(--ap-text);
}

.ap-event__month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ap-text-muted);
}

.ap-event__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.ap-event__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-text);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.ap-event__meta {
    font-size: 12px;
    color: var(--ap-text-muted);
    overflow-wrap: anywhere;
}

.ap-event__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.ap-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.ap-badge--free {
    background: var(--ap-success-soft);
    color: #047857;
}

.ap-badge--price {
    background: var(--ap-accent-soft);
    color: var(--ap-accent);
}

.ap-badge--last {
    background: var(--ap-warn-soft);
    color: var(--ap-warn);
}

.ap-badge--closed {
    background: var(--ap-danger-soft);
    color: var(--ap-danger);
}

.ap-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 12px;
    color: var(--ap-text-muted);
    text-align: center;
}

.ap-empty i {
    font-size: 26px;
    opacity: .5;
}

.ap-empty p {
    margin: 0;
    font-size: 13px;
}

/* ===== Fiche détaillée ===== */
/* Le détail vit dans le même corps de carte que la liste : il était rendu en
   pied de carte, ce qui laissait le corps vide visible au-dessus de lui. */
.ap-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-text-muted);
    cursor: pointer;
}

.ap-detail__back:hover {
    color: var(--ap-text);
}

.ap-detail__title {
    margin: 16px 0 10px;
    font-size: 19px;
    font-weight: 700;
    color: var(--ap-text);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.ap-detail__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.ap-detail__badges:empty {
    display: none;
}

.ap-detail__rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ap-detail__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--ap-text);
    overflow-wrap: anywhere;
}

.ap-detail__row i {
    width: 14px;
    margin-top: 3px;
    flex: none;
    text-align: center;
    color: var(--ap-text-muted);
}

.ap-detail__desc {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--ap-border);
    font-size: 13px;
    line-height: 1.55;
    color: var(--ap-text-muted);
    overflow-wrap: anywhere;
}

.ap-detail__places {
    margin-top: 14px;
    font-size: 13px;
    color: var(--ap-text-muted);
}

.ap-detail__places i {
    color: var(--ap-text-muted);
}

.ap-detail__unavailable {
    margin: 14px 0 0;
    padding: 8px 10px;
    border-radius: var(--ap-radius-sm);
    background: var(--ap-danger-soft);
    color: var(--ap-danger);
    font-size: 12.5px;
}

.ap-detail__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
}

#act_partagee_info_card .ap-detail__actions .btn.act_partagee_registerBtn {
    width: 100%;
    padding: 9px 16px;
    font-weight: 600;
}

.ap-detail__ical {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ap-text-muted);
}

.ap-detail__ical:hover {
    color: var(--ap-accent);
}

/* ===== Responsive ===== */
/* La mise en page de la barre d'outils en petit écran est traitée une seule fois,
   dans act_partagee_calendar.css, partagé avec le widget embarqué. */

@media (max-width: 768px) {
    /* Sur mobile la liste passe avant la grille : c'est elle qui répond à
       « qu'est-ce qui est prévu ? », la grille demande de viser une case. */
    #act_partagee_container_cards .row {
        flex-direction: column;
    }

    .ap-event-list {
        gap: 10px;
    }

    .ap-event {
        padding: 12px;
    }

    .ap-event__title {
        font-size: 14px;
    }

    .ap-detail__actions {
        align-items: stretch;
    }

    .ap-detail__ical {
        text-align: center;
    }
}

@media screen and (max-width: 450px) {
    .mod_act_partagee_cardText {
        font-size: 13px;
        padding-left: 20px;
    }

    .mod_act_partagee_cardTitle {
        margin-top: 15px;
    }
}
