/* Mise en page du catalogue — partagee par /catalogue.html et /packs.html.
   Extrait du <style> inline de catalogue.html pour que les deux pages ne
   puissent pas diverger visuellement. Le reste vient de charte.css. */
/* Styles propres au catalogue (le reste vient de charte.css) */
    /* — Recherche, sous les onglets Fiches / Exercices — */
    .onglets .wrap.rc { padding-top: 0; }
    .rc-champ { flex: 1; display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 13px;
      background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft);
      transition: border-color .15s, box-shadow .15s; }
    .rc-champ:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(226,163,19,.18); }
    .rc-champ svg { width: 19px; height: 19px; flex: 0 0 auto; }
    .rc-champ input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink);
      outline: none; padding: 10px 0; }
    .hero-cat .wrap { padding: 36px 20px 26px; }
    .hero-cat h1 { font-family: var(--serif); font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 900;
      letter-spacing: -.6px; color: var(--ink); }
    .hero-cat p { color: var(--ink-soft); margin-top: 10px; max-width: 640px; font-size: 1.05rem; }
    .hero-cat .stat { margin-top: 16px; display: inline-flex; gap: 8px; align-items: center;
      background: var(--card); border: 1px solid var(--line); padding: 8px 15px; border-radius: 999px;
      font-size: .85rem; font-weight: 700; color: var(--forest); box-shadow: 0 4px 14px rgba(12,74,55,.06); }

    .filtres { position: sticky; top: 62px; z-index: 40; background: rgba(246,239,224,.92);
      backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
    .filtres .wrap { display: flex; gap: 8px; overflow-x: auto; padding: 12px 20px; scrollbar-width: none; }
    .filtres .wrap::-webkit-scrollbar { display: none; }
    .chip-f { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
      border-radius: 999px; padding: 8px 15px; font-weight: 700; font-size: .9rem; cursor: pointer; transition: .15s; }
    .chip-f:hover { border-color: var(--gold); }
    .chip-f.on { background: var(--forest); color: #fdf6e3; border-color: var(--forest); }

    main { padding: 26px 0 60px; }
    .matiere { margin-bottom: 38px; }
    .m-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
    .m-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
      font-size: 1.4rem; background: var(--c-soft); box-shadow: inset 0 0 0 1px var(--c-line); }
    .m-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 900; letter-spacing: -.3px; color: var(--ink); }
    .m-count { margin-left: auto; font-size: .82rem; color: var(--ink-soft); font-weight: 700;
      background: var(--card); border: 1px solid var(--line); padding: 4px 11px; border-radius: 999px; }

    .grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
    @media(min-width:560px){ .grid{ grid-template-columns: repeat(2,1fr); } }
    @media(min-width:880px){ .grid{ grid-template-columns: repeat(3,1fr); } }

    .card-p { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
      padding: 18px; display: flex; flex-direction: column; overflow: hidden;
      box-shadow: 0 1px 2px rgba(24,34,27,.04); transition: transform .14s, box-shadow .14s, border-color .14s; }
    .card-p::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
    .card-p:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(24,34,27,.12); border-color: var(--c-line); }
    .c-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: .72rem;
      font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--c-ink);
      background: var(--c-soft); border-radius: 999px; padding: 4px 10px; margin-bottom: 10px; }
    .c-title { font-size: 1rem; font-weight: 700; line-height: 1.3; min-height: 2.6em; color: var(--ink); }
    /* Le titre mène à la page de la fiche : Google suit le lien, l'élève voit le
       sommaire avant d'acheter. */
    .c-title a { color: inherit; text-decoration: none; }
    .c-title a:hover { text-decoration: underline; text-decoration-color: var(--gold); }

    /* Page Packs : ce que contient le pack, la seule information que le ruban
       « PACK » n'apprend plus quand toute la page est faite de packs. */
    .c-nb { display: inline-block; margin-top: 2px; font-size: .78rem; font-weight: 700;
      color: var(--c-ink, var(--ink-soft)); background: var(--c-soft, transparent);
      border-radius: 999px; padding: 3px 10px; }
    .c-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .price { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: 1.15rem; }
    .price small { font-family: var(--sans); font-weight: 600; color: var(--ink-soft); font-size: .72rem; }
    .add { border: 0; cursor: pointer; font-weight: 700; font-size: .85rem; padding: 9px 14px;
      border-radius: 11px; background: var(--forest); color: #fdf6e3; transition: .15s; }
    .add:hover { background: var(--forest-d); }
    .add.in { background: var(--gold); color: var(--forest-d); }

    .card-p.pack { background: linear-gradient(180deg, #fffdf3, var(--card)); }
    .ribbon { position: absolute; top: 13px; right: -30px; transform: rotate(40deg); background: var(--gold);
      color: var(--forest-d); font-size: .66rem; font-weight: 800; letter-spacing: .06em; padding: 3px 34px; }
    .free-rib { background: #2e7d32; color: #fff; }
    .card-p.free { background: linear-gradient(180deg, #f0f8f1, var(--card)); }
    .card-p.free::before { background: #2e7d32; }
    .apercu { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
      background: #2e7d32; color: #fff; text-decoration: none; font-weight: 700; font-size: .82rem;
      padding: 8px 14px; border-radius: 999px; transition: background .15s, transform .15s; }
    .apercu:hover { background: #256628; transform: translateY(-1px); }

    .vide { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 40px;
      text-align: center; color: var(--ink-soft); }

    /* — Onglets Fiches / Exercices — */
    .onglets { position: sticky; top: 62px; z-index: 40; background: rgba(246,239,224,.92);
      backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
    .onglets .wrap { display: flex; gap: 8px; padding: 10px 20px; }
    .onglet { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
      border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: .95rem;
      cursor: pointer; transition: .15s; }
    .onglet:hover { border-color: var(--gold); }
    .onglet[aria-selected="true"] { background: var(--forest); color: #fdf6e3; border-color: var(--forest); }
    .onglet:focus-visible { outline: 2px solid var(--gold-d); outline-offset: 2px; }
    .onglet .n { font-size: .78rem; font-weight: 800; opacity: .75; }

    /* — Matiere depliable — */
    .matiere { margin-bottom: 14px; background: var(--card); border: 1px solid var(--line);
      border-radius: 18px; overflow: hidden; }
    .m-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px;
      background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit;
      transition: background .14s; }
    .m-head:hover { background: var(--paper-2); }
    .m-head:focus-visible { outline: 2px solid var(--gold-d); outline-offset: -2px; }
    .m-head[aria-expanded="true"] { background: var(--c-soft); }
    .chevron { margin-left: 4px; font-size: 1.4rem; line-height: 1; color: var(--ink-soft);
      transition: transform .2s ease; }
    .m-head[aria-expanded="true"] .chevron { transform: rotate(90deg); }
    .m-corps { padding: 4px 16px 20px; border-top: 1px solid var(--line); }
    .m-head { flex-wrap: wrap; }
    .m-title { flex: 1 1 auto; min-width: 0; font-size: 1.25rem; }
    .m-count { white-space: nowrap; }
    @media (max-width: 560px) {
      .m-title { font-size: 1.05rem; }
      /* Sur telephone, le compteur passe SOUS le titre au lieu de le comprimer. */
      .m-count { order: 3; flex-basis: 100%; margin: 4px 0 0 58px; }
      .chevron { order: 2; }
    }
    .m-corps[hidden] { display: none; }
    .sous-titre { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px;
      font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--forest); }
    .sous-titre::after { content: ""; flex: 1; height: 1px; background: var(--line); }
    @media (max-width: 560px) { .m-corps { padding: 4px 10px 16px; } }
