/* =============================================
   Notification Paragraph Component
   ============================================= */

.paragraph--notification {
  padding: 3rem 10% 1rem 10%;
}

/* --- Paragraph-level sticky: stays in flow until JS adds .notification-is-stuck --- */
.paragraph--notification.notification-is-sticky {
  position: relative;
  z-index: 2;
}

/* Hide sticky notification until JS has calculated position to prevent jump on load */
.paragraph--notification.notification-is-sticky:not(.notification-positioned) {
  opacity: 0;
}

.paragraph--notification.notification-is-sticky.notification-positioned {
  opacity: 1;
}

.paragraph--notification.notification-is-sticky.notification-is-stuck {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  top: 2rem;
  z-index: 2;
  background-color: #f2f2f2;
}

/* --- Content-type sticky: immediately fixed at top (injected via Notification CT with sticky checked) --- */
.notification-source-injected .paragraph--notification.notification-is-sticky {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2;
  background-color: #f2f2f2;
}

/* Placeholder keeps layout space when notification is fixed */
.notification-sticky-placeholder {
  display: none;
}

.notification-sticky-placeholder.is-active {
  display: block;
  height: var(--sticky-placeholder-height, 0px);
}

.field__item:has(.paragraph--notification:not(.notification-hidden)) {
  background-color: #f2f2f2;
}

/* Collapse field item when notification is dismissed */
.field__item:has(.paragraph--notification.notification-hidden) {
  display: none;
}

/* Content-type sticky: reserve layout space when notification is fixed */
.field__item.notification-source-injected.has-sticky-notification {
  min-height: var(--sticky-notification-height, 0px);
}

/* Keep first notification below the overlapping desktop menu */
@media (min-width: 1025px) {
  .field__items > .field__item:first-child .paragraph--notification {
    padding-top: 80px;
  }


  /* Content-type sticky: reduce padding since fixed top handles clearance */
  .field__items > .field__item:first-child.notification-source-injected .paragraph--notification.notification-is-sticky {
    padding-top: 1rem;
  }

  /* Paragraph-level sticky when stuck: reduce padding */
  .field__items > .field__item:first-child .paragraph--notification.notification-is-sticky.notification-is-stuck {
    padding-top: 1rem;
  }

  /* Desktop top offset for content-type sticky */
  .notification-source-injected .paragraph--notification.notification-is-sticky {
    top: 112px;
  }

  /* Desktop top offset for paragraph-level sticky when stuck */
  .paragraph--notification.notification-is-sticky.notification-is-stuck {
    top: 112px;
  }
}

/* --- Wrapper --- */
.paragraph--notification .notification-wrapper {
  border: 1px solid var(--color-gray-light);
  border-left: 6px solid var(--color-gray-light);
  border-radius: 4px;
  padding: 1rem 1.5rem;
  position: relative;
  background-color: var(--color-white);
}

/* --- Close Button --- */
.paragraph--notification .notification-close {
  cursor: pointer;
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: none;
  border: none;
  padding: 0.25rem;
  line-height: 1;
  z-index: 1;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease-out;
}

.paragraph--notification .notification-close:hover {
  background-color: var(--color-gray-lighter);
}

.paragraph--notification .notification-close:focus {
  outline: 2px solid var(--color-gray-dark);
  outline-offset: 2px;
}

.paragraph--notification .notification-close-icon::before {
font-family: 'GeneraliIcons';
font-style: normal;
font-weight: normal;
display: inline-block;
text-decoration: inherit;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
content: "\e913";
color: #c21b17;
}

/* --- Content Layout --- */
.paragraph--notification .notification-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* --- Type Icon --- */
.paragraph--notification .notification-icon-type {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
}

.paragraph--notification .notification-icon-type::before {
  font-family: 'GeneraliIcons';
  font-style: normal;
  font-weight: normal;
  font-size: 1.25rem;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Body --- */
.paragraph--notification .notification-body {
  flex: 1;
  min-width: 0;
}

/* --- Title --- */
.paragraph--notification .notification-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
}

/* --- Message --- */
.paragraph--notification .notification-message {
  margin-top: 0.25rem;
  color: var(--color-body);
  font-size: 0.875rem;
  line-height: 1.5;
}

.paragraph--notification .notification-message p {
  margin: 0;
  word-break: break-word;
}

/* --- Links --- */
.paragraph--notification .notification-links {
  padding: 0.5rem 0 0 2rem;
}

.paragraph--notification .notification-links ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
  display: flex;
  flex-wrap: wrap;
}

.paragraph--notification .notification-links ul li {
  display: inline-block;
  line-height: 1;
  padding: 4px 11px;
  border-right: 1px solid var(--color-gray-light);
}

.paragraph--notification .notification-links ul li:first-child {
  padding-left: 0;
}

.paragraph--notification .notification-links ul li:last-child {
  border-right: none;
}

.paragraph--notification .notification-links ul li:only-child {
  border-right: none;
  padding: 4px 0;
}

.paragraph--notification .notification-links a {
  color: var(--color-red);
  text-decoration: underline;
  font-size: 0.875rem;
  font-weight: 500;
}

.paragraph--notification .notification-links a:hover {
  text-decoration: none;
}

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

/* --- Info --- */
.paragraph--notification .notification-wrapper.type-info {
  border-left-color: #51535a;
}

.paragraph--notification .notification-wrapper.type-info .notification-icon-type::before {
  content: "\e921"; /* Info icon */
  color: #51535a;
}

.paragraph--notification .notification-wrapper.type-info .notification-title {
  color: #51535a;
}

/* --- Error --- */
.paragraph--notification .notification-wrapper.type-error {
  border-left-color: var(--color-red);
}

.paragraph--notification .notification-wrapper.type-error .notification-icon-type::before {
  content: "\e912"; /* Cross-rounded icon */
  color: var(--color-red);
}

.paragraph--notification .notification-wrapper.type-error .notification-title {
  color: var(--color-red);
}

/* --- Success --- */
.paragraph--notification .notification-wrapper.type-success {
  border-left-color: var(--color-green);
}

.paragraph--notification .notification-wrapper.type-success .notification-icon-type::before {
  content: "\e93c"; /* Tick-rounded icon */
  color: var(--color-green);
}

.paragraph--notification .notification-wrapper.type-success .notification-title {
  color: #1a8a4a;
}

/* --- Warning --- */
.paragraph--notification .notification-wrapper.type-warning {
  border-left-color: var(--color-orange);
}

.paragraph--notification .notification-wrapper.type-warning .notification-icon-type::before {
  content: "\e952"; /* Info-icon-1 (warning style) */
  color: var(--color-orange);
}

.paragraph--notification .notification-wrapper.type-warning .notification-title {
  color: #c45a00;
}

/* =============================================
   Hidden state (after close)
   ============================================= */
.paragraph--notification.notification-hidden {
  display: none;
}

/* =============================================
   Slide-up animation
   ============================================= */
.paragraph--notification.notification-closing {
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out, margin 0.3s ease-out;
  max-height: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
}
