/**
 * @file
 * Site-wide restyle of Drupal status/warning/error messages.
 *
 * Claro ships dark messages (--messages-bg-color: #353641, white text).
 * We swap to a light tinted background per type + dark text + the project
 * accent colour on the left border and the icon. Dimensions (border width,
 * radius, padding) stay as Claro sets them.
 *
 * Project accents: success #1F9E89 · warning #E1A83A · error #E65C5F.
 */

/* Rounded corners for all messages. */
.messages {
  --messages-border-radius: 10px;
}

.messages.messages--status {
  --messages-bg-color: #E6F5EE;        /* light green tint */
  --messages-fg-color: #15503B;        /* dark green text */
  --messages--status-color: #1F9E89;   /* border (project green) */
}

.messages.messages--warning {
  --messages-bg-color: #FCF6E0;        /* light amber tint */
  --messages-fg-color: #6F5300;        /* dark amber text */
  --messages--warning-color: #E1A83A;  /* border (project amber) */
}

.messages.messages--error {
  --messages-bg-color: #FBE9E9;        /* light red tint */
  --messages-fg-color: #7D2723;        /* dark red text */
  --messages--error-color: #E65C5F;    /* border (project red) */
}

/* Recolour the type icons to the project accents (Claro hardcodes them). */
.messages--status .messages__header {
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 13'%3e%3cpath d='M2 6.571L5.6 10 14 2' fill='none' stroke='%231F9E89' stroke-width='3'/%3e%3c/svg%3e") no-repeat center left;
}

.messages--warning .messages__header {
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 4 14' fill='%23E1A83A'%3e%3cpath d='M.5 0h3v9h-3z'/%3e%3ccircle cx='2' cy='12.5' r='1.5'/%3e%3c/svg%3e") no-repeat center left;
}

.messages--error .messages__header {
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 14 14'%3e%3cpath d='M3 11.193L11.45 3' stroke='%23E65C5F' stroke-width='2'/%3e%3ccircle cx='7' cy='7' r='6' fill='none' stroke='%23E65C5F' stroke-width='2'/%3e%3c/svg%3e") no-repeat center left;
}

/* Links inside messages (Claro defaults to an unreadable yellow on light). */
.messages a {
  --messages__link-color: #00ACB1;
  --messages__link--hover-color: #007E82;
}

/* Status ("saved") messages: render the entity link as plain, non-clickable
   text so regular users can't navigate away from the confirmation. Admins
   (body.user-role-administrator, added by ds_core) keep the normal link.
   The export "Download the file here" link (has a [download] attribute) is
   excluded so it stays clickable for everyone. */
body:not(.user-role-administrator) .messages--status a:not([download]) {
  pointer-events: none;
  cursor: default;
  color: inherit;
  text-decoration: none;
}
