/* Le Jour Off — outil calendrier (pages calendrier-2027, calendrier-2026-2027). Les options sont des boutons radio et
   des cases : tout l'affichage suit :has(), donc marche sans JavaScript. Impression A4 paysage : seul .cal-feuille sort.
   Couleurs des zones : fonds clairs (texte #1b1b22 lisible, contraste > 10:1), traits foncés en mode « A, B et C ». */
.cal { --za: #ffe45c; --zb: #bfe3ff; --zc: #a6e3a0; --zk: #ffd3a8;
  --ta: #c98a00; --tb: #2a63db; --tc: #1f8f58; margin-top: 14px; }
.cal-opts { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.cal-opts fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.cal-opts legend { padding: 0; margin-bottom: 4px; font: 400 19px/1.2 var(--main); }
.cal-opts label { display: inline-flex; align-items: center; gap: 6px; margin: 0 14px 6px 0; font-size: 15px; cursor: pointer; min-height: 32px; }
.cal-opts input { width: 18px; height: 18px; margin: 0; accent-color: var(--feutre); }
.cal-imprimer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 4px; font-size: 14px; color: var(--doux); }
.cal-imprimer[hidden] { display: none; }
.cal-imprimer .bouton { font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }

.cal-feuille { margin-top: 14px; }
.cal-titre { display: none; }
.cal-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
.cal-t { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.cal-t caption { text-align: left; padding: 0 0 2px; font: 400 19px/1.25 var(--main); }
.cal-t caption span { color: var(--doux); }
.cal-t thead th { padding: 2px 0; border-bottom: 1.5px solid var(--feutre); font-size: 10px; font-weight: 700; color: var(--doux); text-align: center; }
.cal-t abbr { text-decoration: none; }
.cal-t thead th.cs { width: 10%; }
.cal-t td, .cal-t tbody th { position: relative; height: 24px; padding: 0; text-align: center; vertical-align: middle; }
.cal-t tbody th.cs, .cal-t thead th.cs { font-size: 9px; font-weight: 400; color: var(--doux); border-right: 1px solid var(--email-2); }
.cal-t td .n { display: inline-block; min-width: 19px; line-height: 19px; border-radius: 50%; font-weight: 500; color: #2d3139; }
.cal-t td.we { background: #eef1f4; }
.cal-t td.we .n { color: #3a3f48; font-weight: 400; }
.cal-t td .lib { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cal-t td.auj .n { background: var(--feutre); color: #fff; }

/* Fériés entourés (case à décocher), Alsace-Moselle en option */
.cal-t td.f .n, .cal:has(#cal-am:checked) .cal-t td.fam .n { font-weight: 800; color: var(--feutre); box-shadow: inset 0 0 0 2px var(--rouge); }
.cal:has(#cal-fer:not(:checked)) .cal-t td.f .n { box-shadow: none; font-weight: 500; }
.cal:has(#cal-fer:not(:checked)) .cal-t td.f .lib { display: none; }
.cal:not(:has(#cal-am:checked)) .cal-t td.fam .lib { display: none; }

/* Vacances : trois traits (A, B, C) par défaut, une zone = case remplie, « Aucune » = rien */
.cal-t td.va { --a: var(--ta); } .cal-t td.vb { --b: var(--tb); } .cal-t td.vc { --c: var(--tc); }
.cal-t td.va, .cal-t td.vb, .cal-t td.vc {
  background-image: linear-gradient(90deg, var(--a, transparent) 0 33.3%, var(--b, transparent) 33.3% 66.6%, var(--c, transparent) 66.6%);
  background-size: 100% 4px; background-position: bottom; background-repeat: no-repeat; }
.cal:has(#cal-z-0:checked) .cal-t td, .cal:has(#cal-z-a:checked) .cal-t td, .cal:has(#cal-z-b:checked) .cal-t td,
.cal:has(#cal-z-c:checked) .cal-t td, .cal:has(#cal-z-k:checked) .cal-t td { background-image: none; }
.cal:has(#cal-z-a:checked) .cal-t td.va { background-color: var(--za); }
.cal:has(#cal-z-b:checked) .cal-t td.vb { background-color: var(--zb); }
.cal:has(#cal-z-c:checked) .cal-t td.vc { background-color: var(--zc); }
.cal:has(#cal-z-k:checked) .cal-t td.vk { background-color: var(--zk); }

/* Numéros de semaine : colonne masquable */
.cal:has(#cal-sem:not(:checked)) .cs, .cal:has(#cal-sem:not(:checked)) .lg-cs { display: none; }

/* Légende : seulement ce qui est affiché */
.cal-leg { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 14px 0 0; font-size: 13px; color: var(--doux); }
.cal-leg .lg { display: inline-flex; align-items: center; gap: 6px; }
.cal-leg i { display: inline-block; width: 16px; height: 14px; font: 400 10px/14px var(--sans); text-align: center; font-style: normal; }
.lg-f i { border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rouge); }
.lg-fam i { border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rouge); background: #eef1f4; }
.lg-va i { background: var(--za); } .lg-vb i { background: var(--zb); } .lg-vc i { background: var(--zc); } .lg-vk i { background: var(--zk); }
.lg-cs i { border-right: 1px solid var(--email-2); color: var(--doux); }
.cal-leg .lg-fam, .cal-leg .lg-vk { display: none; }
.cal:has(#cal-fer:not(:checked)) .lg-f { display: none; }
.cal:has(#cal-am:checked) .lg-fam { display: inline-flex; }
.cal:has(#cal-z-a:checked) .lg-vb, .cal:has(#cal-z-a:checked) .lg-vc,
.cal:has(#cal-z-b:checked) .lg-va, .cal:has(#cal-z-b:checked) .lg-vc,
.cal:has(#cal-z-c:checked) .lg-va, .cal:has(#cal-z-c:checked) .lg-vb,
.cal:has(#cal-z-k:checked) .lg-va, .cal:has(#cal-z-k:checked) .lg-vb, .cal:has(#cal-z-k:checked) .lg-vc,
.cal:has(#cal-z-0:checked) .lg-va, .cal:has(#cal-z-0:checked) .lg-vb, .cal:has(#cal-z-0:checked) .lg-vc { display: none; }
.cal:has(#cal-z-k:checked) .lg-vk { display: inline-flex; }
.cal:has(#cal-z-t:checked) .lg-va i { background: var(--ta); height: 4px; }
.cal:has(#cal-z-t:checked) .lg-vb i { background: var(--tb); height: 4px; }
.cal:has(#cal-z-t:checked) .lg-vc i { background: var(--tc); height: 4px; }
.cal-src { display: none; }

/* Vue « 12 mois » à l'écran : un mois par ligne, grandes cases avec le nom des fériés */
.cal:has(#cal-v-mois:checked) .cal-grille { grid-template-columns: 1fr; gap: 26px; }
.cal:has(#cal-v-mois:checked) .cal-t { font-size: 15px; }
.cal:has(#cal-v-mois:checked) .cal-t td { height: 52px; vertical-align: top; padding: 3px 2px; text-align: left; border: 1px solid var(--email-2); }
.cal:has(#cal-v-mois:checked) .cal-t tbody th.cs { font-size: 11px; vertical-align: top; padding-top: 6px; }
.cal:has(#cal-v-mois:checked) .cal-t td .n { min-width: 26px; line-height: 26px; text-align: center; }
.cal:has(#cal-v-mois:checked) .cal-t caption { font-size: 24px; }
@media (min-width: 560px) {
  .cal:has(#cal-v-mois:checked) .cal-t td .lib { position: static !important; width: auto; height: auto; overflow: visible; clip: auto;
    display: block; white-space: normal; font-size: 11px; line-height: 1.15; color: var(--rouge-texte); overflow-wrap: anywhere; }
  .cal:has(#cal-v-mois:checked) .cal-t td.fam .lib { color: var(--doux); }
}

/* Les dates en liste (lecteurs d'écran, copier-coller) */
.cal-liste { margin-top: 18px; border-top: 1.5px dashed var(--email-2); }
.cal-liste summary { cursor: pointer; padding: 10px 0 0; font: 400 19px/1.2 var(--main); }
.cal-liste-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 24px; font-size: 14px; }
.cal-liste h3 { margin: 14px 0 4px; font-size: 15px; }
.cal-liste ul { margin: 0; padding-left: 18px; }

@media (max-width: 359px) { .cal-grille { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html, body { background: #fff !important; }
  .haut, .pied, .tete-page, .aussi, .saut, .page-outil > .feuille { display: none !important; }
  .page-outil.env { max-width: none; padding: 0; }
  .page-outil .scene { margin: 0; padding: 0; border: 0; box-shadow: none; }
  .scene > :not(.cal), .cal > :not(.cal-feuille) { display: none !important; }
  .cal { margin: 0; }
  .cal-feuille { margin: 0; }
  .cal-feuille, .cal-feuille * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cal-titre { display: block; margin: 0 0 3mm; font: 800 22pt/1 var(--sans); letter-spacing: -.02em; }
  .cal-src { display: block; margin: 2mm 0 0; font-size: 7.5pt; color: #5a6270; }
  .cal-leg { margin-top: 3mm; font-size: 8.5pt; color: #3a3f48; }
  /* L'année sur une page : 4 colonnes × 3 rangées */
  .cal-grille { grid-template-columns: repeat(4, 1fr); gap: 4mm 7mm; }
  .cal-m { break-inside: avoid; }
  .cal-t { font-size: 8.5pt; }
  .cal-t caption { font-size: 13pt; padding-bottom: 1mm; }
  .cal-t thead th { font-size: 7pt; }
  .cal-t td, .cal-t tbody th { height: 7mm; }
  .cal-t tbody th.cs { font-size: 6.5pt; }
  .cal-t td .n { min-width: 5.2mm; line-height: 5.2mm; }
  .cal-t td.auj .n { background: none; color: inherit; }
  .cal-t td.va, .cal-t td.vb, .cal-t td.vc { background-size: 100% 1.2mm; }
  /* 12 pages : un mois par feuille, grandes cases */
  .cal:has(#cal-v-mois:checked) .cal-titre { display: none; }
  .cal:has(#cal-v-mois:checked) .cal-grille { display: block; }
  .cal:has(#cal-v-mois:checked) .cal-m { break-after: page; }
  .cal:has(#cal-v-mois:checked) .cal-m:last-child { break-after: auto; }
  .cal:has(#cal-v-mois:checked) .cal-t { font-size: 15pt; }
  .cal:has(#cal-v-mois:checked) .cal-t caption { font: 800 26pt/1.1 var(--sans); padding-bottom: 3mm; }
  .cal:has(#cal-v-mois:checked) .cal-t thead th { font-size: 10pt; padding: 1mm 0; }
  .cal:has(#cal-v-mois:checked) .cal-t td { height: 25mm; padding: 1mm 1.5mm; border-color: #c9d0d7; }
  .cal:has(#cal-v-mois:checked) .cal-t tbody th.cs { font-size: 9pt; width: 9mm; }
  .cal:has(#cal-v-mois:checked) .cal-t thead th.cs { width: 9mm; }
  .cal:has(#cal-v-mois:checked) .cal-t td .n { min-width: 8mm; line-height: 8mm; }
  .cal:has(#cal-v-mois:checked) .cal-t td .lib { position: static !important; width: auto; height: auto; overflow: visible; clip: auto;
    display: block; white-space: normal; font-size: 8pt; line-height: 1.15; color: #c4281c; }
  .cal:has(#cal-v-mois:checked) .cal-t td.va, .cal:has(#cal-v-mois:checked) .cal-t td.vb,
  .cal:has(#cal-v-mois:checked) .cal-t td.vc { background-size: 100% 2mm; }
  .cal:has(#cal-v-mois:checked) .cal-leg { break-before: avoid; }
}
