/*!
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-Calendar{
  --spectrum-calendar-day-width:var(--spectrum-component-height-100);
  --spectrum-calendar-day-height:var(--spectrum-component-height-100);
  --spectrum-calendar-border-radius-reset:0;
  --spectrum-calendar-border-width-reset:0;
  --spectrum-calendar-day-border-size:var(--spectrum-border-width-200);
  --spectrum-calendar-margin-y:24px;
  --spectrum-calendar-margin-x:32px;
  --spectrum-calendar-day-padding:4px;
  --spectrum-calendar-width:calc((var(--spectrum-calendar-day-width) + var(--spectrum-calendar-day-padding) * 2) * 7);

  --spectrum-calendar-title-text-letter-spacing:0.06em;
  --spectrum-calendar-title-height:32px;
  --spectrum-calendar-title-text-size:var(--spectrum-font-size-300);

  --spectrum-calendar-day-title-text-font-weight:var(--spectrum-bold-font-weight);
  --spectrum-calendar-day-title-text-color:var(--spectrum-gray-700);
  --spectrum-calendar-day-title-text-size:var(--spectrum-font-size-50);
  --spectrum-calendar-day-text-size-han:var(--spectrum-font-size-50);

  --spectrum-calendar-day-text-size:var(--spectrum-font-size-100);
  --spectrum-calendar-day-text-color-selected:var(--spectrum-gray-900);
  --spectrum-calendar-day-text-color-hover:var(--spectrum-gray-900);
  --spectrum-calendar-day-text-color-cap-selected:var(--spectrum-gray-900);
  --spectrum-calendar-day-text-font-weight-selected:var(--spectrum-bold-font-weight);
  --spectrum-calendar-day-text-font-weight-cap-selected:var(--spectrum-bold-font-weight);

  --spectrum-calendar-day-today-text-color:var(--spectrum-gray-800);
  --spectrum-calendar-day-today-text-font-weight:var(--spectrum-bold-font-weight);
  --spectrum-calendar-day-today-border-color:var(--spectrum-gray-800);

  --spectrum-calendar-day-today-text-color-disabled:var(--spectrum-gray-500);
  --spectrum-calendar-day-today-border-color-disabled:var(--spectrum-gray-400);
  --spectrum-calendar-day-text-color-disabled:var(--spectrum-disabled-content-color);

  --spectrum-calendar-day-text-color-key-focus:var(--spectrum-gray-900);

  --spectrum-calendar-button-icon-color:var(--spectrum-gray-700);
}

[dir="rtl"] .spectrum-Calendar{
		--spectrum-logical-rotation:matrix(-1, 0, 0, 1, 0, 0);
	}

.spectrum-Calendar:dir(rtl){
		--spectrum-logical-rotation:matrix(-1, 0, 0, 1, 0, 0);
	}

.spectrum-Calendar{
  inline-size:var(--mod-calendar-width, var(--spectrum-calendar-width));
  display:inline-block;
}

.spectrum-Calendar--padded{
  margin:var(--mod-calendar-margin-x, var(--spectrum-calendar-margin-x)) var(--mod-calendar-margin-y, var(--spectrum-calendar-margin-y));
}

.spectrum-Calendar-header{
  display:flex;
  align-items:center;
  inline-size:100%;
}

.spectrum-Calendar-title{
  color:var(--highcontrast-calendar-day-title-text-color, var(--mod-calendar-day-title-text-color, var(--spectrum-calendar-day-title-text-color)));
  font-size:var(--mod-calendar-title-text-size, var(--spectrum-calendar-title-text-size));
  font-weight:bold;

  line-height:var(--mod-calendar-title-height, var(--spectrum-calendar-title-height));
  margin:0;
  order:1;
  flex-grow:1;

  text-align:center;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.spectrum-Calendar-prevMonth, .spectrum-Calendar-nextMonth{
  transform:var(--spectrum-logical-rotation);
}

.spectrum-Calendar-prevMonth:not([disabled]), .spectrum-Calendar-nextMonth:not([disabled]){
    color:var(--highcontrast-calendar-button-icon-color, var(--mod-calendar-button-icon-color, var(--spectrum-calendar-button-icon-color)));
  }

.spectrum-Calendar-prevMonth{
  order:0;
}

.spectrum-Calendar-nextMonth{
  order:2;
}

.spectrum-Calendar-dayOfWeek{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  block-size:100%;

  inline-size:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));

  border-block-end:none !important;

  color:var(--highcontrast-calendar-day-title-text-color, var(--mod-calendar-day-title-text-color, var(--spectrum-calendar-day-title-text-color)));
  font-size:var(--mod-calendar-day-title-text-size, var(--spectrum-calendar-day-title-text-size));
  font-weight:var(--mod-calendar-day-title-text-font-weight, var(--spectrum-calendar-day-title-text-font-weight));
  text-transform:uppercase;
  -webkit-text-decoration:none !important;
  text-decoration:none !important;

  cursor:default;
}

.spectrum-Calendar-dayOfWeek[title]{
    border-block-end:none;
    text-decoration:underline;
    text-decoration:underline;
    -webkit-text-decoration:underline dotted;
            text-decoration:underline dotted;
    letter-spacing:var(--mod-calendar-title-text-letter-spacing, var(--spectrum-calendar-title-text-letter-spacing));
  }

.spectrum-Calendar-body{
  outline:none;
}

.spectrum-Calendar-table{
  table-layout:fixed;

  border-collapse:collapse;
  border-spacing:0;

  -webkit-user-select:none;

          user-select:none;
}

.spectrum-Calendar-tableCell{
  text-align:center;
  position:relative;
  box-sizing:content-box;
  block-size:var(--mod-calendar-day-height, var(--spectrum-calendar-day-height));
  inline-size:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
  padding:var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding));
}

.spectrum-Calendar-tableCell:focus{
    outline:0;
  }

.spectrum-Calendar-date{
  position:absolute;
  display:block;
  inset-block-start:0;
  inset-inline-start:0;

  box-sizing:border-box;

  block-size:var(--mod-calendar-day-height, var(--spectrum-calendar-day-height));
  inline-size:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
  margin:var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding));

  border-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
  border:var(--mod-calendar-day-border-size, var(--spectrum-calendar-day-border-size)) solid transparent;

  font-size:var(--mod-calendar-day-text-size, var(--spectrum-calendar-day-text-size));
  line-height:calc(
    var(--mod-calendar-day-width, var(--spectrum-calendar-day-width)) -
    var(--mod-calendar-day-border-size, var(--spectrum-calendar-day-border-size)) * 2
  );
  white-space:nowrap;

  cursor:pointer;
}

.spectrum-Calendar-date:lang(ja), .spectrum-Calendar-date:lang(zh), .spectrum-Calendar-date:lang(ko){
    font-size:var(--mod-calendar-day-text-size-han, var(--spectrum-calendar-day-text-size-han));
  }

.spectrum-Calendar-date.is-disabled{
    cursor:default;
    pointer-events:none;
  }

.spectrum-Calendar-date.is-outsideMonth{
    display:none;
  }

.spectrum-Calendar-date::before{
    content:"";
    position:absolute;
    inset-block-start:calc(50% - calc(var(--mod-calendar-day-width, var(--spectrum-calendar-day-width)) / 2));
    inset-inline-start:calc(
      50% - calc(var(--mod-calendar-day-width, var(--spectrum-calendar-day-width)) / 2)
    );
    box-sizing:border-box;
    inline-size:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
    block-size:var(--mod-calendar-day-height, var(--spectrum-calendar-day-height));
    border-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
    border:var(--mod-calendar-day-border-size, var(--spectrum-calendar-day-border-size)) solid transparent;
  }

.spectrum-Calendar-date.is-selected:not(.is-range-selection){
    font-weight:var(--mod-calendar-day-text-font-weight-selected, var(--spectrum-calendar-day-text-font-weight-selected));
  }

.spectrum-Calendar-date.is-selected:not(.is-range-selection)::before{
      display:none;
    }

.spectrum-Calendar-date.is-today{
    font-weight:var(--mod-calendar-day-today-text-font-weight, var(--spectrum-calendar-day-today-text-font-weight));
  }

.spectrum-Calendar-date.is-range-selection{
    margin:var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding)) 0;
    border-width:var(--mod-calendar-border-width-reset, var(--spectrum-calendar-border-width-reset));
    line-height:var(--mod-calendar-day-height, var(--spectrum-calendar-day-height));
    border-radius:var(--mod-calendar-border-radius-reset, var(--spectrum-calendar-border-radius-reset));

    inline-size:calc(
      var(--mod-calendar-day-width, var(--spectrum-calendar-day-width)) +
      calc(var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding)) * 2)
    );
  }

.spectrum-Calendar-date.is-range-selection.is-range-start, .spectrum-Calendar-date.is-range-selection.is-range-end, .spectrum-Calendar-date.is-range-selection.is-selection-start, .spectrum-Calendar-date.is-range-selection.is-selection-end{
      inline-size:calc(
        var(--mod-calendar-day-width, var(--spectrum-calendar-day-width)) +
        var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding))
      );
    }

.spectrum-Calendar-date.is-range-selection.is-selection-start, .spectrum-Calendar-date.is-range-selection.is-selection-end{
      font-weight:var(--mod-calendar-day-text-font-weight-cap-selected, var(--spectrum-calendar-day-text-font-weight-cap-selected));
    }

.spectrum-Calendar-date.is-range-selection.is-selection-start::after, .spectrum-Calendar-date.is-range-selection.is-selection-end::after{
        position:absolute;
        inset-block-start:0;

        display:block;

        block-size:var(--mod-calendar-day-height, var(--spectrum-calendar-day-height));;
        inline-size:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));

        border-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));

        content:"";
      }

.spectrum-Calendar-date.is-range-selection.is-range-start, .spectrum-Calendar-date.is-range-selection.is-selection-start{
      padding-inline-end:var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding));
      margin-inline-start:var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding));
      border-start-start-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
      border-end-start-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
    }

.spectrum-Calendar-date.is-range-selection.is-range-start::before, .spectrum-Calendar-date.is-range-selection.is-selection-start::before, .spectrum-Calendar-date.is-range-selection.is-range-start::after, .spectrum-Calendar-date.is-range-selection.is-selection-start::after{
        inset-inline-start:0;
      }

.spectrum-Calendar-date.is-range-selection.is-range-end, .spectrum-Calendar-date.is-range-selection.is-selection-end{
      padding-inline-start:var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding));
      margin-inline-end:var(--mod-calendar-day-padding, var(--spectrum-calendar-day-padding));
      border-start-end-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
      border-end-end-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
    }

.spectrum-Calendar-date.is-range-selection.is-range-end::before, .spectrum-Calendar-date.is-range-selection.is-selection-end::before, .spectrum-Calendar-date.is-range-selection.is-range-end::after, .spectrum-Calendar-date.is-range-selection.is-selection-end::after{
        inset-inline-start:auto;
        inset-inline-end:0;
      }

.spectrum-Calendar-date.is-range-selection.is-selection-start.is-selection-end, .spectrum-Calendar-date.is-range-selection.is-selection-start.is-range-end, .spectrum-Calendar-date.is-range-selection.is-selection-end.is-range-start, .spectrum-Calendar-date.is-range-selection.is-range-start.is-range-end{
      inline-size:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
      border-radius:var(--mod-calendar-day-width, var(--spectrum-calendar-day-width));
    }

.spectrum-Calendar-date{
  color:var(--highcontrast-calendar-day-title-text-color, var(--mod-calendar-day-title-text-color, var(--spectrum-calendar-day-title-text-color)));
}

.spectrum-Calendar-date:active,
.spectrum-Calendar-date.is-active{
    background-color:var(--highcontrast-calendar-day-background-color-down, var(--mod-calendar-day-background-color-down, var(--spectrum-calendar-day-background-color-down)));
  }

.spectrum-Calendar-date.is-selected{
    color:var(--highcontrast-calendar-day-text-color-selected, var(--mod-calendar-day-text-color-selected, var(--spectrum-calendar-day-text-color-selected)));
    background:var(--highcontrast-calendar-day-background-color-selected, var(--mod-calendar-day-background-color-selected, var(--spectrum-calendar-day-background-color-selected)));
  }

.spectrum-Calendar-date.is-selected:not(.is-range-selection){
    background:var(--highcontrast-calendar-day-background-color-cap-selected, var(--mod-calendar-day-background-color-cap-selected, var(--spectrum-calendar-day-background-color-cap-selected)));
  }

.spectrum-Calendar-date.is-today{
    color:var(--highcontrast-calendar-day-today-text-color, var(--mod-calendar-day-today-text-color, var(--spectrum-calendar-day-today-text-color)));
    border-color:var(--highcontrast-calendar-day-today-border-color, var(--mod-calendar-day-today-border-color, var(--spectrum-calendar-day-today-border-color)));
  }

.spectrum-Calendar-date.is-today::before{
      border-color:var(--highcontrast-calendar-day-today-border-color, var(--mod-calendar-day-today-border-color, var(--spectrum-calendar-day-today-border-color)));
    }

@media (hover: hover){

.spectrum-Calendar-date:hover,
.spectrum-Calendar-date.is-hover{
    color:var(--highcontrast-calendar-day-text-color-hover, var(--mod-calendar-day-text-color-hover, var(--spectrum-calendar-day-text-color-hover)));
  }

.spectrum-Calendar-date:hover:not(.is-selection-end):not(.is-selection-start)::before,
.spectrum-Calendar-date.is-hover:not(.is-selection-end):not(.is-selection-start)::before,
.spectrum-Calendar-date.is-hover:not(.is-selection-end):not(.is-selection-start)::before{
        background:var(--highcontrast-calendar-day-background-color-hover, var(--mod-calendar-day-background-color-hover, var(--spectrum-calendar-day-background-color-hover)));
      }

.spectrum-Calendar-date.is-selected:hover:not(.is-selection-end):not(.is-selection-start)::before,
.spectrum-Calendar-date.is-selected.is-hover:not(.is-selection-end):not(.is-selection-start)::before,
.spectrum-Calendar-date.is-selected.is-hover:not(.is-selection-end):not(.is-selection-start)::before{
      background:var(--highcontrast-calendar-day-background-color-selected-hover, var(--mod-calendar-day-background-color-selected-hover, var(--spectrum-calendar-day-background-color-selected-hover)));
    }

.spectrum-Calendar-date.is-range-selection:hover::before,
.spectrum-Calendar-date.is-range-selection.is-hover::before{
        background:var(--highcontrast-calendar-day-background-color-selected-hover, var(--mod-calendar-day-background-color-selected-hover, var(--spectrum-calendar-day-background-color-selected-hover)));
      }

.spectrum-Calendar-date.is-today.is-selected:not(.is-range-selection):hover::before,
.spectrum-Calendar-date.is-today.is-selected:not(.is-range-selection).is-hover::before{
      background:var(--highcontrast-calendar-day-today-background-color-selected-hover, var(--mod-calendar-day-today-background-color-selected-hover, var(--spectrum-calendar-day-today-background-color-selected-hover)));
    }
}

.spectrum-Calendar-date.is-today.is-disabled{
      color:var(--highcontrast-calendar-day-today-text-color-disabled, var(--mod-calendar-day-today-text-color-disabled, var(--spectrum-calendar-day-today-text-color-disabled)));
      border-color:var(--highcontrast-calendar-day-today-border-color-disabled, var(--mod-calendar-day-today-border-color-disabled, var(--spectrum-calendar-day-today-border-color-disabled)));
    }

.spectrum-Calendar-date.is-today.is-disabled::before{
        border-color:var(--highcontrast-calendar-day-today-border-color-disabled, var(--mod-calendar-day-today-border-color-disabled, var(--spectrum-calendar-day-today-border-color-disabled)));
      }

.spectrum-Calendar-date.is-focused:not(.is-range-selection){
    background:var(--highcontrast-calendar-day-background-color-key-focus, var(--mod-calendar-day-background-color-key-focus, var(--spectrum-calendar-day-background-color-key-focus)));
    border-color:var(--highcontrast-calendar-day-border-color-key-focus, var(--mod-calendar-day-border-color-key-focus, var(--spectrum-calendar-day-border-color-key-focus)));
    color:var(--highcontrast-calendar-day-text-color-key-focus, var(--mod-calendar-day-text-color-key-focus, var(--spectrum-calendar-day-text-color-key-focus)));
  }

.spectrum-Calendar-date.is-focused.is-today:not(.is-range-selection){
      border-color:var(--highcontrast-calendar-day-border-color-key-focus, var(--mod-calendar-day-border-color-key-focus, var(--spectrum-calendar-day-border-color-key-focus)));
    }

.spectrum-Calendar-date.is-focused:not(.is-range-selection):active, .spectrum-Calendar-date.is-focused.is-selected:not(.is-range-selection),
.spectrum-Calendar-date.is-focused:not(.is-range-selection).is-active{
      color:var(--highcontrast-calendar-day-text-color-selected, var(--mod-calendar-day-text-color-selected, var(--spectrum-calendar-day-text-color-selected)));
      background:var(--highcontrast-calendar-day-background-color-cap-selected, var(--mod-calendar-day-background-color-cap-selected, var(--spectrum-calendar-day-background-color-cap-selected)));
      border-color:var(--highcontrast-calendar-day-border-color-key-focus, var(--mod-calendar-day-border-color-key-focus, var(--spectrum-calendar-day-border-color-key-focus)));
    }

.spectrum-Calendar-date.is-focused.is-selected::before{
        background:var(--highcontrast-calendar-day-background-color-selected-hover, var(--mod-calendar-day-background-color-selected-hover, var(--spectrum-calendar-day-background-color-selected-hover)));
      }

.spectrum-Calendar-date.is-focused.is-range-selection::before{
        background:var(--highcontrast-calendar-day-background-color-selected-hover, var(--mod-calendar-day-background-color-selected-hover, var(--spectrum-calendar-day-background-color-selected-hover)));
      }

.spectrum-Calendar-date.is-focused::before{
      border-color:var(--highcontrast-calendar-day-border-color-key-focus, var(--mod-calendar-day-border-color-key-focus, var(--spectrum-calendar-day-border-color-key-focus)));
    }

.spectrum-Calendar-date.is-disabled{
    color:var(--highcontrast-calendar-day-text-color-disabled, var(--mod-calendar-day-text-color-disabled, var(--spectrum-calendar-day-text-color-disabled)));
  }

.spectrum-Calendar-date.is-selection-start, .spectrum-Calendar-date.is-selection-end{
    color:var(--highcontrast-calendar-day-text-color-cap-selected, var(--mod-calendar-day-text-color-cap-selected, var(--spectrum-calendar-day-text-color-cap-selected)));
  }

.spectrum-Calendar-date.is-selection-start::after, .spectrum-Calendar-date.is-selection-end::after{
      background-color:var(--highcontrast-calendar-day-background-color-selected, var(--mod-calendar-day-background-color-selected, var(--spectrum-calendar-day-background-color-selected)));
    }

.spectrum-Calendar-date.is-selection-start.is-disabled, .spectrum-Calendar-date.is-selection-end.is-disabled{
      color:var(--highcontrast-calendar-day-text-color-disabled, var(--mod-calendar-day-text-color-disabled, var(--spectrum-calendar-day-text-color-disabled)));
    }

@media (forced-colors: active){
  .spectrum-Calendar-prevMonth, .spectrum-Calendar-nextMonth{
    --highcontrast-calendar-button-icon-color-disabled:GrayText;
    --highcontrast-calendar-button-icon-color:ButtonText;
  }

  .spectrum-Calendar-date{
    color:CanvasText;
    forced-color-adjust:none;

    --highcontrast-calendar-day-background-color-cap-selected:Highlight;
    --highcontrast-calendar-day-background-color-down:ButtonFace;
    --highcontrast-calendar-day-background-color-hover:Transparent;
    --highcontrast-calendar-day-background-color-key-focus:ButtonFace;
    --highcontrast-calendar-day-background-color-selected-hover:Transparent;
    --highcontrast-calendar-day-background-color-selected:Highlight;
    --highcontrast-calendar-day-border-color-key-focus:ButtonText;
    --highcontrast-calendar-day-text-color-cap-selected:HighlightText;
    --highcontrast-calendar-day-text-color-disabled:GrayText;
    --highcontrast-calendar-day-text-color-hover:ButtonText;
    --highcontrast-calendar-day-text-color-key-focus:ButtonText;
    --highcontrast-calendar-day-text-color-selected-hover:HighlightText;
    --highcontrast-calendar-day-text-color-selected:HighlightText;
    --highcontrast-calendar-day-title-text-color:CanvasText;
    --highcontrast-calendar-day-today-background-color-selected-hover:Highlight;
    --highcontrast-calendar-day-today-border-color-disabled:GrayText;
    --highcontrast-calendar-day-today-border-color:ButtonText;
    --highcontrast-calendar-day-today-text-color-disabled:GrayText;
    --highcontrast-calendar-day-today-text-color:ButtonText;
  }
      .spectrum-Calendar-date.is-range-selection.is-today{
        color:HighlightText;
      }

      .spectrum-Calendar-date.is-range-selection.is-selection-start::after, .spectrum-Calendar-date.is-range-selection.is-selection-end::after{
        content:none;
      }
      .spectrum-Calendar-date.is-disabled.is-range-selection{
        background:Highlight;
        color:HighlightText;
      }

      .spectrum-Calendar-date.is-disabled.is-selected{
        background:Highlight;
        color:HighlightText;
      }
}
