/* pervaya-pomoshch.ru — блок экстренного вызова 112 на главной (.sos) и QR 112 в статьях (.call-with-qr).
   Подключать после style.css, site.css, pulse.css, batch.css, menu.css и print.css.
   Главная: вариант B (QR отдельным белым квадратом справа от кнопки), модули #c42b1f, файл /assets/img/qr-tel-112-btn-red.svg.
   Статьи (.alert, .when): вариант 1б (2026-12-02), QR 64px в один ряд с кнопками, см. конец файла.
   QR только при (min-width:1024px) and (hover:hover) and (pointer:fine). */
/* --- Общие правки блока: бейдж в потоке, сетка 8px, контраст --- */
.sos{
  padding:32px;
  overflow:hidden;
}
.sos-l{
  position:relative;
  z-index:1;
  gap:8px;
  margin:0;
}
.sos .big{
  letter-spacing:0;
  line-height:.88;
  margin:24px 0 16px;
}
.sos h2{margin-top:0}
.sos p{
  margin-top:8px;
  opacity:1;
  color:var(--on-red);
}
.sos-call-row{
  display:flex;
  align-items:stretch;
  width:100%;
  min-width:0;
  margin-top:32px;
}
.sos .btn{
  margin-top:0;
  width:100%;
  min-height:64px;
  padding:0 24px;
  border-radius:16px;
  gap:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.sos .sos-call{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:0;
}
/* QR скрыт по умолчанию (мобильные, тач, ширина < 1024).
   Перебивает batch.css, где QR — отдельная плашка 128px под кнопкой. */
.sos .qr-112,
.sos .btn .qr-112{
  display:none;
  margin:0;
  max-width:none;
}
.sos .qr-112 img{
  display:block;
  width:63px;
  height:63px;
  background:#fff;
  border-radius:0;
  flex:none;
}

/* --- Десктоп от 1024px с точным указателем: два варианта QR --- */
@media (hover:hover) and (pointer:fine) and (min-width:1024px){
  .sos .btn{min-height:80px}

  /* A: QR справа внутри белой кнопки «Позвонить» */
  .sos--a .btn{
    justify-content:flex-start;
    padding:8px 8px 8px 24px;
    gap:8px;
  }
  .sos--a .sos-call{
    flex:1 1 auto;
    justify-content:center;
  }
  .sos--a .qr-112,
  .sos--a .btn .qr-112{
    display:flex;
    flex:none;
    align-items:center;
    justify-content:center;
    width:64px;
    height:64px;
    margin:0;
    align-self:center;
    background:#fff;
  }
  .sos--a .qr-112 img{
    width:63px;
    height:63px;
    border-radius:0;
  }

  /* B: QR отдельным белым квадратом справа от кнопки, на одной линии, той же высоты */
  .sos--b .btn{
    width:100%;
    min-height:80px;
    padding:0;
    gap:8px;
    background:transparent;
    border-radius:0;
    justify-content:flex-start;
    align-items:stretch;
  }
  .sos--b .btn:hover,
  .sos--b .btn:active{
    background:transparent;
    transform:none;
  }
  .sos--b .sos-call{
    flex:1 1 auto;
    min-height:80px;
    padding:0 24px;
    border-radius:16px;
    background:#fff;
    color:var(--red);
    justify-content:center;
  }
  .sos--b .btn:hover .sos-call,
  .sos--b .btn:hover .qr-112{
    background:#fff3f1;
  }
  .sos--b .btn:hover .sos-call{transform:translateY(-2px)}
  .sos--b .btn:hover .qr-112{transform:translateY(-2px)}
  .sos--b .qr-112,
  .sos--b .btn .qr-112{
    display:flex;
    flex:none;
    align-items:center;
    justify-content:center;
    width:80px;
    height:80px;
    margin:0;
    padding:8px;
    background:#fff;
    border-radius:16px;
    align-self:center;
    box-sizing:border-box;
  }
  .sos--b .qr-112 img{
    width:63px;
    height:63px;
  }

  html[data-scheme] .sos--b .sos-call,
  html[data-scheme] .sos--b .qr-112{
    background:var(--bg);
    color:var(--ink);
  }
}

/* Планшет до 1023: QR нет, кнопка на всю ширину, верхний отступ 32px */
@media (max-width:1023px){
  .sos .btn{min-height:64px}
}

/* Телефон: одна кнопка без QR, верхний отступ 16px, сетка 8px */
@media (max-width:767px){
  .sos{
    padding:16px;
    margin-top:16px;
    align-items:start;
  }
  .sos .big{
    margin:8px 0 0;
  }
  .sos h2{margin-top:8px}
  .sos p{margin-top:4px}
  .sos-call-row{
    grid-column:1/-1;
    margin-top:16px;
  }
  .sos .btn{
    grid-column:auto;
    margin-top:0;
    width:100%;
    min-height:56px;
    font-size:1.0625rem;
    padding:0 16px;
    border-radius:16px;
    background:#fff;
  }
  .sos--b .btn{
    background:#fff;
    min-height:56px;
    padding:0 16px;
    border-radius:16px;
    gap:8px;
  }
  .sos--b .sos-call{
    min-height:0;
    padding:0;
    background:transparent;
    border-radius:0;
  }
}

/* ===== Статьи: QR 112 в ряд с кнопками (вариант 1б, QR 64px) ===== */
/* Вариант 1б «QR в высоту кнопок»: плитка QR - третий элемент ряда кнопок: та же высота, тот же зазор 8px, то же скругление 16px.
   Размер плитки задает --qr-s (высота кнопок = высота плитки), белое поле внутри - --qr-p (quiet zone).
   Только ПК: (hover:hover) and (pointer:fine) and (min-width:1024px). Ниже QR скрыт (batch.css), остается кнопка звонка. */
@media (hover:hover) and (pointer:fine) and (min-width:1024px){
  :root{--qr-s:64px;--qr-p:8px}
  .call-with-qr{gap:8px;align-items:stretch}
  .call-with-qr .call-btns{align-items:stretch}
  .call-with-qr .btn,
  .call-with-qr .call-btns .btn{min-height:var(--qr-s);height:var(--qr-s);margin-top:0;box-sizing:border-box}
  .call-with-qr .qr-112{
    position:relative;display:flex;align-items:center;justify-content:center;flex:none;
    width:var(--qr-s);height:var(--qr-s);max-width:none;margin:0;padding:var(--qr-p);box-sizing:border-box;
    background:#fff;border-radius:16px;
  }
  .call-with-qr .qr-112 img{display:block;width:100%;height:100%;border-radius:0;background:transparent}
  .call-with-qr .qr-112 figcaption{
    position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;
  }
  /* на красной плашке кнопки белые без рамки - плитка тоже; на розовом фоне кнопки красные - плитка с красной рамкой 2px */
  .when .call-with-qr .qr-112{box-shadow:inset 0 0 0 2px var(--red)}
  html[data-scheme] .call-with-qr .qr-112{box-shadow:inset 0 0 0 2px var(--ink)}
}
