/* ---------------------------------------------------------------------------
 * tags.css — /tags/ only. Loaded after site.css via $pageCss.
 * ------------------------------------------------------------------------ */

.tagx-bar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:14px 0 22px}

#tagx-filter{flex:0 0 260px;background:var(--panel);border:1px solid var(--border);
  color:var(--text);padding:9px 16px;border-radius:20px;outline:none;font-size:13px}
#tagx-filter:focus{border-color:var(--pink)}

.tagx-alpha{display:flex;flex-wrap:wrap;gap:4px}
.tagx-alpha button{min-width:30px;height:30px;padding:0 8px;font-size:12px;font-weight:700;
  background:var(--panel);color:var(--muted);border:1px solid var(--border);
  border-radius:6px;cursor:pointer;transition:background .12s,color .12s,border-color .12s}
.tagx-alpha button:hover{color:var(--text);border-color:var(--pink)}
.tagx-alpha button.on{background:var(--pink);border-color:var(--pink);color:#fff}

.tagx-block{margin-bottom:26px}
/* Full-width band rather than a bare heading - at six columns a small letter
   floating above the list reads as decoration; a band separates the sections. */
.tagx-block h2{font-size:13px;font-weight:800;letter-spacing:.5px;color:var(--muted);
  margin:0 0 10px;padding:6px 12px;background:var(--panel);border-radius:5px}

/* ROW-MAJOR grid, back from column-count.
   Column flow only made sense while the list was alphabetical. Sorted by count
   the biggest tag has to land top-left and read ACROSS, which is what a grid
   does and what chococams shows. */
.tagx-grid{list-style:none;margin:0;padding:0 10px 0 0;display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));gap:2px 26px}

@media(max-width:1500px){ .tagx-grid{grid-template-columns:repeat(5,minmax(0,1fr))} }
@media(max-width:1240px){ .tagx-grid{grid-template-columns:repeat(4,minmax(0,1fr))} }
@media(max-width:1000px){ .tagx-grid{grid-template-columns:repeat(3,minmax(0,1fr))} }
@media(max-width:760px){  .tagx-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:480px){  .tagx-grid{grid-template-columns:1fr} }

/* Popular chips carry their own count, so it needs separating from the label. */
.tagx-pop .chip .n{margin-left:5px;font-size:11px}

.tagx-grid a{display:flex;align-items:baseline;gap:8px;padding:5px 8px;
  border-radius:6px;color:var(--text);font-size:13px;font-weight:600}
.tagx-grid a:hover{background:var(--card)}
.tagx-grid a:hover .tagx-name{color:var(--pink2)}
/* Title case, not uppercase: at this density UPPERCASE loses the word shapes
   that make a long list scannable. */
.tagx-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tagx-n{padding-left:7px;font-style:normal;font-size:11.5px;
  font-weight:400;color:var(--muted);flex:0 0 auto}
.tagx-n::before{content:'['}
.tagx-n::after{content:']'}

.tagx-grid li.hide{display:none}
#tagx-none{color:var(--muted);font-size:13px;text-align:center;padding:20px 0}

@media(max-width:900px){
  #tagx-filter{flex:1 1 100%}
}

/* Foldables / large portrait tablets (iPad ~834px, Galaxy Fold ~884px). Match
   the tablet type-scale bump in site.css so this page isn't left at phone sizes.
   The alphabetical grid is already 3 columns at this width (see the max-width
   ladder above), so only the TEXT and control sizes change: the popular tag
   pills, the A-Z filter buttons, section-letter bands, the alphabetical tag names
   + counts, and the search box. Phones (<700px) and desktop (>900px) untouched.
   Placed last so it wins for its range. */
@media(min-width:700px) and (max-width:900px){
  #tagx-filter{font-size:14.5px}
  .tagx-alpha button{min-width:34px;height:34px;font-size:13.5px}
  .tagx-block h2{font-size:14px}
  .tagx-pop .chip{font-size:13.5px;padding:6px 13px}
  .tagx-pop .chip .n{font-size:12.5px}
  .tagx-grid a{font-size:14.5px}
  .tagx-n{font-size:12.5px}
  #tagx-none{font-size:14px}
}