/* =============================================================
   Workflow Library — styles
   Mobile-first. Reuses design tokens from bosai.css.
   ============================================================= */

/* --- Site-nav breathing room (bosai.js injects the site-nav) --- */
body[data-page="workflows"] { padding-top: 80px; }

/* -------------------------------------------------------------
   HERO (index page)
   ------------------------------------------------------------- */
.wf-hero {
  text-align: center;
  padding-top: 48px;
  padding-bottom: 32px;
}
.wf-eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 14px;
}
.wf-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.6vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--white);
  margin: 0 0 18px;
  text-wrap: balance;
}
.wf-hero-title em { font-style: normal; color: var(--cyan); }
.wf-hero-sub {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--ink-70);
  max-width: 640px;
  margin: 0 auto 28px;
  font-weight: 300;
}
.wf-hero-secondary {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: -14px 0 24px;
  opacity: 0.75;
}
.wf-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
.wf-progress-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 198, 240, 0.6);
  animation: wf-pulse 2s ease-in-out infinite;
}
@keyframes wf-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.35); }
}

/* -------------------------------------------------------------
   KIT (ConvertKit) email capture block
   ------------------------------------------------------------- */
.wf-kit-hero { padding: 8px 0 48px; }
.wf-kit {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 24px;
  background: rgba(4, 25, 61, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
}
.wf-kit h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 14px;
}
.wf-kit-compact {
  padding: 22px 20px;
  margin-top: 40px;
}
.wf-kit-compact h3 { font-size: 1.02rem; margin-bottom: 10px; }
/* Kit's default embed comes in as a form, style-agnostic. Give it room. */
.wf-kit form { margin-top: 6px; }

/* -------------------------------------------------------------
   Library — arc sections + card grid
   ------------------------------------------------------------- */
.wf-library { padding-bottom: 40px; }
.wf-arc {
  margin: 48px 0;
}
.wf-arc-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.wf-arc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .wf-arc-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (min-width: 960px) {
  .wf-arc-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
@media (min-width: 1200px) {
  .wf-arc-grid { grid-template-columns: repeat(4, 1fr); }
}

.wf-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(4, 25, 61, 0.55);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.2s;
  min-height: 148px;
}
.wf-card-published:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  background: rgba(4, 25, 61, 0.9);
  box-shadow: var(--shadow-blue);
}
.wf-card-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cyan);
}
.wf-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin: 0;
}
.wf-card-summary {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-60);
  margin: 0;
  font-weight: 300;
}
.wf-tools {
  list-style: none;
  padding: 0;
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wf-tools li {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-70);
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(0, 198, 240, 0.06);
}

/* Locked (upcoming) cards */
.wf-card-locked {
  background: rgba(255, 255, 255, 0.015);
  border-style: dashed;
  border-color: rgba(143, 163, 188, 0.18);
  color: var(--muted-dim);
  justify-content: space-between;
  cursor: default;
}
.wf-card-locked .wf-card-num { color: var(--muted); opacity: 0.55; }
.wf-card-locked-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  opacity: 0.7;
}
.wf-card-locked-label svg { opacity: 0.7; }

/* -------------------------------------------------------------
   Secondary CTA (bottom of index + bottom of detail)
   ------------------------------------------------------------- */
.wf-audit-cta {
  text-align: center;
  padding: 56px 24px;
  margin: 48px 0 24px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.wf-audit-cta p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink-70);
  margin: 0 0 18px;
  font-weight: 500;
}

/* -------------------------------------------------------------
   Detail page — header meta, body grid, sticky nav
   ------------------------------------------------------------- */
.wf-detail {
  padding-top: 48px;
  padding-bottom: 64px;
}
.wf-detail-head {
  max-width: 800px;
  margin: 0 auto 32px;
  text-align: left;
}
.wf-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 18px;
}
.wf-meta-num {
  color: var(--cyan);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(0, 198, 240, 0.06);
}
.wf-meta-arc { opacity: 0.85; }
.wf-meta-date { opacity: 0.7; }
.wf-detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--white);
  margin: 0 0 14px;
  text-wrap: balance;
}
.wf-detail-summary {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-70);
  margin: 0 0 18px;
  font-weight: 300;
  max-width: 68ch;
}
.wf-tools-lg li { font-size: 0.72rem; padding: 4px 10px; }

/* Body grid: nav + prose. Nav is hidden on mobile, sticky on desktop. */
.wf-body-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1080px;
  margin: 0 auto;
}
@media (min-width: 960px) {
  .wf-body-grid {
    grid-template-columns: 220px 1fr;
    gap: 56px;
    align-items: start;
  }
}

