/*
 * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

@reference '@accelint/design-foundation/styles';

@layer components.l1 {
  .group {
    @apply flex w-full flex-col;
  }

  .accordion {
    @apply flex w-full flex-col bg-transparent;
  }

  .header {
    @apply fg-primary-bold gap-s px-s py-xs rounded-medium flex w-full items-center outline-none;

    @variant focus-visible-within {
      @apply bg-interactive-muted-hover;
    }

    @variant hover {
      @apply bg-interactive-muted-hover;
    }

    @variant pressed {
      @apply bg-interactive-muted-pressed;
    }

    @variant group-disabled/accordion {
      @apply fg-disabled cursor-not-allowed;
    }
  }

  .heading {
    @apply grow;
  }

  .panel {
    @apply grid overflow-hidden;
    grid-template-rows: 1fr;

    @variant aria-hidden {
      grid-template-rows: 0fr;
    }

    & > * {
      min-height: 0;
      @apply p-s;
    }

    @variant motion-safe {
      transition: grid-template-rows var(--animation-duration-normal)
        var(--animation-easing-standard);
    }
  }

  .triggerChevron {
    @apply transform;

    @variant group-expanded/accordion {
      @apply rotate-180;
    }

    @variant motion-safe {
      transition: transform var(--animation-duration-normal)
        var(--animation-easing-standard);
    }
  }
}

@layer components.l2 {
  .menu {
    @variant focus-visible {
      @apply outline-mono-bold-pressed;
    }
  }

  .trigger {
    @apply w-full justify-start px-0 transition-none select-none;

    &.cozy {
      @apply gap-s text-header-m;
    }

    &.compact {
      @apply gap-xs text-header-s;
    }
  }
}
