/* v4 design layer for inner pages, matching the homepage (css/home-lower.css):
   Manrope everywhere, ink #0a111a, muted #5c6370, quiet labels #8c949e,
   white cards (radius 28) holding warm #faf8f4 panels (radius 20), warm
   bands #faf8f3 / #f7f5f0, hairlines #e8e4de, cyan #06b6d4 accents.
   Loaded last on every page except the homepage (functions.php). */

:root { --v4-ink: #0a111a; --v4-muted: #5c6370; --v4-quiet: #8c949e; --v4-line: #e8e4de; --v4-panel: #faf8f4; --v4-warm: #faf8f3; --v4-cyan: #06b6d4; }

/* ============ Global layer: every inner page ============ */
:root {
  --serif: 'Manrope', system-ui, sans-serif;   /* the old display serif becomes Manrope everywhere */
  --bg: #faf8f3; --warm: #ffffff; --border: #e8e4de; --border2: #e8e4de;
}
body { background: var(--v4-warm); }
main h1, main h2 { font-weight: 300 !important; } main h3 { font-weight: 400; }
main h1 { letter-spacing: -1px; }
main h2 { letter-spacing: -0.6px; }
.hiw-diamond, .blog-diamond { display: none !important; }
main [class$="-kicker"], main [class*="-kicker "], main .story-eyebrow {
  font-family: var(--sans) !important; font-weight: 500 !important; font-size: 12px !important; line-height: 16px !important;
  letter-spacing: 0.96px !important; text-transform: uppercase; color: var(--v4-quiet) !important;
}

/* section shells from the old homepage system, reused by every template */
main section > [class$="-inner"]:not(.article-hero-inner):not(.midcta-inner) { max-width: 1272px; margin-left: auto; margin-right: auto; background: transparent !important; padding-left: 0; padding-right: 0; }
main section.hipaa, main section.specialties, main section.stories { padding-left: 16px; padding-right: 16px; }
/* cards: white, rounded, borderless */
main :is(.sh-card, .ch-hub-card, .integrations-card) {
  background-color: #fff; border-color: transparent !important; border-radius: 28px; overflow: hidden;
}
main .midcta-inner { border-radius: 28px !important; overflow: hidden; }
main :is(.sp-jcard, .hipaa-pillar, .story-feature, .story-snap, .sp-panel, .sp-site, .sv-site) { border-radius: 28px !important; border-color: transparent !important; overflow: hidden; }
main .sp-jcard li, main .sp-panel li { border-radius: 12px; }

/* ============ Customer story (single-case_study.php) ============ */
.case-page { background: var(--v4-warm); }
.case-hero { background: var(--v4-warm) !important; padding: 150px 16px 40px !important; min-height: 0 !important; color: var(--v4-ink); }
.case-hero::before, .case-hero::after, .case-hero .case-hero-media, .case-hero .case-hero-nav { display: none !important; }
.case-hero .article-hero-inner { max-width: 1272px; gap: 32px; }
.case-hero .article-breadcrumb, .case-hero .article-breadcrumb a, .case-hero .article-breadcrumb-current { color: var(--v4-quiet) !important; font-size: 12px; letter-spacing: 0.96px; }
.case-hero .article-breadcrumb { border: 0 !important; padding: 0 !important; }
.case-hero .article-breadcrumb a:hover { color: var(--v4-ink) !important; }
.case-hero .article-breadcrumb-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.case-hero .article-h1, .case-hero .case-h1 {
  font-family: var(--sans) !important; font-weight: 400 !important; color: var(--v4-ink) !important;
  font-size: clamp(34px, 3.8vw, 56px) !important; line-height: 1.14 !important; letter-spacing: -1px !important; max-width: 1040px;
}
.case-hero .case-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border: 0; padding: 0; }
.case-hero .case-metric { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px 24px 22px; border-radius: 20px; background: #fff; border: 0 !important; }
.case-hero .case-metric-value { font-family: var(--sans) !important; font-weight: 500 !important; font-size: clamp(32px, 3vw, 48px) !important; line-height: 1.05 !important; letter-spacing: -1px; color: var(--v4-ink) !important; }
.case-hero .case-metric-label { font-family: var(--sans); font-size: 13px !important; line-height: 18px; letter-spacing: 0 !important; text-transform: none !important; color: var(--v4-muted) !important; }
.case-hero .case-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; border: 0; padding: 0; margin: 0; }
.case-hero .case-meta-col { gap: 6px; padding-top: 14px; border-top: 1px solid var(--v4-line); }
.case-hero .case-meta-label { font-family: var(--sans); font-weight: 500; font-size: 12px !important; letter-spacing: 0.96px; text-transform: uppercase; color: var(--v4-quiet) !important; padding: 0 !important; }
.case-hero .case-meta-value { font-family: var(--sans) !important; font-weight: 400 !important; font-size: 17px !important; line-height: 24px !important; color: var(--v4-ink) !important; padding: 0 !important; }

