/* phone-rails.css — نسخة الموبايل «تطبيق». كل القواعد جوّه @media (max-width:767px) وتحت html.phone-app
   بتاعتي: #learn (المنهج = كروت أجزاء بتتسحب + صفوف دروس) · #cases (5 حملات = شريط بيتسحب) · #why (4 كروت = شريط + أرقام 2×2).
   html.phone-rails = phone-rails.js اشتغل (النقط والعنوان المضغوط معمولين بالجافاسكريبت). */

/* العناصر اللي الجافاسكريبت بيضيفها مالهاش وجود على الديسكتوب */
.prl-only { display: none; }

@media (max-width: 767px) {

  /* ---------- مسافات السكاشن التلاتة ---------- */
  html.phone-app :is(#learn, #cases, #why).section {
    min-height: 0;
    padding-block: 44px 24px;
  }

  /* ---------- وصفة الشريط اللي بيتسحب (مشتركة) ---------- */
  html.phone-app #learn .crs__tabs,
  html.phone-app #cases .eps__grid,
  html.phone-app #why .diff {
    display: flex;
    gap: 12px;
    width: auto;
    max-width: none;
    margin-inline: calc(-1 * var(--pad-x));
    padding-inline: var(--pad-x);
    scroll-padding-inline: var(--pad-x);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y; /* pan-x لوحده بيبلع السحب لفوق والصفحة بتقف تحت الصباع */
  }
  html.phone-app #learn .crs__tabs::-webkit-scrollbar,
  html.phone-app #cases .eps__grid::-webkit-scrollbar,
  html.phone-app #why .diff::-webkit-scrollbar { display: none; }

  /* النقط: زرار 44px حوالين نقطة 7px */
  html.phone-rails .prl-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    margin-block: 2px 0;
  }
  html.phone-rails .prl-dot {
    width: 44px;
    height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  html.phone-rails .prl-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: var(--r-pill);
    background: var(--glass-brd-hi);
    transition: width .3s var(--ease), background-color .3s var(--ease);
  }
  html.phone-rails .prl-dot[aria-current="true"]::before {
    width: 22px;
    background: var(--accent-txt);
  }
  html.phone-rails .prl-dot:focus-visible { outline-offset: -8px; }

  /* =================== #learn — المنهج =================== */
  html.phone-app #learn .crs { gap: 0; }
  html.phone-app #learn .buy { display: none; }   /* كارت السعر بييجي في #offer على طول — مش مرتين ورا بعض */
  html.phone-app #learn .crs__head { text-align: start; }

  /* «20 فيديو. 12:45 ساعة.» مكان صف الأرقام */
  html.phone-rails #learn .crs__facts { display: none; }
  html.phone-rails #learn .prl-hl {
    display: block;
    margin: 12px 0 4px;
    font-size: clamp(1.7rem, 8vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--text);
  }
  html.phone-rails #learn .prl-hl b {
    font-weight: 800;
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
  }
  html.phone-rails #learn .prl-hl em { font-style: normal; color: var(--accent-txt); }
  html.phone-rails #learn .crs__title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-2);
    text-wrap: pretty;
  }

  /* الأجزاء التلاتة = كروت بتتسحب، المختار في النص وجيرانه باينين من الجنب */
  html.phone-app #learn .crs__map { min-width: 0; }
  html.phone-app #learn .crs__tabs {
    padding-inline: 14vw;
    scroll-padding-inline: 0;
    padding-block: 4px;
    margin-bottom: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
  html.phone-app #learn .crs__tab {
    position: relative;
    flex: 0 0 72vw;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "pk bdg" "t num" "m num";
    align-items: end;
    column-gap: 10px;
    row-gap: 3px;
    min-height: 132px;
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid var(--glass-brd);
    background: var(--surface);
    color: var(--text);
    text-align: start;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }
  html.phone-app #learn .crs__tab b {
    grid-area: t;
    margin-top: 14px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
  }
  html.phone-app #learn .crs__tab small {
    grid-area: m;
    font-size: 12px;
    color: var(--text-2);
    opacity: 1;
  }
  html.phone-app #learn .crs__tab:hover { background: var(--surface); }
  html.phone-app #learn .crs__tab.is-on {
    background: var(--accent);
    border-color: transparent;
    color: var(--accent-ink);
  }
  html.phone-app #learn .crs__tab.is-on small { color: var(--accent-ink); opacity: .78; }
  html.phone-rails #learn :is(.prl-pk, .prl-num, .prl-bdg) { display: block; }
  html.phone-rails #learn .prl-pk {
    grid-area: pk;
    align-self: start;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
  }
  html.phone-rails #learn .prl-pk i { font-style: normal; direction: ltr; unicode-bidi: isolate; }
  html.phone-rails #learn .crs__tab.is-on .prl-pk { color: var(--accent-ink); opacity: .7; }
  html.phone-rails #learn .prl-bdg {
    grid-area: bdg;
    align-self: start;
    justify-self: end;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
    background: var(--accent-soft);
    color: var(--accent-txt);
  }
  html.phone-rails #learn .crs__tab.is-on .prl-bdg { background: var(--accent-ink); color: var(--accent); }
  html.phone-rails #learn .prl-num {
    grid-area: num;
    align-self: end;
    font-size: 58px;
    font-weight: 800;
    line-height: .82;
    letter-spacing: -.03em;
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
    color: var(--text-3);
    opacity: .55;
  }
  html.phone-rails #learn .crs__tab.is-on .prl-num { color: var(--accent-ink); opacity: .26; }
  html.phone-app #learn .crs__tab:focus-visible { outline: 2px solid var(--accent-txt); outline-offset: -4px; }

  /* اسم الجزء المفتوح + «اسحب» */
  html.phone-rails #learn .prl-lh {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 2px 8px;
    border-bottom: 1px solid var(--glass-brd);
  }
  html.phone-rails #learn .prl-lh b { font-size: 16px; font-weight: 800; }
  html.phone-rails #learn .prl-lh span { font-size: 12px; color: var(--text-3); white-space: nowrap; }

  /* الدروس = صفوف تطبيق: رقم في مربع · العنوان · المدة */
  html.phone-app #learn .crs__list li,
  html.phone-app #learn #cpart-3 li {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13.5px;
    line-height: 1.55;
  }
  html.phone-app #learn .crs__list li:hover { background: none; }
  html.phone-app #learn .crs__n {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--glass-brd);
    background: var(--surface-2);
    font-size: 12px;
    direction: ltr;
    unicode-bidi: isolate;
  }
  html.phone-app #learn .crs__t { text-wrap: pretty; }
  html.phone-app #learn .crs__d {
    grid-column: 3;
    margin: 0;
    font-size: 12px;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
  }

  /* =================== #cases — 5 حملات =================== */
  html.phone-app #cases .eps__head { text-align: start; }
  html.phone-app #cases .eps__title { font-size: clamp(1.4rem, 6.4vw, 1.6rem); margin-top: .7rem; }
  html.phone-app #cases .eps__sub { margin: .5rem 0 0; font-size: 14px; line-height: 1.65; }
  html.phone-app #cases .eps__grid {
    margin-top: 18px;
    padding-block: 2px 6px;
  }
  html.phone-app #cases .ep {
    flex: 0 0 82%;
    min-width: 0;
    min-height: 0;
    scroll-snap-align: start;
    padding: 16px 16px 14px;
    border-radius: 22px;
  }
  html.phone-app #cases .ep:hover { transform: none; box-shadow: none; }
  html.phone-app #cases .ep__ses,
  html.phone-app #cases .ep__dur { font-size: 12px; }
  html.phone-app #cases .ep__dur { direction: ltr; }
  html.phone-app #cases .ep__art { height: 72px; margin: .8rem 0 .6rem; }
  html.phone-app #cases .ep__k { font-size: 2rem; }
  html.phone-app #cases .ep__k small { font-size: 12px; }
  html.phone-app #cases .ep h3 { font-size: 17px; }
  html.phone-app #cases .ep p { font-size: 13.5px; line-height: 1.6; }
  html.phone-app #cases .ep__go { font-size: 13px; min-height: 40px; padding-top: .6rem; margin-top: auto; }

  /* =================== #why — الفرق =================== */
  html.phone-app #why .sec-head { text-align: start; margin-bottom: 16px; }
  html.phone-app #why .sec-head h2 { font-size: clamp(1.4rem, 6.4vw, 1.6rem); line-height: 1.45; margin-top: .7rem; }
  html.phone-app #why .diff { padding-block: 2px 6px; }
  html.phone-app #why .dcard {
    flex: 0 0 82%;
    min-width: 0;
    scroll-snap-align: start;
    padding: 18px 16px 16px;
    border-radius: 22px;
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none !important;
  }
  html.phone-app #why .dcard h3 { font-size: 17px; line-height: 1.45; }
  html.phone-app #why .dcard p { font-size: 14px; line-height: 1.6; }
  html.phone-app #why .dcard__vis { margin-top: 14px; }
  html.phone-app #why .chips-row span,
  html.phone-app #why .flow__step,
  html.phone-app #why .kpis b,
  html.phone-app #why .chips-row small,
  html.phone-app #why .flow__note { font-size: 12px; }

  /* الأرقام = شريط تطبيق 2×2 بخطوط رفيعة */
  html.phone-app #why .proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: 14px;
    padding: 0;
    border: 1px solid var(--glass-brd);
    border-radius: 18px;
    background: var(--surface);
    overflow: hidden;
  }
  html.phone-app #why .proof__item {
    min-width: 0;
    padding: 13px 14px 14px;
    text-align: start;
  }
  html.phone-app #why .proof__item:nth-child(even) { border-inline-start: 1px solid var(--glass-brd); }
  html.phone-app #why .proof__item:nth-child(n + 3) { border-top: 1px solid var(--glass-brd); }
  html.phone-app #why .proof__item b {
    display: inline-block;
    font-size: 20px;
    font-weight: 800;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
  }
  html.phone-app #why .proof__item span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
  }

  html.phone-app[data-theme="light"] #why .dcard { background: #FFFFFF; }

  @media (prefers-reduced-motion: reduce) {
    html.phone-app #learn .crs__tabs,
    html.phone-app #cases .eps__grid,
    html.phone-app #why .diff { scroll-behavior: auto; }
    html.phone-rails .prl-dot::before { transition: none; }
  }
}
