/* Scoped styles for the visual calendar shortcode `[ffme_calendrier]` */
.ffme-calendrier-wrap {
  --ffme-cal-border: rgba(0, 0, 0, 0.08);
  --ffme-cal-surface: #ffffff;
  --ffme-cal-surface-2: rgba(0, 0, 0, 0.02);
  --ffme-cal-text: #111827;
  --ffme-cal-muted: rgba(17, 24, 39, 0.55);
  --ffme-cal-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.05);
  --ffme-cal-blue: #1d4ed8;
  --ffme-cal-blue-soft: rgba(29, 78, 216, 0.08);
}

table thead:first-child tr:first-child th {
  border-block-start: none;
}

#calendrier {
  overflow: hidden;
}

.ffme-calendrier-wrap #calendrier .fc,
.ffme-calendrier-wrap #calendrier .fc-view,
.ffme-calendrier-wrap #calendrier .fc-view > table {
  border-radius: 16px;
}

#calendrier {
  --ffme-cal-border: rgba(0, 0, 0, 0.08);
  --ffme-cal-surface: #ffffff;
  --ffme-cal-surface-2: rgba(0, 0, 0, 0.02);
  --ffme-cal-text: #111827;
  --ffme-cal-muted: rgba(17, 24, 39, 0.55);
  --ffme-cal-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.05);
  --ffme-cal-blue: #1d4ed8;
  --ffme-cal-blue-soft: rgba(29, 78, 216, 0.08);
}

.ffme-calendrier-wrap #calendrier .fc {
  font-family: inherit;
  color: var(--ffme-cal-text);
}

/* Header / toolbar */
.ffme-calendrier-wrap #calendrier .fc .fc-toolbar {
  margin: 0 0 14px;
}

.ffme-calendrier-wrap #calendrier .fc .fc-toolbar-chunk {
  gap: 8px;
}

.ffme-calendrier-wrap #calendrier .fc .fc-toolbar-title {
  font-size: 18px;
  font-weight: 600;
}

.ffme-calendrier-wrap #calendrier .fc .fc-button {
  border: 1px solid var(--ffme-cal-border);
  background: var(--ffme-cal-surface) !important;
  color: var(--ffme-cal-blue) !important;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: none;
  text-shadow: none !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-button-primary {
  background: #fff !important;
  border-color: var(--ffme-cal-border) !important;
  color: var(--ffme-cal-blue) !important;
}

.ffme-calendrier-wrap #calendrier > .fc-header-toolbar.fc-toolbar .fc-toolbar-chunk button.fc-button.fc-button-primary,
.ffme-calendrier-wrap #calendrier > .fc-header-toolbar.fc-toolbar .fc-toolbar-chunk .fc-button-group button.fc-button.fc-button-primary {
  background: #fff !important;
  border-color: var(--ffme-cal-border) !important;
  color: var(--ffme-cal-blue) !important;
}

.ffme-calendrier-wrap #calendrier > .fc-header-toolbar.fc-toolbar .fc-toolbar-chunk button.fc-button.fc-button-primary:hover,
.ffme-calendrier-wrap #calendrier > .fc-header-toolbar.fc-toolbar .fc-toolbar-chunk .fc-button-group button.fc-button.fc-button-primary:hover {
  background: var(--ffme-cal-blue-soft) !important;
  border-color: rgba(29, 78, 216, 0.25) !important;
  color: var(--ffme-cal-blue) !important;
}

.ffme-calendrier-wrap #calendrier > .fc-header-toolbar.fc-toolbar .fc-toolbar-chunk button.fc-button.fc-button-primary:disabled,
.ffme-calendrier-wrap #calendrier > .fc-header-toolbar.fc-toolbar .fc-toolbar-chunk .fc-button-group button.fc-button.fc-button-primary:disabled {
  background: #fff !important;
  color: rgba(29, 78, 216, 0.45) !important;
  border-color: var(--ffme-cal-border) !important;
  opacity: 1 !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-button-primary:hover {
  background: var(--ffme-cal-blue-soft) !important;
  border-color: rgba(29, 78, 216, 0.25) !important;
  color: var(--ffme-cal-blue) !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-button-primary:disabled {
  background: #fff !important;
  color: rgba(29, 78, 216, 0.45) !important;
  border-color: var(--ffme-cal-border) !important;
  opacity: 1 !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-icon {
  color: var(--ffme-cal-blue) !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-button:hover {
  background: var(--ffme-cal-blue-soft);
  border-color: rgba(29, 78, 216, 0.25);
}

.ffme-calendrier-wrap #calendrier .fc .fc-button:disabled {
  opacity: 0.5;
}

/* Legacy FullCalendar (v3) toolbar */
.ffme-calendrier-wrap #calendrier .fc .fc-header {
  margin-bottom: 14px;
}
.ffme-calendrier-wrap #calendrier .fc .fc-header-title h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.ffme-calendrier-wrap #calendrier .fc .fc-button {
  background-image: none !important;
}

/* Day grid: rounded cells */
.ffme-calendrier-wrap #calendrier .fc .fc-scrollgrid,
.ffme-calendrier-wrap #calendrier .fc .fc-scrollgrid-section > td {
  border: none;
}

.ffme-calendrier-wrap #calendrier .fc .fc-scrollgrid {
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
}

/* .ffme-calendrier-wrap #calendrier .fc-view-harness {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--ffme-cal-border);
  background: var(--ffme-cal-surface) !important;
} */

.ffme-calendrier-wrap #calendrier .fc-view-harness .fc-view,
.ffme-calendrier-wrap #calendrier .fc-view-harness .fc-view > table,
.ffme-calendrier-wrap #calendrier .fc-view-harness .fc-scrollgrid {
  border-radius: 16px;
  overflow: hidden;
}

