/* ============================================================================
   pd-learning-path.css  —  "Buddha Dhamma Learning Path" home component (v2)
   ----------------------------------------------------------------------------
   Design: an ILLUMINATED PATH. A vertical spine runs down the six stages and
   lights up gold in proportion to progress; each stage medallion ignites when
   its topics are all complete. The metaphor is magga — the path lights as the
   practitioner walks it. Palette + fonts are taken from the existing site
   (warm temple-gold on parchment) so light/dark themes stay in sync and no new
   fonts/images are loaded. Every rule is scoped under .pd-learning-path.
   ========================================================================== */

.pd-learning-path{
  --pdlp-accent: var(--accent, #A0742A);
  --pdlp-ink:    var(--text, #2A2A28);
  --pdlp-muted:  var(--muted, #6E6A61);
  --pdlp-line:   var(--border, #E5DFD3);
  --pdlp-card:   var(--card, #FFFFFF);
  --pdlp-soft:   var(--accent-soft, #F4EBDA);
  --pdlp-parch:  var(--bg-soft, #F2EEE6);
  --pdlp-shadow: var(--shadow, 0 1px 3px rgba(60,50,30,.07));

  --pdlp-serif: Georgia, "Noto Serif", "Times New Roman", serif;
  --pdlp-sans:  -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --pdlp-radius: 16px;
  --pdlp-rail: 26px;           /* x-position of the spine (mobile) */
  --pdlp-maxw: 940px;

  box-sizing: border-box;
  max-width: var(--pdlp-maxw);
  margin: 0 auto;
  padding: 28px 18px 12px;
  color: var(--pdlp-ink);
  font-family: var(--pdlp-sans);
  line-height: 1.6;
}
.pd-learning-path *{ box-sizing: border-box; }

/* bilingual visibility — VI is the no-JS baseline */
.pd-learning-path [data-pdlp-en]{ display: none; }
.pd-learning-path.pdlp--en [data-pdlp-en]{ display: inline; }
.pd-learning-path.pdlp--en [data-pdlp-vi]{ display: none; }
.pd-learning-path p[data-pdlp-en],
.pd-learning-path .pdlp-block[data-pdlp-en]{ display: none; }
.pd-learning-path.pdlp--en p[data-pdlp-en],
.pd-learning-path.pdlp--en .pdlp-block[data-pdlp-en]{ display: block; }
.pd-learning-path.pdlp--en p[data-pdlp-vi],
.pd-learning-path.pdlp--en .pdlp-block[data-pdlp-vi]{ display: none; }

/* ============================== HERO ==================================== */
.pd-learning-path__hero{
  text-align: center;
  padding: 6px 6px 26px;
}
.pd-learning-path__eyebrow{
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pdlp-accent);
  margin-bottom: 14px;
}
.pd-learning-path__title{
  font-family: var(--pdlp-sans);
  font-weight: 700;
  font-size: clamp(20px, 3.4vw, 30px);
  line-height: 1.25;
  letter-spacing: .2px;
  margin: 0;
  color: var(--pdlp-accent);
}
/* one quiet ornament: a single gold diamond hub, echoing a wheel-hub / gem */
.pd-learning-path__hero::after{
  content: "";
  display: block;
  width: 9px; height: 9px;
  margin: 20px auto 0;
  transform: rotate(45deg);
  background: var(--pdlp-accent);
  box-shadow: 0 0 0 5px var(--pdlp-soft);
}
.pd-learning-path__subtitle{
  font-size: clamp(15px, 2.3vw, 17.5px);
  color: var(--pdlp-muted);
  max-width: 600px;
  margin: 18px auto 0;
  line-height: 1.7;
}

/* ============================ INTRO (Welcome) =========================== */
.pd-learning-path__intro{
  background: var(--pdlp-parch);
  border: 1px solid var(--pdlp-line);
  border-left: 4px solid var(--pdlp-accent);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 8px 0 30px;
}
.pd-learning-path__intro-h{
  font-family: var(--pdlp-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--pdlp-accent);
  margin: 0 0 8px;
}
.pd-learning-path__intro p{ margin: 0 0 6px; font-size: 15px; line-height: 1.7; }
.pd-learning-path__intro a{ color: var(--pdlp-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ============================== PROGRESS ================================ */
.pd-learning-path__progress{
  background: var(--pdlp-card);
  border: 1px solid var(--pdlp-line);
  border-radius: var(--pdlp-radius);
  box-shadow: var(--pdlp-shadow);
  padding: 18px 20px 20px;
  margin-bottom: 34px;
}
.pd-learning-path__progress-top{
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 8px; margin-bottom: 12px;
}
.pd-learning-path__progress-label{
  font-family: var(--pdlp-serif);
  font-size: 16px; font-weight: 600; color: var(--pdlp-ink);
}
.pd-learning-path__progress-count{
  font-size: 13px; color: var(--pdlp-muted);
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
}
.pd-learning-path__progress-track{
  height: 10px;
  background: var(--pdlp-soft);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(60,50,30,.10);
}
.pd-learning-path__progress-fill{
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg,
      color-mix(in srgb, var(--pdlp-accent) 78%, #fff),
      var(--pdlp-accent));
  transition: width .55s cubic-bezier(.22,.61,.36,1);
}
.pd-learning-path__continue{
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 16px; padding: 11px 22px;
  font-family: var(--pdlp-sans);
  font-size: 14.5px; font-weight: 700; letter-spacing: .2px;
  color: #fff; background: var(--pdlp-accent);
  border: 1px solid var(--pdlp-accent); border-radius: 11px;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 2px 8px rgba(160,116,42,.22);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.pd-learning-path__continue::before{ content: "\2192"; font-weight: 700; }
.pd-learning-path__continue:hover{ filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(160,116,42,.30); }
.pd-learning-path__continue:focus-visible{ outline: 3px solid var(--pdlp-accent); outline-offset: 3px; }

/* ============================== TIMELINE =============================== */
.pd-learning-path__timeline-wrap{ position: relative; }
.pd-learning-path__timeline{
  list-style: none; margin: 0; padding: 0; position: relative;
}
/* the unlit track */
.pd-learning-path__timeline-wrap::before{
  content: ""; position: absolute;
  left: var(--pdlp-rail); top: 10px; bottom: 10px;
  width: 3px; margin-left: -1.5px;
  background: var(--pdlp-line);
  border-radius: 3px;
}
/* the lit portion (height set by JS = overall progress) */
.pd-learning-path__spine-fill{
  position: absolute;
  left: var(--pdlp-rail); top: 10px;
  width: 3px; margin-left: -1.5px; height: 0;
  background: linear-gradient(var(--pdlp-accent),
      color-mix(in srgb, var(--pdlp-accent) 65%, #fff));
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(160,116,42,.45);
  transition: height .6s cubic-bezier(.22,.61,.36,1);
  pointer-events: none;
}

.pd-learning-path__stage{
  position: relative;
  padding: 0 0 30px calc(var(--pdlp-rail) + 30px);
}
.pd-learning-path__stage:last-child{ padding-bottom: 6px; }

/* medallion */
.pd-learning-path__stage-num{
  position: absolute; left: 0; top: 0;
  width: 52px; height: 52px; margin-left: calc(var(--pdlp-rail) - 26px);
  border-radius: 50%;
  background: var(--pdlp-card);
  border: 2px solid var(--pdlp-line);
  color: var(--pdlp-muted);
  font-family: var(--pdlp-serif);
  font-size: 22px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: border-color .3s ease, color .3s ease, background .3s ease, box-shadow .3s ease;
}
.pd-learning-path__stage.is-complete .pd-learning-path__stage-num{
  background: var(--pdlp-accent);
  border-color: var(--pdlp-accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--pdlp-soft), 0 0 18px rgba(160,116,42,.35);
}

.pd-learning-path__stage-head{ margin: 6px 0 16px; }
.pd-learning-path__stage-title{
  font-family: var(--pdlp-serif);
  font-size: clamp(19px, 3.2vw, 24px);
  font-weight: 600; margin: 0; color: var(--pdlp-ink);
  line-height: 1.25;
}
.pd-learning-path__stage-note{ font-size: 12.5px; color: var(--pdlp-muted); margin: 4px 0 0; }

/* topic "stones" */
.pd-learning-path__topics{
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
.pd-learning-path__topic{
  position: relative;
  display: flex; align-items: center; gap: 12px;
  background: var(--pdlp-card);
  border: 1px solid var(--pdlp-line);
  border-radius: 12px;
  box-shadow: var(--pdlp-shadow);
  padding: 14px 16px 14px 18px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* left accent rail, lights up when complete */
.pd-learning-path__topic::before{
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: transparent; transition: background .25s ease;
}
.pd-learning-path__topic:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(90,70,30,.14);
  border-color: color-mix(in srgb, var(--pdlp-accent) 45%, var(--pdlp-line));
}
.pd-learning-path__topic.is-complete::before{ background: var(--pdlp-accent); }
.pd-learning-path__topic.is-complete{ background: color-mix(in srgb, var(--pdlp-soft) 55%, var(--pdlp-card)); }

.pd-learning-path__topic-main{ flex: 1; min-width: 0; }
.pd-learning-path__topic-link{
  font-size: 15.5px; font-weight: 600; color: var(--pdlp-ink);
  text-decoration: none; display: inline-block; line-height: 1.4;
}
.pd-learning-path__topic-sub{
  display: block;
  font-family: var(--pdlp-serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--pdlp-accent);
  margin-top: 3px;
  line-height: 1.35;
}
.pd-learning-path__topic-link:hover{ color: var(--pdlp-accent); }
.pd-learning-path__topic-link:focus-visible{ outline: 3px solid var(--pdlp-accent); outline-offset: 3px; border-radius: 4px; }
.pd-learning-path__topic.is-complete .pd-learning-path__topic-link{ color: var(--pdlp-muted); }

/* completion bead */
.pd-learning-path__toggle{
  flex: 0 0 auto;
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%;
  border: 2px solid var(--pdlp-line);
  background: var(--pdlp-card);
  color: var(--pdlp-accent);
  font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.pd-learning-path__toggle:hover{ border-color: var(--pdlp-accent); transform: scale(1.06); }
.pd-learning-path__toggle:focus-visible{ outline: 3px solid var(--pdlp-accent); outline-offset: 2px; }
.pd-learning-path__toggle[aria-pressed="true"]{
  background: var(--pdlp-accent); border-color: var(--pdlp-accent); color: #fff;
}

/* resources stage: quieter, no beads */
.pd-learning-path__topic--resource{ background: var(--pdlp-parch); }
.pd-learning-path__topic--resource:hover{ transform: translateY(-2px); }

/* ========================= FOOT (Refs / About / Contact) =============== */
.pd-learning-path__foot{
  margin-top: 36px; padding-top: 24px;
  border-top: 1px solid var(--pdlp-line);
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
.pd-learning-path__foot-card{
  background: var(--pdlp-card);
  border: 1px solid var(--pdlp-line);
  border-radius: 12px; padding: 16px 18px;
}
.pd-learning-path__foot-h{
  font-family: var(--pdlp-serif);
  font-size: 15px; font-weight: 600; color: var(--pdlp-accent); margin: 0 0 6px;
}
.pd-learning-path__foot-card p{ margin: 0; font-size: 14px; color: var(--pdlp-muted); line-height: 1.65; }
.pd-learning-path__foot-card a{ color: var(--pdlp-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.pd-learning-path__sr{
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ============================== RESPONSIVE ============================= */
@media (min-width: 600px){
  .pd-learning-path__topics{ grid-template-columns: 1fr 1fr; }
  .pd-learning-path__foot{ grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 860px){
  .pd-learning-path{ --pdlp-rail: 34px; padding: 40px 24px 12px; }
  .pd-learning-path__stage{ padding-left: calc(var(--pdlp-rail) + 40px); }
  .pd-learning-path__stage-num{ width: 60px; height: 60px; margin-left: calc(var(--pdlp-rail) - 30px); font-size: 25px; }
}

/* ============================== MOTION ================================ */
@keyframes pdlp-rise{ from{ opacity: 0; transform: translateY(14px); } to{ opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference){
  .pd-learning-path[data-pdlp-enhanced="true"] .pd-learning-path__stage{
    opacity: 0; animation: pdlp-rise .5s ease forwards;
  }
  .pd-learning-path__stage:nth-child(1){ animation-delay: .05s; }
  .pd-learning-path__stage:nth-child(2){ animation-delay: .12s; }
  .pd-learning-path__stage:nth-child(3){ animation-delay: .19s; }
  .pd-learning-path__stage:nth-child(4){ animation-delay: .26s; }
  .pd-learning-path__stage:nth-child(5){ animation-delay: .33s; }
  .pd-learning-path__stage:nth-child(6){ animation-delay: .40s; }
}
@media (prefers-reduced-motion: reduce){
  .pd-learning-path__progress-fill,
  .pd-learning-path__spine-fill,
  .pd-learning-path__topic,
  .pd-learning-path__toggle,
  .pd-learning-path__continue,
  .pd-learning-path__stage-num{ transition: none; }
  .pd-learning-path__topic:hover,
  .pd-learning-path__continue:hover,
  .pd-learning-path__toggle:hover{ transform: none; }
}

/* color-mix fallback: if unsupported, values above simply ignore; provide
   solid fallbacks so nothing looks broken on older engines. */
@supports not (color: color-mix(in srgb, red, blue)){
  .pd-learning-path__progress-fill{ background: var(--pdlp-accent); }
  .pd-learning-path__spine-fill{ background: var(--pdlp-accent); }
  .pd-learning-path__topic.is-complete{ background: var(--pdlp-soft); }
  .pd-learning-path__topic:hover{ border-color: var(--pdlp-accent); }
}

/* ======================================================================
   OPTIONAL — make the Learning Path the entire homepage by hiding the
   legacy home sections (featured post + "new / most-read" columns).
   The site header, menu, footer, license, and all other pages are
   untouched. Delete THIS block to bring the old sections back.
   ====================================================================== */
#page-home > #homePostSec,
#page-home > .sec{ display: none !important; }

/* When the timeline jumps to a sitemap section, leave room for the site's
   sticky menu bar so the section heading isn't hidden underneath it. */
#page-sitemap details[id^="smcat-"]{ scroll-margin-top: 120px; }
