/* ------------------------------------------------------------------
   TheMannsion - Mastodon custom CSS
   Palette: cream #F8F5EE  blue #283E87  red #CD2727
            yellow #F2C836  black #0A0A0A

   REQUIRES MASTODON 4.6 OR LATER.
   The theme token system (--color-*) was introduced in 4.6. On an
   older build these overrides do nothing at all, harmlessly.
   Check your version at Preferences > Administration, bottom of the
   page, before assuming this is broken.

   Only hue-carrying tokens are overridden here. Neutral background
   tokens are deliberately left alone so that both the light and dark
   themes keep working. Overriding those on :root breaks one or the
   other, which is the usual reason custom CSS makes a server unusable.
   ------------------------------------------------------------------ */

:root {
  /* Brand: replaces Mastodon purple on buttons, links, active states */
  --color-bg-brand-base: #2f49a6;
  --color-bg-brand-base-hover: #3e5cc9;
  --color-text-on-brand-base: #f8f5ee;

  --color-text-brand: #2f49a6;
  --color-text-brand-hover: #3e5cc9;
  --color-text-status-links: #2f49a6;

  --color-border-brand: #283e87;

  /* Tints use alpha so they sit correctly on light and dark alike */
  --color-bg-brand-soft: rgb(47 73 166 / 16%);
  --color-bg-brand-softest: rgb(47 73 166 / 8%);
  --color-border-brand-soft: rgb(47 73 166 / 45%);

  /* Post actions pick up the other two primaries */
  --color-text-favourite-highlight: #f2c836;
  --color-text-bookmark-highlight: #cd2727;

  /* Destructive actions use the Mondrian red */
  --color-bg-error-base: #cd2727;
  --color-bg-error-base-hover: #dc3a3a;
  --color-text-error: #cd2727;
  --color-border-error: #cd2727;
  --color-bg-error-soft: rgb(205 39 39 / 16%);
  --color-bg-error-softest: rgb(205 39 39 / 8%);

  /* Warning state takes the yellow */
  --color-bg-warning-base: #f2c836;
  --color-text-on-warning-base: #0a0a0a;
  --color-bg-warning-soft: rgb(242 200 54 / 20%);
  --color-bg-warning-softest: rgb(242 200 54 / 10%);
}

/* ------------------------------------------------------------------
   Mondrian rule pinned to the top of every page.
   Targets body only, so no Mastodon class names are involved and
   nothing here breaks on upgrade. Delete this block if you want the
   branding to stay entirely inside the color tokens.
   ------------------------------------------------------------------ */

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 9999;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    #f2c836 0 34%,
    #0a0a0a 34% 52%,
    #cd2727 52% 78%,
    #283e87 78% 100%
  );
}

/* Keep the strip clear of anything that scrolls under it */
@media (prefers-reduced-motion: no-preference) {
  body::before {
    transition: opacity 200ms ease;
  }
}

