/* =========================================================================
 * Hilson Designs · Case Study Template Stylesheet
 * Class prefix: .hd-cs__*  (safe namespace — won't collide with theme/BB/plugins)
 *
 * Pairs with:
 *   - ACF field group: build/acf-case-study-fields.json
 *   - Themer markup:  build/themer-layout.html
 *   - Font enqueue:   build/functions-snippet.php
 *
 * Load this file AFTER the theme stylesheet (the functions.php snippet
 * handles that via wp_enqueue_style with the theme handle as a dependency).
 * ========================================================================= */

/* ---- Design tokens ----------------------------------------------------- */
:root {
  --hdcs-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --hdcs-sans:  'Manrope', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --hdcs-mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --hdcs-bg:        #ffffff;            /* body background — matches live site */
  --hdcs-card:      #fafafa;            /* See-the-Work card */
  --hdcs-card-warm: #f5f5f5;            /* avatar circle bg — matches footer */
  --hdcs-ink:       #1a1a1f;
  --hdcs-ink-soft:  rgba(26,26,31,0.66);
  --hdcs-ink-mute:  rgba(26,26,31,0.50);
  --hdcs-rule:      rgba(26,26,31,0.12);

  --hdcs-brand:      #1a98ce;           /* Hilson header blue */
  --hdcs-brand-deep: #0f6e96;
  --hdcs-cta:        #ff6000;           /* Hilson CTA orange — Sign In match */
  --hdcs-cta-hover:  #e85700;

  --hdcs-pad: 96px;                     /* outer horizontal padding */
  --hdcs-max: 1280px;                   /* content max-width */
}

/* ---- Wrapper ----------------------------------------------------------- */
.hd-cs {
  background: var(--hdcs-bg);
  color: var(--hdcs-ink);
  font-family: var(--hdcs-sans);
  max-width: var(--hdcs-max);
  margin: 0 auto;
}
.hd-cs * { box-sizing: border-box; }
.hd-cs :where(p) { margin: 0; }
.hd-cs :where(ol, ul) { list-style: none; margin: 0; padding: 0; }
.hd-cs a { color: inherit; text-decoration: none; }

/* ---- Utility text classes --------------------------------------------- */
.hd-cs__mono {
  font-family: var(--hdcs-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hdcs-ink-soft);
}
.hd-cs__rule {
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--hdcs-brand);
  margin-right: 12px;
  vertical-align: middle;
}

/* ============== 1. HERO ================================================= */
.hd-cs__hero {
  padding: 96px var(--hdcs-pad) 0;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: end;
}
.hd-cs__hero-text { padding-bottom: 24px; }
.hd-cs__eyebrow { margin-bottom: 28px; display: flex; align-items: center; gap: 12px; }
.hd-cs__title {
  font-family: var(--hdcs-sans);
  font-weight: 700;
  font-size: 92px;
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--hdcs-ink);
}
.hd-cs__subtitle {
  font-family: var(--hdcs-sans);
  font-size: 20px;
  line-height: 1.5;
  color: var(--hdcs-ink-soft);
  margin: 32px 0 0;
  max-width: 560px;
  text-wrap: pretty;
}
.hd-cs__hero-image { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; display: block; }

/* ============== 2. META STRIP ========================================== */
.hd-cs__meta {
  padding: 64px var(--hdcs-pad) 80px;
}
.hd-cs__meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--hdcs-rule);
  border-bottom: 1px solid var(--hdcs-rule);
}
.hd-cs__meta-label { /* uses .hd-cs__mono */ }
.hd-cs__meta-value {
  font-family: var(--hdcs-serif);
  font-size: 19px;
  line-height: 1.35;
  margin-top: 10px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--hdcs-ink);
  text-wrap: pretty;
}

/* ============== 3. THE CLIENT ========================================== */
.hd-cs__client {
  padding: 0 var(--hdcs-pad) 96px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: baseline;
}
.hd-cs__client-label { padding-top: 8px; }
.hd-cs__client-body { max-width: 820px; }
.hd-cs__client-lead {
  font-family: var(--hdcs-serif);
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--hdcs-ink);
  font-weight: 400;
  text-wrap: pretty;
}
.hd-cs__client-rest {
  font-size: 18px;
  line-height: 1.6;
  color: var(--hdcs-ink-soft);
  margin-top: 24px;
  text-wrap: pretty;
}

/* ============== Recurring numbered section head ======================== */
.hd-cs__section { padding: 0 var(--hdcs-pad) 96px; }
.hd-cs__section-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: baseline;
  padding-bottom: 36px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--hdcs-rule);
}
.hd-cs__section-num {
  font-family: var(--hdcs-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 160px;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--hdcs-brand);
}
.hd-cs__section-eyebrow { margin-bottom: 14px; /* uses .hd-cs__mono */ }
.hd-cs__section-title {
  font-family: var(--hdcs-sans);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--hdcs-ink);
}
.hd-cs__section-title em {
  font-family: var(--hdcs-serif);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.02em;
}

