/* "Building the Caladrius PHR with agents": series hub and day posts.
 *
 * No new colours, fonts or type sizes. Day posts use the article tokens from
 * /styles.css (--text-*, --bg-*, --accent-primary) and the article sizes from
 * _layouts/blog.html, like every Pulse article. The hub uses the Pulse page
 * colours (--lib-*, from _includes/pulse-library-tokens.css) and the site's
 * main type system from homepage-v3.css, as on the homepage, Platform and
 * About pages: Fraunces headings (--serif) with the last words in italics
 * (.em), Inter text and buttons (--sans), JetBrains Mono (--mono) for small
 * uppercase labels, dates and figures. Colour marks state only: released
 * (filled), next (outlined), locked (neutral).
 */

/* ---------- Shared: progress bar ---------- */
.pd-progress {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  width: 100%;
}
.pd-seg {
  display: block;
  height: 6px;
  border-radius: 9999px;
  background: var(--pd-seg-empty);
  box-sizing: border-box;
}
.pd-seg--released { background: var(--pd-seg-fill); }
.pd-seg--next { background: transparent; border: 1.5px solid var(--pd-seg-fill); }
.pd-seg--current { box-shadow: 0 0 0 2px var(--pd-seg-ring); }
.pd-num { font-family: var(--mono); }
.pd-lock { vertical-align: -2px; margin-right: 6px; flex: none; }

/* ======================================================================
   Day post (inside _layouts/blog.html, article tokens)
   ====================================================================== */
.pd-seriesbar,
.pd-post {
  --pd-seg-fill: var(--accent-primary);
  --pd-seg-empty: var(--bg-tertiary);
  --pd-seg-ring: var(--bg-primary);
}
.pd-seriesbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.pd-seriesbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.pd-seriesbar-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.pd-seriesbar-all:hover { text-decoration: underline; }
.pd-seriesbar .pd-seriesbar-name {
  margin: 0;
  flex: 1 1 260px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.pd-seriesbar-name strong { color: var(--text-primary); font-weight: 600; }
.pd-seriesbar .pd-progress { flex: 0 1 260px; }

.pd-breadcrumb ol {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}
.pd-breadcrumb li { display: inline-flex; align-items: center; gap: 0.5rem; }
.pd-breadcrumb li + li::before { content: "/"; color: var(--text-tertiary); }
.pd-breadcrumb a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.pd-breadcrumb a:hover { color: var(--text-primary); }
.pd-breadcrumb [aria-current] { color: var(--text-primary); }

.pd-post .pd-eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.pd-post .pd-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--text-tertiary);
}
.pd-byline-author { color: var(--text-primary); font-weight: 600; }
.pd-post .pd-builtwith {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Tables keep their own horizontal scroll at phone width. */
.pd-post .blog-article-content table:not([class]) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.pd-postnav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 4rem 0 1.5rem;
}
.pd-postnav-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 44px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md, 12px);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-decoration: none;
}
a.pd-postnav-card:hover { border-color: var(--accent-primary); }
.pd-postnav-card--static { background: var(--bg-secondary); }
.pd-postnav-card--locked { border-color: var(--accent-primary); }
.pd-postnav-card--next { text-align: right; }
.pd-postnav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.pd-postnav-card--next .pd-postnav-label { justify-content: flex-end; }
.pd-postnav-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
.pd-postnav-note { font-size: 0.9rem; color: var(--text-secondary); }

.pd-seeall { text-align: center; margin: 0 0 2rem; }
.pd-post .pd-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1px solid var(--text-primary);
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.pd-post .pd-btn:hover { background: var(--bg-secondary); }

.pd-seriesbar a:focus-visible,
.pd-post a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .pd-seriesbar-inner { padding: 0.5rem 1rem; gap: 0.25rem 1rem; }
  .pd-seriesbar .pd-progress { flex-basis: 100%; padding-bottom: 0.4rem; }
  .pd-postnav { grid-template-columns: 1fr; }
  .pd-postnav-card--next { text-align: left; }
  .pd-postnav-card--next .pd-postnav-label { justify-content: flex-start; }
}

/* ======================================================================
   Series hub (_layouts/phr-diary-hub.html, Pulse page tokens)
   ====================================================================== */
.phr-hub {
  --pd-seg-fill: var(--lib-accent);
  --pd-seg-empty: var(--lib-border);
  --pd-seg-ring: var(--lib-bg);
  font-family: var(--sans);
  padding-bottom: 80px;
}
/* Hub labels and text are <p> elements: the .phr-hub / .pd-post prefixes
   keep their colours over styles.css's [data-theme="dark"] p rule. */
/* Beats .library-page's DM Sans (the Pulse tokens include loads after this file). */
.library-page.phr-hub { font-family: var(--sans); }
.phr-hub h1,
.phr-hub h2,
.phr-hub h3 { font-family: var(--serif); font-weight: 400; color: var(--lib-text); }
.phr-hub .em { color: var(--lib-accent); }
.phr-hub a:focus-visible,
.phr-hub button:focus-visible {
  outline: 2px solid var(--lib-accent);
  outline-offset: 2px;
}
.pdh-wrap { max-width: 1100px; margin: 0 auto; padding: 0 40px; }

.pdh-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 40px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--lib-text-muted);
}
.pdh-breadcrumb li { display: inline-flex; gap: 8px; align-items: center; }
.pdh-breadcrumb li + li::before { content: "/"; }
.pdh-breadcrumb a { color: var(--lib-accent); text-decoration: underline; text-underline-offset: 2px; }
.pdh-breadcrumb [aria-current] { color: var(--lib-text); }

