/* ============================================================
   Shapes Infinity — learning page layer (layout only)
   The system — chips, hero, cards, pills, banner, footer —
   lives in playground.css. This file only arranges the
   2x2 curriculum grid and the lesson lists inside it.
   ============================================================ */

/* ---- head block: closing line under the lead ---- */
.entries-head .tracks-closing {
  margin-top: 14px; max-width: 46ch;
  font-weight: 500; font-size: 0.95rem;
}

/* ---- tracks: 2x2 grid of color block-cards ---- */
.tracks-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
.track-card { display: flex; flex-direction: column; align-items: flex-start; }
.track-card .track-num {
  font-size: clamp(3rem, 6vw, 4.8rem);
  line-height: 1;
  margin-bottom: 20px;
}
.track-card .card-tag { margin-bottom: 18px; }

/* ---- lesson list: title + "soon" status pill per row ---- */
.lesson-list {
  width: 100%; max-width: 46ch;
  margin-top: 22px;
  display: grid; gap: 10px;
}
.lesson-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 600; font-size: 0.9rem;
}
.pill--soon { padding: 4px 12px; font-size: 0.7rem; flex-shrink: 0; cursor: default; }
/* these pills are statuses, not links — no glow, keep the glass border */
.pill--soon:hover { box-shadow: none; }

/* AR mode: English text blocks align with the lesson labels (left edge) */
html[dir="rtl"] .track-card h3,
html[dir="rtl"] .track-card > p { align-self: flex-end; }

@media (max-width: 767px) {
  .tracks-grid { grid-template-columns: 1fr; }
}

/* ---- Learn AI curriculum explorer ---- */
.modules-list { display: grid; gap: var(--gap); }
.module-card { padding: 0; overflow: hidden; }
.module-card summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: clamp(14px, 2.5vw, 26px);
  padding: clamp(18px, 3vw, 26px);
}
.module-card summary::-webkit-details-marker { display: none; }
.module-num { font-size: clamp(1.8rem, 3.4vw, 2.8rem); opacity: 0.16; font-weight: 700; flex-shrink: 0; }
.module-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.module-info .card-tag { align-self: flex-start; margin-bottom: 0; }
.module-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.15rem, 2vw, 1.5rem); color: var(--ink); }
.module-tagline { font-size: 0.88rem; color: var(--muted); }
.module-count {
  margin-inline-start: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 650; color: var(--muted); white-space: nowrap;
}
.module-caret {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink);
  font-size: 1.1rem; transition: transform var(--dur-ui) var(--ease-fluid), background 0.2s;
}
.module-card[open] .module-caret { transform: rotate(45deg); background: var(--paper); }
.module-lessons {
  list-style: none; display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 0 clamp(18px, 3vw, 26px) clamp(18px, 3vw, 26px);
}
.module-lessons a {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 11px 14px; min-height: 44px;
  text-decoration: none; color: var(--ink);
  font-size: 0.88rem; font-weight: 550;
  transition: transform var(--dur-tap) var(--ease-fluid), border-color 0.2s;
}
.module-lessons a:hover { border-color: var(--orange); transform: translateX(3px); }
.module-lessons .lnum { flex-shrink: 0; font-family: var(--font-display); font-weight: 700; font-size: 0.74rem; color: var(--orange); }
.module-lessons .lgo { margin-inline-start: auto; color: var(--muted); }
@media (max-width: 767px) {
  .module-lessons { grid-template-columns: 1fr; }
  .module-num { display: none; }
  .module-count { display: none; }
}

/* ---- standard motion: smooth module open + staggered lesson links ---- */
html.motion-on .module-card[open] .module-lessons {
  animation: module-open 0.4s var(--ease-fluid);
}
@keyframes module-open { from { opacity: 0; transform: translateY(-10px); } }
html.motion-on .module-card[open] .module-lessons li {
  opacity: 0;
  animation: lesson-in 0.45s var(--ease-fluid) forwards;
}
@keyframes lesson-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html.motion-on .module-card[open] .module-lessons li:nth-child(1)  { animation-delay: 0.05s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(2)  { animation-delay: 0.09s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(3)  { animation-delay: 0.13s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(4)  { animation-delay: 0.17s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(5)  { animation-delay: 0.21s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(6)  { animation-delay: 0.25s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(7)  { animation-delay: 0.29s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(8)  { animation-delay: 0.33s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(9)  { animation-delay: 0.37s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(10) { animation-delay: 0.41s; }
html.motion-on .module-card[open] .module-lessons li:nth-child(n+11) { animation-delay: 0.45s; }
.module-card summary { transition: background 0.25s var(--ease-fluid); border-radius: inherit; }
.module-card summary:hover { background: rgba(242, 240, 250, 0.05); }