/* ============== 4. THE CHALLENGE ======================================= */
.hd-cs__challenge-intro {
  font-size: 20px;
  line-height: 1.55;
  color: var(--hdcs-ink-soft);
  margin-bottom: 48px;
  max-width: 820px;
  text-wrap: pretty;
}
.hd-cs__challenge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hdcs-rule);
  border: 1px solid var(--hdcs-rule);
}
.hd-cs__challenge-card {
  background: var(--hdcs-bg);
  padding: 36px 32px;
  display: flex;
  gap: 24px;
}
.hd-cs__challenge-num {
  font-family: var(--hdcs-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--hdcs-brand);
  min-width: 60px;
  flex-shrink: 0;
}
.hd-cs__challenge-text {
  font-size: 17px;
  line-height: 1.5;
  color: var(--hdcs-ink);
  text-wrap: pretty;
}

/* ============== 5. WHAT WE BUILT ======================================= */
.hd-cs__built-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--hdcs-rule);
  align-items: baseline;
}
.hd-cs__built-item:last-child {
  border-bottom: 1px solid var(--hdcs-rule);
}
.hd-cs__built-num {
  font-family: var(--hdcs-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--hdcs-brand);
}
.hd-cs__built-text {
  font-size: 19px;
  line-height: 1.5;
  color: var(--hdcs-ink);
  max-width: 820px;
  text-wrap: pretty;
}

/* ============== 6. THE RESULT ========================================== */
.hd-cs__result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.hd-cs__result-para {
  font-size: 18px;
  line-height: 1.6;
  color: var(--hdcs-ink-soft);
  text-wrap: pretty;
}

/* ============== 7. TESTIMONIAL ========================================= */
.hd-cs__testimonial {
  padding: 120px var(--hdcs-pad);
  border-top: 1px solid var(--hdcs-rule);
  border-bottom: 1px solid var(--hdcs-rule);
  position: relative;
}
.hd-cs__testimonial-inner { position: relative; }
.hd-cs__quote-mark {
  position: absolute;
  top: -64px;
  left: -28px;
  font-family: var(--hdcs-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 220px;
  line-height: 1;
  color: var(--hdcs-brand);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}
.hd-cs__quote-label {
  margin-bottom: 28px;
  position: relative;
}
.hd-cs__quote {
  font-family: var(--hdcs-serif);
  font-weight: 300;
  font-size: 42px;
  line-height: 1.24;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 980px;
  position: relative;
  color: var(--hdcs-ink);
}
.hd-cs__quote-attrib {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hd-cs__quote-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--hdcs-card-warm);
  border: 1px solid var(--hdcs-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.hd-cs__quote-avatar-initials {
  font-family: var(--hdcs-serif);
  font-style: italic;
  color: var(--hdcs-brand);
  font-size: 22px;
  line-height: 1;
}
.hd-cs__quote-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.hd-cs__quote-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--hdcs-ink);
}
.hd-cs__quote-role {
  margin-top: 4px;
  /* uses .hd-cs__mono */
}

/* ============== 8. SEE THE WORK ======================================== */
.hd-cs__see-work { padding: 64px var(--hdcs-pad) 32px; }
.hd-cs__see-work-label { margin-bottom: 20px; }
.hd-cs__see-work-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 40px 48px;
  background: var(--hdcs-card);
  border: 1px solid var(--hdcs-rule);
  color: var(--hdcs-ink);
  transition: background 0.2s, border-color 0.2s;
}
.hd-cs__see-work-card:hover {
  background: #fff;
  border-color: var(--hdcs-brand);
}
.hd-cs__see-work-mini { /* mono */ }
.hd-cs__see-work-url {
  font-family: var(--hdcs-sans);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.05;
  margin-top: 12px;
  letter-spacing: -0.025em;
}
.hd-cs__see-work-arrow {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--hdcs-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}
.hd-cs__see-work-card:hover .hd-cs__see-work-arrow {
  background: var(--hdcs-brand-deep);
  transform: translate(2px, -2px);
}

