/* ==========================================================================
   CM-SERVICE.CSS — Components specific to CM Service pages
   (CNC Milling, Turning, Wire EDM, Sheet Metal, Surface Finishing,
    Engineering Support)
   Loaded ONLY on /contract-manufacturing/[service]/ pages.
   Builds on top of styles.css + cm-home.css.
   Personality: capabilities-first, structured, technical spec sheet.
   Distinct from cm-industry.css (which is editorial/asymmetric).
   ========================================================================== */


/* ==========================================================================
   1. SERVICE HERO — Structured, capability-forward
   No big editorial italic. No 4:5 image. Capabilities visible above the fold.
   ========================================================================== */

.service-hero {
  position: relative;
  padding: calc(var(--top-offset, 136px) + var(--space-2xl)) 0 var(--space-3xl);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.service-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(160deg, var(--teal-dark) 0%, var(--teal) 60%, var(--teal-light) 100%);
}

.service-hero__bg::before {
  /* Technical blueprint grid — denser than industry hero */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.7;
}

.service-hero__bg::after {
  /* Coral diagonal stripe — different angle than industry */
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--coral);
}

/* --- Hero Photo Overlay System (matches cm-hero__photo) --- */
/* Usage: add .service-hero--with-photo on the section + .service-hero__photo inside */
.service-hero__photo {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}
.service-hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service-hero--with-photo .service-hero__bg {
  background: linear-gradient(160deg, rgba(26, 63, 66, 0.88) 0%, rgba(35, 85, 90, 0.72) 60%, rgba(35, 85, 90, 0.55) 100%);
}

.service-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
  width: 100%;
}

/* Breadcrumb uses the global .breadcrumb system; this only sets hero spacing */
.service-hero .breadcrumb {
  margin-top: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.service-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-on-dark);   /* #19 AA: coral fails on the teal-light end of the hero gradient -> lime (site-wide accent-on-dark rule) */
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
}

.service-hero__eyebrow::before {
  content: "[";
  color: var(--coral);
  opacity: 0.6;
}
.service-hero__eyebrow::after {
  content: "]";
  color: var(--coral);
  opacity: 0.6;
}

.service-hero h1 {
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-md);
  color: #fff;
  max-width: 900px;
}

.service-hero__sub {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--space-2xl);
  max-width: 720px;
}

.service-hero__sub strong { color: #fff; font-weight: 700; }

/* CAPABILITIES STRIP — the key above-the-fold element */
.service-hero__capabilities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-top: var(--space-2xl);
  padding: var(--space-lg) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.service-hero__cap {
  padding: var(--space-sm) var(--space-lg);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.service-hero__cap:last-child {
  border-right: none;
}

@media (max-width: 720px) {
  .service-hero__cap {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-md) 0;
  }
  .service-hero__cap:last-child { border-bottom: none; }
}

.service-hero__cap-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-on-dark);   /* #19 AA: coral on the teal hero strip fails (~3:1) -> lime */
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.service-hero__cap-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.service-hero__ctas {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-xl);
}


/* ==========================================================================
   2. SECTION INTRO (service-flavored)
   Tighter than industry, more direct
   ========================================================================== */

.service-section-intro {
  margin: 0 auto var(--space-2xl);
  max-width: 760px;
}

.service-section-intro--center { text-align: center; }

.service-section-intro__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-on-light);   /* #19 AA: coral on light fails (2.65-2.87:1) -> teal; mono '//' look kept */
  margin-bottom: var(--space-sm);
}

.service-section-intro__eyebrow::before {
  content: "// ";
  opacity: 0.6;
}

.service-section-intro h2 {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--teal);
  margin: 0 0 var(--space-md);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.service-section-intro p {
  font-size: var(--text-base);
  line-height: 1.6;
  color: rgba(35, 85, 90, 0.85);
  margin: 0;
}


/* ==========================================================================
   3. CAPABILITIES MATRIX — The key spec table
   Multi-column technical sheet, not editorial cards
   ========================================================================== */

.spec-matrix {
  background: #fff;
  border: 1px solid rgba(35, 85, 90, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(35, 85, 90, 0.05);
}

.spec-matrix__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid rgba(35, 85, 90, 0.08);
}

.spec-matrix__row:last-child {
  border-bottom: none;
}

@media (max-width: 720px) {
  .spec-matrix__row {
    grid-template-columns: 1fr;
  }
}

.spec-matrix__label {
  background: var(--off-white);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  display: flex;
  align-items: center;
  border-right: 3px solid var(--coral);
}

@media (max-width: 720px) {
  .spec-matrix__label {
    border-right: none;
    border-bottom: 2px solid var(--coral);
  }
}

.spec-matrix__value {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-base);
  color: var(--teal);
  line-height: 1.5;
}

