/* ── Agenda : calendrier mois / semaine / jour ───────────────────────────── */

.agd-archive { padding-bottom: 80px; }
.agd-archive__head { padding: 56px 0 30px; text-align: center; }
.agd-archive__title {
    font-family: var(--agd-font-title); font-size: clamp(26px, 3.6vw, 38px); font-weight: 700;
    margin: 0; color: var(--agd-text); line-height: 1.2;
}
.agd-archive__title::after { content: ''; display: block; width: 56px; height: 3px; background: var(--agd-gold); margin: 18px auto 0; border-radius: 2px; }

.agd-container--wide { max-width: 1560px; }
.agd-archive__layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }

.agd-cal {
    min-width: 0;
    background: #fff; border: 1px solid var(--agd-border); border-radius: 16px;
    box-shadow: var(--agd-shadow); padding: 22px 26px 26px; font-family: var(--agd-font-title);
}

/* Barre d'outils
   Le thème parent colore tous les <button> : on neutralise explicitement. */
.agd-cal button,
.agd-cal button:hover,
.agd-cal button:focus {
    background: transparent; border: 0; box-shadow: none; text-shadow: none;
    color: inherit; font-family: inherit; letter-spacing: normal; text-transform: none;
}
.agd-cal__toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--agd-border);
}
.agd-cal__nav { display: flex; align-items: center; gap: 2px; }
.agd-cal button.agd-cal__nav-btn {
    width: 34px; height: 34px; border-radius: 50%; padding: 0;
    display: flex; align-items: center; justify-content: center;
    color: #8a90a0; cursor: pointer; transition: background .15s, color .15s;
}
.agd-cal__nav-btn svg {
    width: 17px; height: 17px; fill: none;
    stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.agd-cal button.agd-cal__nav-btn:not(:disabled):hover { background: #f2f4f8; color: var(--agd-blue); }
.agd-cal button.agd-cal__nav-btn:disabled { opacity: .22; cursor: default; }
.agd-cal button.agd-cal__today {
    height: 34px; padding: 0 14px; margin-left: 4px; border-radius: 17px;
    font-size: 12.5px; font-weight: 600; color: var(--agd-muted); cursor: pointer;
    transition: background .15s, color .15s;
}
.agd-cal button.agd-cal__today:hover { background: #f2f4f8; color: var(--agd-blue); }

.agd-cal__label {
    margin: 0; font-size: 20px; font-weight: 700; color: var(--agd-text);
    flex: 1; text-align: center; letter-spacing: -.2px;
}

.agd-cal__views { display: flex; gap: 2px; }
.agd-cal button[data-view] {
    padding: 8px 15px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--agd-muted); cursor: pointer;
    transition: background .15s, color .15s;
}
.agd-cal button[data-view]:hover { background: #f2f4f8; color: var(--agd-text); }
.agd-cal button[data-view].is-active { background: var(--agd-blue); color: #fff; }
.agd-cal button[data-view].is-active:hover { background: var(--agd-blue-dark); color: #fff; }

.agd-cal__empty {
    margin: 0 0 16px; padding: 12px 18px; border-radius: 10px;
    background: rgba(195,165,116,.14); border-left: 4px solid var(--agd-gold);
    font-size: 14px; font-weight: 600; color: var(--agd-text);
}

/* Cartes événement (communes) */
.agd-ev {
    display: flex; flex-direction: column; text-decoration: none; color: var(--agd-blue-dark);
    background: #fff; border: 1px solid rgba(53,77,153,.22); border-left: 4px solid var(--agd-blue); border-radius: 8px;
    padding: 7px 9px; font-size: 13px; line-height: 1.35; transition: transform .12s, box-shadow .12s;
    overflow: hidden; box-shadow: 0 1px 3px rgba(26,26,26,.06);
}
.agd-ev:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(53,77,153,.18); }
.agd-ev__time { font-weight: 700; color: var(--agd-gold); font-size: 11px; letter-spacing: .5px; }
.agd-ev__title { font-weight: 600; color: var(--agd-blue-dark); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.agd-ev--past { border-left-color: #b9bcc6; background: #f2f3f6; color: var(--agd-muted); }
.agd-ev--past .agd-ev__time { color: var(--agd-muted); }

/* Carte pleine case avec image */
.agd-ev--hero {
    position: absolute; inset: 0; border-left: 0; border-radius: 12px; padding: 0;
    background-size: cover; background-position: center; justify-content: flex-end; color: #fff;
}
.agd-ev--hero::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,30,70,0) 20%, rgba(20,30,70,.55) 55%, rgba(20,30,70,.95) 100%);
}
.agd-ev--hero .agd-ev__body { position: relative; padding: 10px 12px 12px; }
.agd-ev--hero .agd-ev__time { color: var(--agd-gold); font-size: 12px; }
.agd-ev--hero .agd-ev__title { color: #fff; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.agd-ev--hero.agd-ev--past { filter: grayscale(.7); opacity: .8; }

/* Vue mois — grille fine, sans cadre par case */
.agd-month__head { display: grid; grid-template-columns: repeat(5, 1fr) .58fr .58fr; }
.agd-month__head span {
    text-align: left; padding: 0 0 10px 10px;
    font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: #9aa0ae;
}
.agd-month__cells {
    display: grid; grid-template-columns: repeat(5, 1fr) .58fr .58fr;
    border-top: 1px solid var(--agd-border); border-left: 1px solid var(--agd-border);
    border-radius: 10px 10px 0 0; overflow: hidden;
}
.agd-cell {
    position: relative; min-height: 132px;
    border-right: 1px solid var(--agd-border); border-bottom: 1px solid var(--agd-border);
    background: #fff; padding: 32px 7px 7px; display: flex; flex-direction: column;
}
.agd-cell:nth-child(7n+6), .agd-cell:nth-child(7n) { background: #fbfcfd; }
.agd-cell:nth-child(7n+6) .agd-ev, .agd-cell:nth-child(7n) .agd-ev { font-size: 11.5px; padding: 5px 7px; }
.agd-cell--out { background: #fcfcfd; }
.agd-cell--out .agd-cell__num { color: #cbcfd9; }
.agd-cell__num {
    position: absolute; top: 7px; left: 9px; z-index: 2;
    font-size: 13px; font-weight: 500; color: #8a90a0; cursor: pointer;
    line-height: 20px; transition: color .15s;
}
.agd-cell__num:hover { color: var(--agd-blue); }
.agd-cell--today .agd-cell__num {
    width: 22px; height: 22px; line-height: 22px; text-align: center; left: 7px;
    border-radius: 50%; background: var(--agd-blue); color: #fff; font-weight: 600;
}
.agd-cell--hero { padding: 0; overflow: hidden; }
.agd-cell--hero .agd-cell__num {
    width: 22px; height: 22px; line-height: 22px; text-align: center; left: 7px; border-radius: 50%;
    background: rgba(255,255,255,.94); color: var(--agd-text); font-weight: 600;
}
.agd-cell--hero.agd-cell--today .agd-cell__num { background: var(--agd-blue); color: #fff; }
.agd-cell__list { display: flex; flex-direction: column; gap: 4px; }
.agd-cal button.agd-cell__more {
    color: var(--agd-blue); font-size: 11px; font-weight: 600; cursor: pointer;
    text-align: left; padding: 3px 4px;
}
.agd-cal button.agd-cell__more:hover { text-decoration: underline; }

/* Vue semaine */
.agd-week { display: grid; grid-template-columns: repeat(5, 1fr) .58fr .58fr; gap: 10px; }
.agd-cal button.agd-week__day {
    width: 100%; padding: 6px 2px 10px; display: flex; align-items: baseline; gap: 7px;
    cursor: pointer; border-bottom: 2px solid var(--agd-border); border-radius: 0;
    transition: border-color .15s;
}
.agd-cal button.agd-week__day:hover { border-bottom-color: var(--agd-blue); }
.agd-week__day span { font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: #9aa0ae; }
.agd-week__day strong { font-size: 20px; font-weight: 600; color: var(--agd-text); }
.agd-week__col.is-today .agd-week__day { border-bottom-color: var(--agd-blue); }
.agd-week__col.is-today .agd-week__day strong { color: var(--agd-blue); }
.agd-week__col.is-today .agd-week__day span { color: var(--agd-blue); }
.agd-week__events {
    position: relative; min-height: 210px; margin-top: 10px;
    display: flex; flex-direction: column; gap: 6px; border-radius: 10px;
}
.agd-week__events:empty { background: #fbfcfd; }
.agd-week__events .agd-ev--hero { inset: 0; }
.agd-week__events .agd-ev { font-size: 13px; padding: 10px 12px; }

/* Vue jour */
.agd-day { display: grid; gap: 16px; }
.agd-day__none { margin: 0; padding: 30px; text-align: center; color: var(--agd-muted); background: #fafbfd; border-radius: 12px; }
.agd-ev--big {
    flex-direction: row; gap: 22px; padding: 0; border-left: 0; background: #fff;
    border: 1px solid var(--agd-border); border-radius: 14px; overflow: hidden;
}
.agd-ev--big .agd-ev__img { flex: none; width: 320px; background-size: cover; background-position: center; min-height: 200px; }
.agd-ev--big .agd-ev__body { padding: 24px 26px; display: flex; flex-direction: column; gap: 8px; }
.agd-ev--big .agd-ev__time { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--agd-gold); }
.agd-ev--big .agd-ev__title { font-size: 22px; -webkit-line-clamp: unset; }
.agd-ev__lieu { font-size: 14px; color: var(--agd-blue); font-weight: 600; }
.agd-ev__excerpt { font-family: var(--agd-font-body); font-size: 15px; color: var(--agd-muted); line-height: 1.6; }
.agd-ev__cta {
    align-self: flex-start; margin-top: 8px; background: var(--agd-blue); color: #fff;
    padding: 10px 20px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}

/* À venir (colonne de gauche) */
.agd-upcoming { position: sticky; top: 100px; }
.agd-upcoming__list { display: flex; flex-direction: column; gap: 12px; }
.agd-up {
    display: flex; flex-direction: column; text-decoration: none; color: var(--agd-text);
    background: #fff; border: 1px solid var(--agd-border); border-radius: 12px; overflow: hidden;
    transition: box-shadow .15s, transform .15s;
}
.agd-up:hover { box-shadow: 0 10px 24px rgba(53,77,153,.14); transform: translateY(-1px); }
.agd-up__img { position: relative; display: block; height: 130px; background-size: cover; background-position: center; background-color: #e9ecf3; }
.agd-up__img--none {
    height: auto; background: none; display: flex;
    padding: 14px 14px 0; border-bottom: 0;
}
.agd-up__img--none .agd-up__date {
    position: static; width: auto; height: auto; flex-direction: row; align-items: baseline; gap: 6px;
    background: transparent; box-shadow: none; color: var(--agd-blue);
}
.agd-up__img--none .agd-up__date strong { font-size: 16px; }
.agd-up__img--none .agd-up__date span { color: var(--agd-blue); opacity: .75; }
.agd-up__img--none + .agd-up__body { padding-top: 6px; }
.agd-up__date {
    position: absolute; left: 12px; bottom: 12px; width: 54px; height: 54px; border-radius: 10px;
    background: #fff; color: var(--agd-blue); display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: var(--agd-font-title); box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.agd-up__date strong { font-size: 21px; line-height: 1; }
.agd-up__date span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--agd-muted); }
.agd-up__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.agd-up__title { font-family: var(--agd-font-title); font-weight: 600; font-size: 14.5px; color: var(--agd-blue-dark); line-height: 1.3; }
.agd-up__meta { font-size: 12.5px; color: var(--agd-muted); line-height: 1.4; }

@media (max-width: 1100px) {
    .agd-archive__layout { grid-template-columns: 1fr; }
    .agd-upcoming { position: static; order: 2; }
    .agd-upcoming__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 860px) {
    .agd-month__head, .agd-month__cells, .agd-week { grid-template-columns: repeat(7, 1fr); }
    .agd-month__head span { text-align: center; padding-left: 0; }
    .agd-cal { padding: 16px 12px 18px; border-radius: 12px; }
    .agd-cal__label { order: -1; width: 100%; flex: none; }
    .agd-month__cells, .agd-month__head { gap: 3px; }
    .agd-cell { min-height: 74px; padding: 30px 3px 3px; border-radius: 8px; }
    .agd-cell .agd-ev { font-size: 10px; padding: 3px 4px; }
    .agd-cell .agd-ev__time { display: none; }
    .agd-cell__more { font-size: 10px; }
    .agd-week { grid-template-columns: 1fr; }
    .agd-week__events { min-height: 0; }
    .agd-week__col:not(:has(.agd-ev)) .agd-week__events { display: none; }
    .agd-week__day { flex-direction: row; justify-content: flex-start; gap: 10px; }
    .agd-ev--big { flex-direction: column; }
    .agd-ev--big .agd-ev__img { width: 100%; min-height: 160px; }
}
