/* ==========================================================
   האפליקציות לטיול הגדול  ·  pages/apps.html
   ----------------------------------------------------------
   שתי שכבות: חובה (אדום) ונחמד שיהיה (סגול), ובתוכן קטגוריות
   לפי העבודה שהאפליקציה עושה.

   הפריסה היא עמודה אחת ולא רשת של כרטיסים. כל אפליקציה היא
   שורה מלאה ברוחב הדף: תיבת סימון, אייקון, שם ותיאור, ותג
   האזור בקצה. רשת של כרטיסים צרים הייתה נראית עמוסה ברגע
   שנכנס תיאור לכל שורה.

   האזור הוא לא שכבה אלא תכונה של פריט. שני מתגים עצמאיים
   מדליקים את פריטי המזרח ואת פריטי דרום אמריקה, ואפשר להדליק
   את שניהם, כי יש מי שעושה את שתי היבשות באותו טיול.

   הצבע אף פעם לא לבד. לכל שכבה יש כותרת מפורשת ולכל פריט
   אזורי יש תג כתוב, כדי שמי שלא מבחין בצבעים יקבל בדיוק את
   אותו מידע.
   ========================================================== */

.apps {
  --must:  #c62828;
  --east:  #17998f;
  --south: #065484;
  --extra: #7b3fa0;

  background: var(--cream);
  padding-top: calc(var(--header-h) + 2.6rem);
  padding-bottom: 4rem;
}

