/* ═══ ZAHAL · אריחי הקטגוריות (template-parts/zahal/cat-tiles.php) ═══
   רכיב אחד בשני מקומות: /02 "מה אתם מחפשים?" בבית (‎.zh-home #cats‎, נטען אחרי home.css) ו-/01 "קפצו לקטגוריה" ב-404
   (‎.zh-nf .nf-cats‎, נטען לפני search-404.css) — ירין 22.11: "404: 8 אריחים כמו בבית". הכללים הועברו מ-home.css ומ-home-wp.css
   בלי שינוי בערכים; המסגרת של כל סקשן (כותרת, ריווח, רקע) נשארה בקובץ של העמוד.
   כל סלקטור מתחיל ב-‎:is(.zh-home #cats,.zh-nf .nf-cats)‎: הספציפיות של ‎:is()‎ = של ‎.zh-home #cats‎, כמו שהייתה לכללים בבית,
   כך שהבית נשאר בדיוק כמו קודם. רק טוקנים.
   cat-tiles.php מדפיס על כל אריח: cat + גודל (cat-l = 2×2 הראשי, cat-t = גבוה 1×2, בלי = 1×1) + המפתח cat--{key}. הסדר = סדר
   הקריאה = 01–08: כלי ירייה (l) · מחסניות (t) · אביזרים · ערכות · אופטיקה לאקדח · אופטיקה לנשק ארוך · נרתיקים · ציוד.
   ≥850: ארבע עמודות; גובה השורה נגזר מרוחב הרשת עצמה (100cqi של העוטף — container), כך שכל 1×1 = 1.7917:1, היחס של סדרת
   הצילומים. בבית העוטף = ‎.wrap.wide‎ (רוחב התוכן 1192), ב-404 = ‎.wrap‎ של העמוד (אותה עמודה כמו הפתיחה, 1144). */

/* העוטף של הרשת = מכל (‎cqi‎ בגובה השורה) */
.zh-home #cats .wrap.wide,.zh-nf .nf-cats > .wrap{container-type:inline-size}

