/*
 * Independent clean-room implementation from a written spec.
 * Component: "Services" sections — the home/area-page card carousel
 * (`.ocf-svc-track` / `.ocf-svc-viewport`) and the services-archive
 * page's static grid (`.ocf-services-archive-grid-section`) plus its
 * "need help" contact card. Both surfaces share the `.ocf-svc-card`
 * card shape and the `.ocf-svc-grid` layout class.
 */

/* -- section shell ------------------------------------------------------ */
.ocf-services {
  overflow: hidden;
  background: var(--ocf-bg);
}

/* not emitted by any current template; kept for spec fidelity */
.ocf-services--embedded {
  overflow: visible;
  background: transparent;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.ocf-services-header {
  margin-bottom: 2rem;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
  display: flex;
}

.ocf-services-heading {
  max-width: 720px;
}

.ocf-services-eyebrow {
  margin-bottom: 0.75rem;
}

/* -- "view all" eyebrow link, underline + icon nudge on hover ---------- */
.ocf-eyebrow-link {
  transition: color var(--duration) var(--ease);
  color: inherit;
  padding-bottom: 0.12rem;
  gap: 0.08em;
  align-items: flex-start;
  display: inline-flex;
  position: relative;
}

.ocf-eyebrow-link::after {
  transition: transform var(--duration) var(--ease);
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0.72;
  background: currentColor;
  height: 1px;
  left: 0;
  bottom: 0;
  right: 0;
  position: absolute;
  content: "";
}

.ocf-eyebrow-link__icon {
  transition: transform var(--duration) var(--ease);
  margin-top: 0.12em;
  height: 0.8em;
  width: 0.8em;
  flex: 0 0 auto;
  left: -0.03em;
  position: relative;
}

.ocf-eyebrow-link:hover,
.ocf-eyebrow-link:focus-visible {
  color: var(--ocf-primary);
}

.ocf-eyebrow-link:hover::after,
.ocf-eyebrow-link:focus-visible::after {
  transform: scaleX(1);
}

.ocf-eyebrow-link:hover .ocf-eyebrow-link__icon,
.ocf-eyebrow-link:focus-visible .ocf-eyebrow-link__icon {
  transform: translate(2px, -2px);
}

/* -- carousel prev/next buttons ----------------------------------------- */
.ocf-svc-nav {
  gap: 0.5rem;
  display: flex;
}

.ocf-svc-nav button {
  line-height: 1;
  color: var(--ocf-heading);
  background: var(--ocf-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ocf-border);
  padding: 0;
  place-items: center;
  height: 2.5rem;
  width: 2.5rem;
  display: inline-grid;
}

.ocf-svc-nav svg {
  height: 1.25rem;
  width: 1.25rem;
  display: block;
}

/* -- services-archive page: static grid + "need help" contact card ----- */
.ocf-services-archive-grid-section {
  background: var(--ocf-bg-alt);
}

.ocf-services-archive-grid-section .container-global {
  gap: clamp(2rem, 5vw, 3.5rem);
  display: grid;
}

/* Sized to read as a compact strip in the same card family as .ocf-svc-card
   below it (same background/border/radius/shadow tokens) rather than its
   own oversized block -- see PR for the measured .ocf-svc-card values this
   was matched against (Hannah 9/8: "huge and ugly ... more cohesive"). */
.ocf-services-help-card {
  box-shadow: var(--card-shadow);
  background: var(--ocf-bg);
  border-radius: var(--card-radius);
  border: var(--card-border-width) solid var(--card-border-color);
  padding: 20px 24px;
  gap: 1rem;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  display: grid;
}

.ocf-services-help-card__icon {
  color: var(--ocf-primary);
  background: color-mix(in srgb, var(--ocf-primary) 10%, transparent);
  border-radius: 50%;
  height: 40px;
  width: 40px;
  place-items: center;
  display: inline-grid;
}

.ocf-services-help-card__icon svg {
  height: 18px;
  width: 18px;
}

.ocf-services-help-card__copy {
  gap: 0.35rem;
  display: grid;
}

.ocf-services-help-card h2 {
  font-size: 21px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  color: var(--ocf-heading);
  margin: 0;
}

.ocf-services-help-card p {
  line-height: 1.55;
  font-size: 15px;
  color: var(--ocf-body);
  margin: 0;
}

.ocf-services-help-card .btn-secondary {
  color: var(--ocf-primary);
  border-color: var(--ocf-primary);
  min-height: 2.25rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  white-space: nowrap;
  min-width: 0;
  justify-content: center;
}

/* -- carousel viewport/track + shared card grid ------------------------- */
.ocf-svc-viewport {
  margin-bottom: -0.9rem;
  margin-inline: -1rem;
  padding-bottom: 0.9rem;
  padding-inline: 1rem;
  overflow: hidden;
}

.ocf-svc-track {
  transition: transform 260ms var(--ease);
  gap: var(--grid-gap);
  display: flex;
}

/* also defined identically in service-areas.css; this file's copy loads
   later in the enqueue order and is the one that wins the cascade */
.ocf-svc-grid {
  gap: var(--grid-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  display: grid;
}

.ocf-svc-track .ocf-svc-card {
  flex: 0 0 calc((100% - (var(--grid-gap) * 2)) / 3);
}

/* not emitted by any current template; kept for spec fidelity */
.ocf-services--embedded .ocf-svc-track .ocf-svc-card {
  flex-basis: calc((100% - var(--grid-gap)) / 2);
}

/* -- card ---------------------------------------------------------------- */
.ocf-svc-card {
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
  box-shadow: var(--card-shadow);
  background: var(--ocf-bg);
  border-radius: var(--card-radius);
  border: var(--card-border-width) solid var(--card-border-color);
  overflow: hidden;
  min-height: 100%;
  flex-direction: column;
  display: flex;
}

.ocf-svc-card-img {
  overflow: hidden;
  background: var(--ocf-bg-alt);
  aspect-ratio: 16 / 9.5;
}

.ocf-svc-card-img img {
  transition: transform 320ms var(--ease);
  object-fit: cover;
  height: 100%;
  width: 100%;
}

/* archive-page cards sit on the alt-tinted section background, so their
   own border is dropped (hover state included, to stay borderless) */
.ocf-services-archive-grid-section .ocf-svc-card,
.ocf-services-archive-grid-section .ocf-svc-card:hover {
  border-color: transparent;
}

.ocf-svc-card-body {
  padding: 1.35rem;
  flex: 1;
  gap: 0.72rem;
  grid-template-rows: auto 1fr auto;
  display: grid;
  position: relative;
}

.ocf-svc-card-body h3 {
  line-height: 1.16;
  font-weight: var(--ocf-font-h3-weight, var(--font-weight-bold));
  font-size: var(--font-h3-size);
  font-family: var(--ocf-font-heading), system-ui, sans-serif;
  color: var(--ocf-heading);
  margin: 0;
}

.ocf-svc-card-body p {
  line-height: 1.62;
  font-size: var(--font-label-size);
  color: var(--ocf-body);
  margin: 0;
}

.ocf-svc-card-cta {
  transition: color var(--duration) var(--ease);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0.04em;
  font-weight: 800;
  font-size: var(--font-label-size);
  color: var(--ocf-primary);
  margin-top: 0.2rem;
  width: fit-content;
  gap: 0.55rem;
  align-items: center;
  display: inline-flex;
}

.ocf-svc-arrow {
  transition: transform var(--duration) var(--ease);
  height: 1.1rem;
  width: 1.1rem;
  justify-content: center;
  align-items: center;
  display: inline-flex;
}

.ocf-svc-arrow svg {
  height: 100%;
  width: 100%;
  display: block;
}

/* not emitted by any current template; kept for spec fidelity */
.ocf-services-footer {
  margin-top: 2rem;
}

/* -- hover-capable pointers only: card lift + image zoom + cta nudge ---- */
@media (hover: hover) and (pointer: fine) {
  .ocf-svc-card:hover {
  transform: var(--card-transform-hover);
  box-shadow: var(--card-shadow-hover);
  border-color: color-mix(in srgb, var(--ocf-primary) 24%, var(--card-border-color));
}

  .ocf-svc-card:hover .ocf-svc-card-img img {
    transform: scale(1.02);
  }

  .ocf-svc-card:hover .ocf-svc-card-cta {
    color: var(--ocf-primary-hover);
  }

  .ocf-svc-card:hover .ocf-svc-arrow {
    transform: translateX(3px);
  }
}

/* -- responsive column counts -------------------------------------------- */
@media (max-width: 900px) {
  .ocf-svc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ocf-svc-track .ocf-svc-card {
    flex-basis: calc((100% - var(--grid-gap)) / 2);
  }

  .ocf-services-help-card {
    grid-template-columns: auto 1fr;
    row-gap: 12px;
    column-gap: 1rem;
  }

  .ocf-services-help-card .btn-secondary {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .ocf-services-header {
    display: grid;
  }

  .ocf-svc-grid {
    grid-template-columns: 1fr;
  }

  .ocf-svc-track .ocf-svc-card {
    flex-basis: 100%;
  }
}
