/* Mobile Hub search: keep input and submit button on one line. */
@media screen and (max-width: 540px) {
  body.cp-theme-hub .cp-parity-hero .cp-hub-hero__search {
    width: 100% !important;
    min-width: 0 !important;
  }
  body.cp-theme-hub .cp-parity-hero .cp-hub-hero__search-row {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 5px !important;
  }
  body.cp-theme-hub .cp-parity-hero .cp-hub-hero__search-row input[type="search"] {
    box-sizing: border-box !important;
    display: block !important;
    flex: 1 1 0% !important;
    width: 1% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 44px !important;
    font-size: 16px !important;
  }
  body.cp-theme-hub .cp-parity-hero .cp-hub-hero__search-row button[type="submit"] {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 74px !important;
    max-width: 110px !important;
    min-height: 44px !important;
    padding: 9px 12px !important;
    margin: 0 !important;
  }
}


/* Accessible, collapsible advanced filters. Standard search stays visible. */
#cp-hub-filters .cp-hub-advanced{margin-top:10px;border-top:1px solid #e6edf4;padding-top:8px}
#cp-hub-filters .cp-hub-advanced>summary{cursor:pointer;width:max-content;max-width:100%;padding:4px 0;color:#1767b7;font-size:13px;font-weight:600}
#cp-hub-filters .cp-hub-advanced>summary:focus-visible{outline:2px solid #1767b7;outline-offset:3px}
#cp-hub-filters .cp-hub-advanced[open]>summary{margin-bottom:12px}
#cp-hub-filters .cp-hub-advanced__grid{display:flex;flex-wrap:wrap;gap:10px}
#cp-hub-filters .cp-hub-advanced__actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px}
@media screen and (max-width:700px){
  body.cp-theme-hub main{margin:14px auto!important;padding:0 14px!important}
  body.cp-theme-hub .cp-hub-hero.cp-parity-hero .cp-parity-hero__inner{min-height:0!important;padding:20px 16px!important;display:block!important}
  body.cp-theme-hub .cp-hub-hero .cp-parity-art{display:none!important}
  body.cp-theme-hub .cp-parity-strip{display:none!important}
  body.cp-theme-hub .cp-hub-hero h1{font-size:clamp(25px,6vw,30px)!important;line-height:1.18!important}
  body.cp-theme-hub .cp-hub-hero__description{font-size:14px!important;line-height:1.45!important;margin:8px 0 0!important}
  body.cp-theme-hub .cp-category-index{margin:16px 0 12px!important}
  body.cp-theme-hub .cp-category-index h2{font-size:19px!important;margin-bottom:9px!important}
  body.cp-theme-hub .cp-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body.cp-theme-hub .cp-category-item{min-width:0;padding:10px!important;font-size:13px!important;line-height:1.28!important;align-items:flex-start;flex-direction:column;gap:5px}
  body.cp-theme-hub .cp-cat-count{font-size:11px;padding:2px 6px}
  body.cp-theme-hub .filter{padding:12px!important;margin:12px 0!important}
  body.cp-theme-hub #cp-hub-filters>.filter-row:first-of-type{display:block!important}
  body.cp-theme-hub #cp-hub-filters .cp-hub-filter-search{margin:0!important}
  body.cp-theme-hub #cp-hub-filters .cp-hub-advanced__grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  body.cp-theme-hub #cp-hub-filters .cp-hub-advanced__grid>label{margin:0;min-width:0}
  body.cp-theme-hub #cp-hub-filters .cp-hub-advanced__grid select{width:100%;min-height:42px}
  body.cp-theme-hub #cp-hub-filters .cp-hub-advanced__actions{display:flex!important;margin-top:12px}
  body.cp-theme-hub .cp-results-head{margin:15px 0 6px!important}
  body.cp-theme-hub .cp-results-head h2{font-size:21px!important;margin-bottom:5px!important}
  body.cp-theme-hub .count{font-size:12px}
  body.cp-theme-hub .cp-article-card{padding:13px 14px!important;margin:9px 0!important}
  body.cp-theme-hub .cp-article-card .cp-article-preview{float:right!important;width:104px!important;height:82px!important;margin:2px 0 6px 11px!important}
  body.cp-theme-hub .cp-article-card h2{font-size:18px!important;line-height:1.32!important;margin:8px 0!important}
  body.cp-theme-hub .cp-article-card>p:not(.meta){font-size:14px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin:8px 0 0}
  body.cp-theme-hub .cp-article-card>p.meta:last-of-type{display:none}
  body.cp-theme-hub .cp-article-card .meta{margin:5px 0}
  body.cp-theme-hub .pages{gap:12px;flex-wrap:wrap;margin:18px 0}
  body.cp-theme-hub .pages>a{padding:9px 0;min-height:44px;display:inline-flex;align-items:center}
  body.cp-theme-hub .cp-topic-article,.box.comment,body.cp-theme-hub #reply-form{padding:15px!important}
  body.cp-theme-hub .cp-topic-article>h1{font-size:clamp(23px,6.1vw,29px);line-height:1.25;margin:10px 0 15px}
  body.cp-theme-hub .cp-topic-article .article-content{line-height:1.62}
  body.cp-theme-hub .cp-topic-article .article-content h2{font-size:1.2em;margin:1.3em 0 .5em;padding-bottom:6px}
  body.cp-theme-hub .cp-topic-article .article-content p{margin:.7em 0}
  body.cp-theme-hub .cp-topic-article .article-content img{margin:12px auto}
  body.cp-theme-hub .cp-topic-article .article-content table{display:block;overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
  body.cp-theme-hub .cp-topic-article button,.box.comment button,body.cp-theme-hub #reply-form button{min-height:44px}
}
@media screen and (max-width:390px){
  body.cp-theme-hub #cp-hub-filters .cp-hub-advanced__grid{grid-template-columns:1fr}
  body.cp-theme-hub .cp-category-item{padding:9px!important}
}

/* Keep search visible before the tall category list on phones, preventing browser jump on focus. */
@media screen and (max-width:700px){
  body.cp-theme-hub main{display:flex!important;flex-direction:column!important}
  body.cp-theme-hub main>*{order:5}
  body.cp-theme-hub main>.cp-hub-hero{order:0}
  body.cp-theme-hub main>.cp-parity-strip{order:1}
  body.cp-theme-hub main>.cp-hub-spaces{order:2}
  body.cp-theme-hub main>.filter{order:3}
  body.cp-theme-hub main>.cp-category-index{order:4}
}

/* GPTHub keeps local facets; site-wide search lives in shared Webasyst header. */
body.cp-theme-hub #cp-hub-filters .cp-hub-advanced__grid>label{display:flex!important;flex-direction:column!important}
body.cp-theme-hub #cp-hub-filters>.cp-hub-advanced{margin-top:0;border-top:0;padding-top:0}
@media screen and (max-width:900px){
 body.cp-theme-hub .cp-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:none!important;grid-auto-rows:auto!important;gap:8px!important}
 body.cp-theme-hub .cp-category-item{min-height:0!important;height:auto!important;aspect-ratio:auto!important;padding:11px 12px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:flex-start!important;gap:4px!important;line-height:1.3!important}
}
@media screen and (min-width:701px) and (max-width:900px){
 body.cp-theme-hub main{display:flex!important;flex-direction:column!important}
 body.cp-theme-hub main>*{order:5}
 body.cp-theme-hub main>.cp-hub-hero{order:0}
 body.cp-theme-hub main>.cp-parity-strip{order:1}
 body.cp-theme-hub main>.cp-hub-spaces{order:2}
 body.cp-theme-hub main>.filter{order:3}
 body.cp-theme-hub main>.cp-category-index{order:4}
 body.cp-theme-hub .cp-hub-hero.cp-parity-hero .cp-parity-hero__inner{min-height:0!important;padding:18px 16px!important;display:block!important}
 body.cp-theme-hub .cp-hub-hero .cp-parity-art{display:none!important}
 body.cp-theme-hub .cp-parity-strip{display:none!important}
 body.cp-theme-hub .filter{margin:12px 0!important;padding:14px!important}
}
