/* ============================================================================
   filter-panel - a tab's filter panel, shared (partials/sections/ts_filter_panel.php:
   /townsquare and the search page, every theme that draws them - townsquare,
   homesquare). Kind pills, the select2 choices (Portal; Newsroom and Category
   on National News) and the keyword box with its suggestions
   (search-suggest.css). Colours: the portal's own (--site_color_g,
   --site_font_color_g). 14px minimum.
   ============================================================================ */
/* one corner for every control of the panel (its choices' boxes set it), and for the result line under it */
.tq-shell,.tq-fpanel{--tq-panel-radius:12px;--tq-panel-gap:14px}
/* one rhythm: the same space inside the shell on every side, between its rows, and under it before the first card */
.tq-fmain .tq-shell{padding:var(--tq-panel-gap);margin-bottom:var(--tq-panel-gap)}
.tq-fmain .tq-shell .tq-fmeta{margin:0}
.tq-fpanel{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--tq-panel-gap);margin:0 0 var(--tq-panel-gap);color:var(--site_font_color_g)}
.tq-fpanel > *{min-width:0;max-width:100%}

.tq-fpanel .tq-ctype{border-radius:var(--tq-panel-radius)}
.tq-fpanel .tq-ctypes{margin:0}
.tq-shell .tq-fmeta{border-radius:var(--tq-panel-radius)}

/* the choices: label and box on one line, the box as tall as the keyword box, its text and arrow centred */
.tq-fp-picks{display:flex;flex-wrap:wrap;align-items:center;gap:10px var(--tq-panel-gap)}
.tq-fp-pick{display:inline-flex;align-items:center;gap:10px;margin:0;font-weight:700;font-size:14px;line-height:1}
.tq-fp-pick > span{opacity:.75}
.tq-fp-pick select{min-width:240px;height:46px;font-size:14px}
/* a choice as wide as its chosen name, from 240px to the row's width */
.tq-fp-pick .select2-container{width:auto!important;min-width:240px;max-width:min(100%,460px);vertical-align:middle}
.tq-fp-pick .select2-container .select2-selection--single{height:46px;display:flex;align-items:center;border-radius:var(--tq-panel-radius);border:1px solid color-mix(in srgb,var(--site_font_color_g) 16%,transparent);background:inherit}
.tq-fp-pick .select2-container .select2-selection--single .select2-selection__rendered{line-height:normal;padding:0 36px 0 14px;color:var(--site_font_color_g);font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tq-fp-pick .select2-container .select2-selection--single .select2-selection__arrow{height:100%;top:0;right:10px;display:flex;align-items:center}
.tq-fp-pick .select2-container--focus .select2-selection--single,.tq-fp-pick .select2-container--open .select2-selection--single{border-color:var(--site_color_g)}
.select2-container--open .select2-dropdown{border-color:color-mix(in srgb,var(--site_font_color_g) 16%,transparent);border-radius:var(--tq-panel-radius,12px);overflow:hidden}
.select2-container--open .select2-dropdown{min-width:260px}
/* the full names in the list: long ones wrap */
.select2-container--open .select2-results__option{font-size:14px;padding:9px 14px;white-space:normal;word-break:break-word}
/* the "Portal / Newsroom" groups: a heading, not a choice */
.select2-container--open .select2-results__group{font-size:14px;font-weight:700;padding:10px 14px 4px;opacity:.6;cursor:default;pointer-events:none}
.select2-container--open .select2-results__option[role=group]{padding:0}
.select2-container--open .select2-search--dropdown{padding:8px}
.select2-container--open .select2-search--dropdown .select2-search__field{height:40px;padding:0 12px;border-radius:var(--tq-panel-radius,12px);border:1px solid color-mix(in srgb,var(--site_font_color_g) 16%,transparent);font-size:14px;outline:0}
.select2-container--open .select2-search--dropdown .select2-search__field:focus{border-color:var(--site_color_g)}
.select2-container--open .select2-results__option--highlighted[aria-selected]{background:var(--site_color_g);color:#fff}

/* the keyword box and its button: one row, the same height as the choices */
.tq-fp-search{display:flex;gap:10px;align-items:stretch;margin:0}
.tq-fp-kw{position:relative;flex:1;display:flex;align-items:center;gap:9px;padding:0 16px;border-radius:var(--tq-panel-radius);border:1px solid color-mix(in srgb,var(--site_font_color_g) 16%,transparent);background:inherit}
.tq-fp-kw:focus-within{border-color:var(--site_color_g)}
.tq-fp-kw input{flex:1;min-width:0;border:0;outline:0;background:none;font-size:15px;height:46px;color:var(--site_font_color_g)}
.tq-fp-kw .search-autocomplete-list{top:calc(100% + 6px);left:0;right:0}
.tq-fp-go{border:0;border-radius:var(--tq-panel-radius);padding:0 24px;height:46px;font-size:14.5px;font-weight:700;color:#fff;background:var(--site_color_g);cursor:pointer;white-space:nowrap}
.tq-fp-go:hover{filter:brightness(1.08)}
@media (max-width:600px){
  .tq-fp-search{flex-direction:column}
  .tq-fp-pick{width:100%;min-width:0}
  .tq-fp-pick > span{flex:0 0 auto;min-width:72px}
  .tq-fp-pick .select2-container,.tq-fp-pick select{flex:1 1 0;min-width:0;width:auto !important}
  .tq-fp-kw,.tq-fp-go{width:100%;box-sizing:border-box}
}

/* THE PANEL IN REACH (owner, 2026-11-26: "an arrow at the side that moves to that area"): on every width the
   back-to-top button (js/base.js .tq-totop) becomes a round arrow back to the panel while the panel is out of view
   (js/townsquare.js panelReach()); above the Copilot bubble when it shows, away while a post is being written */
.tq-totop.tq-totop--panel{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom,0px));z-index:80;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:var(--site_color_g);color:#fff;cursor:pointer;box-shadow:0 10px 24px -12px rgba(8,15,84,.6)}
.tq-totop.tq-totop--panel:focus-visible{outline:3px solid #fff;outline-offset:2px;box-shadow:0 0 0 5px var(--site_color_g)}
body.tq-has-bubble .tq-totop.tq-totop--panel{bottom:calc(86px + env(safe-area-inset-bottom,0px))}
/* shown as soon as the panel is out of view (js/townsquare.js), whatever the page's own back-to-top rule says */
.tq-totop.tq-totop--panel:not([data-panel-out="1"]){display:none!important}
.tq-totop.tq-totop--panel[data-panel-out="1"]{display:grid!important}
body:has(.tq-composer.tq-c-open,.tq-composer:focus-within,.tq-edit) .tq-totop.tq-totop--panel{display:none!important}
@media (max-width:480px){
  .tq-fmain .tq-shell{padding:16px}
  .tq-fp-pick{flex-direction:column;align-items:stretch;gap:6px}
  .tq-fp-pick .select2-container,.tq-fp-pick select{width:100%!important;min-width:0;max-width:100%}
}
/* National News: the master admin's "who can see it" row, above its panel */
.tq-nn-access{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:0 0 var(--tq-panel-gap,14px);padding:10px 14px;border-radius:var(--tq-panel-radius,12px);border:1px dashed color-mix(in srgb,var(--site_font_color_g) 25%,transparent);font-size:14px}
.tq-nn-access > span{font-weight:700}
.tq-nn-access label{display:inline-flex;align-items:center;gap:6px}
