/* The following moves search facets to the left when viewed in a window 768 pixels wide or more (which is the cut-off
   between mobile and desktop layouts in the ArchivesSpace CSS). Also make facets bigger, with more vertical spacing,
   for easier touch interaction below that width */

@media (min-width: 768px) {
    #content div:not(.has-resizable-content):not(#tabs)>.col-sm-9 {
        float:right ! important;
    }
    #paging_bottom {
        float:right ! important;
    }
}

@media (max-width: 767px) {
    #facets {
        font-size:1.25em ! important;
    }
    #facets dd {
        padding-top:0.1em ! important;
        padding-bottom:0.1em ! important;
    }
}

/* The following expands the page to fill the browser window height */

@supports (display: flex) {
    body {
        display: flex ! important;
        min-height: 100vh ! important;
        flex-direction: column ! important;
    }

    body > section#content {
        flex: 1 ! important;
    }

    body > div.container-fluid {
        min-width: 100% ! important;
    }
}

/* The following restyles the header */

#header {
    display:block ! important;
    color:#FFFFFF ! important;
    background-color:#002147 ! important;
}

#header>.row {
    border-width:0px ! important;
}

#navigation {
    border-width:0px ! important;
}

#header h1 {
    font-size:30px ! important;
    font-weight:normal ! important;
    color:#FFFFFF ! important;
    margin-top:25px ! important;
    margin-bottom:0px ! important;
}

#header a {
    color:#FFFFFF ! important;
}

@media (max-width: 820px) {
    /* Reduce title font size to avoid overlap with Bodleian logo (modify if logo width changes in future) */
    #header h1 {
        font-size:26px ! important;
    }
}

@media (max-width: 506px) {
    /* Reduce margin so title remains centred when it wraps */
    #header h1 {
        margin-top:15px ! important;
    }
}

/* The following adjusts the main navigation menu */

#navigation>.navbar {
    border-width:0px ! important;
}

#navigation>.navbar>.top-bar {
    background-color:#98aabc ! important;
    border-width:0px ! important;
}

#navigation>.navbar>.top-bar a {
    color:#FFFFFF ! important;
    font-weight:bold ! important;
}

#navigation>.navbar>.navbar-header {
    border-width:0px ! important;
}

/* The following restyles the footer (full control of its HTML via _footer.html.erb) */

.panel-footer {
    color:#FFFFFF ! important;
    background-color:#002147 ! important;
    font-size:16px ! important;
}

.footer-item {
    white-space:nowrap ! important;
    color:#98aabc ! important;
}

.panel-footer a {
    font-weight:bold ! important;
    color:#FFFFFF ! important;
}


.panel-footer a:visited {
    color:#98aabc ! important;
}

/* The following changes the colours of subheadings and some pages elements */

#main-content h1 {
    color:#002147 ! important;
}

h2, h3, h4, h5, h6 {
    color:#002147 ! important;
}

.navbar-default {
    margin-bottom:0.5em ! important;
}

.nav-pills {
    border-bottom:2px #002147 solid ! important;
}

.nav-pills a.active {
    background-color:#002147 ! important;
    font-weight:bold ! important;
    cursor:default ! important;
}

.nav-pills a {
    background-color:#98aabc ! important;
    margin-left:0px ! important;
    margin-right:4px ! important;
    border-bottom-left-radius:0px ! important;
    border-bottom-right-radius:0px ! important;
    border-top-left-radius:8px ! important;
    border-top-right-radius:8px ! important;
}

@media (max-width: 767px) {
    .nav-pills {
        border-bottom-width:0px ! important;
    }
    .nav-pills a {
        margin:4px ! important;
        padding:15px ! important;
        border-radius:0px ! important;
    }
}

.btn-primary {
    font-weight:bold ! important;
}

/* The following changes the page action buttons (request, citation, pdf, etc) */

.page_actions li {
    padding:0px ! important;
    padding-left:4px ! important;
}

.page_actions li:first-child {
    padding-left:0px ! important;
}

.page_action {
    min-width:11ch ! important;
    line-height: 1.15 ! important;
    padding:4px 0px ! important;
}

