/* uw-theme reset bare <button> elements (appearance:none, no background/border); the new
   theme doesn't, so native buttons would otherwise show the OS-default gray chrome.
   More specific classes like .button still override this. */
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch, #ccbcMyBookList, #recommended-book-detail, #diversity-book-detail, #bibliography) button {
    padding: 0;
    background-color: transparent;
    border: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* uw-theme styled every bare <label> (block display, smaller font, normal weight); the
   new theme has no generic label style, so labels default to inline at body font size. */
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch, #ccbcMyBookList, #recommended-book-detail, #diversity-book-detail, #bibliography) label {
    display: block;
    margin: 0;
    font-size: 0.875rem;
    font-weight: normal;
    line-height: 1.5;
    color: #121212;
}

/* uw-theme made a checkbox/radio immediately followed by its <label> render inline-block
   instead of the generic label's block display (sibling markup, not label-wraps-input).
   Matches the original rule's specificity (attribute + element only) so it still beats
   the broader label{display:block} default above, while more specific overrides win over this. */
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch, #ccbcMyBookList) [type=checkbox] + label,
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch, #ccbcMyBookList) [type=radio] + label {
    display: inline-block;
    vertical-align: baseline;
    margin-left: 0.5rem;
    margin-right: 1rem;
    margin-bottom: 0;
}

/* uw-theme set text-decoration:none globally for links; the new theme defaults to underlined. */
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch, #ccbcMyBookList, #recommended-book-detail, #diversity-book-detail, #bibliography) a {
    text-decoration: none;
}

/* uw-theme styled every <hr> (thin bottom border, centered); the new theme has none,
   so browsers fall back to a default 3D inset rule. */
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch, #ccbcMyBookList, #recommended-book-detail, #diversity-book-detail, #myBookListWrapper, #bibliography) hr {
    clear: both;
    height: 0;
    margin: 1.25rem auto;
    border: 0;
    border-bottom: 1px solid #646569;
}

/* uw-theme made every <img> responsive (max-width:100%); needed so raw cover images fit
   their fixed-width containers (.book-thumb, .bookCoverColumn) instead of overflowing. */
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch, #ccbcMyBookList, #recommended-book-detail, #diversity-book-detail, #bibliography) img {
    max-width: 100%;
    height: auto;
}

/*
 * uw-theme previously provided this base styling for every ".button"-classed element
 * (sizing, line-height, default blue color, hover/focus states). The plugin's own
 * .button-blue/.button-gray modifier classes only ever layered color/border/box-shadow
 * on top of this - they were never a full replacement - so it's defined here instead.
 * NOTE: .button-blue/.button-gray are defined as compound ".button.button-blue" selectors
 * (not bare ".button-blue") specifically so they always outrank this rule regardless of
 * which CSS file a given page happens to enqueue first - plain same-specificity classes
 * would otherwise tie and fall back to enqueue order, which is inconsistent across pages.
 */
.button {
    display: inline-block;
    text-align: center;
    font-family: "Red Hat Text", sans-serif;
    font-weight: 500;
    font-size: 1.0625rem;
    line-height: 1.2;
    padding: 0.75rem 1.25rem;
    margin: 0;
    background: #036796;
    color: #fff;
    box-shadow: 2px 2px 6px 0 rgba(0, 0, 0, 0.25);
    position: relative;
    cursor: pointer;
    -webkit-appearance: none;
    transition: all 0.25s ease-out;
    vertical-align: middle;
    border: 2px solid #036796;
    border-radius: 0.5rem;
    text-decoration: none !important;
}

.button:hover,
.button:focus {
    color: #036796;
    background-color: #fff;
    text-decoration: none;
    transition: all 0.25s ease-in-out;
}

/*
 * uw-theme previously gave every anchor "cursor: pointer" via a global `a{...}` reset.
 * The plugin's filter-toggle links (.SearchFiltersToggle, .toggleFiltersSection) are
 * <a role="button"> elements with no href, so they don't get a pointer cursor natively
 * and the new theme doesn't provide a blanket reset either.
 */
:where(#ccbcBookSearch, #ccbcAdvancedBookSearch, #ccbcDiversityBookSearch) [role="button"] {
    cursor: pointer;
}

