/* Calendrier */
.cal { display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2vh, 22px); width: 100%; text-align: center; }
.cal-q { line-height: 1.6; text-wrap: balance; }
.cal-nav { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.cal-arrow { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--frame); color: var(--white); transition: background-color .15s, transform .12s; }
.cal-arrow:hover { background: var(--frame-hi); }
.cal-arrow:active { transform: scale(.94); }
.cal-arrow svg { width: 22px; height: 22px; }
.cal-hq { white-space: nowrap; }
.cal-stage { width: 100%; display: flex; flex-direction: column; align-items: center; }
.cal-ptitle { display: none; margin: 0 0 .3em; font-family: var(--f-display); font-size: calc(48px * var(--cs, 1)); line-height: 1; }
.hero.is-fs .cal-ptitle { display: block; }

/* Vue année : 12 petits mois */
.cal-year { --cal-max: .95vw; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, .9vw, 14px); width: min(calc(1400px * var(--cs, 1)), 100%); }
.cal-m { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: calc(10px * var(--cs, 1)) calc(8px * var(--cs, 1)) calc(8px * var(--cs, 1)); border: 0; border-radius: 16px; background: var(--frame); color: var(--white); font: inherit; text-align: center; transition: background-color .15s, transform .15s var(--ease); }
.cal-m:hover { background: var(--frame-hi); }
.cal-m:active { transform: scale(.98); }
.cal-mt { margin-bottom: .35em; font-weight: 700; font-size: min(calc(15px * var(--cs, 1)), calc(var(--cal-max) * 1.3)); }
.cal-g { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); font-size: min(calc(12px * var(--cs, 1)), var(--cal-max)); line-height: 1.8; font-variant-numeric: tabular-nums; }
.cal-h { font-weight: 700; font-size: .85em; opacity: .75; }
.cal-w { font-size: .82em; opacity: .55; }
.cal-wh { opacity: .55; }
.cal-d { position: relative; }
.cal-d.is-we { opacity: .78; }
.cal-d.is-hol { font-weight: 700; opacity: 1; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cal-g .cal-d.is-today { display: grid; place-items: center; width: 1.7em; height: 1.7em; margin: 0 auto; border-radius: 50%; background: var(--white); color: var(--bg); font-weight: 700; opacity: 1; }

/* Vue mois : la grille en grand, et la liste des fêtes */
.cal-month { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; width: min(calc(1100px * var(--cs, 1)), 100%); }
@media (min-width: 1000px) { .cal-month { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; } }
.cal-bg { display: grid; grid-template-columns: .55fr repeat(7, minmax(0, 1fr)); gap: 6px; font-variant-numeric: tabular-nums; }
.cal-bg .cal-h { padding: 4px 0; font-size: calc(14px * var(--cs, 1)); opacity: .8; }
.cal-bg .cal-w { display: grid; place-items: center; font-size: calc(13px * var(--cs, 1)); }
.cal-bg .cal-d { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: calc(clamp(44px, 7.4vh, 86px) * var(--cs, 1)); padding: 6px 8px; border-radius: 12px; background: var(--frame); text-align: left; overflow: hidden; text-decoration: none; }
.cal-bg .cal-d.is-out { background: none; }
.cal-bg .cal-d b { font-family: var(--f-display); font-weight: 400; font-size: calc(clamp(20px, 2.2vw, 30px) * var(--cs, 1)); line-height: 1; }
.cal-bg .cal-d small { display: block; width: 100%; font-size: calc(12px * var(--cs, 1)); line-height: 1.2; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bg .cal-d small.is-obs { opacity: .75; }
.cal-bg .cal-d.is-hol b { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.cal-bg .cal-d.is-today { background: var(--white); color: var(--bg); }
.cal-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: calc(16px * var(--cs, 1)); line-height: 1.35; }
.cal-list li { padding: 10px 14px; border-radius: 12px; background: var(--frame); }
.cal-list li b { display: block; font-size: .82em; letter-spacing: .06em; text-transform: uppercase; }
.cal-list li.is-obs { background: none; box-shadow: inset 0 0 0 2px var(--frame); }
.cal-list li i { font-style: normal; opacity: .8; }
.cal-list li.is-none { background: none; opacity: .85; }
.cal-plist { display: none; }

/* Glissements (jamais de fondu) */
.slide-l { animation: cal-l .32s var(--ease); }
.slide-r { animation: cal-r .32s var(--ease); }
.slide-u { animation: cal-u .32s var(--ease); }
@keyframes cal-l { from { transform: translateX(28px); } to { transform: none; } }
@keyframes cal-r { from { transform: translateX(-28px); } to { transform: none; } }
@keyframes cal-u { from { transform: translateY(18px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .slide-l, .slide-r, .slide-u { animation: none; } }

@media (max-width: 1180px) { .cal-year { --cal-max: 1.35vw; grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cal-year { --cal-max: 1.8vw; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Plein écran : la barre des vues laisse la place à celle de la taille */
.hero.is-fs .cal-bar { display: none; }
@media (max-width: 600px) {
  .cal-year { --cal-max: 3.1vw; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cal-m { padding: 8px 4px 6px; border-radius: 12px; }
  .cal-g { font-size: min(calc(11px * var(--cs, 1)), var(--cal-max)); }
  .cal-bg { gap: 3px; grid-template-columns: .5fr repeat(7, minmax(0, 1fr)); }
  .cal-bg .cal-d { min-height: 46px; padding: 4px; border-radius: 9px; align-items: center; }
  .cal-bg .cal-d small { display: none; }
  .cal-bar .bar-sep, .cal-bar .cal-printbtn { display: none; }
  .cal-bar .chip-btn { padding: 0 14px; }
}

/* Impression : fond blanc, texte noir, l'année sur une page A4 */
@media print {
  @page { size: A4 portrait; margin: 9mm; }
  html, body { background: #fff !important; }
  .page > :not(.hero) { display: none !important; }
  .hero { min-height: 0 !important; padding: 0 !important; background: #fff !important; color: #000 !important; --white: #000; --frame: transparent; --frame-hi: transparent; overflow: visible; }
  .hero > :not(main), .hero .tbar, .hero .cal-q, .hero .fs-bar, .hero .fs-hint, .hero .scroll-down { display: none !important; }
  .hero .tool { padding: 0 !important; gap: 0; display: block; }
  .cal, .cal * { color: #000 !important; animation: none !important; }
  .cal-stage { display: block; }
  .cal-ptitle { display: block; margin: 0 0 4mm; font-size: 30pt; text-align: center; }
  .cal-year:not([hidden]) { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 3mm 5mm; width: 100%; }
  .cal-m { padding: 0; border-radius: 0; background: none !important; break-inside: avoid; }
  .cal-mt { margin-bottom: 1mm; font-size: 11pt !important; }
  .cal-g { font-size: 8.5pt !important; line-height: 1.55; }
  .cal-g .cal-d.is-today { background: none; width: auto; height: auto; display: inline; }
  .cal-d.is-we { opacity: 1; color: #555 !important; }
  .cal-h, .cal-w { opacity: 1; color: #777 !important; }
  .cal-month:not([hidden]) { display: block; }
  .cal-bg .cal-d { border: .2mm solid #999; background: none !important; min-height: 26mm; }
  .cal-bg .cal-d small { display: block; white-space: normal; }
  .cal-list { margin-top: 5mm; }
  .cal-list li { background: none !important; padding: 1mm 0; box-shadow: none !important; }
  .cal-list li b { display: inline; margin-right: 2mm; }
  .cal-plist { display: block; margin-top: 4mm; font-size: 8pt; line-height: 1.35; text-align: left; }
  .cal-plist p { margin: 0 0 1mm; font-weight: 700; font-size: 9pt; }
  .cal-plist ul { margin: 0; padding: 0; list-style: none; columns: 3; column-gap: 6mm; }
  .cal-plist li b { margin-right: 1.5mm; }
  .cal-plist .is-none { display: none; }
}
/* Tableaux de la page */
.content .cal-rules td:nth-child(2) { font-family: var(--f-body); font-size: 17px; white-space: normal; }
