/* ════════════════════════════════════════════════════════
   CASESTUDY.CSS — Case Study Detail Accordion
   Assumes css/global.css already defines: .container,
   .section-dark, .section-light, .dot-grid-bg, .section-padding,
   .tag-pill, .btn-primary, .btn-secondary, .breadcrumb*,
   .fade-in-up, .text-center, --color-navy / --color-teal /
   --color-cloud and base typography. This file only adds
   the new "cd-" (case detail) components.
   ════════════════════════════════════════════════════════ */

/* ── Category accent colours ──────────────────────────────
   NOTE: I don't have your portfolio.css, so these are
   best-guess accents. If your cs-card__bar--* classes use
   different hex values, swap these to match exactly. */
:root {
  --cd-analytics: #00C9A7;
  --cd-bi: #3B82F6;
  --cd-visualisation: #A855F7;
  --cd-ml: #F59E0B;
  --cd-engineering: #475569;
}

/* ── Screen-reader-only utility (used for the section H2) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ════════════════════════════════════════════════════════
   CD1 · HERO
   ════════════════════════════════════════════════════════ */

.cd-hero__inner {
  padding-top: 48px;
  padding-bottom: 56px;
}

.cd-hero__content {
  max-width: 680px;
  margin: 0 auto;
}

.cd-hero__heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.15;
  margin-top: 20px;
}

.cd-hero__subheading {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 16px;
  line-height: 1.6;
}

.cd-hero__confidentiality {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.cd-hero__confidentiality i {
  color: var(--cd-analytics);
}

/* ════════════════════════════════════════════════════════
   CD2 · ACCORDION LIST
   ════════════════════════════════════════════════════════ */

.cd-accordion {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cd-item {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(15, 32, 64, 0.08);
  box-shadow: 0 2px 10px rgba(15, 32, 64, 0.04);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.cd-item--open {
  box-shadow: 0 10px 28px rgba(15, 32, 64, 0.10);
  border-color: rgba(15, 32, 64, 0.14);
}

.cd-item__heading-wrap {
  margin: 0;
}

/* ── Header (always visible / clickable) ──────────────── */

.cd-item__header {
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: inherit;
}

.cd-item__header:focus-visible {
  outline: 3px solid var(--cd-analytics);
  outline-offset: -3px;
}

.cd-item__bar {
  flex-shrink: 0;
  width: 6px;
}

.cd-item__bar--analytics    { background: var(--cd-analytics); }
.cd-item__bar--bi           { background: var(--cd-bi); }
.cd-item__bar--visualisation{ background: var(--cd-visualisation); }
.cd-item__bar--ml           { background: var(--cd-ml); }
.cd-item__bar--engineering  { background: var(--cd-engineering); }

.cd-item__summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  min-width: 0;
}

.cd-item__meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cd-item__industry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #5a6b85;
}

.cd-item__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #0f2040;
}

.cd-item__teaser {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: #5a6b85;
  line-height: 1.5;
}

.cd-item__chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  color: #5a6b85;
  transition: transform 0.3s ease, color 0.3s ease;
}

.cd-item__header[aria-expanded="true"] .cd-item__chevron {
  transform: rotate(180deg);
  color: var(--cd-analytics);
}

/* ── Panel (collapses/expands) ────────────────────────── */

.cd-item__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.cd-item__panel-inner {
  padding: 4px 20px 28px 26px;
}

.cd-item__details {
  margin: 8px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-item__detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cd-item__detail-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a6b85;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cd-item__detail-label--result {
  color: var(--cd-analytics);
}

.cd-item__detail-value {
  font-size: 0.95rem;
  color: #33415c;
  line-height: 1.55;
  margin: 0;
}

.cd-item__detail-value--result {
  font-weight: 500;
  color: #0f2040;
}

.cd-item__section {
  margin-bottom: 20px;
}

.cd-item__section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: #0f2040;
  margin-bottom: 10px;
}

.cd-item__steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-item__steps li {
  font-size: 0.92rem;
  color: #33415c;
  line-height: 1.55;
}

.cd-item__tool-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cd-item__tool-pill {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 32, 64, 0.05);
  color: #33415c;
  white-space: nowrap;
}

.cd-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 32, 64, 0.08);
}

.cd-item__outcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f2040;
  background: rgba(0, 201, 167, 0.10);
  padding: 7px 14px;
  border-radius: 999px;
}

.cd-item__outcome-pill i {
  color: var(--cd-analytics);
}

/* ── Highlight glow for deep-linked / auto-opened item ──── */

.cd-item--highlight {
  animation: cdGlow 1.6s ease;
}

@keyframes cdGlow {
  0%   { box-shadow: 0 0 0 0 rgba(0, 201, 167, 0.55); }
  30%  { box-shadow: 0 0 0 6px rgba(0, 201, 167, 0.25); }
  100% { box-shadow: 0 10px 28px rgba(15, 32, 64, 0.10); }
}

/* ── Bottom CTA row ────────────────────────────────────── */

.cd-list__cta {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .cd-item__summary {
    padding: 18px 14px;
  }
  .cd-item__chevron {
    width: 40px;
  }
  .cd-item__panel-inner {
    padding: 4px 14px 22px 20px;
  }
  .cd-item__footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ════════════════════════════════════════════════════════
   REDUCED MOTION
   ════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .cd-item__panel {
    transition: none;
  }
  .cd-item__chevron {
    transition: none;
  }
  .cd-item--highlight {
    animation: none;
    box-shadow: 0 0 0 3px rgba(0, 201, 167, 0.45);
  }
}