/* ============================================================
   Guided Path layout - EU5 New Player's Path (airy v2)
   Loaded only on pages carrying main.path-layout
   ============================================================ */

main.path-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1em;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 2.5rem;
  align-items: start;
}

main.path-layout .path-main {
  min-width: 0;
}

main.path-layout .path-main .prose {
  width: 100%;
  max-width: 66ch;
  margin: 0 auto; /* center the text block within the column; text itself stays left-aligned */
}

/* ---- lighter typography (fix the heavy feel) ---- */
main.path-layout .prose p {
  max-width: 66ch;
  line-height: 1.75;
  margin-bottom: 1.4em;
}

/* --- Soft sidebar --- */
.path-sidebar {
  position: sticky;
  display: block;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding: 1.1em;
  background: rgba(15, 20, 32, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.path-nav-list {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
  display: grid;
  gap: 4px;
}

.path-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.3;
  transition: color 0.2s ease, background 0.2s ease;
}

.path-nav-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.path-nav-link:hover {
  color: var(--text-primary);
  background: rgba(30, 41, 59, 0.35);
}

/* soft active state: subtle fill + gold left border, no boxes */
.path-nav-link.is-active {
  color: var(--accent);
  font-weight: 700;
  background: rgba(30, 41, 59, 0.55);
  border-left-color: var(--accent);
}

.path-nav-link.is-active .path-nav-num {
  color: var(--accent);
  border-color: rgba(212, 169, 78, 0.6);
  background: transparent;
}

/* borderless progress card */
.path-nav-count {
  margin-top: 1.2em;
  padding: 0.2em 0;
  background: transparent;
  border: none;
}

.path-nav-count-label {
  display: block;
  margin-bottom: 0.5em;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.path-nav-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  overflow: hidden;
}

.path-nav-fill {
  display: block;
  height: 100%;
  width: 20%;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* --- Stage headers: number + title, breathing room, divider --- */
.path-stage-num {
  display: inline-block;
  margin-right: 0.5em;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.9em;
  font-weight: 600;
  color: #64748b; /* slate-500 */
  letter-spacing: 0.06em;
}

.path-stage {
  position: relative;
  padding-left: 34px;
  scroll-margin-top: 112px;
}

.path-stage:not(:first-child) {
  margin-top: 0;
  border-top: 1px solid #334155; /* divider between stages */
  padding-top: 1.6em;
}

.path-stage::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 28px;
  bottom: -1.7em;
  width: 2px;
  background: var(--border-light);
}

.path-stage:last-child::before {
  bottom: 0;
}

/* connect Stage 1's timeline to the intro above it (no orphaned stub) */
.path-stage:first-child::before {
  top: -2em;
}

.path-stage h2 {
  position: relative;
  margin: 0 0 1.4em; /* mb-6 under the header */
}

.path-stage h2::after {
  content: '';
  position: absolute;
  left: -34px;
  top: 0.55em;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 169, 78, 0.18);
}

/* entrance animation - gated on html.js-path so no-JS stays fully visible */
.path-stage {
  opacity: 1;
  transform: none;
}

html.js-path .path-stage {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js-path .path-stage.is-visible {
  opacity: 1;
  transform: none;
}

/* --- "I'm ready..." button: golden outline pill (a nudge, not a wall) --- */
.path-next-btn {
  display: block;
  margin: 1.4em auto 0.2em;
  padding: 0.8em 2em;
  border: 1px solid rgba(212, 169, 78, 0.5);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.98em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.path-next-btn:hover {
  background: var(--accent);
  color: #16233a;
  transform: translateY(-1px);
}

.path-next-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- "Start the Guide" CTA (top intro) --- */
.path-start-btn {
  display: block;
  width: fit-content;
  margin: 1.8em auto 1.2em; /* tighten the dead zone between intro and Stage 1 */
  padding: 0.9em 2.2em;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #16233a;
  font: inherit;
  font-size: 1.05em;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(212, 169, 78, 0.25);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.path-start-btn:hover {
  background: #e6b84d;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(212, 169, 78, 0.32);
}

.path-start-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* #5 "What to ignore for now" callout: light slate + gold bar + icon */
.path-layout .prose blockquote {
  background: rgba(30, 41, 59, 0.6);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.1em 1.4em 1.1em 2.9em;
  position: relative;
}

.path-layout .prose blockquote::before {
  content: '\2139';
  position: absolute;
  left: 1.1em;
  top: 1.08em;
  font-size: 15px;
  color: var(--accent);
}

.path-layout .prose blockquote p {
  color: #cbd5e1; /* slate-300 */
  max-width: none;
  margin: 0;
}

.path-layout .prose blockquote strong {
  color: var(--accent);
}

/* #8 living-document badge + notice */
.path-living-badge {
  display: inline-block;
  margin-left: 0.7em;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}

.path-living-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 2em 0;
  padding: 1em 1.2em;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.9em;
  line-height: 1.6;
}

.path-living-icon {
  flex: 0 0 auto;
  color: var(--accent);
}

/* --- Mobile: sticky horizontal progress bar instead of sidebar --- */
.path-mobile-bar {
  display: none;
}

@media (max-width: 1000px) {
  main.path-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .path-sidebar {
    display: none;
  }

  .path-mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    z-index: 50;
    margin: 0 -1em 1em;
    padding: 10px 12px;
    background: rgba(15, 20, 32, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
  }

  .path-mobile-label {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
  }

  .path-mobile-fillbar {
    flex: 1 1 auto;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    overflow: hidden;
  }

  .path-mobile-fill {
    display: block;
    height: 100%;
    width: 20%;
    background: var(--accent);
    transition: width 0.4s ease;
  }

  .path-mobile-nav {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
  }

  .path-mobile-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  .path-mobile-btn:hover {
    border-color: var(--accent);
  }

  .path-mobile-btn:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .path-stage {
    scroll-margin-top: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js-path .path-stage {
    transition: none;
  }

  .path-nav-fill,
  .path-mobile-fill {
    transition: none;
  }
}

/* --- Save progress UI --- */
.path-resume-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 1.4em;
  padding: 12px 16px;
  background: rgba(15, 20, 32, 0.6);
  border: 1px solid rgba(212, 169, 78, 0.3);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.92em;
  line-height: 1.5;
}

.path-resume-cta {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.55em 1.2em;
  border: 1px solid rgba(212, 169, 78, 0.5);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.9em;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.path-resume-cta:hover {
  background: var(--accent);
  color: #16233a;
}

.path-resume-dismiss {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1em;
  line-height: 1;
  cursor: pointer;
}

.path-resume-dismiss:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.path-reset {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  text-decoration: underline;
  font: inherit;
  font-size: 0.8em;
  padding: 0.2em 0.4em;
  cursor: pointer;
}

.path-reset:hover {
  color: var(--accent-red);
}

.path-nav-link.is-done .path-nav-num {
  color: var(--accent);
  border-color: rgba(212, 169, 78, 0.6);
}