/**
 * tabs.css
 * Services page sticky anchor sub-nav (56px height).
 * Scroll-spy adds .is-active to the corresponding link.
 * Depends on: tokens.css, base.css
 */

/* --------------------------------------------------------------------------
 * Sticky services sub-nav wrapper
 * -------------------------------------------------------------------------- */

.services-tabs {
  position: sticky;
  top: calc(var(--header-height-desktop) + var(--topbar-height-desktop));
  z-index: 100;
  background-color: var(--color-surface);
  border-bottom: var(--border-hairline);
  height: var(--tabs-height);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.services-tabs::-webkit-scrollbar {
  display: none; /* Chrome / Safari */
}

/* Adjust sticky top when topbar is collapsed */
.topbar-collapsed ~ * .services-tabs,
.topbar-collapsed .services-tabs {
  top: var(--header-height-desktop);
}

@media (max-width: 1023px) {
  .services-tabs {
    top: var(--header-height-mobile);
  }
}

/* --------------------------------------------------------------------------
 * Inner list
 * -------------------------------------------------------------------------- */

.services-tabs__inner {
  display: flex;
  align-items: stretch;
  height: 100%;
  padding-inline: var(--container-pad);
  max-width: var(--container-max);
  margin-inline: auto;
  white-space: nowrap;
}

.tabs-nav {
  display: flex;
  align-items: stretch;
  list-style: none;
  gap: 0;
  height: 100%;
}

/* --------------------------------------------------------------------------
 * Individual tab link
 * -------------------------------------------------------------------------- */

.tabs-nav__item {
  display: flex;
  align-items: stretch;
}

.tabs-nav__link {
  display: flex;
  align-items: center;
  padding-inline: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-ink-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.tabs-nav__link:hover {
  color: var(--color-ink-900);
}

.tabs-nav__link.is-active,
.tabs-nav__item:has(.tabs-nav__link.is-active) .tabs-nav__link {
  color: var(--color-ink-900);
  border-bottom-color: var(--color-brand-green);
}

/* --------------------------------------------------------------------------
 * Services page sections
 * -------------------------------------------------------------------------- */

.services-section {
  padding-block: var(--section-py);
  scroll-margin-top: calc(var(--header-height-desktop) + var(--topbar-height-desktop) + var(--tabs-height));
}

@media (max-width: 1023px) {
  .services-section {
    scroll-margin-top: calc(var(--header-height-mobile) + var(--tabs-height));
  }
}

.services-section:nth-child(odd) {
  background-color: var(--color-bg);
}

.services-section:nth-child(even) {
  background-color: var(--color-surface-alt);
}

/* Services section internal grid */
.services-section__grid {
  display: grid;
  gap: var(--space-12);
}

@media (min-width: 1024px) {
  .services-section__grid {
    grid-template-columns: repeat(12, 1fr);
    align-items: start;
    gap: var(--space-8);
  }

  .services-section__intro {
    grid-column: 1 / 6;
  }

  .services-section__content {
    grid-column: 7 / 13;
  }
}

.services-section__intro .eyebrow {
  margin-bottom: var(--space-4);
}

.services-section__intro h2 {
  margin-bottom: var(--space-4);
}

.services-section__intro .lede {
  font-size: var(--text-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--color-ink-500);
  margin-bottom: var(--space-6);
}

.services-section__intro p {
  font-size: var(--text-body);
  color: var(--color-ink-500);
  line-height: var(--lh-body);
}

/* --------------------------------------------------------------------------
 * Responsive tab adjustments
 * -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .tabs-nav__link {
    padding-inline: var(--space-4);
    font-size: 10px;
    letter-spacing: 0.1em;
  }
}
