/* The sheet of both areas, before their own (App.razor): the intranet's colours, which the back office's previews of
   intranet content wear too, the emojis' font and the emoji picker. Nothing here styles an element of one area only. */

:root {
  --intranet-blue-dark: #00589c;
  /* The text on PERIAL's blue: the agenda's events of all of PERIAL, a company without a badge. */
  --intranet-blue-dark-text: #ffffff;
  --intranet-blue: #316cf9;
  --intranet-blue-like: #2e6bf3;
  --intranet-text: #4c4c4e;
  --intranet-purple: #a04de4;
  --intranet-purple-light: #b577e8;
  --intranet-cursor: #a95fe6;
  --intranet-green: #4dc95b;
  --intranet-amber: #c98a1b;
  /* A slide of the bar in the colour of its announcement's type, white text on it: an information keeps the bar's green. */
  --intranet-bar-info: var(--intranet-green);
  --intranet-bar-success: #2e7d32;
  --intranet-bar-warning: #b26a00;
  --intranet-bar-error: #c62828;
  --intranet-sheet-wash: rgba(50, 50, 120, 0.05);
  /* What only the editors who show the drafts see: the menu's entries and the pages not published yet. */
  --intranet-draft: #d63384;
  --intranet-simulation-height: 0px;
  /* A badge without colours of its own, on the intranet and in the back office's IntranetBadge. */
  --intranet-badge: #eeeeee;
  --intranet-badge-text: #4c4c4e;
  /* The text of an article, a page or a comment: its emojis half as large again as its letters. */
  --intranet-text-font: "Dialog Emoji", 'Open Sans', sans-serif;

  /* The intranet's scale: every colour, corner, shadow, size, space, line height, plane and duration of its stylesheets is
     one of these, each the value its former sheets used most among the close ones. A shade of a colour is a color-mix of it, never a value of its own. */
  --intranet-white: #ffffff;
  --intranet-black: #000000;
  --intranet-text-strong: #333333;
  --intranet-text-soft: #5a5a5f;
  --intranet-text-muted: #6b6b70;
  --intranet-text-faint: #999999;
  --intranet-link: #337ab7;
  --intranet-link-hover: #23527c;
  --intranet-blue-hover: #185af8;
  --intranet-blue-dark-hover: #024b83;
  --intranet-blue-darker: #034171;
  --intranet-blue-wash: #f4f7ff;
  --intranet-blue-tint: #c9d6f7;
  --intranet-sky: #0391fd;
  --intranet-teal: #0daead;
  --intranet-yellow: #ffc000;
  --intranet-red: #c62828;
  --intranet-pink: #ffd1e6;
  --intranet-line: #e3e7f0;
  --intranet-line-strong: #d6d9e0;
  --intranet-gray-light: #eeeeee;
  --intranet-gray: #dddddd;
  --intranet-gray-dark: #cccccc;
  --intranet-wash: #f8f8f8;
  --intranet-backdrop: rgba(0, 0, 0, 0.4);

  --intranet-radius-sm: 4px;
  --intranet-radius-md: 8px;
  --intranet-radius-lg: 12px;
  --intranet-radius-pill: 999px;
  --intranet-radius-round: 50%;

  /* A card of the news; a block raised from its sheet; a menu or a drawer over the page; the rule between a menu's entries. */
  --intranet-shadow-card: 0 0 6px rgba(0, 0, 0, 0.1);
  --intranet-shadow-soft: 0 4px 8px rgba(0, 0, 0, 0.05);
  --intranet-shadow-pop: 0 6px 12px rgba(0, 0, 0, 0.175);
  --intranet-shadow-line: inset 1px -1px 0 rgba(0, 0, 0, 0.1);

  /* The theme's text is 14 pixels. */
  --intranet-font-2xs: 11px;
  --intranet-font-xs: 12px;
  --intranet-font-sm: 13px;
  --intranet-font-md: 14px;
  --intranet-font-lg: 16px;
  --intranet-font-xl: 18px;
  --intranet-font-2xl: 22px;
  --intranet-font-3xl: 30px;
  /* « Texte agrandi » of a rich text. */
  --intranet-font-lead: 20px;

  /* The theme's rhythm of 5 pixels, with the finer steps of the blocks below it. */
  --intranet-space-3xs: 2px;
  --intranet-space-2xs: 4px;
  --intranet-space-xs: 6px;
  --intranet-space-sm: 8px;
  --intranet-space-md: 10px;
  --intranet-space-lg: 12px;
  --intranet-space-xl: 15px;
  --intranet-space-2xl: 20px;
  --intranet-space-3xl: 25px;
  --intranet-space-4xl: 30px;
  --intranet-space-5xl: 40px;
  --intranet-space-6xl: 60px;

  /* A line as tall as its text; a title; a line of a card; the theme's text (20 pixels on 14); a text to read at length. */
  --intranet-leading-none: 1;
  --intranet-leading-tight: 1.2;
  --intranet-leading-snug: 1.35;
  --intranet-leading-base: 1.42857143;
  --intranet-leading-loose: 1.65;

  /* The planes of the page, from the bottom: above its neighbours within a component; a menu or a popover; a drawer or a
     panel over the page; the top bar and its menu on a phone; the bar of a simulation of roles, over everything. */
  --intranet-layer-raised: 1;
  --intranet-layer-menu: 1000;
  --intranet-layer-drawer: 5000;
  --intranet-layer-header: 9000;
  --intranet-layer-top: 10000;

  /* A hover; a panel that opens or a slide that changes; a block that moves into place. */
  --intranet-duration-fast: 150ms;
  --intranet-duration-base: 250ms;
  --intranet-duration-slow: 500ms;
}

