/* Alerts + optional thickness */

.ccl-alert {
  --alert-border-w: 1px;
  --alert-py: 0.75rem;
  --alert-px: 1rem;
  --alert-radius: 0.375rem;
  --alert-focus-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: var(--alert-py) var(--alert-px);
  margin: 0.5rem 0;
  border-radius: var(--alert-radius);
  border: var(--alert-border-w) solid var(--ccl-alert-border, transparent);
  background-color: var(--ccl-alert-bg, transparent);
  color: var(--ccl-alert-color, inherit);
  font-size: 0.875rem;
  line-height: 1.5;
}

.ccl-alert--thick-thin {
  --alert-border-w: 1px;
  --alert-py: 0.5rem;
  --alert-px: 0.75rem;
  font-size: 0.8125rem;
}

.ccl-alert--thick-normal {
  --alert-border-w: 1px;
  --alert-py: 0.75rem;
  --alert-px: 1rem;
  font-size: 0.875rem;
}

.ccl-alert--thick-thick {
  --alert-border-w: 2px;
  --alert-py: 1rem;
  --alert-px: 1.25rem;
  font-size: 1rem;
}

.ccl-alert__content {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.ccl-alert__icon {
  font-size: 1.125rem;
  line-height: 1;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.ccl-alert__text {
  flex: 1;
  min-width: 0;
}

.ccl-alert__title {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: inherit;
}

.ccl-alert__message {
  display: block;
}

/* Semantic variant colors */
.ccl-alert--primary {
  --ccl-alert-bg: #cfe2ff;
  --ccl-alert-border: #9ec5fe;
  --ccl-alert-color: #052c65;
}

.ccl-alert--secondary {
  --ccl-alert-bg: #e2e3e5;
  --ccl-alert-border: #c4c8cb;
  --ccl-alert-color: #41464b;
}

.ccl-alert--success {
  --ccl-alert-bg: #d1e7dd;
  --ccl-alert-border: #a3cfbb;
  --ccl-alert-color: #0a3622;
}

.ccl-alert--danger {
  --ccl-alert-bg: #f8d7da;
  --ccl-alert-border: #f1aeb5;
  --ccl-alert-color: #58151c;
}

.ccl-alert--warning {
  --ccl-alert-bg: #fff3cd;
  --ccl-alert-border: #ffe69c;
  --ccl-alert-color: #664d03;
}

.ccl-alert--info {
  --ccl-alert-bg: #cff4fc;
  --ccl-alert-border: #9eeaf9;
  --ccl-alert-color: #055160;
}

.ccl-alert--light {
  --ccl-alert-bg: #fefefe;
  --ccl-alert-border: #e9ecef;
  --ccl-alert-color: #495057;
}

.ccl-alert--dark {
  --ccl-alert-bg: #ced4da;
  --ccl-alert-border: #adb5bd;
  --ccl-alert-color: #495057;
}

.ccl-alert__close {
  flex-shrink: 0;
  padding: 0.25rem;
  margin: -0.125rem -0.125rem -0.125rem 0;
  background: transparent;
  border: 0;
  border-radius: 0.375rem;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.ccl-alert__close:hover {
  opacity: 1;
}

.ccl-alert__close:focus-visible {
  outline: 0;
  box-shadow: var(--alert-focus-shadow);
}

.ccl-alert__close-icon {
  width: 1rem;
  height: 1rem;
}