.page_action i {
    color:#002147 ! important;
    margin-bottom:6px ! important;
}

.page_action.btn-primary {
    color:#FFFFFF ! important;
}

.page_action.btn-primary i {
    color:#FFFFFF ! important;
}

.page_action.btn-primary:hover, .page_action.btn-primary:focus, .page_action.btn-primary:active {
    background-color:#286090 ! important;
    border-color:#204d74 ! important;
}

.page_action.btn-primary:active:hover, .page_action.btn-primary:active:focus {
    background-color:#204d74 ! important;
    border-color:#122b40 ! important;
}

@media (max-width: 480px) {
    .page_actions li {
        display:block ! important;
        margin-bottom:5px ! important;
        padding-left:0px ! important;
    }
    .page_action {
        display:block ! important;
        float:none ! important;
        min-width: 100% ! important;
        padding:8px 0px ! important;
        margin-bottom:8px ! important;
        border: 1.5px #204D74 solid ! important;
    }
    .page_action i {
        display:none ! important;
    }
    .page_action br {
        display:none ! important;
    }
    .breadcrumb {
        display:none ! important;
    }
}

/* The following changes the colours of the side bars used to navigate around inside multi-level collections */

.resizable-sidebar {
    background-color:#002147 ! important;
}

.resizable-sidebar>h2 {
    color:#FFFFFF ! important;
    margin-left:0.25em ! important;
}

.resizable-sidebar-handle {
    background-color:#002147 ! important;
    background-image: url(/assets/images/sidebar_drag_handle.png) ! important;
}

@media (max-width: 767px) {
    /* Mobile view: increase vertical space between each entry in the collection browser sidebar, for easier touch
       interaction (not increasing font size, because these do not wrap.) */
    .resizable-sidebar #tree-container td {
        padding-top:0.3em ! important;
        padding-bottom:0.3em ! important;
    }
}

/* The following makes blocks of text more readable by setting a line-length */

#static-page {
    max-width:60em ! important;
}

/* The following is CSS for our custom buttons in the top-right corner of record pages */

#cite_modal_bod {
    text-align:left;
}

#request_modal_bod {
    text-align:left;
}

#request_modal_bod .note-content {
    font-weight:bold ! important;
}

li.large-badge:empty {  /* The empty selector does not work if there is whitespace but future browsers may change that */
    display:none ! important;
}

/* The following fixes an inconsistency in the layout of record pages caused by ArchivesSpace treating anything
   that in EAD contains p elements as being comprised of sub-notes, even if it is just one */

div.subnote {
    padding-left:0px ! important;
}

/* The following apply style to the adjusted layout of search results in _result.html.erb */

.recordrow {
    display:block ! important;
    position:relative ! important;
    min-height:11ex ! important;
}

.recordrow .record-type-badge {
    display:inline-block ! important;
    float:left ! important;
    width:9ch ! important;
    text-align:center ! important;
}

.record-type-badge.resource {
    color:#002147 ! important;
}

.recordrow .record-type-badge i {
    font-size:24px ! important;
}

.recordrow .record-type-badge .badge-label {
    display:block ! important;
    font-size:0.85em ! important;
    word-wrap:break-word ! important;
    hyphens:auto ! important;
}

.recordrow .recordsummary {
    display:inline-block ! important;
    max-width:calc(100% - 11ch) ! important;
    margin-left:1ch ! important;
    height:100% ! important;
}

.recordrow .recordsummary-agent_person, .recordrow .recordsummary-subject, .recordrow .recordsummary-agent_corporate_entity, .recordrow .recordsummary-agent_family {
    padding-top:1em ! important;
}

.recordrow .recordsummary-repository {
    padding-top:0.5em ! important;
}

@media (max-width: 480px) {
    /* Reduce down the amount of info displayed for each search result hit on mobiles in portrait orientiation
       and increase the spacing between each one, for easier touch interaction */
    .recordrow {
        min-height:initial ! important;
        padding:0.5em ! important;
        margin-top:1em ! important;
    }
    .recordrow .record-type-badge, .recordrow .result_context, .recordrow .bod_identifier {
        display:none ! important;
    } 
    .recordrow .recordsummary {
       	max-width:100% ! important;
        padding-top:0px ! important;
        margin:0.5em ! important;
    }
}