/* ── האריח ── */
:is(.zh-home #cats,.zh-nf .nf-cats) .cat{position:relative;overflow:hidden;background:var(--c-tile);border:var(--bw-tile) solid var(--c-ink);display:block;grid-column:auto;grid-row:auto}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:var(--op,.72);transform:var(--tf,none);transition:transform var(--dur-reveal) var(--ease-out),opacity var(--dur-reveal) var(--ease-out)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat::after{content:"";position:absolute;inset:0;background:linear-gradient(to top,rgb(var(--c-tile-deep-rgb) / var(--alpha-solid)) 6%,rgb(var(--c-tile-deep-rgb) / 0) 55%)}
/* המספר: מצע כהה שקוף מתחת לצהוב, כשהצילום בהיר מאחוריו (אריח 01, המחסניות: 3.5:1 → 4.5:1 ומעלה) */
:is(.zh-home #cats,.zh-nf .nf-cats) .cat .no{position:absolute;z-index:2;top:var(--sp-3);inset-inline:var(--sp-5) auto;font-size:var(--fs-body);letter-spacing:1.24px;color:var(--c-brand);background:rgb(var(--c-tile-deep-rgb) / .6);padding-inline:var(--sp-2)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat .body{position:absolute;z-index:2;inset-inline:var(--sp-7);bottom:var(--sp-5);display:inline-grid;justify-items:start}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat .he{display:block;font:var(--font-row);font-variation-settings:var(--fvs-display);color:var(--c-on-dark)}
/* ניגודיות (AA): סגול קטן על צילום = ‎--c-accent-lt‎ (9:1 על tile) */
:is(.zh-home #cats,.zh-nf .nf-cats) .cat .en{display:block;justify-self:start;font-size:var(--fs-micro);letter-spacing:1.12px;color:var(--c-accent-lt);margin-block-start:var(--sp-3)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat .ar{position:absolute;z-index:2;bottom:14px;inset-inline:auto 21px;font-size:var(--fs-base);font-weight:700;color:var(--c-accent-lt);opacity:0;transform:translateX(8px);transition:opacity var(--dur-hover) var(--ease-out),transform var(--dur-hover) var(--ease-out)}
@media(hover:hover) and (pointer:fine){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat:hover img{transform:var(--tf,) scale(1.04);opacity:var(--op-h,.85)}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat:hover .ar{opacity:1;transform:none}
}
@media(max-width:549px){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat .en{letter-spacing:.4px}
}

/* ── הרשת ── */
:is(.zh-home #cats,.zh-nf .nf-cats) .cats{
  --g:var(--sp-4);
  --row:max(128px, calc((100cqi - 3 * var(--g)) / 4 / 1.7917));
  display:grid;gap:var(--g);
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-template-rows:repeat(3,var(--row));
  grid-auto-rows:var(--row);
  grid-template-areas:"fa fa mag acc" "fa fa mag kit" "po ro carry gear";   /* RTL: העמודה הראשונה = ימין */
}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--firearms{grid-area:fa}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--mags{grid-area:mag}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--acc{grid-area:acc}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--kits{grid-area:kit}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--opt-pistol{grid-area:po}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--opt-long{grid-area:ro}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--carry{grid-area:carry}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--gear{grid-area:gear}
/* הגנה: לא 8 אריחים (cat-tiles.php מוסיף ‎.is-flow‎) — זרימה רגילה, בלי חורים */
:is(.zh-home #cats,.zh-nf .nf-cats) .cats.is-flow{grid-template-areas:none;grid-template-rows:none}
:is(.zh-home #cats,.zh-nf .nf-cats) .cats.is-flow > .cat{grid-area:auto}
:is(.zh-home #cats,.zh-nf .nf-cats) .cats.is-flow > .cat-l{grid-column:span 2;grid-row:span 2}
:is(.zh-home #cats,.zh-nf .nf-cats) .cats.is-flow > .cat-t{grid-row:span 2}

/* הצילומים: cover בכל רוחב, אף פעם לא במראה; כלל אחד לכל מפתח */
:is(.zh-home #cats,.zh-nf .nf-cats) .cat img{--op:1;--op-h:1;--tf:translate(0);transform-origin:50% 50%;object-fit:cover;object-position:50% 50%}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--firearms img{object-position:100% 50%;--tf:scale(1.12);transform-origin:75% 100%}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--mags img{object-position:86% 50%;--op:.85}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--acc img,:is(.zh-home #cats,.zh-nf .nf-cats) .cat--kits img{--op:.72;--op-h:.85}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--opt-pistol img{--tf:translateY(-7%)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--opt-long img{--tf:translateY(-11%)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--carry img{--tf:translateY(-10%)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat--gear img{object-position:0 50%;--tf:translateY(-6%)}

/* ההצללה והכותרת לפי גודל האריח */
:is(.zh-home #cats,.zh-nf .nf-cats) .cat-l::after{background:linear-gradient(to top,rgb(var(--c-tile-deep-rgb) / var(--alpha-solid)) 0%,rgb(var(--c-tile-deep-rgb) / 0) 42%)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat .he{font-size:var(--fs-h5)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat-t .he{font-size:var(--fs-h4)}
:is(.zh-home #cats,.zh-nf .nf-cats) .cat-l .he{font-size:var(--fs-title)}

/* 850–999: רצפת השורה (128) עושה את ה-1×1 צר מהצילום (≈1.5:1) — צילום הרובה עולה פחות, והמכפל לא נכנס מתחת ל-06 */
@media(min-width:850px) and (max-width:999px){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--opt-long img{--tf:translateY(-5%)}
}
/* 550–849 (וגם בטלפון): שתי עמודות, אותו סדר, אותן שתי רצועות */
@media(max-width:849px){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cats{
    --row:clamp(118px, 92px + 10cqi, 170px);
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:repeat(6,var(--row));
    grid-template-areas:"fa fa" "fa fa" "mag acc" "mag kit" "po ro" "carry gear";
  }
  :is(.zh-home #cats,.zh-nf .nf-cats) .cats.is-flow > .cat-l{grid-column:1/-1}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--mags img{object-position:93% 50%}
}
/* ‎<550‎ טלפון: 1×1 ≈ 1.37:1, כל צילום ממורכז על קבוצת המוצרים שלו */
@media(max-width:549px){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--mags img{object-position:79% 50%}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--acc img{object-position:30% 50%}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--kits img{object-position:40% 50%}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--opt-pistol img{object-position:46% 50%}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--opt-long img{object-position:56% 50%;--tf:translateY(-4%)}   /* פחות הרמה: המכפל לא נכנס מתחת ל-06 */
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat--carry img{object-position:52% 50%}
}
/* דפדפן בלי יחידות מכל (cqi, ספארי ‎<16‎): גובה שורה קבוע, כמו לפני 22.11 — אחרת השורות קורסות לגובה התוכן */
@supports not (width:1cqi){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cats{--row:140px}
  @media(max-width:849px){
    :is(.zh-home #cats,.zh-nf .nf-cats) .cats{--row:130px}
  }
}
/* ‎<390‎: שורה קבועה 112; בלי השם הלועזי ב-1×1 (לפי גודל, לא לפי מפתח); ריפוד 10 — "אופטיקה לנשק ארוך" בשורה אחת */
@media(max-width:389px){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cats{--row:112px}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat:not(.cat-l,.cat-t) .en{display:none}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat .body{inset-inline:var(--sp-5)}
}
/* ‎<350‎ (מסך חיצוני של מתקפל, 320): כותרת 1×1 קטנה ב-10% וריפוד 8 — "אופטיקה לנשק ארוך" נשארת בשורה אחת, כל ה-1×1 באותו גודל */
@media(max-width:349px){
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat:not(.cat-l,.cat-t) .he{font-size:calc(var(--fs-h5) * .9)}
  :is(.zh-home #cats,.zh-nf .nf-cats) .cat .body{inset-inline:var(--sp-4)}
}

/* עזר (תפריט הנגישות, 23.11) · הגדלת טקסט (data-ezer-size): השורה בגובה קבוע והכיתוב absolute, אז ב-130%/150% השם עלה על
   המספר (בטלפון 03–08, וב-404 בדסקטופ "אופטיקה לנשק ארוך" בשתי שורות) ו-"נרתיקים ונשיאה" נחתך בראש האריח. כאן, רק בזמן הגדלה:
   השורה לפחות ‎--row‎ וגדלה עם הכיתוב, והכיתוב בזרימה, מתחת למספר (2.4em = גובה המספר והמרווח שלו). כשהכיתוב נכנס — אותו מראה
   בדיוק (תחתית האריח, אותם שוליים). בלי עזר — כלום לא משתנה */
html[data-ezer-size] :is(.zh-home #cats,.zh-nf .nf-cats) .cats:not(.is-flow){grid-template-rows:repeat(3,minmax(var(--row),auto))}
html[data-ezer-size] :is(.zh-home #cats,.zh-nf .nf-cats) .cats{grid-auto-rows:minmax(var(--row),auto)}
html[data-ezer-size] :is(.zh-home #cats,.zh-nf .nf-cats) .cat{display:flex;flex-direction:column;justify-content:flex-end}
html[data-ezer-size] :is(.zh-home #cats,.zh-nf .nf-cats) .cat .body{position:relative;inset:auto;margin-inline:var(--sp-7);padding-block:calc(var(--sp-3) + 2.4em) var(--sp-5)}
@media(max-width:849px){
  html[data-ezer-size] :is(.zh-home #cats,.zh-nf .nf-cats) .cats:not(.is-flow){grid-template-rows:repeat(6,minmax(var(--row),auto))}
}
@media(max-width:389px){
  html[data-ezer-size] :is(.zh-home #cats,.zh-nf .nf-cats) .cat .body{margin-inline:var(--sp-5)}
}
@media(max-width:349px){
  html[data-ezer-size] :is(.zh-home #cats,.zh-nf .nf-cats) .cat .body{margin-inline:var(--sp-4)}
}
