/* Report template gallery, phone widths only (Daniel, 14 Nov. 2026: "plus raffinée, plus impeccable
   sur les mobiles"). Presentation only: the cards, the filters and their behaviour are unchanged.
   Loaded after template-gallery.css; every rule stays inside the gallery section. */
@media (max-width:809px){
 /* Heading: the two lines of the title hold at every phone width; the intro reads as support text. */
 :root .mv-template-gallery .template-gallery-heading{margin-bottom:32px}
 :root .mv-template-gallery .template-gallery-heading h2{font-size:clamp(28px,8.9vw,40px);line-height:1.08;text-wrap:balance}
 :root .mv-template-gallery .template-gallery-heading .template-intro{max-width:22rem;margin:16px auto 0;font:400 16px/1.5 Geist,sans-serif;text-wrap:balance}

 /* Filters: one row of type filters, then the sector on the same two edges. */
 :root .mv-template-gallery .template-filters{column-gap:0;row-gap:10px;margin-bottom:20px}
 :root .mv-template-gallery .template-filter-group:first-child .template-chip-options{flex-wrap:nowrap;justify-content:flex-start;gap:6px;padding:0 4px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
 :root .mv-template-gallery .template-filter-group:first-child .template-chip-options::-webkit-scrollbar{display:none}
 :root .mv-template-gallery .template-filter-group:first-child .template-chip,
 :root .mv-template-gallery .template-filter-group:first-child .template-chip:nth-last-child(-n+2){flex:1 0 auto;min-height:44px;padding:10px 14px}
 /* If a fifth type filter is published, the row scrolls sideways instead of wrapping a lone filter. */
 :root .mv-template-gallery .template-sector-control{flex-wrap:nowrap;gap:12px;padding:0 4px}
 :root .mv-template-gallery .template-sector-select{flex:1 1 auto;width:auto;max-width:none;min-width:0}
 :root .mv-template-gallery .template-sector-trigger{width:100%;min-height:44px;justify-content:space-between}
 :root .mv-template-gallery .template-gallery-toolbar .template-reset:not([hidden]){margin:0 4px 0 12px}

 /* Compact cards: miniature, text and arrow share one centre line; the caption takes the full
    width under the title. It is never cut: "Modèle fictif" and the language always show, on two
    lines when one is not enough. */
 :root:root:root .mv-template-gallery .template-card:not(.is-featured),
 :root:root:root .mv-template-gallery .template-gallery-grid[data-filtered=true] .template-card:not(.is-featured){grid-template-columns:76px minmax(0,1fr);gap:16px;padding:16px;align-items:center}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-preview,
 :root:root:root .mv-template-gallery .template-gallery-grid[data-filtered=true] .template-card:not(.is-featured) .template-preview{height:128px;padding:4px}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-card-body{grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto auto auto;column-gap:12px;align-items:center}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-card-category{grid-column:1;grid-row:1;margin:0 0 8px}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-card-body>h3[id]{grid-column:1;grid-row:2;font-size:21px;line-height:1.16;text-wrap:balance;overflow-wrap:break-word}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-card-body>p{grid-column:1/-1;grid-row:3;max-width:none;margin:8px 0 0;font:400 14px/1.43 Geist,sans-serif;text-wrap:balance}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-card-actions,
 :root:root:root .mv-template-gallery .template-gallery-grid[data-filtered="false"] .template-card:not(.is-featured) .template-card-actions{grid-column:2;grid-row:1/span 2;align-self:center}

 :root .mv-template-gallery .template-card.is-featured .template-card-body h3{text-wrap:balance}
}
@media (max-width:374px){
 :root .mv-template-gallery .template-filter-group:first-child .template-chip,
 :root .mv-template-gallery .template-filter-group:first-child .template-chip:nth-last-child(-n+2){padding:10px 10px;font-size:13px}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured),
 :root:root:root .mv-template-gallery .template-gallery-grid[data-filtered=true] .template-card:not(.is-featured){grid-template-columns:64px minmax(0,1fr);gap:12px;padding:14px}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-preview,
 :root:root:root .mv-template-gallery .template-gallery-grid[data-filtered=true] .template-card:not(.is-featured) .template-preview{height:110px}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-card-body>h3[id]{font-size:19px}
 :root:root:root .mv-template-gallery .template-card:not(.is-featured) .template-card-body>p{font-size:13px}
 :root .mv-template-gallery .is-featured .template-card-body h3{font-size:30px}
}