.wf-section-nav {
  display: none;
}
@media (min-width: 960px) {
  .wf-section-nav {
    display: block;
    position: sticky;
    top: 100px;
    padding: 20px 18px;
    background: rgba(4, 25, 61, 0.45);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
  }
  .wf-section-nav-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin: 0 0 12px;
  }
  .wf-section-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .wf-section-nav a {
    font-family: var(--font-display);
    font-size: 0.86rem;
    color: var(--ink-70);
    text-decoration: none;
    padding: 4px 0;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -14px;
    transition: color 0.15s, border-color 0.15s;
  }
  .wf-section-nav a:hover { color: var(--cyan); }
  .wf-section-nav a.wf-nav-active {
    color: var(--cyan);
    border-left-color: var(--cyan);
    font-weight: 600;
  }
}

/* Prose body: max-width for readability */
.wf-body {
  max-width: 68ch;
  color: var(--ink-70);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  font-weight: 300;
}
.wf-body p { margin: 0 0 20px; }
.wf-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.wf-body strong { color: var(--white); font-weight: 700; }
.wf-body em { color: var(--white); }
.wf-body ul, .wf-body ol { margin: 0 0 22px; padding-left: 24px; }
.wf-body li { margin-bottom: 8px; }
.wf-body blockquote {
  margin: 24px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--cyan);
  background: rgba(0, 198, 240, 0.05);
  color: var(--ink-70);
  font-style: italic;
}
.wf-body img { max-width: 100%; height: auto; border-radius: 10px; }
.wf-body hr { border: 0; border-top: 1px solid var(--border-soft); margin: 32px 0; }

/* Headings inside the body */
.wf-body h1.wf-h1 { display: none; } /* frontmatter title used instead */
.wf-body h2.wf-h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  margin: 40px 0 16px;
  scroll-margin-top: 100px;
}
/* BOSAI-flagged section headers get a distinctive treatment */
.wf-body h2.wf-h2-bosai {
  font-size: 1.6rem;
  color: var(--cyan);
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(0, 198, 240, 0.08);
  border: 1px solid var(--border);
  margin-top: 44px;
  margin-bottom: 20px;
}
.wf-body h3.wf-h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  margin: 28px 0 10px;
}
.wf-body h4.wf-h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin: 22px 0 8px;
}

/* -------------------------------------------------------------
   Code blocks + copy button
   ------------------------------------------------------------- */
.wf-code {
  position: relative;
  margin: 22px 0;
  border-radius: 12px;
  background: #030c1e;
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.wf-code pre {
  margin: 0;
  padding: 20px 22px;
  padding-top: 44px;
  overflow-x: auto;
  font-family: 'Menlo', 'Monaco', 'Consolas', ui-monospace, monospace;
  font-size: 0.86rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
}
.wf-code code {
  font-family: inherit;
  background: transparent;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.wf-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(0, 198, 240, 0.12);
  border: 1px solid rgba(0, 198, 240, 0.35);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.wf-copy:hover { background: rgba(0, 198, 240, 0.22); border-color: var(--cyan); }
.wf-copy.wf-copied { background: rgba(0, 198, 240, 0.4); color: var(--white); }

/* Inline code (short spans) */
.wf-body p code, .wf-body li code {
  font-family: 'Menlo', 'Monaco', 'Consolas', ui-monospace, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 198, 240, 0.08);
  color: var(--cyan);
  border: 1px solid rgba(0, 198, 240, 0.15);
}

/* -------------------------------------------------------------
   Detail footer: prev/next pager
   ------------------------------------------------------------- */
.wf-detail-foot {
  max-width: 68ch;
  margin: 56px auto 0;
}
.wf-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 40px;
}
.wf-pager-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(4, 25, 61, 0.6);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.wf-pager-link:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}
.wf-pager-next { text-align: right; }
.wf-pager-stub {
  background: transparent;
  border: 1px dashed transparent;
}
.wf-pager-label {
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
}
.wf-pager-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--white);
  font-weight: 600;
  line-height: 1.3;
}

/* -------------------------------------------------------------
   Mobile refinements
   ------------------------------------------------------------- */
@media (max-width: 640px) {
  body[data-page="workflows"] { padding-top: 72px; }
  .wf-hero { padding-top: 32px; padding-bottom: 20px; }
  .wf-arc { margin: 32px 0; }
  .wf-card { min-height: 128px; padding: 18px 16px; }
  .wf-card-title { font-size: 1rem; }
  .wf-detail { padding-top: 32px; }
  .wf-pager { grid-template-columns: 1fr; }
  .wf-pager-next { text-align: left; }
}
