/* ==========================================================================
   Spots (layouts/shared/spot, App\Support\Spots): the small drawings of the
   site. A spot is a tile in the tone of its place with one drawing of the
   sprite (public/img/spots-1.svg) on it. The drawing is shown through <use>
   from another file, so no rule of a sheet reaches its shapes: it reads its
   paint from the custom properties set here, and a tone is nothing but
   another set of them.

       --sp        the tone            --sp-edge   the hairline of a white sheet
       --sp-deep   its dark            --sp-faint  a line of words
       --sp-soft   its light           --sp-ok     the tick of a badge
       --sp-wash   the tile            --sp-gold   the coin, the star, the sun
       --sp-paper  a white sheet       --sp-ring   the rim that parts a badge from the drawing

   The tile is 60px; a place sizes it with --spot-size or with spot--xs (42),
   spot--sm (48), spot--lg (76) and spot--xl (92). spot--bare shows the
   drawing without a tile, spot--pill is the drawing alone at the height of a
   pill (30), spot--dark stands on a deep plate and draws in gold. A wrapper
   that was a tile itself takes spot-holder (see The holder). One sheet for every page that
   shows a spot, printed once. Nothing moves here: a place that lifts its
   card may tilt its spot, and rests it for a reader who asked for less
   motion. The dark dashboard (html.dark) is dressed at the end of the sheet.
   ========================================================================== */

