/* Rubrique Activités — compléments de style (sobre, hérite de ../css/style.css) */
.act-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.act-subnav .btn { min-height: 44px; }

.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 18px; }
.act-card { display: flex; flex-direction: column; padding: 14px; }
.act-card h3 { font-size: 1.05rem; margin: 10px 0 4px; }
.act-card h3 a { color: var(--ink); text-decoration: none; }
.act-card h3 a:hover { text-decoration: underline; }
.act-card .act-actions { margin-top: auto; padding-top: 12px; }
.act-cover { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); aspect-ratio: 1 / 1; }
.act-cover-link { display: block; }
.act-cover-wrap { display: block; position: relative; border-radius: var(--radius-sm); overflow: hidden; }
.act-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block; }
.act-cover-img[hidden] { display: none; }
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.act-actions .btn { min-height: 44px; }
.act-actions .btn.ghost { font-size: 1.3rem; width: 48px; padding: 0; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; align-items: end; }
.filters .field { margin: 0; }
.result-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 16px 0; }

/* ---------- Fiche détaillée ---------- */
.fiche-head { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 22px; align-items: center; }
@media (max-width: 760px) { .fiche-head { grid-template-columns: 1fr; } }
.fiche-synth { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.fiche-synth > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.fiche-synth dt { font-size: 0.78rem; font-weight: 800; color: var(--muted); margin: 0; }
.fiche-synth dd { margin: 2px 0 0; font-weight: 700; }
.fiche-body h2 { font-size: 1.15rem; color: var(--primary); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin: 22px 0 10px; }
:root[data-theme="dark"] .fiche-body h2 { color: var(--ink); }
.fiche-body ul, .fiche-body ol { margin: 0 0 10px; padding-left: 22px; }
.fiche-body li { margin-bottom: 4px; }
.etape { border: 1px solid var(--line); border-left: 6px solid var(--primary); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px; break-inside: avoid; background: var(--surface); }
.etape h3 { font-size: 1rem; margin: 0 0 4px; }
.etape .dit { background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; font-weight: 700; margin: 6px 0 0; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.views { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

/* Vue « fiche jeune » (FALC) */
.jeune { background: var(--surface); border: 3px solid var(--primary); border-radius: 22px; padding: 22px; max-width: 820px; margin-inline: auto; font-size: 1.3rem; line-height: 1.5; }
.jeune h1 { font-size: 2rem; display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.jeune h1 .big { font-size: 3.2rem; line-height: 1; }
.jeune h2 { font-size: 1.35rem; margin: 20px 0 10px; }
.jeune .step { display: grid; grid-template-columns: 52px 66px 1fr; gap: 14px; align-items: center; border: 3px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; break-inside: avoid; }
.jeune .case { width: 44px; height: 44px; border: 4px solid var(--ink); border-radius: 10px; background: #fff; }
.jeune .pic { font-size: 2.6rem; text-align: center; line-height: 1; }
.jeune .need { display: flex; flex-wrap: wrap; gap: 8px; }
.jeune .need span { border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px; }
.jeune .avis { display: flex; gap: 22px; font-size: 3rem; }
.jeune .avis span { display: inline-grid; place-items: center; width: 74px; height: 74px; border: 4px solid var(--ink); border-radius: 50%; }
.jeune .pause { display: flex; align-items: center; gap: 14px; background: var(--info-soft); border-radius: 16px; padding: 12px 16px; font-weight: 800; }
.jeune.ado { border-width: 1px; border-radius: 8px; font-size: 1.1rem; }
.jeune.ado h1 .big { font-size: 1.9rem; }
.jeune.ado .step { border-width: 1px; border-radius: 6px; grid-template-columns: 38px 40px 1fr; }
.jeune.ado .case { width: 28px; height: 28px; border-width: 2px; border-radius: 4px; }
.jeune.ado .pic { font-size: 1.6rem; }
.jeune.ado .avis { font-size: 1.8rem; }
.jeune.ado .avis span { width: 52px; height: 52px; border-width: 2px; }

/* ---------- Feuilles imprimables (A4) ---------- */
.sheet-wrap { background: var(--surface-2); border-radius: var(--radius); padding: 16px; overflow: auto; }
.a4 { width: 210mm; min-height: 297mm; background: #fff; color: #000; margin: 0 auto 16px; padding: 10mm; box-shadow: var(--shadow); font-size: 12pt; position: relative; }
.a4 * { color: #000; }
.a4 .sheet-title { font-size: 18pt; font-weight: 800; margin: 0 0 6mm; text-align: center; }
.a4 .sheet-note { font-size: 9pt; color: #333; text-align: center; margin-top: 6mm; }
.a4 .cards { display: grid; gap: 0; }
.a4 .cut { border: 1.4px dashed #555; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3mm; break-inside: avoid; overflow: hidden; }
.a4 .cut .em { line-height: 1.1; }
.a4 .cut .lb { font-weight: 800; line-height: 1.15; margin-top: 1.5mm; word-break: break-word; }
.a4 .grid-board { border-collapse: collapse; width: 100%; table-layout: fixed; }
.a4 .grid-board td { border: 2px solid #000; text-align: center; vertical-align: middle; padding: 2mm; height: 32mm; }
.a4 .board { break-inside: avoid; margin-bottom: 8mm; }
.a4 .board h3 { margin: 0 0 2mm; font-size: 12pt; }
.a4 .case-box { display: inline-block; width: 7mm; height: 7mm; border: 1.6px solid #000; border-radius: 1.5mm; vertical-align: middle; margin-right: 2mm; }
.a4 table.grille { width: 100%; border-collapse: collapse; }
.a4 table.grille th, .a4 table.grille td { border: 1.3px solid #000; padding: 2mm 2.5mm; text-align: center; background: #fff; font-size: 10.5pt; }
.a4 table.grille th { background: #eee; }
.a4 table.grille td.left, .a4 table.grille th.left { text-align: left; }
.a4 .legend { font-size: 10pt; margin-top: 4mm; }
.a4.sobre .cut { border-radius: 0; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.opts .field { margin: 0; }
.picker { max-height: 52vh; overflow: auto; }
.picker .picto { min-height: 88px; padding: 8px; }
.picker .picto .emoji { font-size: 2rem; }
.picker .picto .label { font-size: 0.8rem; }
.dom { display: flex; align-items: stretch; border: 2px solid #000; border-radius: 3mm; break-inside: avoid; margin: 0 0 4mm; height: 24mm; }
.dom > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1mm; overflow: hidden; }
.dom > div + div { border-left: 2px solid #000; }
.dom .em { font-size: 22pt; line-height: 1; }
.dom .lb { font-size: 9pt; font-weight: 800; }
.path { display: grid; gap: 2mm; }
.path .sq { border: 2px solid #000; border-radius: 3mm; min-height: 24mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1mm; font-size: 8.5pt; font-weight: 800; background: #fff; position: relative; overflow: hidden; }
.path .sq .n { position: absolute; top: 1mm; left: 2mm; font-size: 8pt; }
.path .sq .em { font-size: 20pt; line-height: 1; }
.path .sq.spec { background: #eee; border-style: double; border-width: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }

.mini-table td, .mini-table th { padding: 8px 10px; }
.lock { opacity: .75; }
.sel-fiche { max-width: 100%; }

@media (max-width: 900px) {
  .a4 { width: 100%; min-height: 0; padding: 4mm; }
}

@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff; }
  .sheet-wrap { background: none; padding: 0; overflow: visible; }
  .a4 { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; page-break-after: always; break-after: page; }
  .a4:last-child { page-break-after: auto; break-after: auto; }
  .fiche-head .act-cover, .fiche-head .act-cover-wrap { display: none; }
  .jeune { border-color: #000; box-shadow: none; max-width: none; }
  .jeune .step { border-color: #000; }
  .view-hidden-print { display: none !important; }
  .etape { border-color: #666; border-left-color: #000; }
  .etape .dit { background: #eee; }
  .fiche-synth > div { background: #f2f2f2; }
  .act-print-foot { display: block !important; font-size: 8.5pt; color: #333; border-top: 1px solid #999; margin-top: 8mm; padding-top: 2mm; }
}
.act-print-foot { display: none; }
.cover-strip { display: none; }

@media (max-width: 1100px) { #layout { grid-template-columns: minmax(0, 1fr) !important; } }
@media print { .page-head { display: none !important; } }

/* Types d'activités : entrées rapides du catalogue */
.fam { display: flex; flex-wrap: wrap; gap: 10px; }
.fam-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; box-shadow: var(--relief), var(--shadow-sm); }
.fam-chip:hover { border-color: var(--primary); }
.fam-chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.fam-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.fam-n { font-size: 0.78rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.fam-chip.on .fam-n { background: rgba(255, 255, 255, 0.25); color: inherit; }

/* Le cadre suit la proportion réelle de l'illustration (détourée, sans fond) : pas de rognage ni de fond beige autour */
.act-cover-wrap:has(.act-cover-img:not([hidden])) { background: transparent; }
.act-cover-wrap:has(.act-cover-img:not([hidden])) .act-cover { display: none; }
.act-cover-wrap:has(.act-cover-img:not([hidden])) .act-cover-img { position: static; height: auto; width: 100%; object-fit: contain; }