.case-cover { max-width: 1272px; margin: 0 auto; padding: 0 16px; box-sizing: content-box; }
.case-cover img { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 28px; }

.case-page .article-panel { background: transparent !important; padding: 24px 16px 0 !important; margin: 0 !important; }
.case-hero .case-metric-value { order: -1; }
.case-page .article-shell { max-width: 1272px; background: #fff; border-radius: 28px; padding: 48px 56px 56px; box-sizing: border-box; }
.case-page .article-body, .case-page .article-body p, .case-page .article-body li { font-family: var(--sans); font-weight: 400; font-size: 17px; line-height: 27px; color: #2b323b; }
.case-page .article-body h2 { font-family: var(--sans) !important; font-weight: 400 !important; font-size: 30px !important; line-height: 38px !important; letter-spacing: -0.5px !important; color: var(--v4-ink); margin: 40px 0 14px !important; padding: 0 !important; border: 0 !important; }
.case-page .article-body h2:first-child { margin-top: 0 !important; }
.case-page .article-body h2::before, .case-page .article-body h2::after { display: none !important; }
.case-page .article-body ul { padding-left: 20px; }
.case-page .article-body li { margin: 6px 0; }
.case-page .article-body li::marker { color: var(--v4-cyan); }
.case-page .article-rail, .case-page .article-rail * { font-family: var(--sans) !important; }

/* growth chart: light area, sans labels */
.tely-chart-card { background: var(--v4-panel) !important; border: 0 !important; border-radius: 20px !important; }
.tely-chart-svg path[fill="#06B6D4"] { fill: rgba(6, 182, 212, 0.14); }
.tely-chart-svg rect[fill^="url("] { display: none; }
.tely-chart-svg text { font-family: var(--sans) !important; fill: var(--v4-quiet); }

.case-page .article-related { background: transparent !important; }
.case-page .article-related-heading { font-family: var(--sans) !important; font-weight: 400 !important; letter-spacing: -0.6px; }
.case-page .article-related-heading .blog-diamond { display: none; }

@media (max-width: 860px) {
  .case-hero { padding: 112px 16px 28px !important; }
  .case-hero .case-metrics { grid-template-columns: 1fr; }
  .case-hero .case-meta-grid { grid-template-columns: 1fr; }
  .case-cover img { aspect-ratio: 4 / 3; border-radius: 20px; }
  .case-page .article-shell { padding: 24px 20px 32px; border-radius: 20px; }
  .case-page .article-body h2 { font-size: 24px !important; line-height: 31px !important; }
}
.case-hero .case-metrics { grid-template-rows: none !important; }
.case-hero .case-metric { grid-row: auto !important; grid-template-rows: none !important; }
.case-hero .case-metric-value { order: 0 !important; align-self: flex-start !important; text-align: left !important; justify-self: start !important; }
.case-hero .case-metric-label { order: 1 !important; border: 0 !important; padding: 0 !important; align-self: flex-start !important; }

/* ============ Customer stories archive (archive-case_study.php) ============ */
.cs-page { background: var(--v4-warm); font-family: var(--sans); color: var(--v4-ink); }
.cs-in { max-width: 1272px; margin: 0 auto; }
.cs-hero { padding: 160px 16px 48px; }
.cs-hero .cs-in { display: grid; gap: 18px; }
.cs-k { margin: 0; font-weight: 500; font-size: 12px; letter-spacing: 0.96px; text-transform: uppercase; color: var(--v4-quiet); }
.cs-h { margin: 0; max-width: 980px; font-weight: 400; font-size: clamp(36px, 4.2vw, 64px); line-height: 1.12; letter-spacing: -1.2px; }
.cs-sub { margin: 0; max-width: 640px; font-size: 18px; line-height: 27px; color: var(--v4-muted); }
.cs-list { padding: 0 16px 120px; }
.cs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cs-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 28px; background: #fff; color: var(--v4-ink); text-decoration: none; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.cs-card:hover { transform: translateY(-3px); box-shadow: 0 24px 48px -32px rgba(10, 17, 26, 0.35); }
.cs-photo { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #e9e6df; }
.cs-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.cs-card:hover .cs-photo img { transform: scale(1.03); }
.cs-chip { position: absolute; left: 16px; top: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); font-style: normal; font-weight: 500; font-size: 12px; line-height: 16px; }
.cs-panel { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 20px; background: var(--v4-panel); }
.cs-t { font-size: 22px; line-height: 30px; letter-spacing: -0.2px; }
.cs-spark { display: block; width: 100%; height: 72px; margin-top: auto; }
.cs-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid var(--v4-line); }
.cs-m { display: grid; gap: 2px; }
.cs-m b { font-weight: 500; font-size: 28px; line-height: 34px; letter-spacing: -0.42px; }
.cs-m span { font-size: 12px; line-height: 16px; color: var(--v4-quiet); }
.cs-go { font-weight: 500; font-size: 15px; white-space: nowrap; }
@media (max-width: 860px) {
  .cs-hero { padding: 120px 16px 32px; }
  .cs-grid { grid-template-columns: 1fr; gap: 16px; }
  .cs-card { padding: 14px; border-radius: 22px; }
  .cs-t { font-size: 19px; line-height: 26px; }
}

/* "How it works" step visuals (old homepage component reused on service/specialty pages) */
main .hiw-img-wrap { background: #fff !important; border: 0 !important; border-radius: 28px !important; padding: 20px !important; overflow: hidden; }
main .hiw-img-wrap > img, main .hiw-img-wrap .hiw-img { border-radius: 20px; }
main .hiw-step-num, main [class*="hiw-num"] { font-family: var(--sans); font-weight: 500; letter-spacing: 0.96px; }
main .hiw-img-wrap .hiw-story-frames, main .hiw-img-wrap .hiw-story-img { border-radius: 20px; overflow: hidden; }

/* ===== Homepage blocks reused on inner pages (inc/v4-blocks.php, css/home-lower.css) ===== */
/* results: wide card with the case photo, then two side by side */
.rs--inner .rs-head { display: grid; gap: 14px; max-width: 820px; }
.rs--inner .rs-h { font-weight: 300 !important; }
.rs-lede { margin: 0; font-family: var(--sans); font-size: 18px; line-height: 27px; color: var(--v4-muted); }
.rs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rs-card--wide { grid-column: 1 / -1; flex-direction: row; }
.rs-card--wide .rs-photo { flex: 0 0 48%; height: auto; min-height: 380px; }
.rs--inner .rs-card--small .rs-stats b { font-size: 24px; line-height: 30px; }
.rs--inner .rs-card--small .rs-t { font-size: 20px; line-height: 28px; }
@media (max-width: 860px) {
  .rs-list { grid-template-columns: minmax(0, 1fr); }
  .rs-card--wide { flex-direction: column; }
  .rs-card--wide .rs-photo { flex: none; min-height: 0; height: 240px; }
  .rs--inner .rs-stats b { font-size: 22px; line-height: 28px; }
}
/* practice report row on its own band */
.al--solo { background: #fff; padding: 56px 16px 72px; font-family: var(--sans); }
.al--solo .al-cta { margin-top: 0; }
@media (max-width: 860px) {
  .al--solo .al-cta { flex-direction: column; align-items: stretch; }
  .al--solo .al-search { width: 100%; }
}

/* How it works on service, specialty and agent pages: homepage system cards */
main #how-it-works.sv-hiw, main #how-it-works.sp-hiw { background: #faf8f3 !important; }
main #how-it-works.sv-hiw .hiw-inner, main #how-it-works.sp-hiw .hiw-inner { background: none !important; }
main #how-it-works.sv-hiw .hiw-step, main #how-it-works.sp-hiw .hiw-step {
  align-items: stretch; gap: 40px; min-height: 0;
  padding: 20px 20px 20px 48px !important; margin: 0 0 24px !important;
  border: 0 !important; border-radius: 28px; background: #fff;
}
main #how-it-works.sv-hiw .hiw-step:last-child, main #how-it-works.sp-hiw .hiw-step:last-child { margin-bottom: 0 !important; }
main #how-it-works.sv-hiw .hiw-step-reverse, main #how-it-works.sp-hiw .hiw-step-reverse { padding: 20px 48px 20px 20px !important; }
main #how-it-works.sv-hiw .hiw-text, main #how-it-works.sp-hiw .hiw-text { flex: 1 1 auto; max-width: none; padding: 28px 0; }
main #how-it-works.sv-hiw .hiw-img-wrap, main #how-it-works.sp-hiw .hiw-img-wrap {
  flex: 0 0 520px; max-width: 520px; width: 520px; aspect-ratio: 1 / 1; align-self: center;
  padding: 0 !important; background: #e9e6df !important; border-radius: 20px !important;
}
main #how-it-works.sv-hiw .hiw-img-wrap > .hiw-img, main #how-it-works.sp-hiw .hiw-img-wrap > .hiw-img,
main #how-it-works .hiw-img-wrap .hiw-story-frames { border-radius: 20px; }
@media (max-width: 1100px) {
  main #how-it-works.sv-hiw .hiw-img-wrap, main #how-it-works.sp-hiw .hiw-img-wrap { flex-basis: 44%; width: 44%; }
}
@media (max-width: 860px) {
  main #how-it-works.sv-hiw .hiw-step, main #how-it-works.sp-hiw .hiw-step,
  main #how-it-works.sv-hiw .hiw-step-reverse, main #how-it-works.sp-hiw .hiw-step-reverse { padding: 16px !important; gap: 20px; margin-bottom: 16px !important; }
  main #how-it-works.sv-hiw .hiw-img-wrap, main #how-it-works.sp-hiw .hiw-img-wrap { flex: none; width: 100%; max-width: 100%; min-height: 0; }
  main #how-it-works.sv-hiw .hiw-text, main #how-it-works.sp-hiw .hiw-text { padding: 8px 4px 0; }
}
main .rs.rs--inner { background: var(--v4-warm) !important; }
main .rs--inner .rs-card { background: #fff !important; }
main .rs--inner .rs-panel { background: var(--v4-panel) !important; }
main #how-it-works.sv-hiw .hiw-story-frames, main #how-it-works.sp-hiw .hiw-story-frames { inset: 0 !important; }
main #how-it-works.sv-hiw .hiw-img-wrap > .hiw-img, main #how-it-works.sp-hiw .hiw-img-wrap > .hiw-img { position: absolute; inset: 0 !important; width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
@media (max-width: 860px) { main .rs--inner .rs-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } main .rs--inner .rs-stats b { font-size: 20px; line-height: 26px; } }
#cta.cta { margin-top: 0 !important; }
main .al--solo + .eo { padding-top: 48px !important; }
