/* The filter bar of « Actualités & presse » and « Blog et inspirations » (template-parts/news/filters.php,
   assets/js/news-filters.js). Three blocks over the list:
   1. the bar: one rounded dock holding the search field (with its clear button) and « Filtres ». « Filtres » opens a
      popover under the dock from 900 px, a bottom sheet on a phone (a modal dialog, script), the same panel under the
      dock without JavaScript. With the script the bar sticks under the header while the list scrolls (.is-live) and
      draws a frosted band edge to edge once stuck (.is-stuck); on a phone it follows the header when it slides away;
   2. the chips of the list's main dimension: one line that scrolls sideways when wider than the page (its edges fade,
      arrows for a mouse); the chip in force is filled and carries a check (G1: never colour alone);
   3. the state line once a filter is set: the count, each filter as a removable chip, « Réinitialiser ». With nothing
      set, the count stays for screen readers only (it is the live region).
   Targets are 44 px or more, field borders 3:1 on the page (--field-line), every focus shows the site's 2 px ring with
   the control's own shape (main.css sets a 4 px radius on :focus-visible, so each rule here gives it back). Motion is
   transform and opacity only, and none with reduced motion (main.css). Colours are the site's tokens. */

/* ---------- The zone: the bar sticks inside it, over the list ---------- */
.gp-nf-zone { position: relative; }
.gp-nf-zone [data-nf-item] { scroll-margin-top: 96px; } /* under the header (html scroll-padding) and the stuck bar */

/* ---------- 1. The bar ---------- */
.gp-nf { --nf-r: 18px; position: relative; z-index: 40; display: block; padding-block: 12px; color: var(--ink); }
.gp-nf.is-live { position: sticky; top: var(--header-total); transition: transform var(--dur-header) var(--ease-out); }
/* The frosted band behind the stuck bar, edge to edge. */
.gp-nf::before { content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw); border-bottom: 1px solid var(--line); background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); opacity: 0; transition: opacity .3s var(--ease-out); pointer-events: none; }
.gp-nf.is-stuck::before { opacity: 1; }
/* Phones: the header's bar slides away on the way down (main.js) and the stuck bar follows it, then comes back with it. */
@media (max-width: 767.98px) and (min-height: 481px) {
	html:has(#gp-header.is-hidden) .gp-nf.is-stuck { transform: translate3d(0, calc(-1 * var(--header-h)), 0); }
}
@media (max-height: 480px) {
	html:has(#gp-header.is-hidden) .gp-nf.is-stuck { transform: translate3d(0, calc(-1 * var(--header-total)), 0); }
}

.gp-nf__dock { position: relative; display: flex; align-items: center; gap: 4px; min-height: 60px; padding: 5px; border: 1px solid var(--field-line); border-radius: var(--nf-r); background: var(--bg-2); box-shadow: 0 22px 46px -36px rgba(var(--chrome-rgb), .8); }
.gp-nf__dock:hover { border-color: var(--ink); }
/* While a list is on its way: a line runs under the dock (still with reduced motion, it just does not run). */
.gp-nf__dock::after { content: ""; position: absolute; left: var(--nf-r); right: var(--nf-r); bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-line); opacity: 0; transform-origin: 0 50%; pointer-events: none; }
.gp-nf.is-busy .gp-nf__dock::after { opacity: 1; animation: gp-nf-busy 1.1s var(--ease-out) .12s infinite backwards; }
@keyframes gp-nf-busy { 0% { opacity: 1; transform: scaleX(0); } 65% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1); } }

