/* ============================================================================
   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}
/* SET YOUR NEWS PREFERENCE (client, 2026-11-30): the panel's button, top right (js/news-pref.js), and its SweetAlert list */
.tq-fp-prefrow{display:flex;justify-content:flex-end;margin:0 0 -4px}
/* a tab's RSS feed (townsquare/rss/<tab>), beside Set your News Preference */
.tq-fp-rss{--rss:#f26522;--rss-ink:#c2410c;display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 14px;border-radius:999px;border:1.5px solid color-mix(in srgb,var(--rss) 45%,transparent);background:#fff;color:var(--rss-ink);font-size:14px;font-weight:700;text-decoration:none}
.tq-fp-rss svg{color:var(--rss)}
.tq-fp-rss:hover,.tq-fp-rss:focus{border-color:var(--rss);background:color-mix(in srgb,var(--rss) 9%,#fff);color:var(--rss-ink)!important;text-decoration:none}
/* the first row: the kind pills, then the actions at its right */
.tq-fp-kindrow{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px}
.tq-fp-kindrow>.tq-fp-kinds{flex:1 1 auto;min-width:0}
.tq-fp-acts{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-left:auto}
.tq-fp-acts .tq-fp-prefrow{margin:0}
.tq-fp-toprow{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}.tq-fp-toprow .tq-fp-topics{flex:0 1 auto;min-width:0}.tq-fp-toprow .tq-fp-prefrow{margin:0 0 0 auto}
.tq-fp-pref{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 14px;border-radius:999px;border:1.5px solid color-mix(in srgb,var(--site_color_g) 30%,transparent);background:#fff;color:var(--site_color_g);font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}
.tq-fp-pref:hover,.tq-fp-pref.is-on{background:var(--site_color_g);border-color:var(--site_color_g);color:#fff}
/* the News Preference modal (js/news-pref.js): Bootstrap 5 modal markup; its layout written here, scoped to #tqNpModal,
   so it looks the same where the page has no Bootstrap stylesheet (the TownSquare pages) and where it has one (dashboard) */
#tqNpModal{position:fixed;inset:0;z-index:1062;display:none;overflow-x:hidden;overflow-y:auto;outline:0;font-family:var(--tq-body,inherit);color:var(--site_font_color_g)}
#tqNpModal.fade{transition:opacity .15s linear}#tqNpModal.fade:not(.show){opacity:0}
#tqNpModal .modal-dialog{position:relative;width:auto;max-width:600px;margin:12px auto;padding:0 12px;pointer-events:none;transition:transform .2s ease-out;transform:translateY(-20px)}
#tqNpModal.show .modal-dialog{transform:none}
#tqNpModal .modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 24px)}
#tqNpModal .modal-dialog-scrollable{height:calc(100% - 24px);max-height:640px}#tqNpModal .modal-dialog-centered.modal-dialog-scrollable{min-height:0;height:min(640px,calc(100vh - 24px));margin:max(12px,calc((100vh - 640px) / 2)) auto}#tqNpModal .modal-dialog-scrollable .modal-content{max-height:100%;overflow:hidden}
#tqNpModal .modal-content{position:relative;display:flex;flex-direction:column;width:100%;max-height:min(640px,calc(100vh - 24px));overflow:hidden;pointer-events:auto;background:#fff;border:0;border-radius:10px;box-shadow:0 24px 50px -18px rgba(8,15,84,.4);outline:0}
#tqNpModal .modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 16px 10px;border-bottom:1px solid rgba(8,15,84,.08)}
#tqNpModal .modal-title{margin:0;font-size:17px;font-weight:800;line-height:1.3;color:var(--site_font_color_g)}
#tqNpModal .tq-np-text{margin:2px 0 0;font-size:14px;line-height:1.4;color:color-mix(in srgb,var(--site_font_color_g) 70%,#fff)}
#tqNpModal .tq-np-x{flex:0 0 auto;display:grid;place-items:center;width:30px;height:30px;padding:0;border-radius:6px;border:0;background:color-mix(in srgb,var(--site_color_g) 8%,#fff);color:var(--site_font_color_g);cursor:pointer}
#tqNpModal .tq-np-x:hover{background:var(--site_color_g);color:#fff}
/* a finger, not a mouse: the close button is tap-sized on a touch screen */
@media (pointer:coarse){#tqNpModal .tq-np-x{width:40px;height:40px;border-radius:8px}}
#tqNpModal .modal-body{position:relative;flex:1 1 auto;overflow-y:auto;padding:10px 16px 2px}
#tqNpModal .tq-np-h{margin:0 0 6px;font-size:14px;font-weight:700;line-height:1.3;letter-spacing:.03em;text-transform:uppercase;color:var(--site_color_g)}
#tqNpModal .tq-np-grid{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}
#tqNpModal label.tq-np-opt{position:relative;display:inline-flex;align-items:center;gap:6px;box-sizing:border-box;height:32px;min-height:0;max-width:100%;margin:0;padding:0 10px 0 8px;border-radius:6px;border:1px solid rgba(8,15,84,.14);background:#fff;font-size:14px;font-weight:500;line-height:1.2;color:var(--site_font_color_g);cursor:pointer;transition:border-color .15s,background .15s}
#tqNpModal label.tq-np-opt:hover{border-color:color-mix(in srgb,var(--site_color_g) 55%,transparent)}
#tqNpModal .tq-np-in{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
#tqNpModal .tq-np-tick{flex:0 0 16px;display:grid;place-items:center;width:16px;height:16px;border-radius:4px;border:1.5px solid rgba(8,15,84,.28);color:transparent;background:#fff}
#tqNpModal .tq-np-tick svg{width:11px;height:11px}
#tqNpModal .tq-np-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tqNpModal label.tq-np-opt:has(.tq-np-in:checked){border-color:var(--site_color_g);background:color-mix(in srgb,var(--site_color_g) 7%,#fff);color:var(--site_color_g)}
#tqNpModal .tq-np-in:checked+.tq-np-tick{background:var(--site_color_g);border-color:var(--site_color_g);color:#fff}
#tqNpModal .tq-np-in:focus-visible+.tq-np-tick{outline:2px solid var(--site_color_g);outline-offset:2px}
#tqNpModal label.tq-np-opt:has(.tq-np-in:disabled){opacity:.5;cursor:not-allowed}
#tqNpModal .tq-np-tools{padding:10px 16px 0;border-bottom:1px solid rgba(8,15,84,.08)}
#tqNpModal .tq-np-search{display:flex;align-items:center;gap:8px;height:36px;padding:0 10px;border-radius:6px;background:color-mix(in srgb,var(--site_color_g) 5%,#fff);color:color-mix(in srgb,var(--site_font_color_g) 60%,#fff);border:1px solid transparent}
#tqNpModal .tq-np-search:focus-within{border-color:var(--site_color_g);background:#fff}
#tqNpModal .tq-np-search input{flex:1;min-width:0;height:auto;padding:0;border:0;outline:0;box-shadow:none;background:none;font:inherit;font-size:14px;color:var(--site_font_color_g)}
#tqNpModal .tq-np-picks{padding:8px 0 2px}#tqNpModal .tq-np-picks .tq-np-grid{margin:0 0 8px}
#tqNpModal .tq-np-none,#tqNpModal .tq-np-empty{margin:0 0 8px;font-size:14px;color:color-mix(in srgb,var(--site_font_color_g) 60%,#fff)}
#tqNpModal label.tq-np-opt[hidden],#tqNpModal .tq-np-sec[hidden]{display:none}
#tqNpModal .tq-np-err{margin:0 0 10px;padding:8px 12px;border-radius:6px;background:color-mix(in srgb,var(--tq-danger,#b91c1c) 10%,#fff);color:var(--tq-danger,#b91c1c);font-size:14px}
#tqNpModal .modal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;padding:10px 16px;border-top:1px solid rgba(8,15,84,.08)}
#tqNpModal .tq-np-count{margin-right:auto;font-size:14px;font-weight:600;color:color-mix(in srgb,var(--site_font_color_g) 65%,#fff)}
#tqNpModal .tq-np-btn{display:inline-flex;align-items:center;justify-content:center;height:36px;min-height:0;padding:0 14px;border-radius:6px;font-family:inherit;font-size:14px;font-weight:700;line-height:1;cursor:pointer;border:1px solid transparent}
#tqNpModal .tq-np-save{background:var(--site_color_g);color:#fff}#tqNpModal .tq-np-save:hover{filter:brightness(.92)}#tqNpModal .tq-np-save:disabled{opacity:.6;cursor:wait}
#tqNpModal .tq-np-cancel{background:#fff;border-color:rgba(8,15,84,.18);color:var(--site_font_color_g)}#tqNpModal .tq-np-cancel:hover{border-color:var(--site_color_g);color:var(--site_color_g)}
#tqNpModal .tq-np-clear{background:none;color:var(--site_color_g);text-decoration:underline;padding:0 6px}
/* its backdrop only (Bootstrap adds it to <body>): the page's other modals keep their own */
body:has(#tqNpModal.show)>.modal-backdrop{position:fixed;inset:0;z-index:1061;width:100vw;height:100vh;background:var(--site_font_color_g)}
body:has(#tqNpModal)>.modal-backdrop.fade{opacity:0;transition:opacity .15s linear}body:has(#tqNpModal.show)>.modal-backdrop.show{opacity:.55}
@media (max-width:600px){#tqNpModal .modal-dialog{padding:0 8px}#tqNpModal .modal-header,#tqNpModal .modal-body,#tqNpModal .tq-np-tools,#tqNpModal .modal-footer{padding-left:12px;padding-right:12px}#tqNpModal .tq-np-count{width:100%}#tqNpModal .tq-np-btn{flex:1 1 auto}}
