/* The loading indicator of the public site (owner 2026-11-19, docs/IP-Reference.md section CC).

   ONE look for every wait: four bars that rise and fall, in the brand colour, and NO visible words - the owner chose "Bars" and "No words" on
   the options sheet. Screen readers get the words (a hidden "Ladowanie..." / "Loading..." in a live region, web/partials/loading-indicator).

   The same bars are used in three places:
     - the whole page waits (a link, a menu, the radius slider, a search): .ip-loading, a white veil with the bars on a card - one element per
       page (web/partials/loading-indicator.blade.php), switched on by public/js/ip-loading.js after a short delay, so a quick page never flashes it;
     - a button waits (a form that posts, the AI search): .ip-btn-busy - the bars take the place of the button's icon, or come before its text;
     - a small area waits (the Lokalizacja status, the place suggestions, the map's cover): .ip-bars on its own, coloured by where it sits.

   Colours, radius, spacing and shadow are the design tokens (tokens.css). The sizes of the bars are the component's own geometry, set once on
   .ip-bars and its two modifiers. The bars are drawn in currentColor, so a button's bars have the button's text colour. Every rule starts with a
   class only this component prints (.ip-bars, .ip-loading, .ip-btn-busy) or hangs a new class of ours on an existing element
   (.location-picker-..., .map-loading-overlay); no existing rule is changed here. */

/* ---- the four bars ---- */
.ip-bars {
    --ip-bars-size: 24px;                                   /* the square the bars live in */
    --ip-bars-bar: calc(var(--ip-bars-size) / 9);           /* one bar's width */
    --ip-bars-gap: calc(var(--ip-bars-size) / 10);          /* the space between two bars */

    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: var(--ip-bars-gap);
    width: var(--ip-bars-size);
    height: var(--ip-bars-size);
    vertical-align: middle;
}
/* 16px: the Lokalizacja status box, inside a button */
.ip-bars--sm {
    --ip-bars-size: 16px;
    --ip-bars-bar: 2px;
    --ip-bars-gap: 1.5px;
}
/* 44px: the page's veil, the map's cover */
.ip-bars--lg {
    --ip-bars-size: 44px;
}
.ip-bars > i {
    display: block;
    flex: none;
    width: var(--ip-bars-bar);
    height: 80%;
    border-radius: var(--radius-sm);
    background: currentColor;
    transform: scaleY(0.35);
    animation: ip-bars-rise 1s ease-in-out infinite;
}
.ip-bars > i:nth-child(2) { animation-delay: 0.12s; }
.ip-bars > i:nth-child(3) { animation-delay: 0.24s; }
.ip-bars > i:nth-child(4) { animation-delay: 0.36s; }
@keyframes ip-bars-rise {
    0%, 100% { transform: scaleY(0.35); }
    50% { transform: scaleY(1); }
}
/* the wait is information, so it is slowed down, never switched off (the site's own rule for the old spinner) */
@media (prefers-reduced-motion: reduce) {
    .ip-bars > i { animation-duration: 3s; }
}

/* ---- the whole page waits ---- */
.ip-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;                 /* the old #preloader's level: over the sticky header, the popups and the consent bar */
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    cursor: progress;
    transition: opacity 0.15s ease-out, visibility 0s linear 0.15s;
}
/* the veil: the page's own white, the page shows through it. A layer of its own, so the card above it stays solid */
.ip-loading::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--surface);
    opacity: 0.78;
}
.ip-loading--on {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}
.ip-loading__card {
    position: relative;
    display: flex;
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--elevation-3);
    color: var(--brand-blue);
}
@media (prefers-reduced-motion: reduce) {
    .ip-loading { transition: none; }
}

/* ---- a button waits ----
   ip-loading.js puts .ip-btn-busy on the button, the bars before its content and, when the button has an icon, .ip-btn-busy__icon on
   the icon - the bars take its place. The button keeps its own size, colour and text. */
.ip-btn-busy {
    cursor: progress;
}
.ip-btn-busy .ip-bars {
    margin-right: var(--space-2);
}
.ip-btn-busy .ip-btn-busy__icon {
    display: none;
}
/* the AI search button is a flex row with its own gap between icon and text, so the bars need no margin of their own there */
.ai-search-submit.ip-btn-busy .ip-bars {
    margin-right: 0;
}

/* ---- a small area waits ---- */
/* the Lokalizacja popup's status box (a 16px square beside "Zlokalizuj mnie") */
.location-picker-status .ip-bars {
    color: var(--ink-muted);
}
/* the place suggestions: one row of bars while the list is on its way */
.location-picker-list li.location-picker-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-blue);
    cursor: default;
}
.location-picker-list li.location-picker-loading:hover {
    background: transparent;
}
/* the map's cover (web.css .map-loading-overlay: the white veil over the map until it is drawn) */
.map-loading-overlay .ip-bars {
    color: var(--brand-blue);
}