/* The search field: the largest control, the ring drawn around the whole dock. */
.gp-nf__search { position: relative; display: flex; flex: 1 1 auto; align-items: center; min-width: 0; }
.gp-nf__search > .gp-i { position: absolute; left: 14px; top: 50%; width: 22px; height: 22px; color: var(--muted); translate: 0 -50%; pointer-events: none; }
.gp-nf__search input { flex: 1 1 auto; width: 100%; min-width: 0; height: 48px; margin: 0; padding: 0 10px 0 47px; border: 0; border-radius: calc(var(--nf-r) - 5px); background: transparent; color: var(--ink); font: 500 1.06rem/1.2 var(--font-body); text-overflow: ellipsis; -webkit-appearance: none; appearance: none; }
.gp-nf__search input::placeholder { color: var(--muted); opacity: 1; }
.gp-nf__search input::-webkit-search-cancel-button, .gp-nf__search input::-webkit-search-decoration { display: none; -webkit-appearance: none; appearance: none; }
.gp-nf__search input:focus-visible { outline-offset: -2px; border-radius: calc(var(--nf-r) - 5px); }
@supports selector(:has(*)) {
	.gp-nf__search input:focus-visible { outline: none; }
	.gp-nf__dock:has(input:focus-visible) { border-color: var(--ink); outline: 2px solid var(--accent-ink); outline-offset: 3px; }
}
.gp-nf__clear { display: inline-grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.gp-nf__clear:hover { background: var(--hover); color: var(--ink); }
.gp-nf__clear:focus-visible { outline-offset: -2px; border-radius: 50%; }
.gp-nf__clear .gp-i { width: 18px; height: 18px; }

/* « Filtres »: a pill inside the dock; dark on light (or the reverse) while open, the chevron turned (shape cue). */
.gp-nf__more { flex: none; }
.gp-nf__trigger { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px 0 15px; border-radius: calc(var(--nf-r) - 5px); background: var(--surface-2); color: var(--ink); font-size: 1rem; font-weight: 700; line-height: 1; list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.gp-nf__trigger::-webkit-details-marker { display: none; }
.gp-nf__trigger::marker { content: ""; }
.gp-nf__trigger:hover { background: var(--surface-3); }
.gp-nf__trigger:focus-visible { outline-offset: 2px; border-radius: calc(var(--nf-r) - 5px); }
.gp-nf__trigger > .gp-i { flex: none; width: 20px; height: 20px; }
.gp-nf__chev { display: inline-grid; margin-left: -2px; transition: transform .4s var(--ease-out); }
.gp-nf__chev .gp-i { width: 18px; height: 18px; }
.gp-nf__more[open] > .gp-nf__trigger { background: var(--ink); color: var(--bg); }
.gp-nf__more[open] .gp-nf__chev { transform: rotate(180deg); }
.gp-nf__badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1.5px var(--accent-rim); font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* The panel. From 900 px (and without the script) it hangs under the dock, right-aligned. */
.gp-nf__panel { position: absolute; inset: calc(100% + 10px) 0 auto auto; z-index: 5; width: min(660px, calc(100vw - 2 * var(--gutter))); max-width: none; height: auto; max-height: calc(100vh - var(--header-total) - 130px); max-height: calc(100dvh - var(--header-total) - 130px); margin: 0; padding: 22px 24px 20px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); color: var(--ink); box-shadow: 0 40px 90px -40px rgba(var(--chrome-rgb), .8), 0 2px 12px -6px rgba(var(--chrome-rgb), .35); }
.gp-nf:not(.has-pop) .gp-nf__more[open] > .gp-nf__panel { display: block; }
.gp-nf__panel[open] { transform-origin: 85% 0; animation: gp-nf-pop .34s var(--ease-out); }
@keyframes gp-nf-pop { from { opacity: 0; transform: translate3d(0, -8px, 0) scale(.98); } }
.gp-nf__panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.gp-nf__panel-title { margin: 0; font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.gp-nf__close { display: inline-grid; flex: none; place-items: center; width: 44px; height: 44px; margin: -6px -6px -6px 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.gp-nf__close:hover { border-color: var(--field-line); background: var(--hover); }
.gp-nf__close:focus-visible { outline-offset: 2px; border-radius: 50%; }
.gp-nf__close .gp-i { width: 20px; height: 20px; }

.gp-nf__fields { display: grid; gap: 16px 20px; }
.gp-nf__field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.gp-nf__field label { font-size: .94rem; font-weight: 700; line-height: 1.3; }
.gp-nf__field select { width: 100%; min-height: 48px; margin: 0; padding: 0 44px 0 16px; border: 1px solid var(--field-line); border-radius: var(--field-radius); background: var(--bg) var(--select-arrow) no-repeat right 16px center; color: var(--ink); font: inherit; font-size: 1rem; text-overflow: ellipsis; cursor: pointer; -webkit-appearance: none; appearance: none; }
.gp-nf__field select option { background: var(--bg); color: var(--ink); }
.gp-nf__field select option:disabled { color: var(--muted); }
.gp-nf__field select:not(:disabled):hover { border-color: var(--ink); }
.gp-nf__field select:focus-visible { outline-offset: 2px; border-radius: var(--field-radius); }
.gp-nf__field select:disabled { border-style: dashed; color: var(--muted); cursor: not-allowed; opacity: 1; }
.gp-nf__note { color: var(--muted); font-size: .84rem; line-height: 1.35; }
@media (min-width: 600px) {
	.gp-nf__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
	/* Six selects (the news): three columns, two rows, so the popover stays short. */
	.gp-nf__panel:has(.gp-nf__field:nth-child(6):last-child) { width: min(900px, calc(100vw - 2 * var(--gutter))); }
	.gp-nf__panel:has(.gp-nf__field:nth-child(6):last-child) .gp-nf__fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.gp-nf__panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.gp-nf__reset { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 700; text-decoration: underline 1.5px; text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent); text-underline-offset: .28em; }
.gp-nf__reset:hover { text-decoration-color: currentColor; }
.gp-nf__submit, .gp-nf__done { min-height: 50px; padding: .8em 1.4em .75em; font-size: .92rem; }
.gp-nf__done-n { font-variant-numeric: tabular-nums; }

/* A phone with the script: the panel is a bottom sheet over a dimmed page (the page under it stays still). */
.gp-nf__panel:modal { position: fixed; inset: auto 0 0; display: flex; flex-direction: column; width: 100%; max-width: 100%; max-height: min(88vh, 760px); max-height: min(88dvh, 760px); padding: 0; overflow: hidden; border: 0; border-top: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -30px 70px -30px rgba(var(--chrome-rgb), .8); animation: gp-nf-sheet-in .46s var(--ease-out); }
.gp-nf__panel:modal::backdrop { background: rgba(10, 11, 13, .62); animation: gp-nf-fade .36s var(--ease-out); } /* carbon (--chrome-rgb): a backdrop does not inherit custom properties everywhere */
.gp-nf__panel:modal.is-closing { animation: gp-nf-sheet-out .32s var(--ease-out) forwards; }
.gp-nf__panel:modal.is-closing::backdrop { animation: gp-nf-fade-out .32s var(--ease-out) forwards; }
.gp-nf__panel:modal .gp-nf__panel-head { flex: none; margin: 0; padding: 16px var(--gutter) 12px; border-bottom: 1px solid var(--line); }
.gp-nf__panel:modal .gp-nf__fields { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px var(--gutter) 22px; }
.gp-nf__panel:modal .gp-nf__panel-foot { flex: none; flex-wrap: nowrap; margin: 0; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom, 0px)); }
.gp-nf__panel:modal .gp-nf__done { flex: 1 1 auto; max-width: 340px; }
@keyframes gp-nf-sheet-in { from { transform: translate3d(0, 100%, 0); } }
@keyframes gp-nf-sheet-out { to { transform: translate3d(0, 100%, 0); } }
@keyframes gp-nf-fade { from { opacity: 0; } }
@keyframes gp-nf-fade-out { to { opacity: 0; } }

@media (max-width: 899.98px) {
	.gp-nf__panel { inset-inline: 0; width: auto; } /* without the script: as wide as the dock */
	.gp-nf__chev { display: none; }
}
@media (max-width: 599.98px) {
	.gp-nf { padding-block: 10px; }
	.gp-nf__dock { min-height: 58px; }
	.gp-nf__search > .gp-i { left: 12px; width: 20px; height: 20px; }
	.gp-nf__search input { padding: 0 4px 0 40px; font-size: 1rem; } /* 16 px: no zoom on focus (iOS) */
	.gp-nf__trigger { gap: 6px; padding: 0 11px 0 10px; }
	.gp-nf[data-nf-picked] .gp-nf__trigger-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; } /* the count says it; still the button's name */
}
@media (max-width: 359.98px) {
	.gp-nf__trigger-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; } /* still the button's name */
}

