/* Blog: the search box, tag chips and sort above the cards on /blog, and the small tag chips on cards and posts (owner, 2026-11-24).
   Markup: src/_includes/blog-controls.njk and src/blog/index.njk (the bar and the cards), src/_includes/post-tags.njk and
   scripts/add-post-tags.mjs (the chips in a post's header). Behaviour: /assets/js/mfp-blog.v1.js.
   /assets is cached for a year: change this file under a new name (mfp-blog.v2.css) and update the pages that link it, never in place. */

/* ---- the bar ---- */
.mfp-blogbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.9rem 1rem;align-items:end;margin:0 0 1.5rem;color:#203a3d;font-size:1rem;line-height:1.4;scroll-margin-top:1rem}
.mfp-blogbar[hidden],.mfp-blogbar [hidden],.mfp-bb-empty[hidden],.mfp-post[hidden]{display:none}
.mfp-vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.mfp-bb-search{margin:0;min-width:0;max-width:30rem}
.mfp-blogbar label{display:block;margin:0 0 .3rem;font-size:.875rem;font-weight:400;line-height:1.3;color:#3d5559}
.mfp-blogbar input[type=search],.mfp-blogbar select{display:block;box-sizing:border-box;width:100%;height:46px;margin:0;border:1.5px solid rgba(32,58,61,.6);border-radius:10px;background-color:#fff;background-repeat:no-repeat;color:#203a3d;font:inherit;line-height:1.2;-webkit-appearance:none;appearance:none;caret-color:#203a3d}
.mfp-blogbar input[type=search]{padding:0 .75rem 0 2.6rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%233d5559' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M13 13l4.5 4.5'/%3E%3C/svg%3E");background-position:.8rem 50%;background-size:1.1rem 1.1rem}
.mfp-blogbar select{width:auto;min-width:10rem;padding:0 2.4rem 0 .85rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23203a3d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");background-position:right .85rem center;background-size:.8rem .8rem;cursor:pointer}
.mfp-blogbar input[type=search]:hover,.mfp-blogbar select:hover{border-color:#203a3d}
.mfp-blogbar ::selection{background:#203a3d;color:#fff}

/* focus: the site's yellow ring, with a dark line inside it so it also shows on a white page */
.mfp-blogbar input[type=search]:focus-visible,.mfp-blogbar select:focus-visible,.mfp-chip:focus-visible,.mfp-bb-clear:focus-visible,.mfp-bb-empty button:focus-visible{outline:3px solid #e9b949;outline-offset:2px;box-shadow:0 0 0 2px #203a3d}

/* ---- tag chips (buttons) ---- */
/* position:relative keeps each chip's screen-reader-only count (.mfp-vh, absolutely placed) inside the chip, so on a phone the
   sideways-scrolling row clips it; without it those hidden spans made the whole page scroll sideways. */
.mfp-bb-chips{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:.5rem;min-width:0}
.mfp-chip{position:relative;flex:none;display:inline-flex;align-items:center;gap:.45rem;min-height:44px;margin:0;padding:0 1rem;border:1px solid rgba(32,58,61,.28);border-radius:999px;background:#e8efe4;color:#203a3d;font:inherit;font-size:.95rem;line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color .15s ease-out,border-color .15s ease-out,color .15s ease-out;-webkit-tap-highlight-color:transparent}
.mfp-chip .n{font-size:.8rem;color:#3d5559;font-variant-numeric:tabular-nums}
.mfp-chip:hover{background:#d9e5d3;border-color:rgba(32,58,61,.55)}
.mfp-chip[aria-pressed=true]{background:#203a3d;border-color:#203a3d;color:#fff}
.mfp-chip[aria-pressed=true] .n{color:#cfdccb}

/* ---- count line and "Clear" ---- */
.mfp-bb-status{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:0 .75rem;min-height:44px;margin:-.45rem 0 0}
.mfp-bb-count{margin:0;font-size:.9rem;color:#3d5559}
.mfp-bb-clear{min-height:44px;margin:0;padding:0 .4rem;border:0;border-radius:8px;background:none;color:#203a3d;font:inherit;font-size:.9rem;text-decoration:underline;text-underline-offset:.2em;cursor:pointer}
.mfp-bb-clear:hover{text-decoration-thickness:2px}

/* ---- nothing matches ---- */
.mfp-bb-empty{max-width:40rem;margin:0 0 2rem;padding:1.6rem 1.5rem 1.5rem;border-radius:14px;background:#e8efe4;color:#203a3d;text-align:left}
.mfp-bb-empty-t{margin:0 0 .3rem;font-family:Quattrocento,Georgia,serif;font-size:1.4rem;line-height:1.25;overflow-wrap:anywhere}
.mfp-bb-empty-s{margin:0 0 1.1rem;font-size:.95rem;color:#3d5559}
.mfp-bb-empty button{min-height:48px;margin:0;padding:0 1.5rem;border:0;border-radius:999px;background:#203a3d;color:#fff;font:inherit;cursor:pointer;transition:background-color .15s ease-out}
.mfp-bb-empty button:hover{background:#2c4e52}

/* ---- cards: each is an <article> holding the card link, then its tags ---- */
.mfp-post{display:flex;flex-direction:column;min-width:0}
.mfp-post>a{display:block}
.mfp-post .mfp-card-date{display:flex;align-items:center;gap:.5rem;margin:0 0 .35rem;font-size:.85rem;color:#4d5f59}

/* ---- small tag chips (links to /blog?tag=...): a 44px-high target around a smaller pill ---- */
.mfp-tags{display:flex;flex-wrap:wrap;gap:0 .4rem;margin:.1rem 0 0;padding:0;list-style:none}
.mfp-tags li{margin:0;padding:0}
.mfp-tag{display:inline-flex;align-items:center;min-height:44px;color:#203a3d;text-decoration:none;-webkit-tap-highlight-color:transparent}
.mfp-tag span{display:inline-block;padding:.22rem .7rem;border-radius:999px;background:#e8efe4;font-size:.8125rem;line-height:1.3;white-space:nowrap;transition:background-color .15s ease-out,color .15s ease-out}
.mfp-tag:hover{color:#fff}
.mfp-tag:hover span{background:#203a3d}
.mfp-tag:focus-visible{outline:none}
.mfp-tag:focus-visible span{outline:3px solid #e9b949;outline-offset:2px;box-shadow:0 0 0 2px #203a3d}
/* in a post's dark header */
.mfp-tags-on-dark{margin:.35rem 0 0}
.mfp-tags-on-dark .mfp-tag{color:#fff}
.mfp-tags-on-dark .mfp-tag span{background:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.65)}
.mfp-tags-on-dark .mfp-tag:hover{color:#203a3d}
.mfp-tags-on-dark .mfp-tag:hover span{background:#e8efe4;box-shadow:none}
.mfp-tags-on-dark .mfp-tag:focus-visible span{box-shadow:inset 0 0 0 1px rgba(255,255,255,.65)}

/* ---- phones ---- */
@media (max-width:767px){
  .mfp-blogbar{gap:.75rem .6rem;margin-bottom:1rem}
  .mfp-blogbar select{min-width:0}
}
/* on a touch phone the chips sit in one row you swipe sideways (it runs to the screen edges, so a cut-off chip shows there is more) */
@media (max-width:767px) and (pointer:coarse){
  .mfp-bb-chips{flex-wrap:nowrap;overflow-x:auto;margin:-6px -16px;padding:6px 16px;scrollbar-width:none;overscroll-behavior-x:contain}
  .mfp-bb-chips::-webkit-scrollbar{display:none}
}
@media (prefers-reduced-motion:reduce){.mfp-chip,.mfp-tag span,.mfp-bb-empty button{transition:none}}
@media (forced-colors:active){.mfp-chip[aria-pressed=true]{forced-color-adjust:none;background:Highlight;border-color:Highlight;color:HighlightText}.mfp-chip[aria-pressed=true] .n{color:HighlightText}}
@media print{.mfp-blogbar,.mfp-bb-empty{display:none}}
