/*!
Copyright 2023 Adobe. 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 http://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.
*/

.spectrum{
  --system-spectrum-toast-background-color-default:var(--spectrum-neutral-subdued-background-color-default);
}

.spectrum--express{
  --system-spectrum-toast-background-color-default:var(--spectrum-neutral-background-color-default);
}

.spectrum-Toast{
  --spectrum-toast-font-weight:var(--spectrum-regular-font-weight);

  --spectrum-toast-font-size:var(--spectrum-font-size-100);
  --spectrum-toast-corner-radius:var(--spectrum-corner-radius-100);
  --spectrum-toast-block-size:var(--spectrum-toast-height);
  --spectrum-toast-max-inline-size:var(--spectrum-toast-maximum-width);
  --spectrum-toast-border-width:var(--spectrum-border-width-100);

  --spectrum-toast-line-height:var(--spectrum-line-height-100);
  --spectrum-toast-line-height-cjk:var(--spectrum-cjk-line-height-100);

  --spectrum-toast-spacing-icon-to-text:var(--spectrum-text-to-visual-100);

  --spectrum-toast-spacing-start-edge-to-text-and-icon:var(--spectrum-spacing-300);
  --spectrum-toast-spacing-text-and-action-button-to-divider:var(--spectrum-spacing-300);

  --spectrum-toast-spacing-top-edge-to-divider:var(--spectrum-spacing-100);
  --spectrum-toast-spacing-bottom-edge-to-divider:var(--spectrum-spacing-100);

  --spectrum-toast-spacing-top-edge-to-icon:var(--spectrum-toast-top-to-workflow-icon);

  --spectrum-toast-spacing-text-to-action-button-horizontal:var(--spectrum-spacing-300);
  --spectrum-toast-spacing-close-button:var(--spectrum-spacing-100);

  --spectrum-toast-spacing-block-start:var(--spectrum-spacing-100);
  --spectrum-toast-spacing-block-end:var(--spectrum-spacing-100);

  --spectrum-toast-spacing-top-edge-to-text:var(--spectrum-toast-top-to-text);
  --spectrum-toast-spacing-bottom-edge-to-text:var(--spectrum-toast-bottom-to-text);

  --spectrum-toast-negative-background-color-default:var(--spectrum-negative-background-color-default);
  --spectrum-toast-positive-background-color-default:var(--spectrum-positive-background-color-default);
  --spectrum-toast-informative-background-color-default:var(--spectrum-informative-background-color-default);

  --spectrum-toast-text-and-icon-color:var(--spectrum-white);

  --spectrum-toast-divider-color:var(--spectrum-transparent-white-300);
}

@media (forced-colors: active){
  .spectrum-Toast{
    --highcontrast-toast-border-color:ButtonText;

    border:var(--mod-toast-border-width, var(--spectrum-toast-border-width)) solid var(--highcontrast-toast-border-color, transparent);
  }
}

.spectrum-Toast{
  box-sizing:border-box;
  display:inline-flex;
  flex-direction:row;
  align-items:stretch;
  min-block-size:var(--mod-toast-block-size, var(--spectrum-toast-block-size));
  max-inline-size:var(--mod-toast-max-inline-size, var(--spectrum-toast-max-inline-size));

  border-radius:var(--mod-toast-corner-radius, var(--spectrum-toast-corner-radius));

  padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon, var(--spectrum-toast-spacing-start-edge-to-text-and-icon));

  font-size:var(--mod-toast-font-size, var(--spectrum-toast-font-size));
  font-weight:var(--mod-toast-font-weight, var(--spectrum-toast-font-weight));

  -webkit-font-smoothing:antialiased;

  background-color:var(--highcontrast-toast-background-color-default, var(--mod-toast-background-color-default, var(--spectrum-toast-background-color-default)));
  color:var(--highcontrast-toast-background-color-default, var(--mod-toast-background-color-default, var(--spectrum-toast-background-color-default)));
}

.spectrum-Toast--negative{
  background-color:var(--highcontrast-toast-negative-background-color-default, var(--mod-toast-negative-background-color-default, var(--spectrum-toast-negative-background-color-default)));
  color:var(--highcontrast-toast-negative-background-color-default, var(--mod-toast-negative-background-color-default, var(--spectrum-toast-negative-background-color-default)));
}

.spectrum-Toast--negative .spectrum-Toast-closeButton:focus-visible:not(:active),
.spectrum-Toast--negative .spectrum-Toast-closeButton.is-focus-visible:not(:active){
    color:var(--highcontrast-toast-negative-background-color-default, var(--mod-toast-negative-background-color-default, var(--spectrum-toast-negative-background-color-default)));
  }