/* ============== 9. CARE PLAN CTA ======================================= */
.hd-cs__cta { padding: 32px var(--hdcs-pad) 96px; }
.hd-cs__cta-card {
  padding: 72px 56px;
  background: var(--hdcs-ink);
  color: #f5f1ea;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}
.hd-cs__cta-eyebrow {
  font-family: var(--hdcs-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,241,234,0.6);
}
.hd-cs__cta-heading {
  font-family: var(--hdcs-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  margin: 14px 0 0;
  letter-spacing: -0.02em;
  color: #f5f1ea;
}
.hd-cs__cta-body {
  color: rgba(245,241,234,0.7);
  font-size: 16px;
  line-height: 1.6;
  margin: 18px 0 0;
  max-width: 540px;
  text-wrap: pretty;
}
.hd-cs__cta-contact {
  margin-top: 28px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--hdcs-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,241,234,0.6);
}
.hd-cs__cta-buttons { display: flex; flex-direction: column; gap: 12px; }
.hd-cs__cta-primary,
.hd-cs__cta-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-family: var(--hdcs-sans);
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.hd-cs__cta-primary {
  background: var(--hdcs-cta);
  color: #fff;
}
.hd-cs__cta-primary:hover { background: var(--hdcs-cta-hover); }
.hd-cs__cta-secondary {
  background: transparent;
  color: #f5f1ea;
  border: 1px solid rgba(245,241,234,0.3);
}
.hd-cs__cta-secondary:hover {
  border-color: #f5f1ea;
  background: rgba(245,241,234,0.05);
}

/* ============== SPECIFICITY BOOST ======================================
 * The Ascension/Primer theme (and WordPress core) set paragraph margins
 * via selectors like `.entry-content p` (specificity 0,1,1). Our single-
 * class rules above (0,1,0) lose to those. The :where() wrapper on the
 * reset isn't enough — we need our spacing rules to win too.
 *
 * Re-declaring the spacing here with a chained `.hd-cs` parent class
 * pushes specificity to (0,2,0), which beats `.entry-content p` cleanly.
 * If a future theme override is even more specific, double the prefix:
 *   .hd-cs.hd-cs .hd-cs__subtitle  (specificity 0,3,0)
 * ======================================================================= */
.hd-cs .hd-cs__subtitle       { margin: 32px 0 0; }
.hd-cs .hd-cs__client-lead    { margin: 0; }
.hd-cs .hd-cs__client-rest    { margin: 24px 0 0; }
.hd-cs .hd-cs__challenge-intro{ margin: 0 0 48px; }
.hd-cs .hd-cs__challenge-text { margin: 0; }
.hd-cs .hd-cs__built-text     { margin: 0; }
.hd-cs .hd-cs__result-para    { margin: 0; }
.hd-cs .hd-cs__quote          { margin: 0; }
.hd-cs .hd-cs__quote-name     { margin: 0; }
.hd-cs .hd-cs__quote-role     { margin: 4px 0 0; }
.hd-cs .hd-cs__see-work-mini  { margin: 0; }
.hd-cs .hd-cs__see-work-url   { margin: 12px 0 0; }
.hd-cs .hd-cs__cta-eyebrow    { margin: 0; }
.hd-cs .hd-cs__cta-heading    { margin: 14px 0 0; }
.hd-cs .hd-cs__cta-body       { margin: 18px 0 0; }

/* ============== RESPONSIVE ============================================= */
@media (max-width: 1024px) {
  :root { --hdcs-pad: 64px; }
  .hd-cs__title { font-size: 72px; }
  .hd-cs__section-num { font-size: 130px; }
  .hd-cs__section-title { font-size: 42px; }
  .hd-cs__quote { font-size: 34px; }
  .hd-cs__see-work-url { font-size: 32px; }
  .hd-cs__cta-heading { font-size: 32px; }
}

@media (max-width: 780px) {
  :root { --hdcs-pad: 32px; }

  .hd-cs__hero {
    grid-template-columns: 1fr;
    padding-top: 64px;
    gap: 40px;
  }
  .hd-cs__title { font-size: 52px; }
  .hd-cs__subtitle { font-size: 17px; }

  .hd-cs__meta { padding: 48px var(--hdcs-pad) 48px; }
  .hd-cs__meta-grid { grid-template-columns: 1fr; gap: 24px; }

  .hd-cs__client { grid-template-columns: 1fr; gap: 16px; padding-bottom: 64px; }
  .hd-cs__client-lead { font-size: 21px; }

  .hd-cs__section { padding-bottom: 64px; }
  .hd-cs__section-head { grid-template-columns: 1fr; gap: 8px; }
  .hd-cs__section-num { font-size: 88px; }
  .hd-cs__section-title { font-size: 32px; }

  .hd-cs__challenge-grid { grid-template-columns: 1fr; }
  .hd-cs__challenge-card { padding: 28px 24px; gap: 16px; }
  .hd-cs__challenge-num { font-size: 36px; min-width: 44px; }

  .hd-cs__built-item { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .hd-cs__built-num { font-size: 40px; }
  .hd-cs__built-text { font-size: 17px; }

  .hd-cs__result-grid { grid-template-columns: 1fr; gap: 20px; }

  .hd-cs__testimonial { padding: 72px var(--hdcs-pad); }
  .hd-cs__quote { font-size: 26px; }
  .hd-cs__quote-mark { font-size: 140px; top: -32px; left: -12px; }

  .hd-cs__see-work-card { grid-template-columns: 1fr; padding: 28px 24px; gap: 20px; }
  .hd-cs__see-work-url { font-size: 24px; }
  .hd-cs__see-work-arrow { width: 48px; height: 48px; font-size: 20px; }

  .hd-cs__cta-card { grid-template-columns: 1fr; padding: 48px 28px; gap: 32px; }
  .hd-cs__cta-heading { font-size: 26px; }
}
