/* Copyright 2024, 2025 New Vector Ltd.
 * Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
 *
 * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
 * Please see LICENSE files in the repository root for full details.
 */

.header {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: var(--cpd-space-4x);
  align-items: center;
}

.back-button {
  display: block;
  inline-size: var(--cpd-space-7x);
  block-size: var(--cpd-space-7x);

  /* the icon is 0.75 the size of the button, so add padding to put it in the middle */
  padding: var(--cpd-space-1x);
  aspect-ratio: 1 / 1;
  color: var(--cpd-color-icon-tertiary);
  border: 0;
  appearance: none;
  cursor: pointer;
  border-radius: 50%;
  position: relative;
  background-color: var(--cpd-color-bg-subtle-secondary);
  line-height: 0px;
}

.back-button svg {
  inline-size: var(--cpd-space-5x);
  block-size: var(--cpd-space-5x);
}

.back-button[aria-disabled="true"] {
  color: var(--cpd-color-icon-disabled);
  cursor: not-allowed;
}

/**
 * Hover state
 */

@media (hover) {
  .back-button:not([aria-disabled="true"]):hover {
    color: var(--cpd-color-icon-primary);
    background: var(--cpd-color-bg-subtle-primary);
  }
}

.back-button:not([aria-disabled="true"]):active {
  color: var(--cpd-color-icon-primary);
  background: var(--cpd-color-bg-subtle-primary);
}
