/*
 * Adjustments for PrimeFaces 15 with the legacy bootstrap theme
 * (all-themes 1.0.10).
 *
 * PF 13 drew the paginator First/Prev/Next/Last arrows as an inner
 * <span class="ui-icon ui-icon-seek-*"> backed by the jQuery-UI sprite.
 * PF 15 dropped that inner span and renders the nav as bare <button>s, so
 * the arrows disappeared. Restore the exact PF 13 look by putting the same
 * sprite, at the same seek-* background positions, straight on the buttons.
 * The sprite ships with the bootstrap theme (all-themes) and is reachable at
 * this JSF resource URL; the context root is fixed to /app (glassfish-web.xml).
 */
.ui-paginator .ui-paginator-first,
.ui-paginator .ui-paginator-prev,
.ui-paginator .ui-paginator-next,
.ui-paginator .ui-paginator-last {
    display: inline-block;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    overflow: hidden;
    text-indent: -9999px;          /* hide any residual glyph/label */
    cursor: pointer;
    vertical-align: middle;
    background-image: url("/app/jakarta.faces.resource/images/ui-icons_333333_256x240.png.xhtml?ln=primefaces-bootstrap");
    background-repeat: no-repeat;
}
.ui-paginator .ui-paginator-first { background-position: -80px -160px; }  /* ui-icon-seek-start */
.ui-paginator .ui-paginator-prev  { background-position: -48px -160px; }  /* ui-icon-seek-prev  */
.ui-paginator .ui-paginator-next  { background-position: -32px -160px; }  /* ui-icon-seek-next  */
.ui-paginator .ui-paginator-last  { background-position: -64px -160px; }  /* ui-icon-seek-end   */
.ui-paginator .ui-state-disabled {
    opacity: .35;
    cursor: default;
}

/*
 * PF 15 turned the paginator page from an <a> into a <button class="ui-button">.
 * That makes the app's generic submit-button rule `#content .ui-fluid .ui-button
 * {background:#009EE1}` (specificity 1,2,0) bleed onto the page numbers, so the
 * active page became a filled brand-blue box instead of the PF 13 look
 * (light-grey #EFEFF0 cell, brand-blue text). Re-assert the app's paginator
 * style with an `#content`-prefixed selector (1,3,0) so it beats that rule.
 */
#content .ui-paginator .ui-paginator-page.ui-button {
    background: #EFEFF0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    min-width: 0;
    padding: 5px 10px;
    /* The generic #content .ui-fluid .ui-button rule gives form buttons a
       10px top margin; on the paginator page that shoved the number ~5px below
       the arrows. Reset to a symmetric margin so it stays on the line. */
    margin: 0 2px;
}
#content .ui-paginator .ui-paginator-page.ui-state-active {
    background: #EFEFF0;
    color: #009EE1;
    box-shadow: none;
}

/*
 * PF 15 added a .ui-fluid .ui-selectbooleancheckbox{width:100%} rule that
 * PF 13 did not have. The page content sits inside <div class="ui-fluid">, so
 * boolean checkboxes stretched to full width and their label wrapped to the
 * next line. Restore the PF 13 behaviour.
 *
 * NOTE: only the checkbox. The .ui-password and .ui-calendar width:100% rules
 * already existed in PF 13 identically, so they must stay 100% (e.g. the
 * login password field has to match the full-width username field).
 *
 * body-prefixed: PrimeFaces appends components.css after this file, so the
 * selector needs one extra level of specificity to win.
 */
body .ui-fluid .ui-selectbooleancheckbox {
    width: auto;
}