.apps-wrap {
  max-width: 940px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.apps h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  text-wrap: balance;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .apps h1 .accent {
    background: linear-gradient(120deg, var(--ember-dark), var(--clay));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.apps-lead {
  color: var(--text);
  font-size: 1.05rem;
  max-width: 62ch;
  text-wrap: pretty;
  margin-bottom: 1.35rem;
}
.apps-lead:last-of-type { margin-bottom: 1.8rem; }
.apps-lead strong { color: var(--clay); }
.apps-lead strong.ink { color: var(--ink); }

/* --- שני המתגים --- */
.apps-tools {
  margin-bottom: 1.4rem;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.apps-tools-q {
  margin: 0 0 .8rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.apps-switches {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem .9rem;
}

/* כל מתג הוא כרטיס לחיץ בפני עצמו ולא שורת טקסט, כי בטלפון
   שתי שורות זו מתחת לזו נראות כמו רשימה ולא כמו בחירה. */
.apps-switch {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1 1 240px;
  cursor: pointer;
  padding: .7rem .9rem;
  font-weight: 600;
  line-height: 1.3;
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .15s ease, background .15s ease;
}
.apps-switch:hover { background: var(--sand); }

.apps-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid var(--text-soft);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
.apps-switch input:checked::after {
  content: "";
  position: absolute;
  inset-block-start: .11em;
  inset-inline-start: .31em;
  width: .3em;
  height: .56em;
  border: solid #fff;
  border-width: 0 .17em .17em 0;
  transform: rotate(40deg);
}
.apps-switch input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.apps-switch--east.is-on  { border-color: var(--east);  background: #f1fbfa; }
.apps-switch--south.is-on { border-color: var(--south); background: #f1f7fb; }
.apps-switch--east  input:checked { background: var(--east);  border-color: var(--east); }
.apps-switch--south input:checked { background: var(--south); border-color: var(--south); }

/* --- שכבה --- */
.apps-tier { margin-bottom: 3rem; }

.apps-tier h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 0 0 .25rem;
  padding-inline-start: .7rem;
  border-inline-start: 5px solid var(--line);
}

.apps-tier-sub {
  color: var(--text-soft);
  margin: 0 0 1.4rem;
  padding-inline-start: .7rem;
}

.apps-tier--must  h2 { border-inline-start-color: var(--must); }
.apps-tier--extra h2 { border-inline-start-color: var(--extra); }

/* --- קטגוריות: עמודה אחת, כל אחת ברוחב מלא --- */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.apps-cat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1rem 1.2rem 1.1rem;
}

.apps-cat h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 .6rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
}

/* רקע בגוון של השכבה, חלש מאוד בכוונה. הוא לא אמור להיקרא
   כצבע אלא רק לתת לעין לדעת באיזה חלק של הדף היא נמצאת. */
.apps-tier--must  .apps-cat { border-top: 3px solid var(--must); background: #fff8f7; }
.apps-tier--extra .apps-cat { background: #faf7fd; }

/* הערה מתחת לכותרת של קטגוריה, למקום שבו צריך משפט הסבר אחד
   ולא תיאור של אפליקציה מסוימת. */
.apps-cat-note {
  margin: 0 0 .5rem;
  color: var(--text-soft);
  font-size: .875rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/* --- שורת אפליקציה --- */
.apps-list { list-style: none; margin: 0; padding: 0; }

/* קו מפריד ולא רווח: ברוחב מלא זה מה שגורם לזה להיקרא כרשימה
   מסודרת ולא כגוש טקסט. */
.apps-list li + li { border-top: 1px solid var(--line); }

.apps-list label {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  grid-template-areas: "box ico txt tag";
  align-items: center;
  gap: .2rem .85rem;
  cursor: pointer;
  padding: .7rem .4rem;
  border-radius: var(--r-sm);
  transition: background .15s ease;
}
.apps-list label:hover { background: var(--sand); }

.apps-list input[type="checkbox"] {
  grid-area: box;
  appearance: none;
  -webkit-appearance: none;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid var(--text-soft);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}

/* הוי נצבע בצבע השכבה שהוא יושב בה, ושני הגוונים כהים מספיק
   כדי שהוי הלבן שעליהם יעבור את ה-3:1 שהתקן דורש. */
.apps-tier--must  .apps-list input:checked { background: var(--must);  border-color: var(--must); }
.apps-tier--extra .apps-list input:checked { background: var(--extra); border-color: var(--extra); }

/* הסימון עצמו: וי מצויר, כדי שלא נסתמך על גליף של פונט */
.apps-list input:checked::after {
  content: "";
  position: absolute;
  inset-block-start: .13em;
  inset-inline-start: .31em;
  width: .3em;
  height: .56em;
  border: solid #fff;
  border-width: 0 .17em .17em 0;
  transform: rotate(40deg);
}

.apps-list input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* --- האייקון --- */
/* רוב הרשומות מקבלות את האייקון הרשמי של החברה. לשתיים שאין
   מאחוריהן חברה, הביטוח וה-eSIM, מצוייר כאן אייקון קו במקום:
   מגן לביטוח וטלפון ל-eSIM. הם משתמשים ב-currentColor ולכן
   מקבלים את צבע השכבה שהם יושבים בה. */
.app-ico {
  grid-area: ico;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .2s ease, opacity .2s ease;
}
.app-ico::after { content: attr(data-letter); }
.app-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.app-ico:has(img)::after,
.app-ico:has(svg)::after { content: none; }

/* האייקונים המצויירים */
.app-ico svg {
  width: 68%;
  height: 68%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.apps-tier--must  .app-ico { background: #fde8e8; }
.apps-tier--extra .app-ico { background: #ede2f6; }
.apps-tier--must  .app-ico--draw { color: #9e2f10; }
.apps-tier--extra .app-ico--draw { color: #4a2a9c; }

/* --- הטקסט --- */
.app-txt {
  grid-area: txt;
  min-width: 0;
}

.app-txt b {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
}

.app-txt small {
  display: block;
  margin-top: .1rem;
  color: var(--text-soft);
  font-size: .875rem;
  line-height: 1.45;
  text-wrap: pretty;
}
.app-txt small strong { color: var(--text); }

/* ההדגשה האדומה: שמורה לשתי ההוראות שאיתי ביקש להבליט, הורדת
   מפה אופליין והורדת חבילת שפה. אם היא תופיע בכל מקום היא
   תפסיק לעבוד, ולכן היא נשארת נדירה בכוונה.
   האדום הזה נמדד בדפדפן ומגיע ל-5.36 מול רקע כרטיס החובה. */
.app-txt small strong.hot {
  color: var(--must);
  font-weight: 700;
}

/* --- תג האזור --- */
/* התג אומר במילה למה הפריט הזה הופיע. בלעדיו, מי שמדליק את
   שני המתגים רואה רשימה אחת ארוכה בלי לדעת מה שייך לאן. */
.app-tag {
  grid-area: tag;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.7;
  padding: 0 .55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.app-tag--east  { background: #d4efec; color: #0a5d57; }
.app-tag--south { background: #d9e8f2; color: #054568; }

/* מסומן: השם נמחק והתיאור נשאר קריא. מוחקים רק את השם כי
   התיאור הוא מידע ולא משימה, ומחיקה שלו רק מקשה על הקריאה. */
.apps-list input:checked ~ .app-txt b {
  text-decoration: line-through;
  color: var(--text-soft);
}
.apps-list input:checked ~ .app-ico { opacity: .5; }

/* --- כוכבית וגילוי נאות --- */
.apps-note {
  margin: 0 0 1.1rem;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--amber);
  border-radius: var(--r-sm);
  color: var(--text-soft);
  font-size: .95rem;
  line-height: 1.6;
  text-wrap: pretty;
}
.apps-note strong { color: var(--ink); }
.apps-note a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.apps-note a:hover { color: var(--clay); }

/* --- הכוכבית והערת הקטגוריה --- */
/* הכוכבית בשורה מפנה להערה שיושבת מתחת לאותה קטגוריה ולא
   לתחתית הדף, כדי שהעין לא תצטרך לרדת ולחזור. ההערה שקטה
   מהפריטים בכוונה: אלה לא אפליקציות שאיתי ממליץ עליהן, רק
   מה שאפשר לבדוק אם מה שברשימה לא זמין במדינה שאתם בה.
   היא נושאת data-south בעצמה ולכן יורדת עם האזור שלה. */
.app-ast {
  color: var(--clay);
  font-weight: 700;
  font-size: .9em;
  padding-inline-start: .12em;
}

.apps-cat-foot {
  position: relative;
  margin: .75rem 0 0;
  padding: .6rem .85rem;
  padding-inline-start: 1.8rem;
  background: var(--sand);
  border-radius: var(--r-sm);
  color: var(--text-soft);
  font-size: .86rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.apps-cat-star {
  position: absolute;
  inset-inline-start: .72rem;
  top: .52rem;
  color: #9e2f10;
  font-weight: 700;
}

/* --- הכפתורים וההזמנה לשיחה --- */
.apps-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  margin: 1.6rem 0 2.4rem;
}

/* שני הכפתורים האלה לובשים את אותה חליפה של `.btn` בשאר האתר:
   גופן הכותרות, אותו ריפוד ואותה קפיצה קטנה ב-hover. הם לא
   מקבלים את הכתום של הכפתור הראשי, כי הכפתור הראשי של הדף הוא
   זה שמזמין לשיחה, ושניים ראשיים באותו דף מבטלים זה את זה.
   ב-hover הם מתהפכים לכהה מלא, וכך הם בולטים בלי צבע נוסף. */
.apps-btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font: inherit;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  padding: .78em 1.5em;
  border-radius: 999px;
  border: 2px solid var(--ink-2);
  background: var(--cream);
  color: var(--ink-2);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(7, 22, 26, .12);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.apps-btn:hover {
  transform: translateY(-2px);
  background: var(--ink-2);
  color: var(--cream);
  box-shadow: 0 10px 24px rgba(7, 22, 26, .22);
}
.apps-btn:active { transform: translateY(0); }
.apps-btn:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }

.apps-cta {
  margin: 1rem 0 2.2rem;
  padding: 1.6rem 1.4rem;
  text-align: center;
  background: var(--ink-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.apps-cta p {
  margin: 0 0 1.1rem;
  color: var(--text-invert);
  font-size: 1.08rem;
  text-wrap: balance;
}

/* ==========================================================
   השכבה הכיפית
   ----------------------------------------------------------
   כל התנועה כאן מתבטלת לבד: `html.a11y-noMotion` ב-a11y.css
   מכבה כל אנימציה ומעבר באתר, והקונפטי נבדק גם בקוד.
   ========================================================== */

/* --- לוח המצב, נדבק לראש המסך --- */
.apps-status {
  position: sticky;
  top: calc(var(--header-h) - 1px);
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  margin-bottom: 2.4rem;
  padding: .75rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: border-color .3s ease, background .3s ease;
}

.apps-status-head {
  flex: 1 1 12rem;
  margin: 0;
  font-weight: 600;
  color: var(--ink-2);
}

.apps-status-num {
  font-weight: 700;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.apps-bar {
  flex: 0 0 clamp(80px, 20vw, 200px);
  height: 10px;
  border-radius: 999px;
  background: var(--sand-2);
  overflow: hidden;
}
.apps-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ember), var(--clay));
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}

/* כשהכל סומן הלוח עובר לזהב. הזהב לעולם לא לבד: גם המשפט
   משתנה, ולכן מי שלא מבחין בצבעים מקבל את אותה בשורה. */
.apps-status.is-done { border-color: var(--amber); background: #fffdf3; }
.apps-status.is-done .apps-bar > span { background: linear-gradient(90deg, var(--amber), #e39a12); }

/* --- מונה בכותרת של כל קטגוריה --- */
.cat-count {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.apps-cat.is-full .cat-count { color: var(--clay); }

/* --- האייקון מגיב --- */
.apps-list label:hover .app-ico { transform: scale(1.09) rotate(-4deg); }

@keyframes appPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.24) rotate(-7deg); }
  100% { transform: scale(1); }
}
.app-ico.is-pop { animation: appPop .42s cubic-bezier(.3, 1.4, .4, 1); }

/* --- פריט אזורי שנכנס אחרי הדלקת מתג --- */
@keyframes appIn {
  from { opacity: 0; transform: translateY(-7px); }
  to   { opacity: 1; transform: none; }
}
.apps-list li.is-in { animation: appIn .34s ease both; }

/* --- קונפטי --- */
/* נוצר בקוד רק כשהכל סומן, ומוסר מעצמו אחרי שלוש שניות.
   pointer-events: none כדי שלא יחסום אף לחיצה בדרך. */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -16px;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  animation: confFall linear forwards;
}
@keyframes confFall {
  to { transform: translateY(104vh) rotate(760deg); opacity: .1; }
}

/* --- בלי JS --- */
/* המתגים מסתירים תוכן, ולכן בלי JS הם יורדים וכל הפריטים
   האזוריים מוצגים. עדיף לראות הכל מאשר חצי בלי לדעת. */
html:not(.js) .apps-tools,
html:not(.js) .apps-status,
html:not(.js) .apps-actions { display: none; }
html:not(.js) li[data-east][hidden],
html:not(.js) li[data-south][hidden] { display: revert; }

/* --- טלפון --- */
/* התג יורד לשורה משלו מתחת לטקסט, כי ברוחב של טלפון הוא היה
   דוחס את השם והתיאור לעמודה צרה מדי. */
@media (max-width: 620px) {
  .apps-list label {
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "box ico txt"
      ".   .   tag";
    align-items: start;
    gap: .35rem .7rem;
  }
  .apps-list input[type="checkbox"] { margin-top: .5em; }
  .app-ico { width: 2.1rem; height: 2.1rem; margin-top: .15rem; }
  .app-tag { justify-self: start; }
  /* .8em מביא את הכפתור ל-44 פיקסל, מידת מגע נוחה לאגודל */
  .apps-btn { padding: .8em 1.25em; font-size: .95rem; }
  .apps-tools { padding: .8rem .85rem; }
  .apps-switch { font-size: .92rem; padding: .6rem .75rem; }
  .apps-cat { padding: .9rem .9rem 1rem; }
}

@media (max-width: 560px) {
  .apps-status { padding: .6rem .8rem; font-size: .92rem; }
  .apps-bar { flex: 1 1 100%; order: 3; }
}

/* ------------------------------------------------------------
   בטלפון לוח המצב יורד לתחתית המסך, בדיוק כמו ברשימת הציוד.
   למעלה הוא גנב רצועה מהמסך לאורך כל הגלילה, ולמטה הוא יושב
   בדיוק איפה שהאגודל ממילא נמצא.
   הבלוק הזה חייב להישאר אחרון בקובץ, כי הוא דורס את הריפוד
   שנקבע בשאילתת ה-560 שמעליו.
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  /* מקום לסרגל, אחרת הוא יושב על סוף הדף ועל הפוטר */
  .apps { padding-bottom: 5.5rem; }
  .site-footer { padding-bottom: 6.5rem; }

  /* כפתור הנגישות, כפתור הוואטסאפ ובאנר הקוקיז מקובעים גם הם
     לתחתית, ולכן בדף הזה הם מורמים מעל הסרגל לפי גובהו בפועל.
     הגובה נמדד ב-apps.js ונשמר ב-`--apps-bar-h`. */
  .a11y-root,
  .wa-float { inset-block-end: calc(var(--apps-bar-h, 76px) + .9rem); }
  .cookie-banner { inset-block-end: var(--apps-bar-h, 76px); }

  .apps-status {
    position: fixed;
    top: auto;
    bottom: 0;
    inset-inline: 0;
    z-index: 40;
    margin: 0;
    padding: .5rem .8rem calc(.5rem + env(safe-area-inset-bottom, 0px));
    border-inline: 0;
    border-bottom: 0;
    border-radius: var(--r) var(--r) 0 0;
    box-shadow: 0 -6px 20px rgba(7, 22, 26, .16);
  }

  .apps-status-head { font-size: .85rem; }
}