.ffme-calendrier-wrap #calendrier .fc .fc-col-header-cell-cushion {
  padding: 10px 6px;
  color: var(--ffme-cal-muted);
  font-weight: 600;
  text-transform: lowercase;
}

.ffme-calendrier-wrap #calendrier .fc .fc-daygrid-day {
  background: transparent;
  padding: 0 !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-daygrid-day-frame {
  border: 1px solid var(--ffme-cal-border);
  border-radius: 14px !important;
  background: var(--ffme-cal-surface) !important;
  margin: 8px !important;
  padding: 12px !important;
  min-height: 110px !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-day-today .fc-daygrid-day-frame {
  background: var(--ffme-cal-blue-soft) !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-daygrid-day-number {
  color: var(--ffme-cal-muted);
  font-weight: 600;
  padding: 0;
}

/* Events as cards */
.ffme-calendrier-wrap #calendrier .fc .fc-daygrid-event {
  border-radius: 12px !important;
  border-width: 1px;
  padding: 0;
  margin-top: 8px;
  box-shadow: var(--ffme-cal-shadow) !important;
}

.ffme-calendrier-wrap #calendrier .fc .fc-event-main {
  padding: 8px 10px;
}

.ffme-calendrier-wrap #calendrier .fc .fc-event-title {
  font-weight: 600;
}

.ffme-calendrier-wrap #calendrier .fc .fc-event-time {
  font-weight: 600;
  opacity: 0.85;
  margin-right: 6px;
}

/* Make links feel like cards */
.ffme-calendrier-wrap #calendrier .fc a.fc-event {
  text-decoration: none;
}

/* More-link pill */
.ffme-calendrier-wrap #calendrier .fc .fc-daygrid-more-link {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--ffme-cal-border);
  background: var(--ffme-cal-surface) !important;
  color: var(--ffme-cal-text);
}

/* Legacy FullCalendar (v3) month table compactness fix */
.ffme-calendrier-wrap #calendrier .fc-border-separate {
  border-radius: 16px;
  overflow: hidden;
}

.ffme-calendrier-wrap #calendrier .fc-border-separate th,
.ffme-calendrier-wrap #calendrier .fc-border-separate td {
  border-color: var(--ffme-cal-border) !important;
}

.ffme-calendrier-wrap #calendrier .fc-widget-header {
  background: var(--ffme-cal-surface) !important;
  color: var(--ffme-cal-muted) !important;
  font-weight: 600;
}

.ffme-calendrier-wrap #calendrier .fc-widget-content {
  background: var(--ffme-cal-surface) !important;
}

.ffme-calendrier-wrap #calendrier td.fc-widget-content {
  padding: 10px !important;
  vertical-align: top;
}

.ffme-calendrier-wrap #calendrier .fc-day-number {
  color: var(--ffme-cal-muted) !important;
  font-weight: 600;
  padding: 0 0 6px !important;
}

.ffme-calendrier-wrap #calendrier .fc-event,
.ffme-calendrier-wrap #calendrier .fc-event-skin {
  border-radius: 12px !important;
  box-shadow: var(--ffme-cal-shadow) !important;
}

.ffme-calendrier-wrap #calendrier .fc-event-inner,
.ffme-calendrier-wrap #calendrier .fc-event-title,
.ffme-calendrier-wrap #calendrier .fc-event-time {
  padding: 8px 10px !important;
}

/* View toggle ("Affichage: calendrier | liste | imprimer") */
.ffme-cal-view-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--ffme-cal-border);
  border-radius: 14px;
  background: var(--ffme-cal-surface) !important;
}

.ffme-cal-view-toggle__label {
  color: var(--ffme-cal-muted);
  font-weight: 600;
}

.ffme-cal-view-toggle__sep {
  color: rgba(0, 0, 0, 0.18);
  user-select: none;
}

.ffme-cal-view-toggle__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ffme-cal-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ffme-cal-blue);
  text-decoration: none;
  font-weight: 600;
}

.ffme-cal-view-toggle__link:hover {
  background: var(--ffme-cal-blue-soft);
  border-color: rgba(29, 78, 216, 0.25);
}

/* Calendar links (taxonomies) */
.ffme-calendrier-wrap .calendar_links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ffme-calendrier-wrap .calendar_links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
  border-width: 1px;
  border-style: solid;
  line-height: 1;
}

.ffme-calendrier-wrap .calendar_links a:hover {
  filter: brightness(0.95);
}

/* Event tooltip */
.ffme-cal-tooltip {
  position: fixed;
  z-index: 99999;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.ffme-cal-tooltip__title {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.ffme-cal-tooltip__meta {
  opacity: 0.85;
  font-weight: 600;
  font-size: 12px;
}

/* Events list (toggle "liste") */
.ffme-calendrier-wrap .events_list {
  margin-top: 14px;
}

.ffme-calendrier-wrap .events_list ul {
  margin: 12px 0 22px;
  padding-left: 18px;
}

.ffme-calendrier-wrap .events_list li {
  margin: 8px 0;
}

.ffme-calendrier-wrap .events_list form {
  margin-top: 18px;
}

.ffme-calendrier-wrap .events_list form p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 30px;
  gap: 10px;
}

.ffme-calendrier-wrap .events_list form label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.ffme-calendrier-wrap .events_list form select {
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--ffme-cal-border);
  background: #fff;
}

.ffme-calendrier-wrap .events_list form input[type='submit'] {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--ffme-cal-border);
  background: #fff;
  color: var(--ffme-cal-blue);
  font-weight: 700;
  cursor: pointer;
}

.ffme-calendrier-wrap .events_list form input[type='submit']:hover {
  background: var(--ffme-cal-blue-soft);
  border-color: rgba(29, 78, 216, 0.25);
}

