/* ===== Couleurs par categorie ===== */
.ftse-cat-competition { --c: #d32f2f; } /* rouge */
.ftse-cat-meeting     { --c: #757575; } /* gris */
.ftse-cat-assembly          { --c: #1976d2; } /* bleu */
.ftse-cat-election    { --c: #f57c00; } /* orange */
.ftse-cat-training   { --c: #388e3c; } /* vert */
.ftse-cat-deadline    { --c: #7b1fa2; } /* violet */
.ftse-cat-other       { --c: #37474f; } /* anthracite */

.ftse-badge { display: inline-block; padding: .15em .65em; border-radius: 999px; background: var(--c, #37474f); color: #fff; font-size: .8rem; line-height: 1.5; }
.ftse-badge.ftse-vis { background: transparent; color: #444; border: 1px solid #999; }
.ftse-dot   { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }

/* ===== Widget ===== */
#ftse-agenda { --ftse-border: #dcdfe4; --ftse-bg: #fff; --ftse-muted: #6b7280; --ftse-accent: #0b5ed7; max-width: none; width: 100%; margin: 0 auto; container-type: inline-size; }

/* Disposition : colonne de gauche (horloge + calendrier) / colonne de droite (evenements), meme hauteur */
.ftse-grid { display: grid; grid-template-columns: minmax(270px, 330px) 1fr; gap: .75rem; align-items: stretch; }
.ftse-left { display: flex; flex-direction: column; gap: .75rem; }
.ftse-details { overflow-y: auto; }
.ftse-card { box-sizing: border-box; background: var(--ftse-bg); border: 1px solid var(--ftse-border); border-radius: 12px; padding: .55rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* Horloge (bandeau compact) */
.ftse-clock { display: grid; grid-template-columns: 70px 1fr; grid-template-areas: "svg dig" "svg date"; column-gap: .9rem; align-items: center; }
.ftse-clock svg { grid-area: svg; width: 70px; max-width: 70px; display: block; direction: ltr; }
.ftse-face { fill: #fff; stroke: #263238; stroke-width: 3; }
.ftse-tick { stroke: #90a4ae; stroke-width: 1; }
.ftse-tick-big { stroke: #263238; stroke-width: 2.5; }
.ftse-num { font: 600 12px sans-serif; fill: #263238; }
.ftse-hand { stroke-linecap: round; }
.ftse-hour { stroke: #263238; stroke-width: 5; }
.ftse-min  { stroke: #263238; stroke-width: 3; }
.ftse-sec  { stroke: #d32f2f; stroke-width: 1.5; }
.ftse-pivot { fill: #d32f2f; }
.ftse-digital { grid-area: dig; align-self: end; text-align: start; font: 600 1.1rem/1.2 monospace; direction: ltr; }
.ftse-date-full { grid-area: date; align-self: start; text-align: start; color: var(--ftse-muted); font-size: .78rem; }

/* Calendrier */
.ftse-cal-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .5rem; }
.ftse-cal-title { font-size: .95rem; font-weight: 700; margin: 0; flex: 1; text-align: center; }
.ftse-btn { border: 1px solid var(--ftse-border); background: #f8f9fa; border-radius: 8px; padding: .2rem .5rem; cursor: pointer; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; }
.ftse-btn:hover { background: #eef1f5; }
.ftse-weekdays, .ftse-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ftse-weekdays span { text-align: center; font-size: .68rem; font-weight: 600; color: var(--ftse-muted); padding: .2rem 0; }
.ftse-day { position: relative; aspect-ratio: auto; min-height: 28px; border: 1px solid transparent; border-radius: 8px; background: #f8f9fa; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .78rem; padding: 1px; }
.ftse-day:hover { border-color: var(--ftse-accent); }
.ftse-day.is-today { border-color: #263238; font-weight: 700; }
.ftse-day.is-selected { background: var(--ftse-accent); color: #fff; }
.ftse-day.is-selected .ftse-dot { box-shadow: 0 0 0 1.5px #fff; }
.ftse-dot.is-past { opacity: .35; }
.ftse-dots { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 8px; }
.ftse-empty { visibility: hidden; }

/* Legende = filtres */
.ftse-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 0; padding: 0; }
.ftse-leg { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--ftse-border); background: #fff; border-radius: 999px; padding: .08rem .5rem; font-size: .68rem; cursor: pointer; }
.ftse-leg.is-off { opacity: .45; text-decoration: line-through; }

/* Evenements */
.ftse-details h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.ftse-event { border-inline-start: 5px solid var(--c); padding: .4rem .8rem; margin-bottom: .6rem; background: #fafafa; border-radius: 8px; }
.ftse-event h4 { margin: 0 0 .3rem; font-size: 1rem; }
.ftse-event p { margin: .2rem 0; font-size: .92rem; }
.ftse-docs { margin: .2rem 0 0; padding-inline-start: 1.2rem; font-size: .9rem; }
.ftse-muted { color: var(--ftse-muted); }
.ftse-error { color: #b71c1c; }

/* Conteneur etroit : tout en une colonne */
@container (max-width: 760px) {
  .ftse-grid { grid-template-columns: 1fr; }
  .ftse-details { max-height: 320px; }
}

.ftse-chev { display: block; }
.ftse-pastbtn { display: inline-block; margin: .2rem 0 .6rem; background: #fff; border: 1px solid var(--ftse-accent); color: var(--ftse-accent); border-radius: 8px; padding: .35rem .8rem; cursor: pointer; font-size: .88rem; font-weight: 600; }
.ftse-pastbtn:hover { background: var(--ftse-accent); color: #fff; }
.ftse-past .ftse-event { opacity: .8; }

/* ===== Protection contre les styles du template (boutons a texte blanc, polices, majuscules...) ===== */
#ftse-agenda button { font-family: inherit; text-transform: none; letter-spacing: normal; text-shadow: none; box-shadow: none; line-height: 1.2; }
#ftse-agenda .ftse-day,
#ftse-agenda .ftse-leg,
#ftse-agenda .ftse-btn { color: #1f2937 !important; }
#ftse-agenda .ftse-day span { color: inherit !important; }
#ftse-agenda .ftse-day.is-selected,
#ftse-agenda .ftse-day.is-selected span { color: #fff !important; }
#ftse-agenda .ftse-pastbtn { color: #0b5ed7 !important; }
#ftse-agenda .ftse-pastbtn:hover { color: #fff !important; }
#ftse-agenda .ftse-badge { color: #fff !important; }
#ftse-agenda .ftse-badge.ftse-vis { color: #444 !important; }
#ftse-agenda .ftse-weekdays span { color: #6b7280 !important; }
#ftse-agenda .ftse-digital { color: #111827 !important; }
