/* Jehre — the rainbow: the buttons that were blue, and the logo now and then. Black and white
 * everywhere else. The colours are the logo's own (pink-red, orange, yellow, green, blue, violet,
 * magenta), all side by side across the button.
 *   On light pages: a white button, its edge and its words in the rainbow (readable, and bright).
 *   On dark pages and photos: the rainbow fill, matte with a fine grain, and white words.
 * The platform's primary buttons (formerly blue) wear it: .sk-primary (Mes sites), .st-primary (Studio
 * Pro), .jp-btn--primary (the publish panel), .a-btn--primary (the dashboard), .ab-btn--primary (Abonnements),
 * .c-btn--primary (Compte), .btn--primary (the home page). Anywhere else:
 * class="… jr-rainbow"; on a dark surface add jr-on-dark (or sit under [data-theme="dark"] / .jr-dark).
 * The logo: class="jr-logo" on an <svg> whose page has <linearGradient id="jr-grad">. */
:root {
  --jr-c1: 232, 70, 124; --jr-c2: 240, 138, 60; --jr-c3: 240, 196, 20; --jr-c4: 34, 201, 126;
  --jr-c5: 30, 155, 224; --jr-c6: 106, 76, 255; --jr-c7: 193, 60, 224;
  /* the words in the rainbow: the same colours a little deeper, so they read on white */
  --jr-words: linear-gradient(100deg, #D63A6E, #DD6A1F, #B98500, #10955A, #1479BA, #5B3EF0, #A62BC8, #D63A6E);
  --jr-edge: linear-gradient(100deg, rgb(var(--jr-c1)), rgb(var(--jr-c2)), rgb(var(--jr-c3)), rgb(var(--jr-c4)), rgb(var(--jr-c5)), rgb(var(--jr-c6)), rgb(var(--jr-c7)));
  --jr-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* light pages: white button, rainbow edge and words */
:is(.jr-rainbow, .sk-primary, .st-primary, .jp .jp-btn--primary, .a-btn--primary, .ab-btn--primary, .c-btn--primary, .btn--primary) {
  border: 1.5px solid transparent !important;
  background-color: #FFFFFF !important;
  background-image: var(--jr-words), linear-gradient(#FFFFFF, #FFFFFF), var(--jr-edge) !important;
  /* the words' rainbow repeats every ~90 px, so even a short word shows every colour */
  background-size: 90px 100%, 100% 100%, 100% 100% !important;
  background-repeat: repeat-x, no-repeat, no-repeat !important;
  background-position: center, 0 0, 0 0 !important;
  background-origin: border-box !important;
  -webkit-background-clip: text, padding-box, border-box !important;
  background-clip: text, padding-box, border-box !important;
  -webkit-text-fill-color: transparent;
  color: #5B3EF0 !important;            /* the icons inside take one colour of the rainbow */
  text-shadow: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06) !important;
  transition: box-shadow .2s, transform .2s;
}
:is(.jr-rainbow, .sk-primary, .st-primary, .jp .jp-btn--primary, .a-btn--primary, .ab-btn--primary, .c-btn--primary, .btn--primary):hover { box-shadow: 0 2px 10px -2px rgba(106, 76, 255, .28), 0 2px 10px -4px rgba(232, 70, 124, .22) !important; }
:is(.jr-rainbow, .sk-primary, .st-primary, .jp .jp-btn--primary, .a-btn--primary, .ab-btn--primary, .c-btn--primary, .btn--primary):active { transform: translateY(1px); }
:is(.jr-rainbow, .sk-primary, .st-primary, .jp .jp-btn--primary, .a-btn--primary, .ab-btn--primary, .c-btn--primary, .btn--primary):focus-visible { outline: 2px solid #141414; outline-offset: 2px; }
:is(.jr-rainbow, .sk-primary, .st-primary, .jp .jp-btn--primary, .a-btn--primary, .ab-btn--primary, .c-btn--primary, .btn--primary):is([disabled], [aria-disabled="true"]) { opacity: .5; box-shadow: none !important; }

/* dark pages and photos: the rainbow fill, matte, grain, white words */
:is(.jr-on-dark.jr-rainbow, .jr-dark .jr-rainbow, [data-theme="dark"] :is(.jr-rainbow, .sk-primary, .st-primary), .jp--dark .jp-btn--primary) {
  --jr-tint: .62;
  border: 0 !important;
  background-color: rgba(30, 30, 30, .3) !important;
  background-image: var(--jr-grain), linear-gradient(100deg, rgba(var(--jr-c1), var(--jr-tint)) 0%, rgba(var(--jr-c2), var(--jr-tint)) 17%, rgba(var(--jr-c3), var(--jr-tint)) 33%, rgba(var(--jr-c4), var(--jr-tint)) 50%, rgba(var(--jr-c5), var(--jr-tint)) 67%, rgba(var(--jr-c6), var(--jr-tint)) 83%, rgba(var(--jr-c7), var(--jr-tint)) 100%) !important;
  background-size: 140px 140px, 100% 100% !important;
  background-repeat: repeat, no-repeat !important; background-position: 0 0, 0 0 !important;
  -webkit-background-clip: border-box !important; background-clip: border-box !important;
  background-blend-mode: soft-light, normal;
  -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25);
  -webkit-text-fill-color: #FFFFFF; color: #FFFFFF !important;
  text-shadow: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14) !important;
}
:is(.jr-on-dark.jr-rainbow, .jr-dark .jr-rainbow, [data-theme="dark"] :is(.jr-rainbow, .sk-primary, .st-primary), .jp--dark .jp-btn--primary):hover { --jr-tint: .8; }
:is(.jr-on-dark.jr-rainbow, .jr-dark .jr-rainbow, [data-theme="dark"] :is(.jr-rainbow, .sk-primary, .st-primary), .jp--dark .jp-btn--primary):focus-visible { outline-color: #FFFFFF; }
@property --jr-tint { syntax: '<number>'; inherits: true; initial-value: .62; }

/* the same white button with rainbow words, by class, anywhere */
.jr-rainbow-ink {
  border: 1.5px solid transparent !important;
  background-image: var(--jr-words), linear-gradient(#FFFFFF, #FFFFFF), var(--jr-edge) !important;
  background-size: 90px 100%, 100% 100%, 100% 100% !important;
  background-repeat: repeat-x, no-repeat, no-repeat !important;
  background-position: center, 0 0, 0 0 !important;
  background-origin: border-box !important;
  -webkit-background-clip: text, padding-box, border-box !important; background-clip: text, padding-box, border-box !important;
  -webkit-text-fill-color: transparent; color: #5B3EF0 !important;
}

/* the logo in the rainbow */
.jr-logo { fill: url(#jr-grad) !important; }