/* ---------- 2. The chips ---------- */
.gp-nf-chips { position: relative; padding-top: 2px; }
/* The fade: clear from the page's edge to just inside the gutter, then up to full strength over --nf-fade (under the
   arrow); the script brings the chip in force, and a chip reached with Tab, into the clear part (scroll-padding).
   The padding keeps focus rings inside the scrolling box. */
.gp-nf-chips { --nf-fade: clamp(24px, 12vw - 20px, 100px); }
.gp-nf-chips__rail { --nf-l0: 0px; --nf-l1: 0px; --nf-r0: 0px; --nf-r1: 0px; position: relative; display: flex; gap: 8px; margin: -6px calc(-1 * var(--gutter)); padding: 6px var(--gutter); overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-inline: calc(var(--gutter) + var(--nf-fade)); scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent var(--nf-l0), #000 var(--nf-l1), #000 calc(100% - var(--nf-r1)), transparent calc(100% - var(--nf-r0))); mask-image: linear-gradient(90deg, transparent var(--nf-l0), #000 var(--nf-l1), #000 calc(100% - var(--nf-r1)), transparent calc(100% - var(--nf-r0))); }
.gp-nf-chips__rail::-webkit-scrollbar { display: none; }
.gp-nf-chips.is-scroll:not(.at-start) .gp-nf-chips__rail { --nf-l0: max(0px, calc(var(--gutter) - 12px)); --nf-l1: calc(var(--gutter) + var(--nf-fade)); }
.gp-nf-chips.is-scroll:not(.at-end) .gp-nf-chips__rail { --nf-r0: max(0px, calc(var(--gutter) - 12px)); --nf-r1: calc(var(--gutter) + var(--nf-fade)); }
.gp-nf-chip { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 9px 0 16px; border: 1px solid var(--field-line); border-radius: 999px; background: transparent; color: var(--ink); font-size: .94rem; font-weight: 600; line-height: 1.1; text-decoration: none; white-space: nowrap; }
.gp-nf-chip { max-width: calc(100% - 2 * var(--nf-fade)); padding-block: 4px; } /* % of the rail's inner box: the clear part between the fades */
.gp-nf-chip__label { min-width: 0; white-space: normal; text-wrap: balance; }
.gp-nf-chip:not(:has(.gp-nf-chip__n)) { padding-right: 16px; }
.gp-nf-chip:hover { border-color: var(--ink); background: var(--hover); }
.gp-nf-chip:focus-visible { outline-offset: 2px; border-radius: 999px; }
.gp-nf-chip__check { display: none; }
.gp-nf-chip__n { min-width: 26px; padding: 4px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .76rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; text-align: center; }
.gp-nf-chip[aria-current] { padding-left: 7px; border-color: var(--accent-edge); background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1.5px var(--accent-rim); }
.gp-nf-chip[aria-current] .gp-nf-chip__check { display: inline-grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--on-accent); color: var(--accent); }
.gp-nf-chip[aria-current] .gp-nf-chip__check .gp-i { width: 16px; height: 16px; stroke-width: 2.4; }
.gp-nf-chip[aria-current] .gp-nf-chip__n { background: rgba(10, 11, 13, .14); color: inherit; }
@media (prefers-reduced-motion: no-preference) {
	.gp-nf-chip { transition: transform .25s var(--ease-out); }
	.gp-nf-chip:active { transform: scale(.96); }
}
/* Arrows for a mouse when the line is wider than the page (keyboard: Tab reaches every chip; a finger swipes). */
.gp-nf-chips__arrow { position: absolute; top: 50%; z-index: 1; display: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--field-line); border-radius: 50%; background: var(--bg-2); color: var(--ink); box-shadow: 0 10px 24px -12px rgba(var(--chrome-rgb), .8); cursor: pointer; translate: 0 -50%; transition: opacity .25s var(--ease-out); }
.gp-nf-chips__arrow:hover { border-color: var(--ink); background: var(--bg-3); }
.gp-nf-chips__arrow--prev { left: max(4px, calc(var(--gutter) - 8px)); }
.gp-nf-chips__arrow--next { right: max(4px, calc(var(--gutter) - 8px)); }
@media (hover: hover) and (pointer: fine) {
	.gp-nf-chips.is-scroll .gp-nf-chips__arrow { display: grid; }
	.gp-nf-chips.at-start .gp-nf-chips__arrow--prev, .gp-nf-chips.at-end .gp-nf-chips__arrow--next { opacity: 0; pointer-events: none; }
	.gp-nf-chips:has(.gp-nf-chip:focus-visible) .gp-nf-chips__arrow { opacity: 0; pointer-events: none; }
}