button.buttonAddBookToBookList,
button.buttonAddBookToBookList:hover,
button.buttonShareBook,
button.buttonShareBook:hover
{
    color: #006E98;
    background-color: rgb(230,230,230);
    font-size: 16px;
    font-weight: 600;
    padding: .25rem .5rem;
    margin-bottom: 0;
    border: 2px solid transparent;
    border-radius: 0px;
    box-shadow: none;
}

button.buttonAddBookToBookList:focus,
button.buttonShareBook:focus {
    color: #006E98;
    background-color: rgb(230,230,230);
    font-size: 16px;
    font-weight: 600;
    padding: .25rem .5rem;
    margin-bottom: 0;
    border: 2px solid black;
    border-radius: 0px;
    box-shadow: none;
}

button.buttonAddBookToBookList.remove,
button.buttonAddBookToBookList.remove:hover{
    color: #575656;
}

button.buttonAddBookToBookList.bibliographyAddButton,
button.buttonAddBookToBookList.bibliographyAddButton:hover
{
    background-color: rgb(255,255,255);
}

button.buttonAddBookToBookList.remove:focus {
    color: #575656;
    border: 2px solid black;
}

button.buttonAddBookToBookList.bibliographyAddButton:focus {
    background-color: rgb(255,255,255);
    border: 2px solid black;
}

#myBookListWrapper{
    max-width: 75rem; margin: 0 auto; padding-left: 0; padding-right: 0;
}

#myBookListWrapper hr{
    margin-bottom: 0;
    margin-top: .5rem;
}

#myBookListWrapper a.button {
    border: 2px solid transparent;
    border-radius: 0px;
    box-shadow: none;
    padding-top: 0.85em;
    padding-bottom: 0.85em;
}

#myBookListWrapper a.button:hover {
    color: #fff;
}

#myBookListWrapper a.button:focus {
    color: #fff;
    border: 2px solid black;
}

#myBookListCounter{
    float: right;
    margin-bottom: 0;
    background-color: #c5050c;
    font-size: 16px;
    font-weight: 600;
}

#myBookListCounter a{
    color: white;
}

.white-popup {
    position: relative;
    background: #FFF;
    padding: 20px;
    width: auto;
    max-width: 500px;
    margin: 20px auto;
}

/* Reduce the padding of the breadcrumbs on pages where we're going to inject a My List button */
#main > *:first-child{
    padding-top: .5rem;
}

/*
 * The new theme's block-content layout caps each direct child of the content area to a
 * ~50rem (800px) reading column, widening only elements explicitly marked "wide"
 * (see .alignwide in the theme's layout CSS). The old theme's .uw-outer-row/.uw-inner-row
 * applied a flat 75rem (1200px) container to all page content instead, which is the width
 * our result layouts (.row/.col-md-*) were designed for. Since we don't control how an
 * editor wraps our shortcode output (plain paragraph, shortcode block, etc.), override
 * whichever single ancestor the new theme constrained - whether that's our own container
 * (unwrapped) or an element wrapping it - back to the old 75rem width instead of relying
 * on editor-applied block alignment. The form containers (#ccbcBookSearch etc.) are listed
 * separately from the results containers (#book_search_results etc.) because the latter
 * only render once a search actually returns results - without the always-rendered form
 * entries, the page stayed capped at 800px until results existed.
 */
.is-layout-constrained > *:has(#ccbcBookSearch),
.is-layout-constrained > #ccbcBookSearch,
.is-layout-constrained > *:has(#ccbcAdvancedBookSearch),
.is-layout-constrained > #ccbcAdvancedBookSearch,
.is-layout-constrained > *:has(#ccbcDiversityBookSearch),
.is-layout-constrained > #ccbcDiversityBookSearch,
.is-layout-constrained > *:has(#ccbcMyBookList),
.is-layout-constrained > #ccbcMyBookList,
.is-layout-constrained > *:has(#book_search_results),
.is-layout-constrained > #book_search_results,
.is-layout-constrained > *:has(#recommended-book-detail),
.is-layout-constrained > #recommended-book-detail,
.is-layout-constrained > *:has(#diversity-book-detail),
.is-layout-constrained > #diversity-book-detail,
.is-layout-constrained > *:has(#my_book_list_results),
.is-layout-constrained > #my_book_list_results,
.is-layout-constrained > *:has(#bibliography),
.is-layout-constrained > #bibliography {
    max-width: 75rem !important;
}

.bookButtonWrapper button.button{
    margin-right: .75rem;
    margin-top: .75rem;
}