:host {
  --star-height: 16px;
  --star-height-large: 23px;
  --star-width: 16px;
  --star-width-large: 24px;
}

.dc-rating {
  display: flex;
  height: var(--star-height);
}

.dc-rating-inputs {
  display: flex;
}

.dc-rating-input-label {
  cursor: pointer;
  height: var(--star-height);
  position: relative;
  width: var(--star-width);
}

.dc-rating-input-label:not(:last-child),
.dc-rating-star-wrapper:not(:last-child) {
  padding-right: 4px;
}

.dc-rating-input {
  margin: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  pointer-events: none;
}

.dc-rating-star-wrapper {
  height: var(--star-height);
  width: var(--star-width);
}

.dc-rating-star {
  height: var(--star-height);
  overflow: hidden;
}

.dc-rating-star svg {
  height: var(--star-height);
  width: var(--star-width);
}

.dc-rating-star svg path {
  stroke: var(--dc-border-color);
}

.dc-full-star path {
  fill: var(--dc-fill-interactive);
}

/* Input related classes */
.full-star {
  display: block;
  left: 0;
  position: absolute;
  top: 0;
}

/* Read only variant classes */
.dc-rating-display {
  display: flex;
  position: relative;
}

.dc-rating-display-empty-stars {
  display: flex;
  height: var(--star-height);
}

.dc-rating-display-full-stars {
  display: flex;
  height: var(--star-height);
  position: absolute;
}

/* Input label should only be visible to screen readers */
.dc-rating-sr-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  border: 0;
}

.dc-rating-label {
  align-items: center;
  color: var(--dc-primary-text-color);
  display: flex;
  font-family: var(--dc-font-family);
  font-size: 14px;
  letter-spacing: -0.2px;
  line-height: 18px;
  margin-left: 8px;
}

/* Initial state to hide full stars on initial load */
.initial-state .full-star {
  opacity: 0;
}

/* Checked states */
.dc-rating-input:checked ~ .dc-rating-input-label .full-star {
  opacity: 0;
}

.dc-rating-input:checked + .dc-rating-input-label .full-star {
  opacity: 1;
}

/* Focus state */
.dc-rating-input:focus-visible + .dc-rating-input-label .full-star {
  border-radius: 4px;
  outline: 1px solid var(--dc-primary-colour);
  outline-offset: 1px;
}

/* Hover states */

/*
 * '!important' keywords used to enforce hover styles,
 * even if above checked styles are present
 */
.dc-rating-inputs:hover .full-star {
  opacity: 1 !important;
}

.dc-rating-input-label:hover ~ .dc-rating-input-label .full-star {
  opacity: 0 !important;
}

/* Large size variant */
.large .dc-rating-input-label,
.large .dc-rating-star-wrapper,
.large .dc-rating-star,
.large .dc-rating-star svg {
  height: var(--star-height-large);
  width: var(--star-width-large);
}

.large.dc-rating,
.large .dc-rating-display-empty-stars,
.large .dc-rating-display-full-stars {
  height: var(--star-height-large);
}
