/* ==========================================================================
   The Measurement Lab — Services
   Lifted from the inline styles in the Claude Design output's Services
   template. Section padding is per-section by design and preserved.
   ========================================================================== */

/* Page-scope container override. Services is 1180/40 where Home is 1200/44 —
   a real per-page difference in the design, not drift, so both are kept. */
.tml-page-services {
  --container-max: 1180px;
  --gutter: 40px;
}

/* ============ PAGE INTRO ================================================= */
.tml-svc-intro { padding: 152px 0 56px; }
.tml-svc-intro-inner { max-width: 760px; }
.tml-svc-intro .tml-eyebrow {
  display: block;
  font-size: var(--fs-sm);
  letter-spacing: 0.16em;
  margin-bottom: 20px;
}
.tml-svc-intro h1 {
  font-size: var(--fs-display-9);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  color: var(--tml-dark);
}
.tml-svc-intro p {
  font-size: var(--fs-2xl);
  line-height: 1.6;
  color: var(--ui-text);
}

/* ============ STAGE SECTIONS ============================================= */
.tml-svc-section { padding: 48px 0; }
.tml-svc-section--last { padding-bottom: 96px; }

.tml-svc-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  border-bottom: 2px solid var(--ui-divider);
  padding-bottom: 20px;
  margin-bottom: 28px;
}
/* Stage numeral. Color comes from --stage so each section declares its
   accent once. Decision Systems is terracotta deliberately — the "arrival"
   accent on the most-mature stage. */
.tml-svc-num {
  font-size: var(--fs-display-6);
  font-weight: var(--weight-bold);
  color: var(--stage);
  line-height: 1;
}
.tml-svc-name {
  font-size: var(--fs-display-2);
  font-weight: var(--weight-bold);
  color: var(--tml-dark);
}
.tml-svc-locator {
  font-style: italic;
  font-size: var(--fs-md);
  color: var(--ui-text-muted);
  margin-top: 2px;
}

.tml-svc-section--foundations { --stage: var(--tml-purple); }
.tml-svc-section--interpretation { --stage: var(--tml-purple-mid); }
.tml-svc-section--decision { --stage: var(--tml-terracotta); }
.tml-svc-section--embedded { --stage: var(--tml-purple); }

.tml-svc-products { display: flex; flex-direction: column; gap: 14px; }

/* ============ PRODUCT EXPANDABLE ========================================= */
.tml-product {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: var(--tml-white);
  overflow: hidden;
}

/* The whole row is the control — ≥44px tap target on mobile. */
.tml-product-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.tml-product-toggle:hover { background: var(--tml-grey); }

.tml-product-name {
  font-size: var(--fs-2xl);
  font-weight: var(--weight-bold);
  color: var(--tml-dark);
}
.tml-product-summary {
  font-size: var(--fs-base);
  color: var(--ui-text-faint);
  margin-top: 4px;
}
.tml-product-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: none;
}
.tml-product-count {
  font-size: var(--fs-sm);
  font-weight: var(--weight-bold);
  color: var(--ui-text-ghost);
}
.tml-product-state {
  font-size: var(--fs-xs);
  color: var(--ui-text-ghost);
}

/* Collapse is CSS, never removal — the detail stays in the DOM for indexing,
   analytics attachment, and no-JS resilience (skeleton brief §8). */
.tml-product-detail[data-expanded="false"] { display: none; }
.tml-product-detail { padding: 4px 28px 28px; }
.tml-product-detail-inner {
  border-top: 1px solid #f0f0f5;
  padding-top: 22px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: start;
}
.tml-product-detail-inner--wide { display: block; }

.tml-product-body {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--ui-text);
}
.tml-product-body p + p { margin-top: 16px; }
.tml-product-body em { color: var(--tml-dark); font-style: italic; }
.tml-product-body strong { color: var(--tml-dark); }

/* "You leave with" / "You get" panel */
.tml-outcome {
  background: var(--tml-purple-light);
  border-radius: 14px;
  padding: 20px 22px;
}
.tml-outcome p {
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ui-text);
}
.tml-outcome strong { color: var(--tml-dark); }

