/*
 * v18-swipe.css · phone swipe rails for the product pages of site V18.
 *
 * What it is: on a phone (760px and narrower) a sequence of equal cards (what you get, the steps, the
 * row of products, the plans) becomes a horizontal rail: one card fills most of the screen, the next
 * one peeks at the edge, the rail snaps card by card, and a bar under it shows where you are
 * ("2 / 5") with previous and next buttons. On a computer nothing here applies: the sections keep
 * the grids each page draws.
 * Why: ruling of Gene Deyev 07.11.2026 ("on mobile everything that is a sequence turns into
 * horizontal swipes, big graphics, big text") repeated for this site on 21.11.2026 ("в мобилках
 * свайпы обязательны"). Memory: mobile-sequences-become-swipes.md. Not for tables, forms, price
 * registers, folded answers or legal text (ruling 16.11.2026).
 * Where it sits: linked after a page's own CSS by its builder (build_v18_<page>.py), together with
 * v18-swipe.js, which marks the rails (class "swr") from the selectors the builder names and draws
 * the bar. Without the script the page stays a vertical list, which is a safe fallback.
 * Check: open a product page at 375px, swipe a rail, watch the counter reach the last card.
 * Undo: remove the two links from the builder and rebuild.
 */
@media (max-width:760px){
  /* The rail runs under the page gutter to the screen's edges, so the next card visibly peeks.
     !important: each page styles these lists as grids or ruled rows in its own CSS, and the rail
     must win over that on the phone only. */
  .swr{display:flex!important;flex-wrap:nowrap!important;grid-template-columns:none!important;
      gap:12px!important;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;
      -webkit-overflow-scrolling:touch;scrollbar-width:none;
      margin-left:calc(-1 * var(--g))!important;margin-right:calc(-1 * var(--g))!important;
      padding:4px var(--g) 6px!important;scroll-padding-inline:var(--g);list-style:none;
      max-width:none!important;width:auto!important;border:0!important}
  .swr::-webkit-scrollbar{display:none}
  /* One card: 86% of the screen, its own frame, equal height with its neighbours (flex stretch).
     The frame takes the colour of the text around it, so it reads on white, navy and blue grounds
     alike without a colour per section. */
  .swr > *{flex:0 0 86%!important;width:auto!important;max-width:none!important;min-width:0;
          scroll-snap-align:start;scroll-snap-stop:always;margin:0!important;
          border:1px solid color-mix(in srgb,currentColor 18%,transparent)!important;
          border-radius:18px;padding:22px 20px 24px!important;box-sizing:border-box;
          transition:border-color .35s cubic-bezier(.23,1,.32,1)}
  /* Inside a card everything stands in one column: number, title, text, badge. The pages lay these
     items out as desktop rows (number | title | text); kept on a phone card that left text in a
     column a third of the card wide. Cards whose only child is a link keep the link as the column. */
  .swr > *,.swr > * > a:only-child{display:flex!important;flex-direction:column!important;
          align-items:stretch!important;justify-content:flex-start!important;gap:10px!important;
          grid-template-columns:none!important;text-align:left!important}
  .swr > * > *,.swr > * > a:only-child > *{grid-column:auto!important;grid-row:auto!important;
          max-width:none!important;width:auto!important;margin:0!important;padding-left:0!important}
  /* Short labels (a badge, a price tag, "this page") keep their own width instead of stretching. */
  .swr > * > :is(span,em,small,mark,i,b),.swr > * > a:only-child > :is(span,em,small,mark,i,b){align-self:flex-start!important}
  /* The desktop draws these lists as a line of stops (a rule with dots, a rail of arrows). On a
     card the line is cut into stubs and means nothing, so the decorations go. */
  .swr > *::before,.swr > *::after,.swr > * > a:only-child::before,.swr > * > a:only-child::after{display:none!important}
  /* Body text in a card is never smaller than 17px on the phone (ruling: no small text). */
  .swr > * p{font-size:max(17px,1em)}
  /* Every card stays at full opacity: any dimming of a peek card pulled its buttons and small labels
     under 4.5:1 (axe colour-contrast; final QA 22.11.2026, rounds at .5, .7 and .85 all failed). The card
     in view is marked by its frame instead: the border steps up from 18% to 45% of the text colour.
     The frame is not text, so the text contrast of every card is untouched. */
  .swr.on > .cur{border-color:color-mix(in srgb,currentColor 45%,transparent)!important}

  /* The bar spans the whole row even when the rail sits in a page grid, and its counter keeps its own
     type: some pages style every <b> of a section large. */
  .sw-bar{display:flex;align-items:center;gap:12px;margin:16px 0 0;grid-column:1/-1;width:100%}
  /* A rail taller than the screen gets its bar above it (v18-swipe.js sets .top), so the buttons are in
     view where the cards start (item 25). */
  .sw-bar.top{margin:0 0 16px}
  .sw-bar .track{flex:1;height:2px;position:relative;background:color-mix(in srgb,currentColor 18%,transparent);overflow:hidden}
  .sw-bar .track i{position:absolute;inset:0 auto 0 0;width:var(--w,20%);background:currentColor;
                   transform:translateX(var(--x,0px));transition:transform .2s linear}
  .sw-bar .cnt{font:500 14px/1 var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap;opacity:.75}
  .sw-bar .cnt b{font:inherit;color:inherit;opacity:1}
  .sw-bar .cnt{display:inline-block!important;width:auto!important}
  .sw-bar .cnt b{display:inline!important}
  /* Buttons are a second way through the rail besides the swipe: 44px, as the tap-target rule asks. */
  .sw-bar button{all:unset;box-sizing:border-box;width:44px;height:44px;border-radius:50%;
                 display:grid;place-items:center;cursor:pointer;
                 border:1px solid color-mix(in srgb,currentColor 30%,transparent)}
  .sw-bar button svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6}
  .sw-bar button[disabled]{opacity:.3;cursor:default}
  .sw-bar button:focus-visible,.swr:focus-visible{outline:2px solid var(--blue);outline-offset:3px}
}
@media (min-width:761px){.sw-bar{display:none}}
@media (prefers-reduced-motion:reduce){
  .swr > *,.sw-bar .track i{transition:none}
}
