@use "sass:math";
@use "../base/var";
@use "../base/const";
@use "../base/color";
@use "../base/backdrop";
@use "../base/position";
@use "../base/text";

[part~="wy-titlebar"] {
  --wy-component-color: #{color.token(--wy-on-surface)};

  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-items: center;
  min-height: var.default(--wy-titlebar-height);
  padding: calc(var.default(--wy-padding-sm));
  flex: 0 0 var.default(--wy-titlebar-height);
  line-height: var.default(--wy-line-height);

  color: var(--wy-component-color);
}

[part~="wy-titlebar-buttons"],
[part~="wy-titlebar-section"] {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var.default(--wy-gap-sm);
  max-width: 100%;
  box-shadow: var(--wy-component-box-shadow);
  border-radius: var.default(--wy-button-border-radius);
  background-color: var(--wy-component-background-color);
  
  /*@supports (background-color: color(from var(--wy-component-background-color) srgb r g b / 0.5)) {
    background-color: color(from var(--wy-component-background-color) srgb r g b / 0.5);
    backdrop-filter: blur(4px);
  }*/
}

[part~="wy-titlebar-section"] {
  margin-left: auto;
  margin-right: auto;
  flex: 0 1 auto;
  min-width: 0;
}

[part~="wy-titlebar-wrapping"] {
  flex-wrap: balance;
  justify-content: flex-end;
}

[part~="wy-titlebar-lg"] {
  padding: var.default(--wy-padding);
  height: auto;
}

[part~="wy-titlebar-buttons-first"] {
  justify-content: flex-start;
}

[part~="wy-titlebar-buttons-last"] {
  justify-content: flex-end;
}

[part~="wy-titlebar-text"] {
  max-width: 100%;
  display: block;

  color: inherit !important;
  user-select: none;
  padding: var.default(--wy-padding);

  @include text.truncate;
}

[part~="wy-titlebar-text-trashed"] {
  text-decoration: line-through;
}

[part~="wy-titlebar-fill"] {
  flex: 0 999999999999999 auto;
  --wy-fill: attr(data-fill px);
  width: var(--wy-fill, 0);
}