/* Case study single view. Loaded only on posts in the Case Studies category.
   Tokens (--cyan, --muted, --border …) come from spectrum.css via .ac-page. */

.ac-cs-main {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 140px 24px 0;
}

/* Astra ships `.ast-separate-container #primary { margin: 4em 0 }`. That
   shorthand zeroes the left/right auto margins this template centres with, and
   its selector (class + id) outranks .ac-cs-main on its own. Re-assert the
   centring at higher specificity — same override approach as doc.css. */
body.ac-cs #primary.ac-cs-main {
  float: none;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 140px 24px 0;
  border: 0;
  background: transparent;
}

/* ── HERO ── */
.ac-cs-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.2s, gap 0.2s;
}
.ac-cs-back:hover { color: var(--cyan); gap: 10px; }

.ac-cs-title {
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text) !important;
  margin: 10px 0 20px;
}

.ac-cs-summary {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 32px;
}

/* Hero fact row — client / industry / timeline */
.ac-cs-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ac-cs-fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1 1 140px;
}
.ac-cs-fact-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}
.ac-cs-fact-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

/* Stack chips */
.ac-cs-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.ac-cs-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 9999px;
  padding: 5px 12px;
  line-height: 1;
}

/* ── COVER IMAGE ── */
.ac-cs-cover {
  margin: 48px 0 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.ac-cs-cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── RESULTS STRIP ── */
.ac-cs-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 48px 0 8px;
}
.ac-cs-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: border-color 0.25s, transform 0.25s;
}
.ac-cs-metric:hover {
  border-color: rgba(6, 182, 212, 0.28);
  transform: translateY(-3px);
}
.ac-cs-metric-value {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--cyan);
  margin-bottom: 8px;
}
.ac-cs-metric-label {
  display: block;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ── BODY COPY ── */
.ac-cs-body {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 52px;
}
.ac-cs-body > *:first-child { margin-top: 0; }

.ac-cs-body h2 {
  font-family: 'Space Grotesk', sans-serif !important;
  color: var(--text) !important;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.ac-cs-body h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.ac-cs-body h3 {
  font-family: 'Space Grotesk', sans-serif !important;
  color: var(--text) !important;
  font-size: 1.12rem;
  margin: 2rem 0 0.6rem;
}

.ac-cs-body p { margin: 0 0 1.15rem; }
.ac-cs-body strong { color: var(--text); font-weight: 600; }
.ac-cs-body em { color: var(--subtle); }

.ac-cs-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.ac-cs-body a:hover { text-decoration: none; }

.ac-cs-body ul,
.ac-cs-body ol { margin: 0 0 1.4rem; padding-left: 1.3em; }
.ac-cs-body li { margin: 0.5em 0; }
.ac-cs-body li::marker { color: var(--cyan); }

.ac-cs-body img,
.ac-cs-body .wp-block-image img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ac-cs-body figure { margin: 2rem 0; }
.ac-cs-body figcaption {
  font-size: 0.78rem;
  color: var(--subtle);
  text-align: center;
  margin-top: 10px;
}

/* Pull quote — the client's own words */
.ac-cs-body blockquote {
  margin: 2.2rem 0;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 0 12px 12px 0;
}
.ac-cs-body blockquote p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 0.6rem;
}
.ac-cs-body blockquote cite,
.ac-cs-body blockquote .wp-block-quote__citation {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-style: normal;
  color: var(--subtle);
}

.ac-cs-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--text);
}
.ac-cs-body pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 1.8rem 0;
}
.ac-cs-body pre code { background: none; border: 0; padding: 0; }

.ac-cs-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.6rem 0;
}

.ac-cs-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.88rem;
}
.ac-cs-body th,
.ac-cs-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.ac-cs-body th { color: var(--text); background: var(--surface); font-weight: 600; }

/* ── VISIT LIVE SITE ── */
.ac-cs-visit { margin: 40px 0 0; }

/* ── CTA ── */
.ac-cs-cta {
  margin: 64px 0 0;
  padding: 44px 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.ac-cs-cta-title {
  font-family: 'Space Grotesk', sans-serif !important;
  color: var(--text) !important;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.25;
  margin: 0 0 10px;
}
.ac-cs-cta-text {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 440px;
  margin-inline: auto;
}

/* ── NEXT CASE STUDY ── */
.ac-cs-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 0;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s;
}
.ac-cs-next:hover {
  border-color: rgba(6, 182, 212, 0.28);
  transform: translateY(-3px);
}
.ac-cs-next-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ac-cs-next-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}
.ac-cs-next-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.ac-cs-next-thumb {
  flex: 0 0 auto;
  width: 88px;
  height: 60px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.ac-cs-next-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Footer sits directly under the article; give it breathing room. */
.ac-cs-main + .ac-footer,
.ac-cs .ac-footer { margin-top: 80px; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .ac-cs-main,
  body.ac-cs #primary.ac-cs-main { padding: 108px 18px 0; }
  .ac-cs-facts { gap: 18px; }
  .ac-cs-fact { flex: 1 1 100%; }
  .ac-cs-metrics { grid-template-columns: 1fr; }
  .ac-cs-cta { padding: 34px 20px; }
  .ac-cs-next-thumb { display: none; }
}
