/* ============================================================
   home-paths.css — Learning Paths & How It Works
   ─────────────────────────────────────────
   PURPOSE : The three goal cards and the three-step explainer
             (html-templates/home/paths.html, how-it-works.html).
   ============================================================ */

/* ── Path cards ───────────────────────────────────────────────── */
.home-paths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.home-path {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 26px 24px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 1px 2px hsl(var(--shadow-color) / 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-path:hover {
  border-color: var(--border);
  box-shadow: 0 16px 36px -20px hsl(var(--shadow-color) / 0.4);
  transform: translateY(-2px);
}

.home-path--featured,
.home-path--featured:hover {
  border-color: var(--accent);
}

.home-path__badge {
  position: absolute;
  top: -12px;
  inset-inline-start: 24px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--mark-catch);
  color: var(--mark-disc);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.home-path__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-tint);
  color: var(--accent);
}

.home-path__icon svg {
  width: 24px;
  height: 24px;
}

.home-path__title {
  margin-top: 18px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.home-path__desc {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-soft);
}

/* Grows to push the call to action to the bottom, so cards line up. */
.home-path__pages {
  flex: 1;
  margin: 18px 0 22px;
  list-style: none;
}

.home-path__pages a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-inline: -10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.home-path__pages a::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-top: 1.6px solid var(--text-faint);
  border-inline-end: 1.6px solid var(--text-faint);
  transform: rotate(45deg);
}

html[dir="rtl"] .home-path__pages a::after {
  transform: rotate(-45deg);
}

.home-path__pages a.badge-soon-link {
  position: relative;
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.home-path__pages a.badge-soon-link::before {
  content: attr(data-badge);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-end: 32px; /* before the chevron arrow */
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--mark-catch, #FEB536);
  color: var(--mark-disc, #043E3D);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(254, 181, 54, 0.4), 0 1px 2px rgba(0,0,0,0.1);
  border: 1px solid rgba(254, 181, 54, 0.6);
  pointer-events: none;
}

html[dir="rtl"] .home-path__pages a.badge-soon-link::before {
  letter-spacing: normal;
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Inter', system-ui, sans-serif;
}

.home-path__pages a:hover {
  background: var(--bg);
  color: var(--accent-strong);
}

.home-path__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--accent-strong);
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.home-path__cta:hover {
  background: var(--accent-tint);
}

.home-path--featured .home-path__cta {
  background: var(--accent);
  color: #FFFFFF !important;
}

.home-path--featured .home-path__cta:hover {
  background: var(--accent-strong);
}

/* ── How it works ─────────────────────────────────────────────── */
.home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  list-style: none;
}

.home-step {
  text-align: center;
}

.home-step__number {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--mark-disc);
  color: var(--on-accent);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
}

.home-step__title {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.home-step__text {
  max-width: 320px;
  margin: 6px auto 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text-soft);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .home-paths,
  .home-steps {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
    margin-inline: auto;
  }

  .home-paths {
    gap: 28px;
  }
}

/* Touch screens: no lift-on-hover (it sticks after a tap); press feedback instead. */
@media (hover: none) {
  .home-path:hover {
    border-color: var(--border-soft);
    box-shadow: 0 1px 2px hsl(var(--shadow-color) / 0.05);
    transform: none;
  }

  .home-path--featured:hover {
    border-color: var(--accent);
  }

  .home-path__pages a:hover {
    background: transparent;
    color: var(--text);
  }

  .home-path__pages a:active {
    background: var(--surface-sunken);
  }

  .home-path__cta:active {
    transform: scale(0.98);
  }
}

/* ── Phone ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .home-paths {
    gap: 20px;
  }

  /* Header row: icon beside title, description underneath. */
  .home-path {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
    padding: 22px 18px 18px;
    border-radius: 22px;
    -webkit-tap-highlight-color: transparent;
  }

  .home-path--featured {
    padding-top: 26px;
    background:
      radial-gradient(120% 70% at 100% 0%, var(--accent-tint) 0%, transparent 60%),
      var(--surface);
    box-shadow: 0 14px 32px -22px hsl(var(--shadow-color) / 0.55);
  }

  html[dir="rtl"] .home-path--featured {
    background:
      radial-gradient(120% 70% at 0% 0%, var(--accent-tint) 0%, transparent 60%),
      var(--surface);
  }

  .home-path__badge {
    inset-inline-start: 18px;
  }

  .home-path__icon {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .home-path__icon svg {
    width: 22px;
    height: 22px;
  }

  .home-path__title {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .home-path__desc,
  .home-path__pages,
  .home-path__cta {
    grid-column: 1 / -1;
  }

  .home-path__desc {
    margin-top: 12px;
    font-size: 0.93rem;
  }

  /* Pages as a grouped list with hairline dividers and 48px tap targets. */
  .home-path__pages {
    margin: 14px 0 16px;
    border-top: 1px solid var(--border-soft);
  }

  .home-path__pages li + li {
    border-top: 1px solid var(--border-soft);
  }

  .home-path__pages a {
    min-height: 48px;
    margin-inline: -6px;
    padding: 6px;
    font-size: 0.97rem;
  }

  .home-path__cta {
    min-height: 50px;
    border-radius: 14px;
    font-size: 0.97rem;
    transition: background-color 0.15s ease, transform 0.1s ease;
  }

  /* How it works: a vertical timeline instead of three centred columns. */
  .home-steps {
    gap: 0;
  }

  .home-step {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 16px;
    padding-bottom: 26px;
    text-align: start;
  }

  .home-step:last-child {
    padding-bottom: 0;
  }

  .home-step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 46px;
    bottom: 6px;
    inset-inline-start: 19.5px;
    width: 1px;
    background: var(--border);
  }

  .home-step__number {
    grid-row: 1 / span 2;
  }

  .home-step__title {
    align-self: center;
    margin-top: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  .home-step__text {
    max-width: none;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-path,
  .home-path__pages a {
    transition: none;
  }

  .home-path:hover {
    transform: none;
  }
}