.spot {
    --sp: #2563eb;
    --sp-deep: #1d4ed8;
    --sp-soft: #bfdbfe;
    --sp-wash: #eff6ff;
    --sp-edge: rgba(37, 99, 235, 0.3);
    --sp-faint: rgba(15, 23, 42, 0.14);
    --sp-ok: #059669;
    --sp-gold: #f59e0b;
    --sp-paper: #ffffff;
    --sp-ring: #ffffff;
    --spot-size: 60px;

    position: relative;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    box-sizing: border-box;
    width: var(--spot-size);
    height: var(--spot-size);
    border-radius: calc(var(--spot-size) * 0.3);
    background: linear-gradient(150deg, #ffffff 0%, var(--sp-wash) 100%);
    box-shadow: inset 0 0 0 1px var(--sp-edge), 0 14px 22px -18px var(--sp);
    line-height: 0;
    vertical-align: middle;
}

.spot svg {
    display: block;
    width: 74%;
    height: 74%;
    overflow: visible;
}

.spot--xs { --spot-size: 42px; }
.spot--sm { --spot-size: 48px; }
.spot--lg { --spot-size: 76px; }
.spot--xl { --spot-size: 92px; }

/* the drawing alone, where its place is already a tile */
.spot--bare {
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.spot--bare svg {
    width: 100%;
    height: 100%;
}

/* the drawing alone at the height of a pill: the chip of an accreditation, a link of a list */
.spot--pill {
    --spot-size: 30px;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.spot--pill svg {
    width: 100%;
    height: 100%;
}

/* --------------------------------------------------------------------------
   The holder
   A wrapper that held an icon and was a tile itself (a fill, a border, a
   fixed size, written by a sheet of its page or of its platform) takes
   spot-holder and rests: it is the place of the drawing and nothing more, and
   what its old sheet wrote for an icon inside it no longer reaches the
   drawing. The name is said four times so that it holds against the sheet of
   any page; a wrapper whose old rules are forced takes a new name instead.
   -------------------------------------------------------------------------- */
.spot-holder.spot-holder.spot-holder.spot-holder {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    line-height: 0;
}

.spot-holder.spot-holder.spot-holder.spot-holder .spot svg {
    width: 74%;
    height: 74%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    fill: none;
    stroke: none;
}

.spot-holder.spot-holder.spot-holder.spot-holder .spot--bare svg,
.spot-holder.spot-holder.spot-holder.spot-holder .spot--pill svg {
    width: 100%;
    height: 100%;
}

/* --------------------------------------------------------------------------
   The tones
   -------------------------------------------------------------------------- */
.spot--sky {
    --sp: #0284c7;
    --sp-deep: #0369a1;
    --sp-soft: #bae6fd;
    --sp-wash: #f0f9ff;
    --sp-edge: rgba(2, 132, 199, 0.32);
}

.spot--violet {
    --sp: #7c3aed;
    --sp-deep: #6d28d9;
    --sp-soft: #ddd6fe;
    --sp-wash: #f5f3ff;
    --sp-edge: rgba(124, 58, 237, 0.3);
}

.spot--rose {
    --sp: #e11d48;
    --sp-deep: #be123c;
    --sp-soft: #fecdd3;
    --sp-wash: #fff1f2;
    --sp-edge: rgba(225, 29, 72, 0.28);
}

.spot--teal {
    --sp: #0d9488;
    --sp-deep: #0f766e;
    --sp-soft: #99f6e4;
    --sp-wash: #f0fdfa;
    --sp-edge: rgba(13, 148, 136, 0.32);
    --sp-ok: #2563eb;
}

.spot--orange {
    --sp: #ea580c;
    --sp-deep: #c2410c;
    --sp-soft: #fed7aa;
    --sp-wash: #fff7ed;
    --sp-edge: rgba(234, 88, 12, 0.3);
}

.spot--indigo {
    --sp: #4f46e5;
    --sp-deep: #4338ca;
    --sp-soft: #c7d2fe;
    --sp-wash: #eef2ff;
    --sp-edge: rgba(79, 70, 229, 0.3);
}

.spot--emerald {
    --sp: #059669;
    --sp-deep: #047857;
    --sp-soft: #a7f3d0;
    --sp-wash: #ecfdf5;
    --sp-edge: rgba(5, 150, 105, 0.32);
    --sp-ok: #2563eb;
}

.spot--amber {
    --sp: #d97706;
    --sp-deep: #b45309;
    --sp-soft: #fde68a;
    --sp-wash: #fffbeb;
    --sp-edge: rgba(217, 119, 6, 0.34);
    --sp-gold: #fbbf24;
}

.spot--navy {
    --sp: #1e3a8a;
    --sp-deep: #172554;
    --sp-soft: #bfdbfe;
    --sp-wash: #eff6ff;
    --sp-edge: rgba(30, 58, 138, 0.3);
}

.spot--cyan {
    --sp: #0891b2;
    --sp-deep: #0e7490;
    --sp-soft: #a5f3fc;
    --sp-wash: #ecfeff;
    --sp-edge: rgba(8, 145, 178, 0.32);
}

/* On a deep plate (navy, emerald) the tile is glass and the drawing is gold, whatever tone it was given:
   a tone made for a white card would sink into the plate. The white sheets of a drawing stay white. */
.spot--dark {
    --sp: #fbbf24;
    --sp-deep: #fde68a;
    --sp-soft: rgba(253, 230, 138, 0.4);
    --sp-edge: rgba(255, 255, 255, 0.55);
    --sp-faint: rgba(15, 23, 42, 0.2);
    --sp-ok: #34d399;
    --sp-gold: #fbbf24;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

/* --------------------------------------------------------------------------
   The dark dashboard. The page is repainted by a script that cannot reach a
   drawing, so the tile carries data-dm-skip and is dressed here: a pane of
   glass, sheets of slate, and each tone a shade lighter so it holds on the
   dark surface.
   -------------------------------------------------------------------------- */
html.dark .spot {
    --sp: #60a5fa;
    --sp-deep: #93c5fd;
    --sp-soft: rgba(96, 165, 250, 0.3);
    --sp-edge: rgba(191, 208, 235, 0.62);
    --sp-faint: rgba(226, 232, 240, 0.5);
    --sp-ok: #34d399;
    --sp-gold: #fbbf24;
    --sp-paper: #3f5583;
    --sp-ring: #1b2640;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

html.dark .spot--sky { --sp: #38bdf8; --sp-deep: #7dd3fc; --sp-soft: rgba(56, 189, 248, 0.28); }
html.dark .spot--violet { --sp: #a78bfa; --sp-deep: #c4b5fd; --sp-soft: rgba(167, 139, 250, 0.3); }
html.dark .spot--rose { --sp: #fb7185; --sp-deep: #fda4af; --sp-soft: rgba(251, 113, 133, 0.28); }
html.dark .spot--teal { --sp: #2dd4bf; --sp-deep: #5eead4; --sp-soft: rgba(45, 212, 191, 0.26); --sp-ok: #60a5fa; }
html.dark .spot--orange { --sp: #fb923c; --sp-deep: #fdba74; --sp-soft: rgba(251, 146, 60, 0.28); }
html.dark .spot--indigo { --sp: #818cf8; --sp-deep: #a5b4fc; --sp-soft: rgba(129, 140, 248, 0.3); }
html.dark .spot--emerald { --sp: #34d399; --sp-deep: #6ee7b7; --sp-soft: rgba(52, 211, 153, 0.26); --sp-ok: #60a5fa; }
html.dark .spot--amber { --sp: #fbbf24; --sp-deep: #fcd34d; --sp-soft: rgba(251, 191, 36, 0.28); --sp-gold: #fde68a; }
html.dark .spot--navy { --sp: #93c5fd; --sp-deep: #bfdbfe; --sp-soft: rgba(147, 197, 253, 0.26); }
html.dark .spot--cyan { --sp: #22d3ee; --sp-deep: #67e8f9; --sp-soft: rgba(34, 211, 238, 0.26); }

html.dark .spot--dark {
    --sp: #fbbf24;
    --sp-deep: #fde68a;
    --sp-soft: rgba(253, 230, 138, 0.4);
    --sp-paper: #ffffff;
    --sp-ring: #ffffff;
    --sp-faint: rgba(15, 23, 42, 0.2);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

html.dark .spot--bare,
html.dark .spot--pill {
    background: none;
    box-shadow: none;
}