/* ---------- 3. The state line ---------- */
.gp-nf-status:not(.is-active) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gp-nf-status.is-active { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 14px; }
.gp-nf-status__count { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.gp-nf-status__active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.gp-nf-status__active:empty { display: none; }
.gp-nf-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gp-nf-tag { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 5px 5px 15px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface-1); color: var(--ink); font-size: .92rem; font-weight: 600; line-height: 1.25; text-decoration: none; }
.gp-nf-tag__label { overflow-wrap: anywhere; } /* a long theme wraps inside its chip: never cut */
.gp-nf-tag__x { display: inline-grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); }
.gp-nf-tag__x .gp-i { width: 16px; height: 16px; }
.gp-nf-tag:hover { border-color: var(--field-line); }
.gp-nf-tag:hover .gp-nf-tag__x { background: var(--ink); color: var(--bg); }
.gp-nf-tag:focus-visible { outline-offset: 2px; border-radius: 22px; }
.gp-nf-status__reset { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 700; text-decoration: underline 1.5px; text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent); text-underline-offset: .28em; }
.gp-nf-status__reset:hover { text-decoration-color: currentColor; }

/* ---------- The list ---------- */
[data-nf-results] { transition: opacity .25s var(--ease-out); }
[data-nf-results][aria-busy="true"] { opacity: .5; }
/* A swapped list, or a page added by « Afficher plus »: the new items rise in turn (the twelfth and later together). */
html.gp-js .is-entering { animation: gp-nf-enter .8s var(--ease-out) backwards; animation-delay: calc(var(--nf-k, 0) * 50ms); }
html.gp-js .is-entering[data-reveal] { transition: none; }
@keyframes gp-nf-enter { from { opacity: 0; transform: translate3d(0, 24px, 0); } }
/* The lead picture follows the pointer a little (news-filters.js sets --nf-x and --nf-y, mouse only). */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	[data-nf-depth] img { scale: 1.05; translate: calc(var(--nf-x, 0) * -16px) calc(var(--nf-y, 0) * -12px); transition: translate .9s var(--ease-out), scale 1.1s var(--ease-out); }
}
/* What « Afficher plus » has shown, out of the whole list. */
.gp-nf-meter { display: block; width: min(260px, 70%); height: 4px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.gp-nf-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent-line); transform: scaleX(var(--nf-p, 0)); transform-origin: 0 50%; transition: transform .9s var(--ease-out); }
[data-nf-more][aria-busy="true"] { cursor: progress; opacity: .8; }
[data-nf-more][aria-busy="true"] .gp-i { animation: gp-nf-spin .9s linear infinite; }
[data-nf-more]:hover .gp-i { transform: rotate(90deg); }
@keyframes gp-nf-spin { to { transform: rotate(360deg); } }

/* The empty state of a filtered list. */
.gp-nf-empty { display: grid; justify-items: start; gap: 14px; max-width: 62ch; padding-block: clamp(40px, 6vw, 88px); }
.gp-nf-empty__mark { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 6px; border: 1px solid var(--field-line); border-radius: 50%; color: var(--accent-ink); }
.gp-nf-empty__mark .gp-i { width: 30px; height: 30px; }
.gp-nf-empty__title { margin: 0; font-size: clamp(1.7rem, 1.1rem + 2.2vw, 3rem); line-height: 1; text-wrap: balance; }
.gp-nf-empty__text { margin: 0; color: var(--ink-2); }
.gp-nf-empty:first-child { padding-top: clamp(8px, 1.6vw, 20px); } /* right under the state line */
.gp-nf-empty .gp-btn { margin-top: 10px; }