.spec-matrix__value strong {
  color: var(--accent-on-light);   /* #19 AA: coral on white spec sheet fails (2.87:1) -> teal; bold+mono keeps emphasis */
  font-weight: 900;
  font-family: var(--font-mono);
}

.spec-matrix__value-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.spec-matrix__chip {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(35, 85, 90, 0.08);
  color: var(--teal);
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

.spec-matrix__chip--primary {
  background: var(--coral);
  color: #fff;
}

/* Inline annotation next to a highlighted value (e.g. "preferred", "max capability") */
.spec-matrix__note {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  background: rgba(237, 131, 94, 0.12);
  color: var(--accent-on-light);   /* #19 AA: coral on coral-tint fails (2.58:1) -> teal */
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 3px;
  vertical-align: middle;
  white-space: nowrap;
}


/* ==========================================================================
   4. WHAT WE MAKE — Compact bento grid (different from industry storyboard)
   Icons + short label + 1-line desc. Visual but compact.
   ========================================================================== */

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.parts-grid__cell {
  background: #fff;
  border: 1px solid rgba(35, 85, 90, 0.1);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.parts-grid__cell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--coral);
  transition: width 0.25s ease;
}

.parts-grid__cell:hover {
  border-color: var(--coral);
  transform: translateY(-2px);
}

.parts-grid__cell:hover::before {
  width: 100%;
}

.parts-grid__icon {
  width: 32px;
  height: 32px;
  color: var(--coral);
  margin-bottom: var(--space-md);
}

.parts-grid__title {
  font-size: var(--text-base);
  font-weight: 900;
  color: var(--teal);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.parts-grid__desc {
  font-size: var(--text-sm);
  color: var(--text-body);   /* founder pref: max legibility (~10:1) over muted teal */
  line-height: 1.4;
  margin: 0;
}

/* --- Bento variant: 1 hero (2 rows tall) + 6 standard, in 3 columns --- */
.parts-grid--bento {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: row dense;
  gap: var(--space-md);
}

.parts-grid--bento .parts-grid__cell--hero {
  grid-row: span 2;
  background: linear-gradient(135deg, var(--teal) 0%, var(--deep-blue) 100%);   /* #16 AA: teal-light end made lime tag (3.37:1) + on-cell text fail; deep-blue end clears AA at every gradient position */
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}

.parts-grid--bento .parts-grid__cell--hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, transparent 50%, var(--coral) 50%);
  z-index: 0;
}

.parts-grid--bento .parts-grid__cell--hero > * {
  position: relative;
  z-index: 1;
}

.parts-grid--bento .parts-grid__cell--hero::before {
  width: 0; /* override the small coral bar — we use the corner accent instead */
}

.parts-grid--bento .parts-grid__cell--hero:hover {
  border-color: transparent;
  transform: translateY(-2px);
}

.parts-grid--bento .parts-grid__cell--hero .parts-grid__icon {
  color: var(--coral);
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-lg);
}

.parts-grid--bento .parts-grid__cell--hero .parts-grid__title {
  color: #fff;
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.parts-grid--bento .parts-grid__cell--hero .parts-grid__desc {
  color: rgba(255, 255, 255, 0.95);   /* #16 AA: was 0.85 (4.46:1) -> 0.95 on the darkened cell */
  font-size: var(--text-base);
  line-height: 1.55;
}

.parts-grid--bento .parts-grid__cell--hero .parts-grid__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-on-dark);   /* #19 AA: coral on teal bento hero cell fails -> lime */
  margin-bottom: var(--space-sm);
}

@media (max-width: 720px) {
  .parts-grid--bento {
    grid-template-columns: 1fr;
  }
  .parts-grid--bento .parts-grid__cell--hero {
    grid-row: auto;
  }
}


/* ==========================================================================
   5. PROCESS STEPS — Compact, secondary (not protagonist like industry storyboard)
   Horizontal numbered flow
   ========================================================================== */

.process-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  background: #fff;
  border: 1px solid rgba(35, 85, 90, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.process-flow__step {
  padding: var(--space-xl) var(--space-lg);
  border-right: 1px solid rgba(35, 85, 90, 0.08);
  position: relative;
}

.process-flow__step:last-child {
  border-right: none;
}

@media (max-width: 720px) {
  .process-flow__step {
    border-right: none;
    border-bottom: 1px solid rgba(35, 85, 90, 0.08);
  }
  .process-flow__step:last-child { border-bottom: none; }
}

.process-flow__num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--accent-on-light);   /* #19 AA: coral on coral-tint pill fails (2.62:1) -> teal */
  background: rgba(237, 131, 94, 0.1);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: var(--space-md);
}

.process-flow__title {
  font-size: var(--text-base);
  font-weight: 900;
  color: var(--teal);
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.01em;
}

.process-flow__desc {
  font-size: var(--text-sm);
  color: var(--text-body);   /* founder pref: max legibility (~10:1) over muted teal */
  line-height: 1.5;
  margin: 0;
}