.spectrum-Toast--info{
  background-color:var(--highcontrast-toast-informative-background-color-default, var(--mod-toast-informative-background-color-default, var(--spectrum-toast-informative-background-color-default)));
  color:var(--highcontrast-toast-informative-background-color-default, var(--mod-toast-informative-background-color-default, var(--spectrum-toast-informative-background-color-default)));
}

.spectrum-Toast--info .spectrum-Toast-closeButton:focus-visible:not(:active),
.spectrum-Toast--info .spectrum-Toast-closeButton.is-focus-visible:not(:active){
    color:var(--highcontrast-toast-informative-background-color-default, var(--mod-toast-informative-background-color-default, var(--spectrum-toast-informative-background-color-default)));
  }

.spectrum-Toast--positive{
  background-color:var(--highcontrast-toast-positive-background-color-default, var(--mod-toast-positive-background-color-default, var(--spectrum-toast-positive-background-color-default)));
  color:var(--highcontrast-toast-positive-background-color-default, var(--mod-toast-positive-background-color-default, var(--spectrum-toast-positive-background-color-default)));
}

.spectrum-Toast--positive .spectrum-Toast-closeButton:focus-visible:not(:active),
.spectrum-Toast--positive .spectrum-Toast-closeButton.is-focus-visible:not(:active){
    color:var(--highcontrast-toast-positive-background-color-default, var(--mod-toast-positive-background-color-default, var(--spectrum-toast-positive-background-color-default)));
  }

.spectrum-Toast-typeIcon{
  flex-shrink:0;
  flex-grow:0;

  margin-block-start:var(--mod-toast-spacing-top-edge-to-icon, var(--spectrum-toast-spacing-top-edge-to-icon));
  margin-inline-end:var(--mod-toast-spacing-icon-to-text, var(--spectrum-toast-spacing-icon-to-text));
  margin-inline-start:0;

  color:var(--highcontrast-toast-text-and-icon-color, var(--mod-toast-text-and-icon-color, var(--spectrum-toast-text-and-icon-color)));
}

.spectrum-Toast-content{
  flex:1 1 auto;
  display:inline-block;
  box-sizing:border-box;

  padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text, var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start, var(--spectrum-toast-spacing-block-start)));
  padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text, var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end, var(--spectrum-toast-spacing-block-end)));

  padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal, var(--spectrum-toast-spacing-text-to-action-button-horizontal));
  padding-inline-start:0;

  line-height:var(--mod-toast-line-height, var(--spectrum-toast-line-height));

  text-align:start;

  color:var(--highcontrast-toast-text-and-icon-color, var(--mod-toast-text-and-icon-color, var(--spectrum-toast-text-and-icon-color)));
}

.spectrum-Toast-content:lang(ja), .spectrum-Toast-content:lang(zh), .spectrum-Toast-content:lang(ko){
    line-height:var(--mod-toast-line-height-cjk, var(--spectrum-toast-line-height-cjk));
  }

.spectrum-Toast-buttons{
  display:flex;
  flex:0 0 auto;
  align-items:flex-start;

  margin-block-start:var(--mod-toast-spacing-top-edge-to-divider, var(--spectrum-toast-spacing-top-edge-to-divider));
  margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider, var(--spectrum-toast-spacing-bottom-edge-to-divider));
  border-inline-start-color:var(--mod-toast-divider-color, var(--spectrum-toast-divider-color));
  padding-inline-end:var(--mod-toast-spacing-close-button, var(--spectrum-toast-spacing-close-button));
}

.spectrum-Toast-buttons .spectrum-CloseButton{
    align-self:flex-start;
  }

.spectrum-Toast-body{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  flex:1 1 auto;
  align-self:center;

  padding-block-start:var(--mod-toast-spacing-block-start, var(--spectrum-toast-spacing-block-start));
  padding-block-end:var(--mod-toast-spacing-block-end, var(--spectrum-toast-spacing-block-end));
}

.spectrum-Toast-body .spectrum-Button{
    margin-inline-start:auto;
    margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider, var(--spectrum-toast-spacing-text-and-action-button-to-divider));
  }

[dir="rtl"] .spectrum-Toast-body .spectrum-Button{
      margin-inline-end:auto;
      margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider, var(--spectrum-toast-spacing-text-and-action-button-to-divider));
    }

.spectrum-Toast-body .spectrum-Button:dir(rtl){
      margin-inline-end:auto;
      margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider, var(--spectrum-toast-spacing-text-and-action-button-to-divider));
    }

.spectrum-Toast-body + .spectrum-Toast-buttons{
    padding-inline-start:var(--mod-toast-spacing-close-button, var(--spectrum-toast-spacing-close-button));

    border-inline-start-width:1px;
    border-inline-start-style:solid;
  }

.spectrum-Toast{
  --spectrum-toast-background-color-default:var(--system-spectrum-toast-background-color-default);
}
