/* Homepage service navigation tree: built on the framework's container,
   section headings and links.  Each branch is a real list of guide links. */

@layer components {
  .section-service-map {
    background: var(--color-bg);
  }

  .service-map {
    --map-line: var(--color-border-accent-medium);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    position: relative;
    padding: 1.625rem 0 0.625rem;
  }

  .service-map::before {
    content: "";
    position: absolute;
    top: 1.625rem;
    left: 1.25rem;
    right: 1.25rem;
    height: 0.1875rem;
    background: var(--color-border-accent-strong);
  }

  .service-map__branch {
    --branch: var(--color-accent);
    min-width: 0;
    padding: 0 1.125rem 0 0;
    position: relative;
  }

  .service-map__branch--technology {
    --branch: var(--color-category-technology);
  }

  .service-map__branch--library {
    --branch: var(--color-category-library);
  }

  .service-map__branch--support {
    --branch: var(--color-category-support);
  }

  .service-map__branch--learning {
    --branch: var(--color-category-learning);
  }

  .service-map__heading {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 3.375rem;
    gap: 0.75rem;
    border-left: 3px solid var(--branch);
    margin-left: var(--space-4);
    padding-left: 1.0625rem;
  }

  .service-map__heading h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--branch);
    font-weight: 850;
    line-height: 1.35;
  }

  .service-map__dot {
    position: absolute;
    left: calc(-1 * var(--space-2));
    top: 50%;
    translate: 0 -50%;
    width: 0.8125rem;
    height: 0.8125rem;
    background: var(--color-surface);
    border: 3px solid var(--branch);
    border-radius: 50%;
    z-index: 1;
  }

  .service-map__list {
    list-style: none;
    margin: 0 0 0 var(--space-4);
    padding: 0 0 0.1875rem;
    border-left: 3px solid var(--branch);
  }

  .service-map__list li {
    position: relative;
    min-width: 0;
    padding: 0 0 0 1.0625rem;
  }

  .service-map__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 0.625rem 0.5625rem 0.625rem 0.1875rem;
    min-height: 2.6875rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 650;
    color: var(--color-text-strong);
    text-decoration: none;
    border-radius: 0.4375rem;
  }

  .service-map__list a:hover {
    color: var(--branch);
    background: var(--color-surface-highlight);
  }

  .service-map__list a:focus-visible {
    outline: 3px solid var(--color-accent-powder);
    outline-offset: 0.0625rem;
  }

  .service-map__arrow {
    color: var(--color-muted);
    opacity: 0;
    transform: translate(-4px, 3px);
    transition: opacity 0.15s, transform 0.15s;
    flex: none;
    font-size: 1rem;
  }

  .service-map__list a:hover .service-map__arrow, .service-map__list a:focus-visible .service-map__arrow {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 850px) {
  .service-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.625rem var(--space-4);
  }

  .service-map::before {
    display: none;
  }

  .service-map__branch {
    border-top: 3px solid var(--branch);
    padding-top: 0.75rem;
  }

  .service-map__heading {
    min-height: 2.625rem;
  }
}

@media (max-width: 520px) {
  .service-map {
    grid-template-columns: 1fr;
    gap: 0.9375rem;
    padding-top: var(--space-2);
  }

  .service-map__branch {
    border: 1px solid var(--color-surface-prominent);
    border-top: 3px solid var(--branch);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem 0.75rem 0;
    background: var(--color-surface);
    box-shadow: 0 4px 15px color-mix(in oklab, var(--shadow-ink) 3.5%, transparent);
  }

  .service-map__heading, .service-map__list {
    margin-left: 1.5625rem;
    border-left: 2px solid var(--branch);
  }

  .service-map__list a {
    min-height: 2.6875rem;
  }

  .service-map__arrow {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-map__arrow {
    transition: none;
  }
}