/* The intranet's breakpoints, which a variable cannot hold: write them as they are, and no others.
   - Phone: (max-width: 767.98px), and (min-width: 768px) above it: the top bar instead of the side menu, one column.
   - Tablet: (max-width: 1024px), and (min-width: 1025px) above it: no side menu, no side column, no page actions.
   - Large: (min-width: 1480px): the agenda and the wide pages take their full width. */

/* The motifs both areas draw, the back office in its previews of the intranet. A badge: a rubrique, a company, an
   affiliation, in its own colours (an inline style, or --badge and --badge-text) when it has some; a count of a side
   column keeps its square. */
.pill-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: var(--intranet-radius-pill);
  background-color: var(--badge, var(--intranet-badge));
  color: var(--badge-text, var(--intranet-badge-text));
  font-size: var(--intranet-font-2xs);
  line-height: 16px;
  text-decoration: none;
}

.pill-badge.is-count {
  width: 37px;
  border-radius: var(--intranet-radius-sm);
  background-color: var(--intranet-white);
  color: var(--intranet-blue-dark);
  font-weight: 700;
  text-align: center;
}

a.pill-badge:hover,
a.pill-badge:focus-visible {
  text-decoration: none;
  filter: brightness(0.95);
}

/* The visual of a tool, as « Outils » frames it beside its name (ToolTile, the back office's ToolLogoPreview). */
.tool-visual {
  width: 108px;
  height: 72px;
  border-radius: var(--intranet-radius-md);
  object-fit: cover;
}

/* The system's emojis, half as large again as the letters around them, as the former theme drew its EmojiOne images
   (3ex): the intranet's texts and the editor's. The family covers the emojis only: the letters, ©, ® and the arrows keep
   the text's font. */
@font-face {
  font-family: "Dialog Emoji";
  src: local("Segoe UI Emoji"), local("Apple Color Emoji"), local("Noto Color Emoji");
  size-adjust: 150%;
  unicode-range: U+200D, U+20E3, U+2300-23FF, U+2600-27BF, U+2B00-2BFF, U+3030, U+303D, U+3297, U+3299, U+FE0F, U+1F000-1FAFF;
}

/* The emoji picker in its popover and the suggestions of « :bravo » (emoji.js). The accent is the area's: MudBlazor's
   primary in the back office, the theme's blue on the intranet. */

.emoji-popover,
.emoji-suggestions {
  --emoji-accent: var(--mud-palette-primary, var(--intranet-blue-dark, #00589c));
  --emoji-hover: color-mix(in srgb, var(--emoji-accent) 9%, #fff);
  --emoji-selected: color-mix(in srgb, var(--emoji-accent) 16%, #fff);
  position: fixed;
  z-index: 2000;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 32, 64, 0.18), 0 0 0 1px rgba(16, 32, 64, 0.08);
}

.emoji-popover[hidden],
.emoji-suggestions[hidden] {
  display: none;
}

.emoji-popover {
  overflow: hidden;
}

.emoji-popover emoji-picker {
  --num-columns: 8;
  --emoji-size: 1.5rem;
  --emoji-padding: 0.375rem;
  --border-size: 0;
  --background: #fff;
  --indicator-color: var(--emoji-accent);
  --outline-color: var(--emoji-accent);
  --input-border-radius: 8px;
  --input-font-size: 0.9375rem;
  --input-padding: 0.5rem 0.75rem;
  --button-hover-background: var(--emoji-hover);
  --button-active-background: var(--emoji-selected);
  --category-font-size: 0.8125rem;
  height: 22rem;
}

.emoji-suggestions {
  min-width: 15rem;
  max-width: 22rem;
  margin: 0;
  padding: 4px;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.3;
  color: #333;
}

.emoji-suggestions li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.625rem;
  border-radius: 8px;
  cursor: pointer;
}

.emoji-suggestions li:hover {
  background: var(--emoji-hover);
}

.emoji-suggestions li[aria-selected="true"] {
  background: var(--emoji-selected);
}

.emoji-suggestions-glyph {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.375rem;
  line-height: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .emoji-popover:not([hidden]) {
    animation: emoji-open 120ms ease-out;
  }
}

@keyframes emoji-open {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
