:host {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;

  // Ensure control icons are relative to the thumbnail.
  position: relative;
  overflow: hidden;

  transition: transform 0.2s linear;
}

:host(:not([details])) {
  aspect-ratio: 1 / 1;
}

:host([details]) {
  border: 1px solid var(--advanced-camera-card-thumbnail-border-color);
  border-radius: var(
    --advanced-camera-card-css-border-radius,
    var(--ha-card-border-radius, 4px)
  );
  padding: 2px;

  // When details are enabled, use a background color so that the details have
  // contrast with the background.
  background-color: var(--advanced-camera-card-thumbnail-background);
}

:host(:hover) {
  transform: scale(1.04);
}

advanced-camera-card-icon {
  position: absolute;
  border-radius: 50%;
  color: var(--advanced-camera-card-thumbnail-icon-color);

  cursor: pointer;

  transition:
    opacity 0.2s ease-in-out,
    color 0.2s ease-in-out;
}
advanced-camera-card-icon:hover {
  opacity: 1;
}

advanced-camera-card-icon.star {
  top: 3px;
  left: 3px;
}
advanced-camera-card-icon.star.starred {
  color: var(--advanced-camera-card-thumbnail-icon-favorite-color);
}

advanced-camera-card-icon.timeline {
  top: 3px;
  right: 3px;
}

advanced-camera-card-icon.download {
  right: 3px;
  bottom: 3px;
}

advanced-camera-card-thumbnail-details {
  flex: 1;
}