.pdh-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: end;
  padding: 40px 0 28px;
}
.phr-hub .pdh-eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lib-accent);
  margin: 0 0 12px;
}
.pdh-title {
  font-size: var(--fs-h1);
  line-height: 1.04;
  letter-spacing: -.025em;
  margin: 0 0 20px;
}
.phr-hub .pdh-intro {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--lib-text-muted);
  max-width: 620px;
  margin: 0 0 24px;
}
.pdh-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.pdh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .005em;
  text-decoration: none;
  border: 1px solid var(--lib-text);
  color: var(--lib-text);
  background: transparent;
}
.pdh-btn--primary { background: var(--lib-text); color: var(--lib-bg); }
.pdh-btn:hover { border-color: var(--lib-accent); }
.pdh-btn--primary:hover { background: var(--lib-accent); border-color: var(--lib-accent); color: var(--lib-surface); }
.pdh-author { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--lib-text-muted); }
.pdh-builtwith { font-size: 13px; color: var(--lib-text-muted); }
.pdh-author strong { color: var(--lib-text); font-weight: 500; }

.pdh-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pdh-stat {
  background: var(--lib-surface);
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius);
  padding: 16px;
}
.pdh-stat-num { font-family: var(--mono); font-size: 26px; line-height: 1.1; color: var(--lib-text); }
.pdh-stat-label { font-size: 13px; color: var(--lib-text-muted); margin-top: 4px; }
.pdh-stat--next {
  grid-column: 1 / -1;
  border-color: var(--lib-accent);
}
.pdh-stat--next .pdh-stat-label { margin: 0 0 6px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; }
.pdh-stat--next .pdh-stat-value { font-family: var(--serif); font-size: var(--fs-h4); line-height: 1.22; letter-spacing: -.01em; color: var(--lib-text); margin: 0; }

.pdh-progress-row { padding: 8px 0 8px; }
.pdh-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--lib-text-muted);
  margin-bottom: 8px;
}

.pdh-section { padding-top: 48px; }
.pdh-h2 {
  font-size: var(--fs-h3);
  letter-spacing: -.02em;
  line-height: 1.06;
  margin: 0 0 20px;
}
.pdh-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.pdh-section-note { font-size: 13px; color: var(--lib-text-muted); }

/* Newest released part */
.pdh-feature {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  background: var(--lib-surface);
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius);
  overflow: hidden;
}
.pdh-feature-img img,
.pdh-feature-img picture { display: block; width: 100%; height: auto; }
.pdh-feature-body { padding: 28px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.phr-hub .pdh-meta-line {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lib-accent);
  margin: 0;
}
.pdh-feature-title { font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -.02em; margin: 0; }
.pdh-feature-title a,
.pdh-card-title a { color: var(--lib-text); text-decoration: none; }
.pdh-feature-title a:hover,
.pdh-card-title a:hover { color: var(--lib-accent); }
.phr-hub .pdh-excerpt { font-size: var(--fs-body); line-height: 1.6; color: var(--lib-text-muted); margin: 0; }
.phr-hub .pdh-small { font-size: 13px; color: var(--lib-text-muted); margin: 0; }
.pdh-feature .pdh-btn { align-self: flex-start; }

/* Older released parts */
.pdh-older { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.pdh-card {
  background: var(--lib-surface);
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius);
  overflow: hidden;
}
.pdh-card-img { aspect-ratio: 2 / 1; overflow: hidden; }
.pdh-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdh-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.pdh-card-title { font-size: var(--fs-h4); line-height: 1.22; letter-spacing: -.01em; margin: 0; }
.pdh-readmore { font-size: 12px; font-weight: 500; color: var(--lib-accent); text-decoration: none; }
.pdh-readmore:hover { text-decoration: underline; }

/* Locked parts */
.pdh-locked { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pdh-lockcard {
  background: var(--lib-surface);
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--lib-text-muted);
}
.pdh-lockcard--next { border-color: var(--lib-accent); box-shadow: inset 0 0 0 1px var(--lib-accent); }
.pdh-lockcard-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pdh-lockcard-day { font-family: var(--serif); font-size: var(--fs-h4); line-height: 1.22; letter-spacing: -.01em; color: var(--lib-text); }
.pdh-next-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--lib-accent-light);
  color: var(--lib-accent);
}
.phr-hub .pdh-lockcard-note { font-size: 13px; margin: 0; }
.phr-hub .pdh-lockcard-title { font-size: 14px; line-height: 1.45; color: var(--lib-text); margin: 0; }
.phr-hub .pdh-lockcard-opens { font-size: 13px; color: var(--lib-text); margin: 0; }

/* Follow */
.pdh-follow {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--lib-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.pdh-follow .pdh-h2 { margin: 0 0 8px; }
.pdh-follow p { margin: 0; font-size: 15px; color: var(--lib-text-muted); max-width: 620px; line-height: 1.6; }

@media (max-width: 960px) {
  .pdh-hero { grid-template-columns: 1fr; align-items: start; }
  .pdh-feature { grid-template-columns: 1fr; }
  .pdh-locked { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdh-older { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .pdh-wrap { padding: 0 16px; }
  .pdh-feature-body { padding: 20px; }
  .pdh-locked, .pdh-older { grid-template-columns: 1fr; }
}

/* styles.css gives every <section> large page-level padding; the hub's
   sections set their own. */
.phr-hub section.pdh-hero { padding: 40px 0 28px; }
.phr-hub section.pdh-section { padding: 48px 0 0; }
.phr-hub section.pdh-follow { padding: 28px 0 0; }