.recordrow .component {
    font-weight:normal ! important;
}

.recordrow .abstract {
    padding-top:0.25em ! important;
    padding-bottom:0.25em ! important;
}

.recordrow .result_context {
    padding-top:0px ! important;
}

.recordrow strong {
    display:inline-block ! important;
    min-width:9ch ! important;
    color:rgb(51, 51, 51) ! important;
    font-family:"Roboto Slab", serif ! important;
}

/* Search form customizations */

#advanced_search_button {
    min-width:100%;
}

#advanced_search label, .plusminus_label {
    color:#002147 ! important;
    max-height:1.25em ! important;
    overflow:hidden;
    margin-bottom:0px ! important;
}

@media (min-width: 768px) {
    .search_row .form-group {
        padding-right: 0px ! important;
    }
    #submit_div>div {
        padding-right: 0px ! important;
    }
    .search-form-year-fields {
        padding-left:0.5em ! important;
    }
    .search-form-year-fields input {
        width:calc(4ch + 28px) ! important;
    }
}

@media (max-width: 767px) {
    .search_row .bool {
        padding-top: 2em ! important;
        padding-bottom: 2em ! important;
    }
    .search_row .form-group {
        margin-bottom: 0.5em ! important;
    }
    #submit_div {
        padding-top: 1em ! important;
        padding-bottom: 1em ! important;
    }
    .search_row .bool select {
        width:auto ! important;
    }
}

/* Refine search */

@media (min-width: 768px) {
    .searchstatement {
        padding: 5px ! important;
    }
}

#refineSearchPanel label {
    color:#00171f ! important;
}

.searchstatement .btn-sm {
    color:white ! important;
    background-color:#337ab7;
    border-color:#2e6da4 ! important;
    margin-right:4px ! important;
    border-radius:3px ! important;
}

.searchstatement .active {
    background-color:#98aabc ! important;
}

/* Home page */

.welcome_note {
    border:4px #98aabc solid;
    background-color:#EEEEEE;
    padding:0.75em;
    font-weight:bold;
}

.welcome_bullets i.fa {
    font-size:1.25em;
}

.welcome_bullets .fa-check {
    color:green;
}

.welcome_bullets .fa-times {
    color:red;
}

#welcome_image {
    background-image:url(/assets/images/ArchivesManuscriptsHeaderFinal.jpg);
    min-height:230px;
}

/* Help page */

#helpcontents, #helpcontents ul {
    list-style-type:disc;
}

@media (max-width: 767px) {
    /* Mobile view: increase vertical space between each link in the help contents list, for easier touch interaction */
    #helpcontents ul {
        padding-top:0.3em;
    }
    #helpcontents li {
        padding-top:0.3em;
        padding-bottom:0.3em;
    }
}

/* Thumbnails: Override 50% width, add more space between them and text, and remove uneven padding */

.objectimage {
    width:inherit ! important;
    float:right ! important;
    margin:0 1em 1em 1em ! important;
}

.objectimage a.thumbnail {
    margin:0px ! important;
    padding:0px ! important;
    border-width:0px ! important;
}

.objectimage p {
    text-align:center ! important;
}

/* Remove indent on the list of applied filters */

.filters ul {
    padding-left:0px ! important;
}

/* Adjust layout of lists of fields in finding aid and admin info section */

.dl-horizontal-fa dd {
    margin-left:2ch ! important;
}

/* Global message banner */

.globalbanner {
    padding:0.5em;
    margin:1em 20%;
    text-align:center;
    background-color:#fffce5;
    border:1px #ed5 solid;
}

/* Record view pages */

#main-content .record-type-badge {
    padding-left:0px ! important;
}

#held_at {
    clear:both;
    font-style:italic;
    padding-top:0.6em;
    padding-bottom:0.9em;
}

/*  */
