/* ==========================================================================
   alerts.css — eHaj Design System
   Alert / notice banners: info, success, warning, danger; dismissible
   (pure CSS, no JavaScript) and sticky notification bar.
   Requires base.css.
   ========================================================================== */

.eh-alert {
  --_fg: var(--eh-info);
  --_bg: var(--eh-info-bg);
  --_border: var(--eh-info-border);

  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: var(--eh-space-4);
  border: 1px solid var(--_border);
  border-radius: var(--eh-radius);
  background: var(--_bg);
  color: color-mix(in srgb, var(--_fg) 88%, black);
}

.eh-alert-icon {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--_fg);
  color: var(--eh-white);
  font-size: 0.78rem;
  font-weight: 800;
}

.eh-alert-body {
  flex: 1;
  min-width: 0;
}

.eh-alert-title {
  margin: 0 0 0.15rem;
  font-weight: 700;
}

.eh-alert-body p {
  margin: 0;
  color: inherit;
  font-size: 0.875rem;
}

.eh-alert-success { --_fg: var(--eh-success); --_bg: var(--eh-success-bg); --_border: var(--eh-success-border); }
.eh-alert-warning { --_fg: var(--eh-warning); --_bg: var(--eh-warning-bg); --_border: var(--eh-warning-border); }
.eh-alert-danger  { --_fg: var(--eh-danger);  --_bg: var(--eh-danger-bg);  --_border: var(--eh-danger-border); }
.eh-alert-info    { --_fg: var(--eh-info);    --_bg: var(--eh-info-bg);    --_border: var(--eh-info-border); }
.eh-alert-neutral { --_fg: var(--eh-neutral); --_bg: var(--eh-neutral-bg); --_border: var(--eh-neutral-border); }

/* --------------------------------------------------------------------------
   Fermeture sans JavaScript (checkbox hack)
   Structure :
   <div class="eh-alert eh-alert-warning eh-alert-dismissible">
     <input type="checkbox" id="alert-1" class="eh-alert-dismiss-toggle">
     ...
     <label for="alert-1" class="eh-alert-close" aria-label="Fermer">×</label>
   </div>
   -------------------------------------------------------------------------- */

.eh-alert-dismissible {
  padding-right: 2.75rem;
}

.eh-alert-dismiss-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.eh-alert-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
}

.eh-alert-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.eh-alert-dismiss-toggle:checked ~ .eh-alert-body,
.eh-alert-dismiss-toggle:checked ~ .eh-alert-icon {
  display: none;
}

.eh-alert-dismiss-toggle:checked ~ .eh-alert-close::before {
  content: "";
}

.eh-alert:has(.eh-alert-dismiss-toggle:checked) {
  display: none;
}

/* --------------------------------------------------------------------------
   Bandeau de notification global (haut de page)
   -------------------------------------------------------------------------- */

.eh-alert-banner {
  border-radius: 0;
  border-width: 0 0 1px;
  justify-content: center;
  text-align: center;
}

.eh-alert-banner .eh-alert-body {
  flex: none;
}

/* --------------------------------------------------------------------------
   Zone de notifications (liste, ex : cloche du menu utilisateur)
   -------------------------------------------------------------------------- */

.eh-notification-list {
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: 360px;
}

.eh-notification-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.8rem;
  border-bottom: 1px solid var(--eh-border);
  text-decoration: none;
  color: inherit;
}

.eh-notification-item:last-child {
  border-bottom: 0;
}

.eh-notification-item:hover {
  background: var(--eh-bg-soft);
}

.eh-notification-item.is-unread {
  background: var(--eh-gold-100);
}

.eh-notification-item p {
  margin: 0;
  font-size: 0.85rem;
}

.eh-notification-item time {
  color: var(--eh-text-muted);
  font-size: 0.74rem;
}
