/* ==========================================================================
   Global Notifications
   --------------------------------------------------------------------------
   - Flat white surface, subtle 1px border, soft radius, light shadow
   - 4px left accent color per variant
   - Typography and spacing aligned with article cards/panels
   ========================================================================== */

/* Root stack (inserted below header) */
.global-notifications-root {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* When visible, add a little space below the header */
#global-notifications-root:not(.hidden) {
  margin-top: 1rem;
}

/* Base card */
.global-notification {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  position: relative;
  border-left: 4px solid transparent;
  font-family: inherit;
}

/* Remove any previous glossy/radial highlights */
.global-notification::after { content: none; }

/* Ensure children inherit the same font stack */
.global-notification * {
  font-family: inherit;
}

/* Icon (soft-tinted background, colored glyph) */
.global-notification__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

/* Content column */
.global-notification__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}


/* Message — match article body size/line-height */
.global-notification__message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #334155;
}

/* Meta (e.g., “Publicerad för X min”) — align with timestamps */
.global-notification__meta {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #e5e7eb;
}

/* Actions (e.g., “Öppna i CMS”) */
.global-notification__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* CTA buttons — neutral, rounded, subtle lift on hover */
.global-notification__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.global-notification__cta:hover {
  background-color: #e2e8f0;
  transform: translateY(-1px);
}

.global-notification__cta i {
  font-size: 0.9rem;
}

/* Dismiss button — matches gray close icons elsewhere */
.global-notification__dismiss {
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.global-notification__dismiss:hover {
  color: #374151;
  background-color: #f1f5f9;
}

/* Fade-out helper used when removing notifications */
.animate-fade-out {
  animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* --------------------------------------------------------------------------
   Variants — accent strip + icon tint
   -------------------------------------------------------------------------- */

/* Info (blue) */
.global-notification--info { border-left-color: #2563eb; }
.global-notification--info .global-notification__icon {
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* Warning (amber) */
.global-notification--warning { border-left-color: #f59e0b; }
.global-notification--warning .global-notification__icon {
  background-color: #fef3c7;
  color: #b45309;
}

/* Critical (red) */
.global-notification--critical { border-left-color: #ef4444; }
.global-notification--critical .global-notification__icon {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Success (green) */
.global-notification--success { border-left-color: #16a34a; }
.global-notification--success .global-notification__icon {
  background-color: #dcfce7;
  color: #166534;
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .global-notification {
    flex-direction: column;
    align-items: stretch;
  }
  .global-notification__icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .global-notification__dismiss {
    align-self: flex-end;
  }
}

/* --------------------------------------------------------------------------
   (Optional) entry/exit animation helpers
   -------------------------------------------------------------------------- */
.global-notification--enter {
  opacity: 0;
  transform: translateY(-6px);
}
.global-notification--enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 140ms ease, transform 140ms ease;
}
.global-notification--exit {
  opacity: 1;
  transform: translateY(0);
}
.global-notification--exit-active {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
}


/* Match article-card headline scale & color */
.global-notification__title {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 600;
  color: #000000;
  letter-spacing: 0;
  margin: 0 0 0.125rem 0;
}

/* Give the bigger title some breathing room */
.global-notification {
  padding: 1rem 1.25rem;
}

/* Keep visual balance with a larger title */
.global-notification__icon {
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
}

/* Keep the message at the site’s body size */
.global-notification__message {
  font-size: 1rem;
  line-height: 1.6;
}

/* Meta line: keep our improved spacing/divider from the last patch */
.global-notification__meta {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #e5e7eb;
  text-transform: none;
  letter-spacing: normal;
}

/* Mobile: gently reduce the headline so banners don’t overwhelm */
@media (max-width: 640px) {
  .global-notification__title { font-size: 1.125rem; }
  .global-notification__icon  { width: 38px; height: 38px; font-size: 1.1rem; }
}
