/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
@use './core' as *;
@use '../dialog';
@use '../utils/mixins-media';

//
// Host
//

:host {
  @include host;
}

:host([hidden]) {
  display: none;
}

//
// Base
//

.dialog {
  @include tokens;
}

.surface {
  @include surface;
}

.dialog.dragging {
  &::part(surface) {
    transition: none;
  }
}

:host([open]) {
  forge-dialog.fullscreen {
    @include dialog.provide-theme((
      max-height: 100%
    ));

    // Override the internals of the dialog to add a height transition
    &::part(surface) {
      transition: max-height #{token(animation-duration)} #{token(animation-timing)};
    }
  }
}

forge-dialog {
  @include dialog.provide-theme((
    width: #{token(desktop-max-width)},
    max-height: #{token(desktop-max-height)},
  ));
}

//
// Responsive
//

@include mixins-media.tablet-portrait-down {
  forge-dialog {
    @include dialog.provide-theme((
      shape: 0,
      max-width: 100vw,
      width: 100vw
    ));
  }
}
