/* =========================================================
   alert.css — DutchLine MAX Alerts
   - Default: soft
   - Left rail: ONLY for neutral
   - Works with theme-core.css vars
   ========================================================= */

/* Fallbacks (if a project page misses some vars) */
:root{
  --dl-alert-success: #20c997;
  --dl-alert-warning: #ffc107;
  --dl-alert-danger:  #ff4d4d;
  --dl-alert-info:    #0d6efd;
  --dl-alert-neutral: rgba(11,18,32,.72);
  --dl-alert-accent:  var(--accent, #304DA1);
}

/* Base */
.dl-alert{
  --_a: var(--dl-alert-neutral); /* type color */
  --_bg: color-mix(in srgb, var(--_a) 9%, #fff);
  --_bd: color-mix(in srgb, var(--_a) 18%, var(--border, rgba(11,18,32,.10)));
  --_iconbg: color-mix(in srgb, var(--_a) 12%, #fff);

  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;

  border-radius: var(--r2, 18px);
  border: 1px solid var(--_bd);
  background: var(--_bg);

  padding: 14px 14px;
  box-shadow: var(--shadow2, 0 12px 30px rgba(11,18,32,.10));

  color: var(--text, #0b1220);
}

/* Content */
.dl-alert-title{
  font-weight: 950;
  letter-spacing: -.01em;
  margin: 0;
  line-height: 1.2;
}

.dl-alert-text{
  margin: 6px 0 0;
  color: var(--muted, rgba(11,18,32,.70));
  line-height: 1.6;
}

.dl-alert-content{ min-width: 0; flex: 1 1 auto; }

.dl-alert-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Icon chip */
.dl-alert-icon{
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;

  background: var(--_iconbg);
  border: 1px solid color-mix(in srgb, var(--_a) 18%, var(--border, rgba(11,18,32,.10)));
  color: color-mix(in srgb, var(--_a) 75%, var(--text, #0b1220));
}

/* Icon SVG defaults */
.dl-alert-icon svg{
  width: 18px;
  height: 18px;
}

/* Dismiss button */
.dl-alert-dismiss{
  flex: 0 0 auto;
  margin-left: 2px;

  width: 38px;
  height: 38px;
  border-radius: 14px;

  border: 1px solid var(--border, rgba(11,18,32,.10));
  background: rgba(255,255,255,.72);

  display: grid;
  place-items: center;

  color: rgba(11,18,32,.72);
  cursor: pointer;

  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dl-alert-dismiss:hover{
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--border2, rgba(11,18,32,.14));
  box-shadow: 0 10px 22px rgba(11,18,32,.08);
}

.dl-alert-dismiss:focus{
  outline: none;
  box-shadow: 0 0 0 6px var(--focus, rgba(48,77,161,.26));
}

/* =========================================================
   Types (set only the type color)
   ========================================================= */
.dl-alert-neutral{ --_a: var(--dl-alert-neutral); }
.dl-alert-info{    --_a: var(--dl-alert-info); }
.dl-alert-success{ --_a: var(--dl-alert-success); }
.dl-alert-warning{ --_a: var(--dl-alert-warning); }
.dl-alert-danger{  --_a: var(--dl-alert-danger); }
.dl-alert-accent{  --_a: var(--dl-alert-accent); }

/* =========================================================
   Left rail ONLY on neutral
   ========================================================= */
.dl-alert-neutral{
  padding-left: 16px; /* room for rail + nicer alignment */
}

.dl-alert-neutral::before{
  content:"";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent, #304DA1) 70%, rgba(11,18,32,.70)),
    rgba(11,18,32,.14)
  );
  opacity: .85;
}

/* =========================================================
   Variants
   ========================================================= */

/* Outline: for dense UI contexts */
.dl-alert-outline{
  background: #fff;
  box-shadow: none;
  border-color: color-mix(in srgb, var(--_a) 22%, var(--border, rgba(11,18,32,.10)));
}

.dl-alert-outline .dl-alert-icon{
  background: rgba(255,255,255,.92);
}

/* Compact: toolbars, inline system notes */
.dl-alert-compact{
  padding: 10px 12px;
  gap: 10px;
  border-radius: var(--r2, 18px);
}

.dl-alert-compact .dl-alert-icon{
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.dl-alert-compact .dl-alert-title{
  font-size: .98rem;
}

.dl-alert-compact .dl-alert-text{
  margin-top: 4px;
  font-size: .94rem;
}

.dl-alert-compact .dl-alert-dismiss{
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

/* No shadow: if embedded inside panels already */
.dl-alert-flat{
  box-shadow: none;
}

/* =========================================================
   Animations for dismiss (JS adds classes)
   ========================================================= */
.dl-alert.is-hiding{
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

/* =========================================================
   Links inside alerts
   ========================================================= */
.dl-alert a{
  color: color-mix(in srgb, var(--_a) 70%, var(--text, #0b1220));
  font-weight: 850;
  text-decoration: none;
}

.dl-alert a:hover{
  color: var(--accent, #304DA1);
}

/* =========================================================
   Utility: spacing when stacked
   ========================================================= */
.dl-alert + .dl-alert{ margin-top: 10px; }
