/* JustWorker r4 — «Посмотреть все» pill, dialog visibility, scroll lock, header sizes */

/* Closed dialogs must never appear in the page flow (e.g. hanging in the footer). */
dialog:not([open]){display:none!important}

/* Service dialog: only flex when open, fixed and centered in the viewport */
.service-dialog{display:none;overflow:hidden}
.service-dialog[open],.service-dialog[open].is-closing{
  display:flex;
  flex-direction:column;
  position:fixed;
  inset:0;
  margin:auto;
  max-height:calc(100dvh - 48px);
  height:fit-content;
  width:min(920px,calc(100vw - 48px));
}
@media (max-width:700px){
  .service-dialog[open],.service-dialog[open].is-closing{
    width:calc(100vw - 24px);
    max-height:calc(100dvh - 24px);
  }
}

/* Media / promo: same rule — hidden when closed, centered when open */
.media-dialog:not([open]),.promo-dialog:not([open]){display:none!important}
.media-dialog[open],.promo-dialog[open]{
  position:fixed;
  inset:0;
  margin:auto;
}

/* Scroll lock: overflow hidden only, no position:fixed jump */
html.jw-scroll-lock,html.jw-scroll-lock body{
  overflow:hidden!important;
  scroll-behavior:auto!important;
  overscroll-behavior:none;
}

/* «Посмотреть все»: pill, one line, aligned with the arrow buttons */
.carousel-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.carousel-controls button.carousel-more,
button.carousel-more{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  max-width:none;
  height:auto;
  min-height:50px;
  padding:0 22px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--ink);
  font:700 16px/1 inherit;
  letter-spacing:0;
  text-decoration:none;
  text-underline-offset:unset;
  white-space:nowrap;
  flex:0 0 auto;
  box-sizing:border-box;
  cursor:pointer;
  transition:background .2s,border-color .2s,color .2s;
}
.carousel-controls button.carousel-more:hover,
.carousel-controls button.carousel-more:focus-visible,
button.carousel-more:hover,
button.carousel-more:focus-visible{
  background:#fff;
  border-color:var(--orange);
  color:var(--ink);
  text-decoration:none;
}
.carousel-controls button.carousel-more:disabled{
  opacity:.3;
}
@media (max-width:700px){
  .carousel-controls button.carousel-more,
  button.carousel-more{
    min-height:44px;
    padding:0 18px;
    font-size:15px;
  }
}
@media (max-width:359px){
  .carousel-controls button.carousel-more,
  button.carousel-more{
    min-height:44px;
    padding:0 14px;
    font-size:14px;
  }
}

/* Sticky header: logo and «Обсудить задачу» stay the same size. Only shadow/air. */
.site-header .brand,
.site-header .brand img,
.site-header .button-small{
  transition:none;
}
.site-header.is-compact .brand,
.site-header.is-compact .brand img{
  width:104px;
  height:81px;
  transition:none;
}
.site-header.is-compact .button-small{
  min-height:40px;
  padding:10px 22px;
  font-size:15px;
  transition:none;
}
@media (max-width:700px){
  .site-header.is-compact .brand,
  .site-header.is-compact .brand img{
    width:84px;
    height:66px;
  }
}
@media (max-width:359px){
  .site-header.is-compact .brand,
  .site-header.is-compact .brand img{
    width:72px;
    height:58px;
  }
}

/* Keep carousel arrows clear of the floating «Наверх» button */
.carousel-controls{padding-right:80px;}
@media (max-width:759px){
  .carousel-controls{padding-right:64px;}
}
@media (max-width:359px){
  .carousel-controls{padding-right:56px;}
}
