/* ==========================================================================
   .tp-notice — P1.F2.T3
   ©2026 Vexstorm Studios – All Rights Reserved

   UX-008's four mandated types, and the inline form of a Django message.

     --informational   blue    something the reader should know
     --update          green   something changed for the better
     --caution         yellow  something needs attention before it becomes a problem
     --alert           red     something is wrong now

   Variants   --informational  --update  --caution  --alert  --compact
   Elements   __icon  __body  __type  __title  __message  __actions  __dismiss
   States     :hover  :active  :focus-visible  :disabled  (on the dismiss control)

   ACC-004 IS THE POINT OF THIS FILE. Every notice renders three things: a type
   icon, a visible type word, and the message. The colour is the fourth signal,
   never the first. Remove all colour from this component and it still reads
   correctly — that is the test, and .tp-notice__type exists solely to pass it.

   Each type's surface, border, and text come from --tp-color-notice-<type>-*,
   and every one of those triples is asserted at AA in both themes by
   tests/accessibility/test_token_contrast.py.
   ========================================================================== */

.tp-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--tp-space-3);
  padding: var(--tp-space-4);
  border: var(--tp-border-width-hairline) solid var(--tp-color-border-default);
  border-inline-start: var(--tp-border-width-thick) solid var(--tp-color-border-strong);
  border-radius: var(--tp-radius-md);
  background-color: var(--tp-color-surface-raised);
  color: var(--tp-color-text-primary);
  font-size: var(--tp-text-sm);
  line-height: var(--tp-leading-normal);
}

/* --------------------------------------------------------------------------
   Elements
   -------------------------------------------------------------------------- */

/* aria-hidden in the template: the type word beside it already says this. */
.tp-notice__icon {
  flex: none;
  width: var(--tp-space-icon-lg);
  height: var(--tp-space-icon-lg);
  margin-top: var(--tp-space-1);
}

.tp-notice__body {
  flex: 1 1 auto;
  min-width: 0;
}

/* THE NON-COLOUR SIGNAL. "Information", "Update", "Caution", "Alert" — always
   rendered, never abbreviated, never replaced by the icon alone. */
.tp-notice__type {
  display: block;
  font-size: var(--tp-text-xs);
  font-weight: var(--tp-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tp-notice__title {
  display: block;
  margin-top: var(--tp-space-1);
  font-size: var(--tp-text-base);
  font-weight: var(--tp-weight-bold);
  line-height: var(--tp-leading-tight);
  overflow-wrap: break-word;
}

.tp-notice__message {
  margin-top: var(--tp-space-1);
  overflow-wrap: break-word;
}

.tp-notice__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tp-space-2);
  margin-top: var(--tp-space-3);
}

/* Marked data-tp-dismiss in the template; P1.F7's notices.js attaches to it. */
.tp-notice__dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--tp-space-target-min);
  height: var(--tp-space-target-min);
  border-radius: var(--tp-radius-sm);
  color: inherit;
  opacity: var(--tp-opacity-muted);
  cursor: pointer;
}

.tp-notice__dismiss:hover {
  opacity: 1;
  background-color: var(--tp-color-surface-raised);
}

.tp-notice__dismiss:active {
  background-color: var(--tp-color-accent-subtle);
}

.tp-notice__dismiss:disabled {
  opacity: var(--tp-opacity-disabled);
  cursor: not-allowed;
}

.tp-notice__dismiss:focus-visible {
  outline-offset: 0;
  opacity: 1;
}

.tp-notice__dismiss-icon {
  width: var(--tp-space-icon);
  height: var(--tp-space-icon);
}

/* --------------------------------------------------------------------------
   The four types
   -------------------------------------------------------------------------- */

.tp-notice--informational {
  border-color: var(--tp-color-notice-informational-border);
  background-color: var(--tp-color-notice-informational-surface);
  color: var(--tp-color-notice-informational-text);
}

.tp-notice--informational .tp-notice__icon {
  color: var(--tp-color-notice-informational);
}

.tp-notice--update {
  border-color: var(--tp-color-notice-update-border);
  background-color: var(--tp-color-notice-update-surface);
  color: var(--tp-color-notice-update-text);
}

.tp-notice--update .tp-notice__icon {
  color: var(--tp-color-notice-update);
}

.tp-notice--caution {
  border-color: var(--tp-color-notice-caution-border);
  background-color: var(--tp-color-notice-caution-surface);
  color: var(--tp-color-notice-caution-text);
}

.tp-notice--caution .tp-notice__icon {
  color: var(--tp-color-notice-caution);
}

.tp-notice--alert {
  border-color: var(--tp-color-notice-alert-border);
  background-color: var(--tp-color-notice-alert-surface);
  color: var(--tp-color-notice-alert-text);
}

.tp-notice--alert .tp-notice__icon {
  color: var(--tp-color-notice-alert);
}

/* --------------------------------------------------------------------------
   Variants
   -------------------------------------------------------------------------- */

.tp-notice--compact {
  padding: var(--tp-space-3);
  gap: var(--tp-space-2);
}

.tp-notice--compact .tp-notice__icon {
  width: var(--tp-space-icon);
  height: var(--tp-space-icon);
}