/* ==========================================================================
   6. MATERIALS COMPATIBILITY — Clean two-column list, family + grades per row
   ========================================================================== */

.materials-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 880px) {
  .materials-strip {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

.materials-strip__col {
  background: #fff;
  border: 1px solid rgba(35, 85, 90, 0.1);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
}

.materials-strip__col-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--coral);
}

.materials-strip__col-title {
  font-size: var(--text-base);
  font-weight: 900;
  color: var(--teal);
  margin: 0;
  letter-spacing: -0.01em;
}

.materials-strip__col-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-on-light);   /* #19 AA: coral on white fails (2.87:1) -> teal */
}

.materials-strip__rows {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.materials-strip__row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px dashed rgba(35, 85, 90, 0.1);
  align-items: baseline;
}

.materials-strip__row:last-child {
  border-bottom: none;
}

@media (max-width: 480px) {
  .materials-strip__row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: var(--space-sm) 0;
  }
}

.materials-strip__family {
  font-size: var(--text-sm);
  font-weight: 900;
  color: var(--teal);
  letter-spacing: -0.005em;
}

.materials-strip__grades {
  font-size: var(--text-sm);
  color: var(--text-body);   /* founder pref: max legibility (~10:1) over muted teal */
  line-height: 1.5;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.materials-strip__footer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(35, 85, 90, 0.08);
}

.materials-strip__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--accent-on-light);   /* #19 AA: coral link on white fails (2.87:1) -> teal */
  font-weight: 700;
  text-decoration: none;
  transition: gap 0.2s ease;
}

.materials-strip__link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.materials-strip__link:hover::after {
  transform: translateX(3px);
}


/* ==========================================================================
   7. INDUSTRY USAGE STRIP — Horizontal "used by" cross-link
   ========================================================================== */

.industry-usage {
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-2xl);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

@media (min-width: 880px) {
  .industry-usage {
    grid-template-columns: 1fr 2fr;
  }
}

.industry-usage__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-on-dark);   /* #19 AA: coral on teal panel fails (2.61:1) -> lime (4.62:1) */
  margin-bottom: var(--space-sm);
  display: block;
}

.industry-usage__title {
  font-size: var(--text-xl);
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.01em;
  color: #fff;
}

.industry-usage__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.industry-usage__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.industry-usage__pill:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--on-accent);   /* ink — white on coral fails AA (2.87:1), ink = 6.07:1 */
}

.industry-usage__pill::after {
  content: "→";
  opacity: 0.6;
  font-weight: 400;
}


/* ==========================================================================
   8. HERO IMAGE — Optional small floating image (only 1 placeholder per page)
   ========================================================================== */

.service-hero__image {
  margin-top: var(--space-2xl);
}

.service-hero__image .img-ph {
  /* cm-industry.css was removed 2026-06-10; these placeholder styles are
     self-contained and do not depend on industry CSS. */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
  padding: var(--space-2xl);
  color: rgba(255, 255, 255, 0.6);
  aspect-ratio: 21 / 9;
  min-height: 240px;
}

/* Reusable image placeholder for service pages (self-contained; cm-industry.css removed 2026-06-10) */
.service-img-ph {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
  padding: var(--space-xl);
  isolation: isolate;
  aspect-ratio: 16 / 9;
  min-height: 280px;
}

.service-img-ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: -1;
}

.service-img-ph::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, transparent 50%, var(--coral) 50%);
  z-index: -1;
}

.service-img-ph__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.85;
}

.service-img-ph__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-on-dark);   /* #19 AA: coral on teal image placeholder -> lime */
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
}

.service-img-ph__caption {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
  max-width: 480px;
  line-height: 1.4;
}

.service-img-ph__dim {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-md);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}


/* ==========================================================================
   9. SECTION SPACING & CTA
   ========================================================================== */

.section--service {
  padding: var(--space-4xl) 0;
}

.section--service-tight {
  padding: var(--space-3xl) 0;
}

.service-cta {
  background: var(--teal-dark);
  color: #fff;
  padding: var(--space-4xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.service-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
}

.service-cta__container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.service-cta__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-on-dark);   /* #19 AA: coral on teal-dark CTA fails (3.62:1) -> lime */
  margin-bottom: var(--space-md);
  display: block;
}

.service-cta h2 {
  font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.5rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 var(--space-md);
  letter-spacing: -0.025em;
}

.service-cta p {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.85);
  margin: 0 auto var(--space-xl);
  max-width: 560px;
  line-height: 1.6;
}

.service-cta__ctas {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.service-cta__small {
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
  .service-hero { padding: calc(var(--top-offset, 128px) + var(--space-xl)) 0 var(--space-2xl); }
  .service-hero__capabilities { grid-template-columns: 1fr 1fr; }
}
