/* JS Jobs - star rating widget.
 *
 * Markup (generated server-side, unchanged):
 *   <div class="jsjobs-container-small">
 *     <ul class="jsjobs-stars-small">
 *       <li id="rating_7" class="current-rating" style="width:60%"></li>
 *       <li><a class="one-star"   onclick="setrating('rating_7',1)">1</a></li>
 *       ... through five-stars
 *     </ul>
 *   </div>
 *
 * setrating() sets the WIDTH of li.current-rating, so the filled overlay is
 * clipped to that width.
 *
 * Previously this used a 22x66 three-row sprite (star_small.png). The rule
 *   ul.jsjobs-stars-small li { background-position: 0 !important; }
 * out-weighted the later "left -1000px", so li.current-rating rendered the
 * sprite's TOP row - the empty stars - which was invisible against the
 * identical empty track. A rating could never appear no matter what
 * setrating() did. Drawing the stars as text removes the sprite dependency
 * and the cascade fight entirely.
 */

.jsjobs-container,
.jsjobs-container-small { display: inline-block; line-height: 0; }

ul.jsjobs-stars,
ul.jsjobs-stars-small {
    position: relative;
    display: block;
    width: 110px;
    height: 22px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    overflow: hidden;
    font-size: 0;
    background: none !important;
}

ul.jsjobs-stars li,
ul.jsjobs-stars-small li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    background: none !important;
}

/* Empty stars - the track. */
ul.jsjobs-stars::before,
ul.jsjobs-stars-small::before {
    content: "\2605\2605\2605\2605\2605";
    position: absolute;
    top: 0;
    left: 0;
    width: 110px;
    height: 22px;
    font-size: 19px;
    line-height: 22px;
    letter-spacing: 2px;
    color: #d5dbe4;
    pointer-events: none;
}

/* Filled stars - clipped to the width setrating() applies. */
ul.jsjobs-stars li.current-rating,
ul.jsjobs-stars-small li.current-rating {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    overflow: hidden;
    z-index: 1;
    white-space: nowrap;
    text-indent: 0 !important;
    pointer-events: none;
}

ul.jsjobs-stars li.current-rating::before,
ul.jsjobs-stars-small li.current-rating::before {
    content: "\2605\2605\2605\2605\2605";
    position: absolute;
    top: 0;
    left: 0;
    width: 110px;
    height: 22px;
    font-size: 19px;
    line-height: 22px;
    letter-spacing: 2px;
    color: #f5b301;
}

/* Invisible click targets stacked over the track. */
ul.jsjobs-stars li a,
ul.jsjobs-stars-small li a {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    display: block;
    overflow: hidden;
    text-indent: -9999px;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

/* Hover preview. */
ul.jsjobs-stars li a:hover,
ul.jsjobs-stars-small li a:hover { background: rgba(245, 179, 1, .18) !important; }

li a.one-star    { width: 20%;  z-index: 6; }
li a.two-stars   { width: 40%;  z-index: 5; }
li a.three-stars { width: 60%;  z-index: 4; }
li a.four-stars  { width: 80%;  z-index: 3; }
li a.five-stars  { width: 100%; z-index: 2; }