/* ============ SUB-ANALYSES (Performance Deep Dive) ======================= */
.tml-subanalyses {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tml-sub {
  border: 1px solid var(--ui-border-soft);
  border-radius: 10px;
  background: var(--tml-grey);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
}
.tml-sub-name {
  font-size: var(--fs-lg);
  font-weight: var(--weight-bold);
  color: var(--tml-dark);
}
.tml-sub-desc {
  font-size: var(--fs-sm);
  color: var(--ui-text-faint);
  margin-top: 2px;
}
.tml-sub .tml-sample { align-items: flex-end; flex: none; }

/* ============ SAMPLE-DELIVERABLE BUTTON ==================================
   Injected by js/services.js only where a product's flag is true and it has
   images. Absent entirely otherwise — no placeholder, no "coming soon". */
.tml-sample {
  margin-top: 16px;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.tml-sub .tml-sample { margin-top: 0; }

.tml-sample-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--cta);
  color: var(--tml-white);
  background: var(--cta);
  border-radius: 8px;
  padding: 11px 16px;
  font-size: var(--fs-base);
  font-weight: var(--weight-bold);
  cursor: pointer;
  white-space: nowrap;
}
.tml-sample-btn:hover { background: #b96a49; border-color: #b96a49; }
.tml-sample-icon { font-size: var(--fs-sm); }
.tml-sample-sub {
  font-size: var(--fs-2xs);
  color: #8a7fa0;
  padding-left: 2px;
}

/* ============ LIGHTBOX =================================================== */
.tml-lb[hidden] { display: none; }
.tml-lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.tml-lb-scrim {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.66);
  backdrop-filter: blur(2px);
}
.tml-lb-panel {
  position: relative;
  width: 100%;
  max-width: 1000px;
  background: var(--tml-white);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.tml-lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--ui-border-soft);
}
.tml-lb-kicker {
  font-size: var(--fs-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--tml-purple-mid);
}
.tml-lb-title {
  font-size: var(--fs-3xl);
  font-weight: var(--weight-bold);
  color: var(--tml-dark);
  margin-top: 3px;
}
/* Required in every viewer header so nothing reads as a named engagement. */
.tml-lb-disclosure {
  font-size: var(--fs-sm);
  color: var(--ui-text-fainter);
  margin-top: 4px;
}
.tml-lb-close {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--ui-border-menu);
  background: var(--tml-white);
  font-size: var(--fs-2xl);
  color: var(--ui-text);
  cursor: pointer;
  line-height: 1;
}
.tml-lb-close:hover { background: var(--tml-grey); }

.tml-lb-body {
  background: var(--tml-grey);
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.tml-lb-stage {
  flex: 1;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tml-lb-stage img {
  max-width: 100%;
  max-height: 60vh;
  border: 1px solid #e0e0e8;
  border-radius: 8px;
  /* Deterrence only — pairs with the contextmenu handler in services.js. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.tml-lb-arrow {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #dcdce4;
  background: var(--tml-white);
  font-size: var(--fs-2xl);
  color: var(--tml-purple);
  cursor: pointer;
}
.tml-lb-arrow:hover { background: var(--tml-purple-light); }
.tml-lb-arrow[hidden] { display: none; }

/* Footer: dots, counter, and the required `view only` label.
   There is no download control here, deliberately and permanently. */
.tml-lb-foot {
  padding: 16px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-top: 1px solid var(--ui-border-soft);
}
.tml-lb-dots { display: flex; gap: 7px; }
.tml-lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d3d3de;
}
.tml-lb-dot.is-active { background: var(--tml-purple); }
.tml-lb-viewonly {
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ui-text-fainter);
}
.tml-lb-counter {
  font-size: var(--fs-sm);
  color: var(--ui-text-fainter);
}

/* Page must not scroll behind the open modal. */
body.tml-noscroll { overflow: hidden; }
